myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: cosmetics
Date Wed, 05 Dec 2018 21:51:09 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new 82fa738  cosmetics
82fa738 is described below

commit 82fa7382d37e9849c0532db7606df65e34b4cd99
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Wed Dec 5 22:51:09 2018 +0100

    cosmetics
---
 .../java/javax/faces/component/UIViewRoot.java     |  17 +-
 .../myfaces/application/StateManagerImpl.java      |   2 +-
 .../apache/myfaces/lifecycle/LifecycleImpl.java    | 205 ++++++++-------------
 .../myfaces/lifecycle/PhaseListenerManager.java    |   9 +-
 .../myfaces/lifecycle/RenderResponseExecutor.java  |   3 +-
 .../taglib/core/DelegateActionListener.java        |   8 +-
 .../myfaces/taglib/core/DelegateConverter.java     |  12 +-
 .../myfaces/taglib/core/DelegateValidator.java     |   5 +
 .../taglib/core/DelegateValueChangeListener.java   |   5 +
 .../DefaultFaceletsStateManagementStrategy.java    |   7 +-
 .../FaceletViewDeclarationLanguageStrategy.java    |   2 +
 .../myfaces/view/facelets/ViewPoolProcessor.java   |   5 +-
 .../myfaces/view/facelets/impl/DefaultFacelet.java |  11 ++
 .../view/facelets/impl/DefaultFaceletContext.java  |   9 +
 .../view/facelets/impl/DefaultFaceletFactory.java  |   4 +
 .../facelets/impl/DefaultResourceResolver.java     |   1 +
 .../view/facelets/impl/TemplateContextImpl.java    |  11 ++
 .../view/jsp/JspViewDeclarationLanguageBase.java   |  41 -----
 ...DefaultFaceletsStateManagementStrategyTest.java |   3 +-
 19 files changed, 159 insertions(+), 201 deletions(-)

diff --git a/api/src/main/java/javax/faces/component/UIViewRoot.java b/api/src/main/java/javax/faces/component/UIViewRoot.java
index f22c35e..a0a7073 100644
--- a/api/src/main/java/javax/faces/component/UIViewRoot.java
+++ b/api/src/main/java/javax/faces/component/UIViewRoot.java
@@ -98,8 +98,6 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
     private static final PhaseProcessor APPLY_REQUEST_VALUES_PROCESSOR = new ApplyRequestValuesPhaseProcessor();
     private static final PhaseProcessor PROCESS_VALIDATORS_PROCESSOR = new ProcessValidatorPhaseProcessor();
     private static final PhaseProcessor UPDATE_MODEL_PROCESSOR = new UpdateModelPhaseProcessor();
-
-    private static final VisitCallback RESET_VALUES_CALLBACK = new ResetValuesCallback();
     
     /**
      * Class that is used to create the view scope map. This strategy
@@ -1470,12 +1468,11 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
      * @param context
      * @param clientIds 
      */
-    public void resetValues(FacesContext context,
-                        java.util.Collection<java.lang.String> clientIds)    
+    public void resetValues(FacesContext context, java.util.Collection<java.lang.String>
clientIds)    
     {
         VisitContext visitContext = (VisitContext) VisitContext.createVisitContext(
             context, clientIds, null);
-        this.visitTree(visitContext, RESET_VALUES_CALLBACK);
+        this.visitTree(visitContext, ResetValuesCallback.INSTANCE);
     }
 
     /**
@@ -1835,6 +1832,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
 
     private static class ApplyRequestValuesPhaseProcessor implements PhaseProcessor
     {
+        @Override
         public void process(FacesContext context, UIViewRoot root)
         {
             PartialViewContext pvc = context.getPartialViewContext();
@@ -1861,6 +1859,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
 
     private static class ProcessValidatorPhaseProcessor implements PhaseProcessor
     {
+        @Override
         public void process(FacesContext context, UIViewRoot root)
         {
             PartialViewContext pvc = context.getPartialViewContext();
@@ -1887,6 +1886,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
 
     private static class UpdateModelPhaseProcessor implements PhaseProcessor
     {
+        @Override
         public void process(FacesContext context, UIViewRoot root)
         {
             PartialViewContext pvc = context.getPartialViewContext();
@@ -1945,9 +1945,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
      */
     private static class Events
     {
-        
         private final List<FacesEvent> _anyPhase;
-        
         private final List<FacesEvent> _onPhase;
         
         public Events(List<FacesEvent> anyPhase, List<FacesEvent> onPhase)
@@ -1975,6 +1973,9 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
     
     private static class ResetValuesCallback implements VisitCallback
     {
+        private static final ResetValuesCallback INSTANCE = new ResetValuesCallback();
+        
+        @Override
         public VisitResult visit(VisitContext context, UIComponent target)
         {
             if (target instanceof EditableValueHolder)
@@ -1985,7 +1986,7 @@ public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
         }
     }
     
-    private void publishException (FacesContext facesContext, Throwable e, PhaseId phaseId,
String key)
+    private void publishException(FacesContext facesContext, Throwable e, PhaseId phaseId,
String key)
     {
         ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext,
e, null, phaseId);
         
diff --git a/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java b/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
index 8211a68..530e659 100644
--- a/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
@@ -47,7 +47,7 @@ public class StateManagerImpl extends StateManager
 {
     private static final Logger log = Logger.getLogger(StateManagerImpl.class.getName());
     
-    private static final String SERIALIZED_VIEW_REQUEST_ATTR = 
+    public static final String SERIALIZED_VIEW_REQUEST_ATTR = 
         StateManagerImpl.class.getName() + ".SERIALIZED_VIEW";
     
     private RenderKitFactory _renderKitFactory = null;
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java b/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
index 71733f9..33c89ba 100755
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
@@ -60,21 +60,8 @@ public class LifecycleImpl extends Lifecycle
     
     private final PhaseExecutor[] lifecycleExecutors;
     private final PhaseExecutor renderExecutor;
-
-    /**
-     * Initially, for ensure thread safety we used synchronization blocks and a cached 
-     * _phaseListenerArray and that works. The intention is ensure atomicity between
-     * _phaseListenerList and _phaseListenerArray, but thinking more about it use
-     * CopyOnWriteArrayList and do not use _phaseListenerArray is a lot better. 
-     * 
-     * Most times, we have few instances of PhaseListener registered, so the advantage of

-     * use _phaseListenerArray is overcome by do not have a synchronization block on getPhaseListeners().
-     * Additionally, it is more often to perform traversals than insertions/removals and

-     * we can expect only 2 calls for getPhaseListeners() per request (so only two copy 
-     * operations of a very small list).
-     */
-    private final List<PhaseListener> _phaseListenerList
-            = new CopyOnWriteArrayList<PhaseListener>(); // new ArrayList();
+    private final ClientWindowFactory clientWindowFactory;
+    private final List<PhaseListener> phaseListeners;
 
     /**
      * This variable should be marked as volatile to ensure all threads can see it
@@ -85,8 +72,6 @@ public class LifecycleImpl extends Lifecycle
      * note in this case the semantic of the variable must be preserved.
      */
     private volatile boolean _firstRequestProcessed = false;
-
-    private ClientWindowFactory clientWindowFactory;
     
     public LifecycleImpl()
     {
@@ -96,6 +81,7 @@ public class LifecycleImpl extends Lifecycle
 
         renderExecutor = new RenderResponseExecutor();
         clientWindowFactory = (ClientWindowFactory) FactoryFinder.getFactory(FactoryFinder.CLIENT_WINDOW_FACTORY);
+        phaseListeners = new CopyOnWriteArrayList<>();
     }
     
     @Override
@@ -121,30 +107,20 @@ public class LifecycleImpl extends Lifecycle
     @Override
     public void execute(FacesContext facesContext) throws FacesException
     {
-        //try
-        //{
-            // check for updates of web.xml and faces-config descriptors 
-            // only if project state is not production
-            if(!facesContext.isProjectStage(ProjectStage.Production))
-            {
-                WebXml.update(facesContext.getExternalContext());
-                new FacesConfigurator(facesContext.getExternalContext()).update();
-            }
-            
-            PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext,
getPhaseListeners());
-            for (PhaseExecutor executor : lifecycleExecutors)
+        if(!facesContext.isProjectStage(ProjectStage.Production))
+        {
+            WebXml.update(facesContext.getExternalContext());
+            new FacesConfigurator(facesContext.getExternalContext()).update();
+        }
+
+        PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext,
getPhaseListeners());
+        for (PhaseExecutor executor : lifecycleExecutors)
+        {
+            if (executePhase(facesContext, executor, phaseListenerMgr))
             {
-                if (executePhase(facesContext, executor, phaseListenerMgr))
-                {
-                    return;
-                }
+                return;
             }
-        //}
-        //catch (Throwable ex)
-        //{
-            // handle the Throwable accordingly. Maybe generate an error page.
-            //ErrorPageWriter.handleThrowable(facesContext, ex);
-        //}
+        }
     }
 
     private boolean executePhase(FacesContext context, PhaseExecutor executor, PhaseListenerManager
phaseListenerMgr)
@@ -227,75 +203,67 @@ public class LifecycleImpl extends Lifecycle
     @Override
     public void render(FacesContext facesContext) throws FacesException
     {
-        //try
-        //{
-            // if the response is complete we should not be invoking the phase listeners
+        // if the response is complete we should not be invoking the phase listeners
+        if (isResponseComplete(facesContext, renderExecutor.getPhase(), true))
+        {
+            return;
+        }
+        if (log.isLoggable(Level.FINEST))
+        {
+            log.finest("entering " + renderExecutor.getPhase() + " in " + LifecycleImpl.class.getName());
+        }
+
+        PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext,
getPhaseListeners());
+        Flash flash = facesContext.getExternalContext().getFlash();
+
+        try
+        {
+            facesContext.setCurrentPhaseId(renderExecutor.getPhase());
+
+            flash.doPrePhaseActions(facesContext);
+
+            // let the PhaseExecutor do some pre-phase actions
+            renderExecutor.doPrePhaseActions(facesContext);
+
+            phaseListenerMgr.informPhaseListenersBefore(renderExecutor.getPhase());
+            // also possible that one of the listeners completed the response
             if (isResponseComplete(facesContext, renderExecutor.getPhase(), true))
             {
                 return;
             }
-            if (log.isLoggable(Level.FINEST))
-            {
-                log.finest("entering " + renderExecutor.getPhase() + " in " + LifecycleImpl.class.getName());
-            }
-    
-            PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext,
getPhaseListeners());
-            Flash flash = facesContext.getExternalContext().getFlash();
-            
-            try
-            {
-                facesContext.setCurrentPhaseId(renderExecutor.getPhase());
-                
-                flash.doPrePhaseActions(facesContext);
-                
-                // let the PhaseExecutor do some pre-phase actions
-                renderExecutor.doPrePhaseActions(facesContext);
-                
-                phaseListenerMgr.informPhaseListenersBefore(renderExecutor.getPhase());
-                // also possible that one of the listeners completed the response
-                if (isResponseComplete(facesContext, renderExecutor.getPhase(), true))
-                {
-                    return;
-                }
-                
-                renderExecutor.execute(facesContext);
-            }
-            
-            catch (Throwable e)
-            {
-                // JSF 2.0: publish the executor's exception (if any).
-                
-                publishException (e, renderExecutor.getPhase(), facesContext);
-            }
-            
-            finally
-            {
-                phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
-                flash.doPostPhaseActions(facesContext);
-                
-                // publish a field in the application map to indicate
-                // that the first request has been processed
-                requestProcessed(facesContext);
-            }
-            
-            facesContext.getExceptionHandler().handle();
-            
-            if (log.isLoggable(Level.FINEST))
-            {
-                // Note: DebugUtils Logger must also be in trace level
-                DebugUtils.traceView("View after rendering");
-            }
-    
-            if (log.isLoggable(Level.FINEST))
-            {
-                log.finest("exiting " + renderExecutor.getPhase() + " in " + LifecycleImpl.class.getName());
-            }
-        //}
-        //catch (Throwable ex)
-        //{
-            // handle the Throwable accordingly. Maybe generate an error page.
-            //ErrorPageWriter.handleThrowable(facesContext, ex);
-        //}
+
+            renderExecutor.execute(facesContext);
+        }
+
+        catch (Throwable e)
+        {
+            // JSF 2.0: publish the executor's exception (if any).
+
+            publishException (e, renderExecutor.getPhase(), facesContext);
+        }
+
+        finally
+        {
+            phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
+            flash.doPostPhaseActions(facesContext);
+
+            // publish a field in the application map to indicate
+            // that the first request has been processed
+            requestProcessed(facesContext);
+        }
+
+        facesContext.getExceptionHandler().handle();
+
+        if (log.isLoggable(Level.FINEST))
+        {
+            // Note: DebugUtils Logger must also be in trace level
+            DebugUtils.traceView("View after rendering");
+        }
+
+        if (log.isLoggable(Level.FINEST))
+        {
+            log.finest("exiting " + renderExecutor.getPhase() + " in " + LifecycleImpl.class.getName());
+        }
     }
 
     private boolean isResponseComplete(FacesContext facesContext, PhaseId phase, boolean
before)
@@ -334,12 +302,8 @@ public class LifecycleImpl extends Lifecycle
     public void addPhaseListener(PhaseListener phaseListener)
     {
         Assert.notNull(phaseListener, "phaseListener");
-        
-        //synchronized (_phaseListenerList)
-        //{
-            _phaseListenerList.add(phaseListener);
-            //_phaseListenerArray = null; // reset lazy cache array
-        //}
+
+        phaseListeners.add(phaseListener);
     }
 
     @Override
@@ -347,29 +311,16 @@ public class LifecycleImpl extends Lifecycle
     {
         Assert.notNull(phaseListener, "phaseListener");
 
-        //synchronized (_phaseListenerList)
-        //{
-            _phaseListenerList.remove(phaseListener);
-            //_phaseListenerArray = null; // reset lazy cache array
-        //}
+        phaseListeners.remove(phaseListener);
     }
 
     @Override
     public PhaseListener[] getPhaseListeners()
     {
-        //synchronized (_phaseListenerList)
-        //{
-            // (re)build lazy cache array if necessary
-            //if (_phaseListenerArray == null)
-            //{
-            //    _phaseListenerArray = _phaseListenerList.toArray(new PhaseListener[_phaseListenerList.size()]);
-            //}
-            //return _phaseListenerArray;
-        //}
-        return _phaseListenerList.toArray(new PhaseListener[_phaseListenerList.size()]);
+        return phaseListeners.toArray(new PhaseListener[phaseListeners.size()]);
     }
     
-    private void publishException (Throwable e, PhaseId phaseId, FacesContext facesContext)
+    private void publishException(Throwable e, PhaseId phaseId, FacesContext facesContext)
     {
         ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext,
e, null, phaseId);
         
@@ -385,7 +336,7 @@ public class LifecycleImpl extends Lifecycle
      */
     private void requestProcessed(FacesContext facesContext)
     {
-        if(!_firstRequestProcessed)
+        if (!_firstRequestProcessed)
         {
             // The order here is important. First it is necessary to put
             // the value on application map before change the value here.
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java b/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
index 7ac4ff1..899a652 100644
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
@@ -46,7 +46,6 @@ class PhaseListenerManager
     // an exception should not have its afterPhase called
     private Map<PhaseId, boolean[]> listenerSuccessMap = new HashMap<PhaseId, boolean[]>();
 
-    /** Creates a new instance of PhaseListenerManager */
     PhaseListenerManager(Lifecycle lifecycle, FacesContext facesContext, PhaseListener[]
phaseListeners)
     {
         this.lifecycle = lifecycle;
@@ -120,7 +119,7 @@ class PhaseListenerManager
                 {
                     // JSF 2.0: publish exceptions instead of logging them.
                     
-                    publishException (e, phaseId, ExceptionQueuedEventContext.IN_AFTER_PHASE_KEY);
+                    publishException(e, phaseId, ExceptionQueuedEventContext.IN_AFTER_PHASE_KEY);
                 }
             }
         }
@@ -129,10 +128,10 @@ class PhaseListenerManager
     
     private void publishException (Throwable e, PhaseId phaseId, String key)
     {
-        ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext,
e, null, phaseId);
+        ExceptionQueuedEventContext context = new ExceptionQueuedEventContext(facesContext,
e, null, phaseId);
         
-        context.getAttributes().put (key, Boolean.TRUE);
+        context.getAttributes().put(key, Boolean.TRUE);
         
-        facesContext.getApplication().publishEvent (facesContext, ExceptionQueuedEvent.class,
context);
+        facesContext.getApplication().publishEvent(facesContext, ExceptionQueuedEvent.class,
context);
     }
 }
diff --git a/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java b/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
index 4167230..1ecf911 100644
--- a/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
+++ b/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
@@ -72,8 +72,7 @@ class RenderResponseExecutor extends PhaseExecutor
                 previousRoot = root;
                 viewId = root.getViewId();
                 
-                ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(
-                        facesContext, viewId);
+                ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(facesContext,
viewId);
                 if (vdl != null)
                 {
                     vdl.buildView(facesContext, root);
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
index e476a0b..d85023e 100644
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
+++ b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
@@ -65,11 +65,13 @@ public class DelegateActionListener implements ActionListener, StateHolder
         _binding = binding;
     }
 
+    @Override
     public boolean isTransient()
     {
         return false;
     }
 
+    @Override
     public void restoreState(FacesContext facesContext, Object state)
     {
         Object[] values = (Object[]) state;
@@ -77,6 +79,7 @@ public class DelegateActionListener implements ActionListener, StateHolder
         _binding = (ValueExpression) values[1];
     }
 
+    @Override
     public Object saveState(FacesContext facesContext)
     {
         Object[] values = new Object[2];
@@ -85,6 +88,7 @@ public class DelegateActionListener implements ActionListener, StateHolder
         return values;
     }
 
+    @Override
     public void setTransient(boolean arg0)
     {
         // Do nothing        
@@ -154,8 +158,8 @@ public class DelegateActionListener implements ActionListener, StateHolder
         return listener;
     }
 
-    public void processAction(ActionEvent event)
-            throws AbortProcessingException
+    @Override
+    public void processAction(ActionEvent event) throws AbortProcessingException
     {
         _getDelegate().processAction(event);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java
index 618b1e2..4dfb0e1 100644
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java
+++ b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java
@@ -63,11 +63,13 @@ public class DelegateConverter implements Converter, StateHolder
         _converterIdString = converterIdString;
     }
 
+    @Override
     public boolean isTransient()
     {
         return false;
     }
 
+    @Override
     public void restoreState(FacesContext facesContext, Object state)
     {
         Object[] values = (Object[]) state;
@@ -76,6 +78,7 @@ public class DelegateConverter implements Converter, StateHolder
         _converterIdString = (String) values[2];
     }
 
+    @Override
     public Object saveState(FacesContext facesContext)
     {
         Object[] values = new Object[3];
@@ -85,19 +88,20 @@ public class DelegateConverter implements Converter, StateHolder
         return values;
     }
 
+    @Override
     public void setTransient(boolean arg0)
     {
         // Do nothing        
     }
 
-    public Object getAsObject(FacesContext facesContext, UIComponent component,
-            String value)
+    @Override
+    public Object getAsObject(FacesContext facesContext, UIComponent component, String value)
     {
         return _getDelegate().getAsObject(facesContext, component, value);
     }
 
-    public String getAsString(FacesContext facesContext, UIComponent component,
-            Object value)
+    @Override
+    public String getAsString(FacesContext facesContext, UIComponent component, Object value)
     {
         return _getDelegate().getAsString(facesContext, component, value);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java
index b8356e7..9a8096e 100644
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java
+++ b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java
@@ -68,11 +68,13 @@ public class DelegateValidator implements Validator, StateHolder
         _validatorIdString = converterIdString;
     }
 
+    @Override
     public boolean isTransient()
     {
         return false;
     }
 
+    @Override
     public void restoreState(FacesContext facesContext, Object state)
     {
         Object[] values = (Object[]) state;
@@ -81,6 +83,7 @@ public class DelegateValidator implements Validator, StateHolder
         _validatorIdString = (String) values[2];
     }
 
+    @Override
     public Object saveState(FacesContext facesContext)
     {
         Object[] values = new Object[3];
@@ -90,6 +93,7 @@ public class DelegateValidator implements Validator, StateHolder
         return values;
     }
 
+    @Override
     public void setTransient(boolean arg0)
     {
         // Do nothing        
@@ -151,6 +155,7 @@ public class DelegateValidator implements Validator, StateHolder
         throw new ValidatorException(new FacesMessage("validatorId and/or binding must be
specified"));
     }
 
+    @Override
     public void validate(FacesContext facesContext, UIComponent component, Object value)
             throws ValidatorException
     {
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
index 8c5f95b..53e5da2 100644
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
+++ b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
@@ -61,11 +61,13 @@ public class DelegateValueChangeListener implements ValueChangeListener,
StateHo
         _binding = binding;
     }
 
+    @Override
     public boolean isTransient()
     {
         return false;
     }
 
+    @Override
     public void restoreState(FacesContext facesContext, Object state)
     {
         Object[] values = (Object[]) state;
@@ -73,6 +75,7 @@ public class DelegateValueChangeListener implements ValueChangeListener,
StateHo
         _binding = (ValueExpression) values[1];
     }
 
+    @Override
     public Object saveState(FacesContext facesContext)
     {
         Object[] values = new Object[2];
@@ -81,6 +84,7 @@ public class DelegateValueChangeListener implements ValueChangeListener,
StateHo
         return values;
     }
 
+    @Override
     public void setTransient(boolean arg0)
     {
         // Do nothing
@@ -154,6 +158,7 @@ public class DelegateValueChangeListener implements ValueChangeListener,
StateHo
         return listener;
     }
 
+    @Override
     public void processValueChange(ValueChangeEvent event) throws AbortProcessingException
     {
         _getDelegate().processValueChange(event);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
index 9621922..0e2c1e6 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
@@ -151,9 +151,6 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
     
     private static final String SKIP_ITERATION_HINT = "javax.faces.visit.SKIP_ITERATION";
     
-    private static final String SERIALIZED_VIEW_REQUEST_ATTR = 
-        StateManagerImpl.class.getName() + ".SERIALIZED_VIEW";
-    
     private static final Object[] EMPTY_STATES = new Object[]{null, null};
     
     private static final Set<VisitHint> VISIT_HINTS = Collections.unmodifiableSet(

@@ -696,7 +693,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
         }
         
         Object serializedView = context.getAttributes()
-            .get(SERIALIZED_VIEW_REQUEST_ATTR);
+            .get(StateManagerImpl.SERIALIZED_VIEW_REQUEST_ATTR);
         
         //Note on ajax case the method saveState could be called twice: once before start
         //document rendering and the other one when it is called StateManager.getViewState
method.
@@ -801,7 +798,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
                 }
             }
             
-            context.getAttributes().put(SERIALIZED_VIEW_REQUEST_ATTR, serializedView);
+            context.getAttributes().put(StateManagerImpl.SERIALIZED_VIEW_REQUEST_ATTR, serializedView);
 
         }
         
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguageStrategy.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguageStrategy.java
index d472ee6..1bd9787 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguageStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguageStrategy.java
@@ -55,6 +55,7 @@ public class FaceletViewDeclarationLanguageStrategy implements ViewDeclarationLa
     /**
      * {@inheritDoc}
      */
+    @Override
     public ViewDeclarationLanguage getViewDeclarationLanguage()
     {
         return _language;
@@ -63,6 +64,7 @@ public class FaceletViewDeclarationLanguageStrategy implements ViewDeclarationLa
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean handles(String viewId)
     {
         if (viewId == null)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
index 3571508..2e91b8a 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
@@ -996,9 +996,6 @@ public class ViewPoolProcessor
         }
     }
     
-    private static final String SERIALIZED_VIEW_REQUEST_ATTR = 
-        StateManagerImpl.class.getName() + ".SERIALIZED_VIEW";
-
     public void disposeView(FacesContext facesContext, UIViewRoot root)
     {
         if (root == null)
@@ -1046,7 +1043,7 @@ public class ViewPoolProcessor
                     }
 
                     // Clear the calculated value from the application map
-                    facesContext.getAttributes().remove(SERIALIZED_VIEW_REQUEST_ATTR);
+                    facesContext.getAttributes().remove(StateManagerImpl.SERIALIZED_VIEW_REQUEST_ATTR);
                 }
             }
         }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
index 82bede6..5d238b6 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
@@ -127,6 +127,7 @@ final class DefaultFacelet extends AbstractFacelet
      * @see org.apache.myfaces.view.facelets.Facelet#apply(javax.faces.context.FacesContext,
      *      javax.faces.component.UIComponent)
      */
+    @Override
     public void apply(FacesContext facesContext, UIComponent parent) throws IOException,
FacesException,
             FaceletException, ELException
     {
@@ -238,6 +239,7 @@ final class DefaultFacelet extends AbstractFacelet
         }
     }
     
+    @Override
     public void applyDynamicComponentHandler(FacesContext facesContext, 
             UIComponent parent, String baseKey)
          throws IOException, FacesException, FaceletException, ELException
@@ -421,11 +423,13 @@ final class DefaultFacelet extends AbstractFacelet
      * 
      * @return alias name
      */
+    @Override
     public String getAlias()
     {
         return _alias;
     }
     
+    @Override
     public String getFaceletId()
     {
         return _faceletId;
@@ -436,6 +440,7 @@ final class DefaultFacelet extends AbstractFacelet
      * 
      * @return internal ExpressionFactory instance
      */
+    @Override
     public ExpressionFactory getExpressionFactory()
     {
         return _elFactory;
@@ -544,6 +549,7 @@ final class DefaultFacelet extends AbstractFacelet
      * @throws FaceletException
      * @throws ELException
      */
+    @Override
     public void include(AbstractFaceletContext ctx, UIComponent parent, String path)
             throws IOException, FacesException, FaceletException, ELException
     {
@@ -566,6 +572,7 @@ final class DefaultFacelet extends AbstractFacelet
      * @throws FaceletException
      * @throws ELException
      */
+    @Override
     public void include(AbstractFaceletContext ctx, UIComponent parent, URL url) throws IOException,
FacesException,
             FaceletException, ELException
     {
@@ -573,6 +580,7 @@ final class DefaultFacelet extends AbstractFacelet
         f.include(ctx, parent);
     }
     
+    @Override
     public void applyCompositeComponent(AbstractFaceletContext ctx, UIComponent parent, Resource
resource)
             throws IOException, FacesException, FaceletException, ELException
     {
@@ -637,12 +645,14 @@ final class DefaultFacelet extends AbstractFacelet
             _time = time;
         }
 
+        @Override
         public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
         {
             _alias = in.readUTF();
             _time = in.readLong();
         }
 
+        @Override
         public void writeExternal(ObjectOutput out) throws IOException
         {
             out.writeUTF(_alias);
@@ -650,6 +660,7 @@ final class DefaultFacelet extends AbstractFacelet
         }
     }
 
+    @Override
     public String toString()
     {
         return _alias;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
index 9427dd3..9c08693 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java
@@ -342,6 +342,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         }
     }
     
+    @Override
     public String generateUniqueFaceletTagId(String count, String base)    
     {
         initPrefix();
@@ -440,6 +441,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         _isolatedTemplateContext.get(_currentTemplateContext).pushClient(this, this._facelet,
client);
     }
 
+    @Override
     public TemplateManager popExtendedClient(TemplateClient client)
     {
         //return _clients.removeLast();
@@ -680,6 +682,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
             this._pageContext = pageContext;
         }
 
+        @Override
         public boolean apply(FaceletContext ctx, UIComponent parent, String name)
                 throws IOException, FacesException, FaceletException,
                 ELException
@@ -827,11 +830,13 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         return _facelet.isBuildingCompositeComponentMetadata();
     }
     
+    @Override
     public FaceletCompositionContext getFaceletCompositionContext()
     {
         return _mctx;
     }
     
+    @Override
     public boolean isAnyFaceletsVariableResolved()
     {
         //if (isAllowCacheELExpressions() && _varMapperBase != null)
@@ -842,12 +847,14 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         return true;
     }
     
+    @Override
     public boolean isAllowCacheELExpressions()
     {
         return _isCacheELExpressions && getTemplateContext().isAllowCacheELExpressions()

                 && getPageContext().isAllowCacheELExpressions();
     }
     
+    @Override
     public void beforeConstructELExpression()
     {
         //if (isAllowCacheELExpressions() && _varMapperBase != null)
@@ -857,6 +864,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         }
     }
     
+    @Override
     public void afterConstructELExpression()
     {
         //if (isAllowCacheELExpressions() && _varMapperBase != null)
@@ -866,6 +874,7 @@ final class DefaultFaceletContext extends AbstractFaceletContext
         }
     }
     
+    @Override
     public ELExpressionCacheMode getELExpressionCacheMode()
     {
         return _elExpressionCacheMode;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
index 37275b6..7ee36c2 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
@@ -113,6 +113,7 @@ public final class DefaultFaceletFactory extends FaceletFactory
         
         FaceletCache.MemberFactory<Facelet> faceletFactory = new FaceletCache.MemberFactory<Facelet>()
         {
+            @Override
             public Facelet newInstance(URL url) throws IOException
             {
                 return _createFacelet(url);
@@ -120,6 +121,7 @@ public final class DefaultFaceletFactory extends FaceletFactory
         };
         FaceletCache.MemberFactory<Facelet> viewMetadataFaceletFactory = new FaceletCache.MemberFactory<Facelet>()
         {
+            @Override
             public Facelet newInstance(URL url) throws IOException
             {
                 return _createViewMetadataFacelet(url);
@@ -133,6 +135,7 @@ public final class DefaultFaceletFactory extends FaceletFactory
             FaceletCache.MemberFactory<Facelet> compositeComponentMetadataFaceletFactory
= 
                 new FaceletCache.MemberFactory<Facelet>()
             {
+                @Override
                 public Facelet newInstance(URL url) throws IOException
                 {
                     return _createCompositeComponentMetadataFacelet(url);
@@ -595,6 +598,7 @@ public final class DefaultFaceletFactory extends FaceletFactory
         }
     }
 
+    @Override
     public Facelet compileComponentFacelet(String taglibURI, String tagName, Map<String,Object>
attributes)
     {
         FaceletHandler handler = _compiler.compileComponent(taglibURI, tagName, attributes);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultResourceResolver.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultResourceResolver.java
index cff1cd0..278810c 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultResourceResolver.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultResourceResolver.java
@@ -56,6 +56,7 @@ public class DefaultResourceResolver extends ResourceResolver
         }
     }
 
+    @Override
     public String toString()
     {
         return "DefaultResourceResolver";
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/TemplateContextImpl.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/TemplateContextImpl.java
index b1fea2a..af6d384 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/TemplateContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/TemplateContextImpl.java
@@ -106,6 +106,7 @@ public class TemplateContextImpl extends TemplateContext
         _lastClient = _clients.get(0);
     }
 
+    @Override
     public TemplateManager popExtendedClient(final AbstractFaceletContext actx)
     {
         _lastClient = null;
@@ -163,6 +164,7 @@ public class TemplateContextImpl extends TemplateContext
             this._pageContext = pageContext;
         }
 
+        @Override
         public boolean apply(FaceletContext ctx, UIComponent parent, String name)
                 throws IOException, FacesException, FaceletException,
                 ELException
@@ -232,6 +234,7 @@ public class TemplateContextImpl extends TemplateContext
             return _knownParameters == null ? true : _knownParameters.isEmpty();
         }
         
+        @Override
         public boolean equals(Object o)
         {
             if (this._owner != null)
@@ -259,11 +262,13 @@ public class TemplateContextImpl extends TemplateContext
     }
     
     
+    @Override
     public TemplateManager getCompositeComponentClient()
     {
         return _compositeComponentClient;
     }
 
+    @Override
     public void setCompositeComponentClient(
             TemplateManager compositeComponentClient)
     {
@@ -328,11 +333,13 @@ public class TemplateContextImpl extends TemplateContext
         return true;
     }
     
+    @Override
     public Map<String, ValueExpression> getParameterMap()
     {
         return _templateClientAttributeMap;
     }
     
+    @Override
     public boolean isKnownParametersEmpty()
     {
         TemplateManagerImpl client;
@@ -347,6 +354,7 @@ public class TemplateContextImpl extends TemplateContext
         return true;
     }
     
+    @Override
     public Set<String> getKnownParameters()
     {
         return _templateClientKnownParameterMap.keySet();
@@ -442,11 +450,13 @@ public class TemplateContextImpl extends TemplateContext
             _length = parameterNames.length;
         }
 
+        @Override
         public boolean hasMoreElements()
         {
             return _index < _length;
         }
 
+        @Override
         public String nextElement()
         {
             if (!hasMoreElements())
@@ -517,6 +527,7 @@ public class TemplateContextImpl extends TemplateContext
      */
     public static final class InitialTemplateClient implements TemplateClient
     {
+        @Override
         public boolean apply(FaceletContext ctx, UIComponent parent, String name)
                 throws IOException, FacesException, FaceletException, ELException
         {
diff --git a/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguageBase.java
b/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguageBase.java
index a0e0d6f..74234f4 100644
--- a/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguageBase.java
+++ b/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguageBase.java
@@ -454,45 +454,4 @@ public abstract class JspViewDeclarationLanguageBase extends ViewDeclarationLang
       return null;
   }
 
-  /**
-   * Writes the response and replaces the state marker tags with the state information for
the current context
-   */
-/*  private static class StateMarkerAwareWriter extends Writer
-  {
-    private StringBuilder buf;
-
-    public StateMarkerAwareWriter()
-    {
-        this.buf = new StringBuilder();
-    }
-
-    @Override
-    public void close() throws IOException
-    {
-    }
-
-    @Override
-    public void flush() throws IOException
-    {
-    }
-
-    @Override
-    public void write(char[] cbuf, int off, int len) throws IOException
-    {
-      if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length)
|| ((off + len) < 0))
-      {
-        throw new IndexOutOfBoundsException();
-      }
-      else if (len == 0)
-      {
-        return;
-      }
-      buf.append(cbuf, off, len);
-    }
-
-    public StringBuilder getStringBuilder()
-    {
-      return buf;
-    }
-  }*/
 }
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
b/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
index c9a1a47..e155cb8 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategyTest.java
@@ -420,8 +420,7 @@ public class DefaultFaceletsStateManagementStrategyTest extends
     
     public UIViewRoot saveAndRestore(StateManagementStrategy stateManagement, UIViewRoot
viewRoot)
     {
-        facesContext.getAttributes()
-            .remove(StateManagerImpl.class.getName() + ".SERIALIZED_VIEW");        
+        facesContext.getAttributes().remove(StateManagerImpl.SERIALIZED_VIEW_REQUEST_ATTR);
       
         Object state1 = stateManagement.saveView(facesContext);
         stateToRestore = state1;
         facesContext.setViewRoot(null);


Mime
View raw message