myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1542331 [12/28] - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/ tobago-core/src/main/java/org/apache/myfaces/tobago/application/ tobago-core/src/main/java/org/apache/myfaces/tobago/compat/ tobago-core/...
Date Fri, 15 Nov 2013 17:11:10 GMT
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Fri Nov 15 17:10:58 2013
@@ -42,6 +42,7 @@ import javax.faces.FactoryFinder;
 import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.ActionSource;
+import javax.faces.component.ContextCallback;
 import javax.faces.component.EditableValueHolder;
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UICommand;
@@ -98,9 +99,9 @@ public final class ComponentUtils {
   private ComponentUtils() {
   }
 
-  public static boolean hasErrorMessages(FacesContext context) {
-    for (Iterator iter = context.getMessages(); iter.hasNext();) {
-      FacesMessage message = (FacesMessage) iter.next();
+  public static boolean hasErrorMessages(final FacesContext context) {
+    for (final Iterator iter = context.getMessages(); iter.hasNext();) {
+      final FacesMessage message = (FacesMessage) iter.next();
       if (FacesMessage.SEVERITY_ERROR.compareTo(message.getSeverity()) <= 0) {
         return true;
       }
@@ -108,9 +109,9 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static boolean containsPopupActionListener(UICommand command) {
-    ActionListener[] actionListeners = command.getActionListeners();
-    for (ActionListener actionListener : actionListeners) {
+  public static boolean containsPopupActionListener(final UICommand command) {
+    final ActionListener[] actionListeners = command.getActionListeners();
+    for (final ActionListener actionListener : actionListeners) {
       if (actionListener instanceof AbstractPopupActionListener) {
         return true;
       }
@@ -118,12 +119,12 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static String getFacesMessageAsString(FacesContext facesContext, UIComponent component) {
-    Iterator messages = facesContext.getMessages(
+  public static String getFacesMessageAsString(final FacesContext facesContext, final UIComponent component) {
+    final Iterator messages = facesContext.getMessages(
         component.getClientId(facesContext));
-    StringBuilder stringBuffer = new StringBuilder();
+    final StringBuilder stringBuffer = new StringBuilder();
     while (messages.hasNext()) {
-      FacesMessage message = (FacesMessage) messages.next();
+      final FacesMessage message = (FacesMessage) messages.next();
       stringBuffer.append(message.getDetail());
     }
     if (stringBuffer.length() > 0) {
@@ -143,8 +144,8 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static void resetPage(FacesContext context) {
-    UIViewRoot view = context.getViewRoot();
+  public static void resetPage(final FacesContext context) {
+    final UIViewRoot view = context.getViewRoot();
     if (view != null) {
       view.getAttributes().remove(PAGE_KEY);
     }
@@ -154,8 +155,8 @@ public final class ComponentUtils {
    * Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
    * the view root.
    */
-  public static UIViewRoot findViewRoot(FaceletContext faceletContext, UIComponent component) {
-    UIViewRoot viewRoot = findAncestor(component, UIViewRoot.class);
+  public static UIViewRoot findViewRoot(final FaceletContext faceletContext, final UIComponent component) {
+    final UIViewRoot viewRoot = findAncestor(component, UIViewRoot.class);
     if (viewRoot != null) {
       return viewRoot;
     } else {
@@ -163,12 +164,12 @@ public final class ComponentUtils {
     }
   }
 
-  public static AbstractUIPage findPage(FacesContext context, UIComponent component) {
-    UIViewRoot view = context.getViewRoot();
+  public static AbstractUIPage findPage(final FacesContext context, final UIComponent component) {
+    final UIViewRoot view = context.getViewRoot();
     if (view != null) {
       TransientStateHolder stateHolder = (TransientStateHolder) view.getAttributes().get(PAGE_KEY);
       if (stateHolder == null || stateHolder.isEmpty()) {
-        AbstractUIPage page = findPage(component);
+        final AbstractUIPage page = findPage(component);
         stateHolder = new TransientStateHolder(page);
         context.getViewRoot().getAttributes().put(PAGE_KEY, stateHolder);
       }
@@ -192,18 +193,18 @@ public final class ComponentUtils {
     }
   }
 
-  public static AbstractUIPage findPage(FacesContext facesContext) {
+  public static AbstractUIPage findPage(final FacesContext facesContext) {
     return findPageBreadthFirst(facesContext.getViewRoot());
   }
 
-  private static AbstractUIPage findPageBreadthFirst(UIComponent component) {
-    for (UIComponent child : component.getChildren()) {
+  private static AbstractUIPage findPageBreadthFirst(final UIComponent component) {
+    for (final UIComponent child : component.getChildren()) {
       if (child instanceof AbstractUIPage) {
         return (AbstractUIPage) child;
       }
     }
-    for (UIComponent child : component.getChildren()) {
-      AbstractUIPage result = findPageBreadthFirst(child);
+    for (final UIComponent child : component.getChildren()) {
+      final AbstractUIPage result = findPageBreadthFirst(child);
       if (result != null) {
         return result;
       }
@@ -222,7 +223,7 @@ public final class ComponentUtils {
     return null;
   }
 
-  public static <T> T findAncestor(UIComponent component, Class<T> type) {
+  public static <T> T findAncestor(UIComponent component, final Class<T> type) {
 
     while (component != null) {
       if (type.isAssignableFrom(component.getClass())) {
@@ -237,17 +238,17 @@ public final class ComponentUtils {
    * Find all sub forms of a component, and collects it.
    * It does not find sub forms of sub forms.
    */
-  public static List<AbstractUIForm> findSubForms(UIComponent component) {
-    List<AbstractUIForm> collect = new ArrayList<AbstractUIForm>();
+  public static List<AbstractUIForm> findSubForms(final UIComponent component) {
+    final List<AbstractUIForm> collect = new ArrayList<AbstractUIForm>();
     findSubForms(collect, component);
     return collect;
   }
 
   @SuppressWarnings("unchecked")
-  private static void findSubForms(List<AbstractUIForm> collect, UIComponent component) {
-    Iterator<UIComponent> kids = component.getFacetsAndChildren();
+  private static void findSubForms(final List<AbstractUIForm> collect, final UIComponent component) {
+    final Iterator<UIComponent> kids = component.getFacetsAndChildren();
     while (kids.hasNext()) {
-      UIComponent child = kids.next();
+      final UIComponent child = kids.next();
       if (child instanceof AbstractUIForm) {
         collect.add((AbstractUIForm) child);
       } else {
@@ -259,9 +260,9 @@ public final class ComponentUtils {
   /**
    * Searches the component tree beneath the component and return the first component matching the type.
    */
-  public static <T extends UIComponent> T findDescendant(UIComponent component, Class<T> type) {
+  public static <T extends UIComponent> T findDescendant(final UIComponent component, final Class<T> type) {
 
-    for (UIComponent child : component.getChildren()) {
+    for (final UIComponent child : component.getChildren()) {
       if (type.isAssignableFrom(child.getClass())) {
         return (T) child;
       }
@@ -276,11 +277,11 @@ public final class ComponentUtils {
   /**
    * Searches the component tree beneath the component and return all component matching the type.
    */
-  public static <T extends UIComponent> List<T> findDescendantList(UIComponent component, Class<T> type) {
+  public static <T extends UIComponent> List<T> findDescendantList(final UIComponent component, final Class<T> type) {
 
-    List<T> result = new ArrayList<T>();
+    final List<T> result = new ArrayList<T>();
     
-    for (UIComponent child : component.getChildren()) {
+    for (final UIComponent child : component.getChildren()) {
       if (type.isAssignableFrom(child.getClass())) {
         result.add((T) child);
       }
@@ -296,10 +297,10 @@ public final class ComponentUtils {
    * If there is no "for" attribute, return the "clientId" of the parent
    * (if it has a parent). This is useful for labels.
    */
-  public static String findClientIdFor(UIComponent component, FacesContext facesContext) {
-    UIComponent forComponent = findFor(component);
+  public static String findClientIdFor(final UIComponent component, final FacesContext facesContext) {
+    final UIComponent forComponent = findFor(component);
     if (forComponent != null) {
-      String clientId = forComponent.getClientId(facesContext);
+      final String clientId = forComponent.getClientId(facesContext);
       if (LOG.isDebugEnabled()) {
         LOG.debug("found clientId: '" + clientId + "'");
       }
@@ -311,8 +312,8 @@ public final class ComponentUtils {
     return null;
   }
 
-  public static UIComponent findFor(UIComponent component) {
-    String forValue = (String) component.getAttributes().get(Attributes.FOR);
+  public static UIComponent findFor(final UIComponent component) {
+    final String forValue = (String) component.getAttributes().get(Attributes.FOR);
     if (forValue == null) {
       return component.getParent();
     }
@@ -327,13 +328,13 @@ public final class ComponentUtils {
    * @deprecated
    */
   @Deprecated
-  public static void evaluateAutoFor(UIComponent component) {
-    String forComponent = (String) component.getAttributes().get(Attributes.FOR);
+  public static void evaluateAutoFor(final UIComponent component) {
+    final String forComponent = (String) component.getAttributes().get(Attributes.FOR);
     if (LOG.isDebugEnabled()) {
       LOG.debug("for = '" + forComponent + "'");
     }
     if ("@auto".equals(forComponent)) {
-      for (UIComponent child : component.getParent().getChildren()) {
+      for (final UIComponent child : component.getParent().getChildren()) {
         if (setForToInput(component, child, AbstractUIInput.class, false)) {
           break;
         }
@@ -347,20 +348,20 @@ public final class ComponentUtils {
    * checked if they are of the type of the parameter clazz. The "id" of the first one will be used to reset the "for"
    * attribute of the component.
    */
-  public static void evaluateAutoFor(UIComponent component, Class<? extends UIComponent> clazz) {
-    String forComponent = (String) component.getAttributes().get(Attributes.FOR);
+  public static void evaluateAutoFor(final UIComponent component, final Class<? extends UIComponent> clazz) {
+    final String forComponent = (String) component.getAttributes().get(Attributes.FOR);
     if (LOG.isDebugEnabled()) {
       LOG.debug("for = '" + forComponent + "'");
     }
     if ("@auto".equals(forComponent)) {
       // parent
-      for (UIComponent child : component.getParent().getChildren()) {
+      for (final UIComponent child : component.getParent().getChildren()) {
         if (setForToInput(component, child, clazz, component instanceof NamingContainer)) {
           return;
         }
       }
       // grand parent
-      for (UIComponent child : component.getParent().getParent().getChildren()) {
+      for (final UIComponent child : component.getParent().getParent().getChildren()) {
         if (setForToInput(component, child, clazz, component.getParent() instanceof NamingContainer)) {
           return;
         }
@@ -369,7 +370,8 @@ public final class ComponentUtils {
   }
 
   private static boolean setForToInput(
-      UIComponent component, UIComponent child, Class<? extends UIComponent> clazz, boolean namingContainer) {
+      final UIComponent component, final UIComponent child, final Class<? extends UIComponent> clazz,
+      final boolean namingContainer) {
     if (clazz.isAssignableFrom(child.getClass())) { // find the matching component
       final String forComponent;
       if (namingContainer) {
@@ -386,7 +388,7 @@ public final class ComponentUtils {
   public static boolean isInActiveForm(UIComponent component) {
     while (component != null) {
       if (component instanceof AbstractUIForm) {
-        AbstractUIForm form = (AbstractUIForm) component;
+        final AbstractUIForm form = (AbstractUIForm) component;
         if (form.isSubmitted()) {
           return true;
         }
@@ -396,13 +398,13 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static FacesMessage.Severity getMaximumSeverity(UIComponent component) {
+  public static FacesMessage.Severity getMaximumSeverity(final UIComponent component) {
     final boolean invalid = component instanceof UIInput && !((UIInput) component).isValid();
     FacesMessage.Severity max = invalid ? FacesMessage.SEVERITY_ERROR : null;
-    FacesContext facesContext = FacesContext.getCurrentInstance();
+    final FacesContext facesContext = FacesContext.getCurrentInstance();
     final Iterator messages = facesContext.getMessages(component.getClientId(facesContext));
     while (messages.hasNext()) {
-      FacesMessage message = (FacesMessage) messages.next();
+      final FacesMessage message = (FacesMessage) messages.next();
       if (max == null || message.getSeverity().getOrdinal() > max.getOrdinal()) {
         max = message.getSeverity();
       }
@@ -410,34 +412,34 @@ public final class ComponentUtils {
     return max;
   }
 
-  public static boolean isError(UIInput uiInput) {
-    FacesContext facesContext = FacesContext.getCurrentInstance();
+  public static boolean isError(final UIInput uiInput) {
+    final FacesContext facesContext = FacesContext.getCurrentInstance();
     return !uiInput.isValid()
         || facesContext.getMessages(uiInput.getClientId(facesContext)).hasNext();
   }
 
-  public static boolean isError(UIComponent component) {
+  public static boolean isError(final UIComponent component) {
     if (component instanceof AbstractUIInput) {
       return isError((AbstractUIInput) component);
     }
     return false;
   }
 
-  public static boolean isOutputOnly(UIComponent component) {
+  public static boolean isOutputOnly(final UIComponent component) {
     return getBooleanAttribute(component, Attributes.DISABLED)
         || getBooleanAttribute(component, Attributes.READONLY);
   }
 
-  public static boolean mayValidate(UIComponent component) {
+  public static boolean mayValidate(final UIComponent component) {
     return !isOutputOnly(component)
         && ComponentUtils.isInActiveForm(component);
   }
 
-  public static boolean mayUpdateModel(UIComponent component) {
+  public static boolean mayUpdateModel(final UIComponent component) {
     return mayValidate(component);
   }
 
-  public static boolean getBooleanAttribute(UIComponent component, String name) {
+  public static boolean getBooleanAttribute(final UIComponent component, final String name) {
 
     Object bool = component.getAttributes().get(name);
     if (bool == null) {
@@ -463,7 +465,7 @@ public final class ComponentUtils {
 
 
 
-  public static ValueBinding createValueBinding(String value) {
+  public static ValueBinding createValueBinding(final String value) {
     return FacesContext.getCurrentInstance().getApplication().createValueBinding(value);
   }
 
@@ -473,7 +475,7 @@ public final class ComponentUtils {
    * {@link SupportsMarkup#setMarkup(Markup markup)} before the rendering phase.
    */
   @Deprecated
-  public static void setStyleClasses(UIComponent component, String styleClasses) {
+  public static void setStyleClasses(final UIComponent component, final String styleClasses) {
     Deprecation.LOG.warn("style class " + styleClasses);
   }
 
@@ -481,11 +483,11 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setMarkup(UIComponent markupComponent, String markup) {
+  public static void setMarkup(final UIComponent markupComponent, final String markup) {
     Deprecation.LOG.error("markup=" + markup);
   }
 
-  public static Object getAttribute(UIComponent component, String name) {
+  public static Object getAttribute(final UIComponent component, final String name) {
     Object value = component.getAttributes().get(name);
     if (value instanceof ValueBinding) {
       value = ((ValueBinding) value).getValue(FacesContext.getCurrentInstance());
@@ -493,27 +495,27 @@ public final class ComponentUtils {
     return value;
   }
 
-  public static Object getObjectAttribute(UIComponent component, String name) {
+  public static Object getObjectAttribute(final UIComponent component, final String name) {
     return getAttribute(component, name);
   }
 
-  public static String getStringAttribute(UIComponent component, String name) {
+  public static String getStringAttribute(final UIComponent component, final String name) {
     return (String) getAttribute(component, name);
   }
 
-  public static int getIntAttribute(UIComponent component, String name) {
+  public static int getIntAttribute(final UIComponent component, final String name) {
     return getIntAttribute(component, name, 0);
   }
 
-  public static int getIntAttribute(UIComponent component, String name,
-      int defaultValue) {
-    Object integer = component.getAttributes().get(name);
+  public static int getIntAttribute(final UIComponent component, final String name,
+      final int defaultValue) {
+    final Object integer = component.getAttributes().get(name);
     if (integer instanceof Number) {
       return ((Number) integer).intValue();
     } else if (integer instanceof String) {
       try {
         return Integer.parseInt((String) integer);
-      } catch (NumberFormatException e) {
+      } catch (final NumberFormatException e) {
         LOG.warn("Can't parse number from string : \"" + integer + "\"!");
         return defaultValue;
       }
@@ -526,14 +528,14 @@ public final class ComponentUtils {
     }
   }
 
-  public static Character getCharacterAttribute(UIComponent component, String name) {
-    Object character = component.getAttributes().get(name);
+  public static Character getCharacterAttribute(final UIComponent component, final String name) {
+    final Object character = component.getAttributes().get(name);
     if (character == null) {
       return null;
     } else if (character instanceof Character) {
       return ((Character) character);
     } else if (character instanceof String) {
-      String asString = ((String) character);
+      final String asString = ((String) character);
       return asString.length() > 0 ? asString.charAt(0) : null;
     } else {
       LOG.warn("Unknown type '" + character.getClass().getName()
@@ -542,9 +544,9 @@ public final class ComponentUtils {
     }
   }
 
-  public static boolean isFacetOf(UIComponent component, UIComponent parent) {
-    for (Object o : parent.getFacets().keySet()) {
-      UIComponent facet = parent.getFacet((String) o);
+  public static boolean isFacetOf(final UIComponent component, final UIComponent parent) {
+    for (final Object o : parent.getFacets().keySet()) {
+      final UIComponent facet = parent.getFacet((String) o);
       if (component.equals(facet)) {
         return true;
       }
@@ -552,22 +554,23 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static RendererBase getRenderer(FacesContext facesContext, UIComponent component) {
+  public static RendererBase getRenderer(final FacesContext facesContext, final UIComponent component) {
     return getRenderer(facesContext, component.getFamily(), component.getRendererType());
   }
 
-  public static RendererBase getRenderer(FacesContext facesContext, String family, String rendererType) {
+  public static RendererBase getRenderer(final FacesContext facesContext, final String family,
+                                         final String rendererType) {
     if (rendererType == null) {
       return null;
     }
 
-    Map<String, Object> requestMap = (Map<String, Object>) facesContext.getExternalContext().getRequestMap();
-    StringBuilder key = new StringBuilder(RENDER_KEY_PREFIX);
+    final Map<String, Object> requestMap = (Map<String, Object>) facesContext.getExternalContext().getRequestMap();
+    final StringBuilder key = new StringBuilder(RENDER_KEY_PREFIX);
     key.append(rendererType);
     RendererBase renderer = (RendererBase) requestMap.get(key.toString());
 
     if (renderer == null) {
-      Renderer myRenderer = getRendererInternal(facesContext, family, rendererType);
+      final Renderer myRenderer = getRendererInternal(facesContext, family, rendererType);
       if (myRenderer instanceof RendererBase) {
         requestMap.put(key.toString(), myRenderer);
         renderer = (RendererBase) myRenderer;
@@ -579,17 +582,18 @@ public final class ComponentUtils {
   }
 
 
-  private static Renderer getRendererInternal(FacesContext facesContext, String family, String rendererType) {
-    RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
-    RenderKit renderKit = rkFactory.getRenderKit(facesContext, facesContext.getViewRoot().getRenderKitId());
-    Renderer myRenderer = renderKit.getRenderer(family, rendererType);
+  private static Renderer getRendererInternal(
+      final FacesContext facesContext, final String family, final String rendererType) {
+    final RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+    final RenderKit renderKit = rkFactory.getRenderKit(facesContext, facesContext.getViewRoot().getRenderKitId());
+    final Renderer myRenderer = renderKit.getRenderer(family, rendererType);
     return myRenderer;
   }
 
-  public static Object findParameter(UIComponent component, String name) {
-    for (UIComponent child : component.getChildren()) {
+  public static Object findParameter(final UIComponent component, final String name) {
+    for (final UIComponent child : component.getChildren()) {
       if (child instanceof UIParameter) {
-        UIParameter parameter = (UIParameter) child;
+        final UIParameter parameter = (UIParameter) child;
         if (LOG.isDebugEnabled()) {
           LOG.debug("Select name='" + parameter.getName() + "'");
           LOG.debug("Select value='" + parameter.getValue() + "'");
@@ -602,16 +606,16 @@ public final class ComponentUtils {
     return null;
   }
 
-  public static ActionListener createActionListener(String type)
+  public static ActionListener createActionListener(final String type)
       throws JspException {
     try {
       ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
       if (classLoader == null) {
         classLoader = type.getClass().getClassLoader();
       }
-      Class clazz = classLoader.loadClass(type);
+      final Class clazz = classLoader.loadClass(type);
       return (ActionListener) clazz.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       if (LOG.isDebugEnabled()) {
         LOG.debug("type=" + type, e);
       }
@@ -619,9 +623,9 @@ public final class ComponentUtils {
     }
   }
 
-  public static UIGraphic getFirstGraphicChild(UIComponent component) {
+  public static UIGraphic getFirstGraphicChild(final UIComponent component) {
     UIGraphic graphic = null;
-    for (UIComponent child : component.getChildren()) {
+    for (final UIComponent child : component.getChildren()) {
       if (child instanceof UIGraphic) {
         graphic = (UIGraphic) child;
         break;
@@ -630,12 +634,12 @@ public final class ComponentUtils {
     return graphic;
   }
 
-  public static boolean isHoverEnabled(UIComponent component) {
+  public static boolean isHoverEnabled(final UIComponent component) {
     return ComponentUtils.getBooleanAttribute(component, Attributes.HOVER);
   }
 
-  public static UIOutput getFirstNonGraphicChild(UIComponent component) {
-    for (UIComponent child : component.getChildren()) {
+  public static UIOutput getFirstNonGraphicChild(final UIComponent component) {
+    for (final UIComponent child : component.getChildren()) {
       if (child instanceof UIOutput) {
         return (UIOutput) child;
       }
@@ -647,7 +651,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setIntegerSizeProperty(UIComponent component, String name, String value) {
+  public static void setIntegerSizeProperty(final UIComponent component, final String name, final String value) {
     Deprecation.LOG.error("name=" + name + " value=" + value);
   }
 
@@ -658,15 +662,15 @@ public final class ComponentUtils {
     return value;
   }
 
-  public static void setValueForValueBinding(String name, Object value) {
-    FacesContext context = FacesContext.getCurrentInstance();
-    ValueBinding valueBinding = context.getApplication().createValueBinding(name);
+  public static void setValueForValueBinding(final String name, final Object value) {
+    final FacesContext context = FacesContext.getCurrentInstance();
+    final ValueBinding valueBinding = context.getApplication().createValueBinding(name);
     valueBinding.setValue(context, value);
   }
 
 
-  public static boolean hasSelectedValue(List<SelectItem> items, Object value) {
-    for (SelectItem item : items) {
+  public static boolean hasSelectedValue(final List<SelectItem> items, final Object value) {
+    for (final SelectItem item : items) {
       if (item.getValue().equals(value)) {
         return true;
       }
@@ -674,12 +678,12 @@ public final class ComponentUtils {
     return false;
   }
 
-  public static int getIntValue(ValueBinding valueBinding) {
+  public static int getIntValue(final ValueBinding valueBinding) {
     return getAsInt(valueBinding.getValue(FacesContext.getCurrentInstance()));
   }
 
-  private static int getAsInt(Object value) {
-    int result;
+  private static int getAsInt(final Object value) {
+    final int result;
     if (value instanceof Number) {
       result = ((Number) value).intValue();
     } else if (value instanceof String) {
@@ -691,14 +695,15 @@ public final class ComponentUtils {
   }
 
 
-  public static String createPickerId(FacesContext facesContext, UIComponent component, String postfix) {
+  public static String createPickerId(
+      final FacesContext facesContext, final UIComponent component, final String postfix) {
     //String id = component.getId();
-    String id = getComponentId(facesContext, component);
+    final String id = getComponentId(facesContext, component);
     return id + "_picker" + postfix;
   }
 
-  public static String getComponentId(FacesContext facesContext, UIComponent component) {
-    String id = component.getId();
+  public static String getComponentId(final FacesContext facesContext, final UIComponent component) {
+    final String id = component.getId();
     //if (id == null) {
     // XXX What is this?
     //  id = component.getClientId(facesContext).substring(id.lastIndexOf('_'));
@@ -711,7 +716,7 @@ public final class ComponentUtils {
    *
    * Todo: check if this method should be set to deprecated. 
    */
-  public static UIComponent provideLabel(FacesContext facesContext, UIComponent component) {
+  public static UIComponent provideLabel(final FacesContext facesContext, final UIComponent component) {
     UIComponent label = component.getFacet(Facets.LABEL);
 
 
@@ -723,10 +728,10 @@ public final class ComponentUtils {
       }
 
       if (labelText != null) {
-        Application application = FacesContext.getCurrentInstance().getApplication();
+        final Application application = FacesContext.getCurrentInstance().getApplication();
         label = application.createComponent(UIOutput.COMPONENT_TYPE);
         label.setRendererType(RendererTypes.LABEL);
-        String idprefix = ComponentUtils.getComponentId(facesContext, component);
+        final String idprefix = ComponentUtils.getComponentId(facesContext, component);
         label.setId(idprefix + "_" + Facets.LABEL);
         label.setRendered(true);
 
@@ -746,7 +751,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setValidator(EditableValueHolder editableValueHolder, String validator) {
+  public static void setValidator(final EditableValueHolder editableValueHolder, final String validator) {
     Deprecation.LOG.error("validator=" + validator);
   }
 
@@ -754,7 +759,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setConverter(ValueHolder valueHolder, String converterId) {
+  public static void setConverter(final ValueHolder valueHolder, final String converterId) {
     Deprecation.LOG.error("converterId=" + converterId);
   }
 
@@ -762,7 +767,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setAction(ActionSource component, String action) {
+  public static void setAction(final ActionSource component, final String action) {
     Deprecation.LOG.error("action=" + action);
   }
 
@@ -770,7 +775,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setActionListener(ActionSource command, String actionListener) {
+  public static void setActionListener(final ActionSource command, final String actionListener) {
     Deprecation.LOG.error("actionListener=" + actionListener);
   }
 
@@ -778,7 +783,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setValueChangeListener(EditableValueHolder valueHolder, String valueChangeListener) {
+  public static void setValueChangeListener(final EditableValueHolder valueHolder, final String valueChangeListener) {
     Deprecation.LOG.error("valueChangeListener=" + valueChangeListener);
   }
 
@@ -786,7 +791,7 @@ public final class ComponentUtils {
    * @deprecated since 1.5.0
    */
   @Deprecated
-  public static void setValueBinding(UIComponent component, String name, String state) {
+  public static void setValueBinding(final UIComponent component, final String name, final String state) {
     Deprecation.LOG.error("name=" + name + " state=" + state);
   }
 
@@ -794,16 +799,16 @@ public final class ComponentUtils {
    * @deprecated since 1.5
    */
   @Deprecated
-  public static String[] getMarkupBinding(FacesContext facesContext, SupportsMarkup component) {
-    ValueBinding vb = ((UIComponent) component).getValueBinding(Attributes.MARKUP);
+  public static String[] getMarkupBinding(final FacesContext facesContext, final SupportsMarkup component) {
+    final ValueBinding vb = ((UIComponent) component).getValueBinding(Attributes.MARKUP);
     if (vb != null) {
-      Object markups = vb.getValue(facesContext);
+      final Object markups = vb.getValue(facesContext);
       if (markups instanceof String[]) {
         return (String[]) markups;
       } else if (markups instanceof String) {
-        String[] strings = StringUtils.split((String) markups, ", ");
-        List<String> result = new ArrayList<String>(strings.length);
-        for (String string : strings) {
+        final String[] strings = StringUtils.split((String) markups, ", ");
+        final List<String> result = new ArrayList<String>(strings.length);
+        for (final String string : strings) {
           if (string.trim().length() != 0) {
             result.add(string.trim());
           }
@@ -831,18 +836,18 @@ public final class ComponentUtils {
    * </dl>
    * (to the view root, if naming containers run out)
    */
-  public static UIComponent findComponent(UIComponent from, String relativeId) {
+  public static UIComponent findComponent(final UIComponent from, final String relativeId) {
     return FindComponentUtils.findComponent(from, relativeId);
   }
 
-  public static String[] splitList(String renderers) {
+  public static String[] splitList(final String renderers) {
     return StringUtils.split(renderers, LIST_SEPARATOR_CHARS);
   }
 
   public static Object getConvertedValue(
-      FacesContext facesContext, UIComponent component, String stringValue) {
+      final FacesContext facesContext, final UIComponent component, final String stringValue) {
     try {
-      Renderer renderer = getRenderer(facesContext, component);
+      final Renderer renderer = getRenderer(facesContext, component);
       if (renderer != null) {
         if (component instanceof UISelectMany) {
           final Object converted = renderer.getConvertedValue(facesContext, component, new String[]{stringValue});
@@ -854,9 +859,9 @@ public final class ComponentUtils {
         Converter converter = ((ValueHolder) component).getConverter();
         if (converter == null) {
           //Try to find out by value binding
-          ValueBinding vb = component.getValueBinding("value");
+          final ValueBinding vb = component.getValueBinding("value");
           if (vb != null) {
-            Class valueType = vb.getType(facesContext);
+            final Class valueType = vb.getType(facesContext);
             if (valueType != null) {
               converter = facesContext.getApplication().createConverter(valueType);
             }
@@ -866,13 +871,13 @@ public final class ComponentUtils {
           converter.getAsObject(facesContext, component, stringValue);
         }
       }
-    } catch (Exception e) {
+    } catch (final Exception e) {
       LOG.warn("Can't convert string value '" + stringValue + "'", e);
     }
     return stringValue;
   }
 
-  public static Markup updateMarkup(UIComponent component, Markup markup) {
+  public static Markup updateMarkup(final UIComponent component, Markup markup) {
     if (markup == null) {
       markup = Markup.NULL;
     }
@@ -883,7 +888,7 @@ public final class ComponentUtils {
       markup = markup.add(Markup.READONLY);
     }
     if (component instanceof UIInput) {
-      UIInput input = (UIInput) component;
+      final UIInput input = (UIInput) component;
 
       final FacesMessage.Severity maximumSeverity = ComponentUtils.getMaximumSeverity(input);
       markup = markup.add(markupOfSeverity(maximumSeverity));
@@ -895,7 +900,7 @@ public final class ComponentUtils {
     return markup;
   }
 
-  public static Markup markupOfSeverity(FacesMessage.Severity maximumSeverity) {
+  public static Markup markupOfSeverity(final FacesMessage.Severity maximumSeverity) {
     if (FacesMessage.SEVERITY_FATAL.equals(maximumSeverity)) {
       return Markup.FATAL;
     } else if (FacesMessage.SEVERITY_ERROR.equals(maximumSeverity)) {
@@ -908,15 +913,15 @@ public final class ComponentUtils {
     return null;
   }
 
-  public static void addCurrentMarkup(SupportsMarkup component, Markup markup) {
+  public static void addCurrentMarkup(final SupportsMarkup component, final Markup markup) {
     component.setCurrentMarkup(markup.add(component.getCurrentMarkup()));
   }
 
-  public static boolean hasChildrenWithMessages(FacesContext facesContext, NamingContainer  container) {
+  public static boolean hasChildrenWithMessages(final FacesContext facesContext, final NamingContainer  container) {
     if (container instanceof UIComponent) {
-      String clientId = ((UIComponent) container).getClientId(facesContext);
-      for (Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
-        String id = (String) ids.next();
+      final String clientId = ((UIComponent) container).getClientId(facesContext);
+      for (final Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
+        final String id = (String) ids.next();
         if (id.startsWith(clientId)) {
           return true;
         }
@@ -926,16 +931,16 @@ public final class ComponentUtils {
   }
 
   public static FacesMessage.Severity getMaximumSeverityOfChildrenMessages(
-      FacesContext facesContext, NamingContainer container) {
+      final FacesContext facesContext, final NamingContainer container) {
     if (container instanceof UIComponent) {
-      String clientId = ((UIComponent) container).getClientId(facesContext);
+      final String clientId = ((UIComponent) container).getClientId(facesContext);
       FacesMessage.Severity max = null;
-      for (Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
-        String id = (String) ids.next();
+      for (final Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
+        final String id = (String) ids.next();
         if (id != null && id.startsWith(clientId)) {
           final Iterator messages = facesContext.getMessages(id);
           while (messages.hasNext()) {
-            FacesMessage message = (FacesMessage) messages.next();
+            final FacesMessage message = (FacesMessage) messages.next();
             if (max == null || message.getSeverity().getOrdinal() > max.getOrdinal()) {
               max = message.getSeverity();
             }
@@ -947,12 +952,12 @@ public final class ComponentUtils {
     return null;
   }
 
-  public static String[] getChildrenWithMessages(FacesContext facesContext, NamingContainer container) {
+  public static String[] getChildrenWithMessages(final FacesContext facesContext, final NamingContainer container) {
     if (container instanceof UIComponent) {
-      List<String> clientIds = new ArrayList<String>();
-      String clientId = ((UIComponent) container).getClientId(facesContext);
-      for (Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
-        String id = (String) ids.next();
+      final List<String> clientIds = new ArrayList<String>();
+      final String clientId = ((UIComponent) container).getClientId(facesContext);
+      for (final Iterator ids = facesContext.getClientIdsWithMessages(); ids.hasNext();) {
+        final String id = (String) ids.next();
         if (id.startsWith(clientId)) {
           clientIds.add(id);
         }
@@ -966,7 +971,7 @@ public final class ComponentUtils {
    * Adding a data attribute to the component. 
    * The name must start with "data-", e. g. "data-tobago-foo" or "data-bar"
    */
-  public static void putDataAttributeWithPrefix(UIComponent component, String name, Object value) {
+  public static void putDataAttributeWithPrefix(final UIComponent component, final String name, final Object value) {
     if (name.startsWith("data-")) {
       putDataAttribute(component, name.substring(5), value);
     } else {
@@ -978,7 +983,7 @@ public final class ComponentUtils {
    * Adding a data attribute to the component.
    * The name should not start with "data-", e. g. "tobago-foo" or "bar"
    */
-  public static void putDataAttribute(UIComponent component, Object name, Object value) {
+  public static void putDataAttribute(final UIComponent component, final Object name, final Object value) {
     Map<Object, Object> map = getDataAttributes(component);
     if (map == null) {
       map = new HashMap<Object, Object>();
@@ -988,13 +993,13 @@ public final class ComponentUtils {
   }
 
   @SuppressWarnings("unchecked")
-  public static Map<Object, Object> getDataAttributes(UIComponent component) {
+  public static Map<Object, Object> getDataAttributes(final UIComponent component) {
     return (Map<Object, Object>) component.getAttributes().get(DATA_ATTRIBUTES_KEY);
   }
 
   public static boolean invokeOnComponent(
-      FacesContext context, UIComponent component, String clientId, javax.faces.component.ContextCallback callback) {
-    String thisClientId = component.getClientId(context);
+      final FacesContext context, final UIComponent component, final String clientId, final ContextCallback callback) {
+    final String thisClientId = component.getClientId(context);
 
     if (clientId.equals(thisClientId)) {
       callback.invokeContextCallback(context, component);
@@ -1020,9 +1025,9 @@ public final class ComponentUtils {
   }
 
   private static boolean invokeOnComponentFacetsAndChildren(
-      FacesContext context, UIComponent component, String clientId, javax.faces.component.ContextCallback callback) {
-    for (java.util.Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext();) {
-      UIComponent child = it.next();
+      final FacesContext context, final UIComponent component, final String clientId, final ContextCallback callback) {
+    for (final java.util.Iterator<UIComponent> it = component.getFacetsAndChildren(); it.hasNext();) {
+      final UIComponent child = it.next();
       if (child.invokeOnComponent(context, clientId, callback)) {
         return true;
       }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java Fri Nov 15 17:10:58 2013
@@ -32,11 +32,11 @@ public class DebugNavigationHandler exte
 
   private NavigationHandler navigationHandler;
 
-  public DebugNavigationHandler(NavigationHandler navigationHandler) {
+  public DebugNavigationHandler(final NavigationHandler navigationHandler) {
     this.navigationHandler = navigationHandler;
   }
 
-  public void handleNavigation(FacesContext facesContext, String fromAction, String outcome) {
+  public void handleNavigation(final FacesContext facesContext, final String fromAction, final String outcome) {
     if (LOG.isDebugEnabled()) {
       LOG.debug("Handle Navigation context: " + facesContext + " fromAction: '"
           + fromAction + "' outcome: '" + outcome + "'");

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugPhaseListener.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugPhaseListener.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugPhaseListener.java Fri Nov 15 17:10:58 2013
@@ -42,7 +42,7 @@ public class DebugPhaseListener implemen
 
   private static final String KEY = DebugPhaseListener.class.getName() + "_ID_";
 
-  public void afterPhase(PhaseEvent phaseEvent) {
+  public void afterPhase(final PhaseEvent phaseEvent) {
     final FacesContext facesContext = FacesContext.getCurrentInstance();
     final boolean productionMode = TobagoConfig.getInstance(facesContext).getProjectStage() == ProjectStage.Production;
     if (productionMode) {
@@ -76,10 +76,10 @@ public class DebugPhaseListener implemen
           LOG.info("Total response time : " + (end - start + " milliseconds"));
         }
       }
-      for (Iterator iterator = facesContext.getClientIdsWithMessages(); iterator.hasNext();) {
+      for (final Iterator iterator = facesContext.getClientIdsWithMessages(); iterator.hasNext();) {
         final String clientId = (String) iterator.next();
 
-        for (Iterator messageIterator = facesContext.getMessages(clientId); messageIterator.hasNext();) {
+        for (final Iterator messageIterator = facesContext.getMessages(clientId); messageIterator.hasNext();) {
           final FacesMessage msg = (FacesMessage) messageIterator.next();
           LOG.info(MessageFormat.format("Faces message found."
               + "\n  Component: {0} \n  Severity : {1}"
@@ -90,7 +90,7 @@ public class DebugPhaseListener implemen
     }
   }
 
-  public void beforePhase(PhaseEvent phaseEvent) {
+  public void beforePhase(final PhaseEvent phaseEvent) {
     final FacesContext facesContext = FacesContext.getCurrentInstance();
     final boolean productionMode = TobagoConfig.getInstance(facesContext).getProjectStage() == ProjectStage.Production;
     if (productionMode) {
@@ -109,15 +109,15 @@ public class DebugPhaseListener implemen
 
           final Object request = externalContext.getRequest();
           if (request instanceof HttpServletRequest) {
-            HttpServletRequest servletRequest = (HttpServletRequest) request;
+            final HttpServletRequest servletRequest = (HttpServletRequest) request;
             LOG.trace("RequestURI = " + servletRequest.getRequestURI());
           }
           final Map headerMap = externalContext.getRequestHeaderMap();
-          for (Object key : headerMap.keySet()) {
+          for (final Object key : headerMap.keySet()) {
             LOG.trace("Header : '" + key + "' = '" + headerMap.get(key) + "'");
           }
           final Map parameterMap = externalContext.getRequestParameterMap();
-          for (Object key : parameterMap.keySet()) {
+          for (final Object key : parameterMap.keySet()) {
             LOG.trace("Param  : '" + key + "' = '" + parameterMap.get(key) + "'");
           }
         }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugUtils.java Fri Nov 15 17:10:58 2013
@@ -35,12 +35,12 @@ public final class DebugUtils {
     // to prevent instantiation
   }
 
-  public static String toString(UIComponent component, int offset) {
+  public static String toString(final UIComponent component, final int offset) {
     return toString(component, offset, false);
   }
 
-  public static String toString(UIComponent component, int offset, boolean asFacet) {
-    StringBuilder result = new StringBuilder();
+  public static String toString(final UIComponent component, final int offset, final boolean asFacet) {
+    final StringBuilder result = new StringBuilder();
     if (component == null) {
       result.append("null");
     } else {
@@ -49,10 +49,10 @@ public final class DebugUtils {
         result.append(spaces(offset));
         result.append(toString(component));
       }
-      Map facets = component.getFacets();
+      final Map facets = component.getFacets();
       if (facets.size() > 0) {
-        for (Map.Entry<String, UIComponent> entry : (Set<Map.Entry<String, UIComponent>>) facets.entrySet()) {
-          UIComponent facet = entry.getValue();
+        for (final Map.Entry<String, UIComponent> entry : (Set<Map.Entry<String, UIComponent>>) facets.entrySet()) {
+          final UIComponent facet = entry.getValue();
           result.append('\n');
           result.append(spaces(offset + 1));
           result.append('\"');
@@ -62,15 +62,15 @@ public final class DebugUtils {
           result.append(toString(facet, offset + 1, true));
         }
       }
-      for (UIComponent child : component.getChildren()) {
+      for (final UIComponent child : component.getChildren()) {
         result.append(toString(child, offset + 1, false));
       }
     }
     return result.toString();
   }
 
-  public static String toString(UIComponent component) {
-    StringBuilder buf = new StringBuilder(component.getClass().getName());
+  public static String toString(final UIComponent component) {
+    final StringBuilder buf = new StringBuilder(component.getClass().getName());
 //    buf.append('@');
 //    buf.append(Integer.toHexString(component.hashCode()));
     buf.append(" ");
@@ -86,15 +86,15 @@ public final class DebugUtils {
     return buf.toString();
   }
 
-  public static String spaces(int n) {
-    StringBuilder buffer = new StringBuilder();
+  public static String spaces(final int n) {
+    final StringBuilder buffer = new StringBuilder();
     for (int i = 0; i < n; i++) {
       buffer.append("  ");
     }
     return buffer.toString();
   }
 
-  public static void addDevelopmentMessage(FacesContext facesContext, String message) {
+  public static void addDevelopmentMessage(final FacesContext facesContext, final String message) {
     if (TobagoConfig.getInstance(FacesContext.getCurrentInstance()).getProjectStage() == ProjectStage.Development) {
       facesContext.addMessage(null, new FacesMessage(message));
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/EncodeAjaxCallback.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/EncodeAjaxCallback.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/EncodeAjaxCallback.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/EncodeAjaxCallback.java Fri Nov 15 17:10:58 2013
@@ -25,36 +25,35 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.internal.layout.LayoutContext;
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.apache.myfaces.tobago.renderkit.util.EncodeUtils;
 
 import javax.faces.FacesException;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 import java.io.IOException;
-import java.util.Iterator;
 
 public class EncodeAjaxCallback implements TobagoCallback {
 
-  public void invokeContextCallback(FacesContext facesContext, UIComponent component) {
+  public void invokeContextCallback(final FacesContext facesContext, final UIComponent component) {
     try {
-       UIComponent reload = component.getFacet(Facets.RELOAD);
+       final UIComponent reload = component.getFacet(Facets.RELOAD);
        if (reload != null && reload.isRendered()) {
-         Boolean immediate = (Boolean) reload.getAttributes().get(Attributes.IMMEDIATE);
+         final Boolean immediate = (Boolean) reload.getAttributes().get(Attributes.IMMEDIATE);
          if (immediate != null && !immediate) {
-           Boolean update = (Boolean) reload.getAttributes().get(Attributes.UPDATE);
+           final Boolean update = (Boolean) reload.getAttributes().get(Attributes.UPDATE);
            if (update != null && !update) {
              return;
            }
          }
       }
-      prepareRendererAll(facesContext, component);
+      EncodeUtils.prepareRendererAll(facesContext, component);
       if (component instanceof LayoutContainer) {
-        LayoutContainer layoutContainer = (LayoutContainer) component;
-        Measure width = layoutContainer.getCurrentWidth();
-        Measure height = layoutContainer.getCurrentHeight();
-        Measure oldWidth = layoutContainer.getWidth();
-        Measure oldHeight = layoutContainer.getHeight();
+        final LayoutContainer layoutContainer = (LayoutContainer) component;
+        final Measure width = layoutContainer.getCurrentWidth();
+        final Measure height = layoutContainer.getCurrentHeight();
+        final Measure oldWidth = layoutContainer.getWidth();
+        final Measure oldHeight = layoutContainer.getHeight();
         layoutContainer.setWidth(width);
         layoutContainer.setHeight(height);
         new LayoutContext(layoutContainer).layout();
@@ -62,7 +61,7 @@ public class EncodeAjaxCallback implemen
         layoutContainer.setHeight(oldHeight);
       }
       encodeAll(facesContext, component);
-    } catch (IOException e) {
+    } catch (final IOException e) {
       throw new FacesException(e);
     }
   }
@@ -73,13 +72,13 @@ public class EncodeAjaxCallback implemen
   
 
   // TODO replace with component.encodeAll after removing jsf 1.1 support
-  public static void encodeAll(FacesContext facesContext, UIComponent component) throws IOException {
+  public static void encodeAll(final FacesContext facesContext, final UIComponent component) throws IOException {
      if (component.isRendered()) {
       component.encodeBegin(facesContext);
       if (component.getRendersChildren()) {
         component.encodeChildren(facesContext);
       } else {
-        for (UIComponent child : component.getChildren()) {
+        for (final UIComponent child : component.getChildren()) {
           encodeAll(facesContext, child);
         }
       }
@@ -87,25 +86,12 @@ public class EncodeAjaxCallback implemen
     }
   }
 
-  // TODO merge with RenderUtils.prepareRendererAll
-  public static void prepareRendererAll(FacesContext facesContext, UIComponent component) throws IOException {
-    if (!component.isRendered()) {
-      return;
-    }
-    RendererBase renderer = ComponentUtils.getRenderer(facesContext,  component);
-    boolean prepareRendersChildren = false;
-    if (renderer != null) {
-      renderer.prepareRender(facesContext, component);
-      prepareRendersChildren = renderer.getPrepareRendersChildren();
-    }
-    if (prepareRendersChildren) {
-      renderer.prepareRendersChildren(facesContext, component);
-    } else {
-      Iterator it = component.getFacetsAndChildren();
-      while (it.hasNext()) {
-        UIComponent child = (UIComponent) it.next();
-        prepareRendererAll(facesContext, child);
-      }
-    }
+  /**
+   * @deprecated since 2.0.0, please use EncodeUtils.prepareRendererAll()
+   */
+  @Deprecated
+  public static void prepareRendererAll(final FacesContext facesContext, final UIComponent component)
+      throws IOException {
+    EncodeUtils.prepareRendererAll(facesContext, component);
   }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacesVersion.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacesVersion.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacesVersion.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacesVersion.java Fri Nov 15 17:10:58 2013
@@ -45,7 +45,7 @@ public enum FacesVersion {
       currentVersion = VERSION_21;
       Application.class.getMethod("getFlowHandler");
       currentVersion = VERSION_22;
-    } catch (NoSuchMethodException e) {
+    } catch (final NoSuchMethodException e) {
       // ignore
     }
 
@@ -54,21 +54,21 @@ public enum FacesVersion {
 
   }
 
-  private static boolean isAvailable(String className) {
+  private static boolean isAvailable(final String className) {
     try {
       try {
         Class.forName(className, false, Thread.currentThread().getContextClassLoader());
         return true;
-      } catch (ClassNotFoundException e) {
+      } catch (final ClassNotFoundException e) {
         // ignore
         try {
           Class.forName(className, false, FacesVersion.class.getClassLoader());
           return true;
-        } catch (ClassNotFoundException e1) {
+        } catch (final ClassNotFoundException e1) {
           // ignore
         }
       }
-    } catch (Exception e) {
+    } catch (final Exception e) {
       // ignore
     }
     return false;

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacetUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacetUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacetUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/FacetUtils.java Fri Nov 15 17:10:58 2013
@@ -35,22 +35,22 @@ public final class FacetUtils {
   /**
    * A type save utility to get the facet <code>contextMenu</code> from a component.
    */
-  public static AbstractUIMenu getContextMenu(UIComponent component) {
+  public static AbstractUIMenu getContextMenu(final UIComponent component) {
     return (AbstractUIMenu) component.getFacet(Facets.CONTEXT_MENU);
   }
 
-  public static void setContextMenu(UIComponent component, AbstractUIMenu menu) {
+  public static void setContextMenu(final UIComponent component, final AbstractUIMenu menu) {
     component.getFacets().put(Facets.CONTEXT_MENU, menu);
   }
 
   /**
    * A type save utility to get the facet <code>dropDownMenu</code> from a component.
    */
-  public static AbstractUIMenu getDropDownMenu(UIComponent component) {
+  public static AbstractUIMenu getDropDownMenu(final UIComponent component) {
     return (AbstractUIMenu) component.getFacet(Facets.DROP_DOWN_MENU);
   }
 
-  public static void setDropDownMenu(UIComponent component, AbstractUIMenu menu) {
+  public static void setDropDownMenu(final UIComponent component, final AbstractUIMenu menu) {
     component.getFacets().put(Facets.DROP_DOWN_MENU, menu);
   }
 }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LayoutInfo.java Fri Nov 15 17:10:58 2013
@@ -49,12 +49,13 @@ public class LayoutInfo {
   private LayoutTokens layoutTokens;
   private String clientIdForLogging;
 
-  public LayoutInfo(int cellCount, int space, LayoutTokens layoutTokens, String clientIdForLogging) {
+  public LayoutInfo(
+      final int cellCount, final int space, final LayoutTokens layoutTokens, final String clientIdForLogging) {
     this(cellCount, space, layoutTokens, clientIdForLogging, false);
   }
 
-  public LayoutInfo(int cellCount, int space, LayoutTokens layoutTokens,
-      String clientIdForLogging, boolean ignoreMismatch) {
+  public LayoutInfo(final int cellCount, final int space, final LayoutTokens layoutTokens,
+      final String clientIdForLogging, final boolean ignoreMismatch) {
 
     this.cellsLeft = cellCount;
     this.spaceLeft = space;
@@ -93,18 +94,18 @@ public class LayoutInfo {
     createAndInitSpaces(cellCount, FREE);
   }
 
-  private void createAndInitSpaces(int columns, int initValue) {
+  private void createAndInitSpaces(final int columns, final int initValue) {
     spaces = new int[columns];
     for (int j = 0; j < spaces.length; j++) {
       spaces[j] = initValue;
     }
   }
 
-  public void update(int space, int index) {
+  public void update(final int space, final int index) {
     update(space, index, false);
   }
 
-  public void update(int space, int index, boolean force) {
+  public void update(int space, final int index, final boolean force) {
     if (space > spaceLeft) {
       if (LOG.isDebugEnabled()) {
         LOG.debug("More space (" + space + ") needed than available (" + spaceLeft + ")!"
@@ -159,25 +160,25 @@ public class LayoutInfo {
   }
 
 
-  public static String listToTokenString(List list) {
-    String[] tokens = new String[list.size()];
+  public static String listToTokenString(final List list) {
+    final String[] tokens = new String[list.size()];
     for (int i = 0; i < list.size(); i++) {
       tokens[i] = list.get(i).toString();
     }
     return tokensToString(tokens);
   }
 
-  public static String tokensToString(int[] tokens) {
-    String[] strings = new String[tokens.length];
+  public static String tokensToString(final int[] tokens) {
+    final String[] strings = new String[tokens.length];
     for (int i = 0; i < tokens.length; i++) {
       strings[i] = Integer.toString(tokens[i]);
     }
     return tokensToString(strings);
   }
 
-  public static String tokensToString(String[] tokens) {
-    StringBuilder sb = new StringBuilder();
-    for (String token : tokens) {
+  public static String tokensToString(final String[] tokens) {
+    final StringBuilder sb = new StringBuilder();
+    for (final String token : tokens) {
       if (sb.length() != 0) {
         sb.append(";");
       }
@@ -188,7 +189,7 @@ public class LayoutInfo {
     return sb.toString();
   }
 
-  public boolean isFree(int column) {
+  public boolean isFree(final int column) {
     return spaces[column] == FREE;
   }
 
@@ -205,8 +206,8 @@ public class LayoutInfo {
   }
 
   public List<Integer> getSpaceList() {
-    List<Integer> list = new ArrayList<Integer>(spaces.length);
-    for (int space : spaces) {
+    final List<Integer> list = new ArrayList<Integer>(spaces.length);
+    for (final int space : spaces) {
       list.add(space);
     }
     return list;
@@ -249,9 +250,9 @@ public class LayoutInfo {
   }
 
   //TODO replace with Arrays.asList ..
-  private String arrayAsString(int[] currentSpaces) {
-    StringBuilder sb = new StringBuilder("[");
-    for (int currentSpace : currentSpaces) {
+  private String arrayAsString(final int[] currentSpaces) {
+    final StringBuilder sb = new StringBuilder("[");
+    for (final int currentSpace : currentSpaces) {
       sb.append(currentSpace);
       sb.append(", ");
     }
@@ -259,7 +260,7 @@ public class LayoutInfo {
     return sb.toString();
   }
 
-  private void addSpace(int space, int i) {
+  private void addSpace(final int space, final int i) {
     if (spaces[i] > HIDE) {
       if (spaces[i] == FREE) {
         spaces[i] = space;
@@ -271,17 +272,17 @@ public class LayoutInfo {
   }
 
 
-  private void parsePortions(int portions) {
+  private void parsePortions(final int portions) {
     if (columnsLeft()) {
 
       //  2. calc and set portion
       if (portions > 0) {
-        int widthForPortions = getSpaceLeft();
+        final int widthForPortions = getSpaceLeft();
         for (int i = 0; i < layoutTokens.getSize(); i++) {
-          LayoutToken token = layoutTokens.get(i);
+          final LayoutToken token = layoutTokens.get(i);
           if (isFree(i) && token instanceof RelativeLayoutToken) {
-            int portion = ((RelativeLayoutToken) token).getFactor();
-            float w = (float) widthForPortions / portions * portion;
+            final int portion = ((RelativeLayoutToken) token).getFactor();
+            final float w = (float) widthForPortions / portions * portion;
             if (w < 0) {
               update(0, i);
               if (LOG.isDebugEnabled()) {
@@ -331,16 +332,16 @@ public class LayoutInfo {
   }
 */
 
-  public void parseColumnLayout(double space) {
+  public void parseColumnLayout(final double space) {
     parseColumnLayout(space, 0);
   }
 
-  public void parseColumnLayout(double space, int padding) {
+  public void parseColumnLayout(final double space, final int padding) {
 
     if (hasLayoutTokens()) {
       int portions = 0;
       for (int i = 0; i < layoutTokens.getSize(); i++) {
-        LayoutToken token = layoutTokens.get(i);
+        final LayoutToken token = layoutTokens.get(i);
         if (token instanceof HideLayoutToken) {
           update(0, i);
           spaces[i] = HIDE;
@@ -349,7 +350,7 @@ public class LayoutInfo {
                 + " to hide " + " clientId='" + clientIdForLogging + "'");
           }
         } else if (token instanceof PixelLayoutToken) {
-          int w = ((PixelLayoutToken) token).getPixel();
+          final int w = ((PixelLayoutToken) token).getPixel();
           update(w, i, true);
           if (LOG.isDebugEnabled()) {
             LOG.debug("set column " + i + " from " + token
@@ -358,8 +359,8 @@ public class LayoutInfo {
         } else if (token instanceof RelativeLayoutToken) {
           portions += ((RelativeLayoutToken) token).getFactor();
         } else if (token instanceof PercentLayoutToken) {
-          int percent = ((PercentLayoutToken) token).getPercent();
-          int w = (int) (space / 100 * percent);
+          final int percent = ((PercentLayoutToken) token).getPercent();
+          final int w = (int) (space / 100 * percent);
           update(w, i);
           if (LOG.isDebugEnabled()) {
             LOG.debug("set column " + i + " from " + token

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/LocaleUtils.java Fri Nov 15 17:10:58 2013
@@ -31,9 +31,9 @@ public final class LocaleUtils {
   private LocaleUtils() {
   }
 
-  public static Locale createLocale(String value) {
+  public static Locale createLocale(final String value) {
     Locale locale = null;
-    String[] strings = StringUtils.split(value, "_");
+    final String[] strings = StringUtils.split(value, "_");
     switch (strings.length) {
       case 1:
         locale = new Locale(strings[0]);
@@ -54,10 +54,10 @@ public final class LocaleUtils {
    * @deprecated since 1.5
    */
   @Deprecated
-  public static List<Locale> getLocaleList(Locale locale) {
+  public static List<Locale> getLocaleList(final Locale locale) {
 
     String string = locale.toString();
-    List<Locale> locales = new ArrayList<Locale>(3);
+    final List<Locale> locales = new ArrayList<Locale>(3);
     locales.add(locale);
     int underscore;
     while ((underscore = string.lastIndexOf('_')) > 0) {
@@ -73,15 +73,15 @@ public final class LocaleUtils {
    * 
    * Sample: "de_DE" -> "_de_DE", "_de", "" 
    */
-  public static List<String> getLocaleSuffixList(Locale locale) {
+  public static List<String> getLocaleSuffixList(final Locale locale) {
 
     if (locale == null) {
       return Arrays.asList("");
     }
     
     String string = locale.toString();
-    String prefix = "_";
-    List<String> locales = new ArrayList<String>(4);
+    final String prefix = "_";
+    final List<String> locales = new ArrayList<String>(4);
     locales.add(prefix + string);
     int underscore;
     while ((underscore = string.lastIndexOf('_')) > 0) {

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/MessageUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/MessageUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/MessageUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/MessageUtils.java Fri Nov 15 17:10:58 2013
@@ -48,22 +48,22 @@ public final class MessageUtils {
   }
 
   public static void addMessage(
-      FacesContext facesContext, UIComponent component, FacesMessage.Severity severity,
-      String messageId, Object[] args) {
+      final FacesContext facesContext, final UIComponent component, final FacesMessage.Severity severity,
+      final String messageId, final Object[] args) {
     facesContext.addMessage(component.getClientId(facesContext),
         getMessage(facesContext, facesContext.getViewRoot().getLocale(), severity, messageId, args));
   }
 
   public static FacesMessage getMessage(
-      FacesContext facesContext, Locale locale,
-      FacesMessage.Severity severity, String messageId, Object... args) {
+      final FacesContext facesContext, final Locale locale,
+      final FacesMessage.Severity severity, final String messageId, final Object... args) {
 
-    ResourceBundle appBundle = getApplicationBundle(facesContext, locale);
+    final ResourceBundle appBundle = getApplicationBundle(facesContext, locale);
     String summary = getBundleString(appBundle, messageId);
     String detail = getBundleString(appBundle, messageId + DETAIL_SUFFIX);
 
     if (summary == null || detail == null) {
-      ResourceBundle tobagoBundle = new TobagoResourceBundle();
+      final ResourceBundle tobagoBundle = new TobagoResourceBundle();
       if (summary == null) {
         summary = getBundleString(tobagoBundle, messageId);
       }
@@ -72,7 +72,7 @@ public final class MessageUtils {
       }
 
       if (summary == null || detail == null) {
-        ResourceBundle defBundle = getDefaultBundle(facesContext, locale);
+        final ResourceBundle defBundle = getDefaultBundle(facesContext, locale);
         if (summary == null) {
           summary = getBundleString(defBundle, messageId);
         }
@@ -103,38 +103,39 @@ public final class MessageUtils {
     return new LabelValueExpressionFacesMessage(severity, summary, detail);
   }
 
-  private static String getBundleString(ResourceBundle bundle, String key) {
+  private static String getBundleString(final ResourceBundle bundle, final String key) {
     try {
       return bundle == null ? null : bundle.getString(key);
-    } catch (MissingResourceException e) {
+    } catch (final MissingResourceException e) {
       return null;
     }
   }
 
-  private static ResourceBundle getApplicationBundle(FacesContext facesContext, Locale locale) {
-    String bundleName = facesContext.getApplication().getMessageBundle();
+  private static ResourceBundle getApplicationBundle(final FacesContext facesContext, final Locale locale) {
+    final String bundleName = facesContext.getApplication().getMessageBundle();
     return bundleName != null ? getBundle(facesContext, locale, bundleName) : null;
   }
 
-  private static ResourceBundle getDefaultBundle(FacesContext facesContext, Locale locale) {
+  private static ResourceBundle getDefaultBundle(final FacesContext facesContext, final Locale locale) {
     return getBundle(facesContext, locale, FacesMessage.FACES_MESSAGES);
   }
 
-  private static ResourceBundle getBundle(FacesContext facesContext, Locale locale, String bundleName) {
+  private static ResourceBundle getBundle(
+      final FacesContext facesContext, final Locale locale, final String bundleName) {
     try {
       return ResourceBundle.getBundle(bundleName, locale, MessageUtils.class.getClassLoader());
-    } catch (MissingResourceException ignore2) {
+    } catch (final MissingResourceException ignore2) {
       try {
         return ResourceBundle.getBundle(bundleName, locale, Thread.currentThread().getContextClassLoader());
-      } catch (MissingResourceException damned) {
+      } catch (final MissingResourceException damned) {
         facesContext.getExternalContext().log("resource bundle " + bundleName + " could not be found");
         return null;
       }
     }
   }
 
-  public static String getLabel(FacesContext facesContext, UIComponent component) {
-    Object label = component.getAttributes().get("label");
+  public static String getLabel(final FacesContext facesContext, final UIComponent component) {
+    final Object label = component.getAttributes().get("label");
     if (label != null) {
       return label.toString();
     }
@@ -149,9 +150,9 @@ public final class MessageUtils {
    * @deprecated Since Tobago 2.0.0
    */
   @Deprecated
-  public static String getFormatedMessage(String message, Locale locale, Object... args) {
+  public static String getFormatedMessage(final String message, final Locale locale, final Object... args) {
     if (args != null && args.length > 0 && message != null) {
-      MessageFormat format = new MessageFormat(message, locale);
+      final MessageFormat format = new MessageFormat(message, locale);
       return format.format(args);
     }
     return message;

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ProcessValidationsCallback.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ProcessValidationsCallback.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ProcessValidationsCallback.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ProcessValidationsCallback.java Fri Nov 15 17:10:58 2013
@@ -27,13 +27,13 @@ import javax.faces.context.FacesContext;
 
 public class ProcessValidationsCallback implements javax.faces.component.ContextCallback {
 
-  public void invokeContextCallback(FacesContext facesContext, UIComponent component) {
+  public void invokeContextCallback(final FacesContext facesContext, final UIComponent component) {
     if (facesContext.getExternalContext().getRequestMap().get(AbstractUIForm.SUBMITTED_MARKER) == null
         || ((Boolean) facesContext.getExternalContext().getRequestMap().get(AbstractUIForm.SUBMITTED_MARKER))) {
       component.processValidators(facesContext);
     } else {
       // if we're not the submitted form, only process subforms.
-      for (AbstractUIForm subForm : ComponentUtils.findSubForms(component)) {
+      for (final AbstractUIForm subForm : ComponentUtils.findSubForms(component)) {
         subForm.processValidators(facesContext);
       }
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/UpdateModelValuesCallback.java Fri Nov 15 17:10:58 2013
@@ -27,13 +27,13 @@ import javax.faces.context.FacesContext;
 
 public class UpdateModelValuesCallback implements javax.faces.component.ContextCallback {
 
-  public void invokeContextCallback(FacesContext facesContext, UIComponent component) {
+  public void invokeContextCallback(final FacesContext facesContext, final UIComponent component) {
     if (facesContext.getExternalContext().getRequestMap().get(AbstractUIForm.SUBMITTED_MARKER) == null
         || ((Boolean) facesContext.getExternalContext().getRequestMap().get(AbstractUIForm.SUBMITTED_MARKER))) {
       component.processUpdates(facesContext);
     } else {
       // if we're not the submitted form, only process sub forms.
-      for (AbstractUIForm subForm : ComponentUtils.findSubForms(component)) {
+      for (final AbstractUIForm subForm : ComponentUtils.findSubForms(component)) {
         subForm.processUpdates(facesContext);
       }
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueBindingComparator.java Fri Nov 15 17:10:58 2013
@@ -41,36 +41,39 @@ public class ValueBindingComparator exte
 
   private ValueBinding valueBinding;
 
-  public ValueBindingComparator(FacesContext facesContext, String var, ValueBinding valueBinding) {
+  public ValueBindingComparator(final FacesContext facesContext, final String var, final ValueBinding valueBinding) {
     this.facesContext = facesContext;
     this.var = var;
     this.valueBinding = valueBinding;
   }
 
-  public ValueBindingComparator(FacesContext facesContext, String var, ValueBinding valueBinding, boolean reverse) {
+  public ValueBindingComparator(
+      final FacesContext facesContext, final String var, final ValueBinding valueBinding, final boolean reverse) {
     super(reverse);
     this.facesContext = facesContext;
     this.var = var;
     this.valueBinding = valueBinding;
   }
 
-  public ValueBindingComparator(FacesContext facesContext, String var,
-      ValueBinding valueBinding, Comparator comparator) {
+  public ValueBindingComparator(
+      final FacesContext facesContext, final String var,
+      final ValueBinding valueBinding, final Comparator comparator) {
     super(comparator);
     this.facesContext = facesContext;
     this.var = var;
     this.valueBinding = valueBinding;
   }
 
-  public ValueBindingComparator(FacesContext facesContext, String var,
-      ValueBinding valueBinding, boolean reverse, Comparator comparator) {
+  public ValueBindingComparator(
+      final FacesContext facesContext, final String var,
+      final ValueBinding valueBinding, final boolean reverse, final Comparator comparator) {
     super(reverse, comparator);
     this.facesContext = facesContext;
     this.var = var;
     this.valueBinding = valueBinding;
   }
 
-  public boolean equals(Object o) {
+  public boolean equals(final Object o) {
     if (this == o) {
       return true;
     }
@@ -107,22 +110,17 @@ public class ValueBindingComparator exte
 
   // implementation of java.util.Comparator interface
 
-  /**
-   * @param param1 <description>
-   * @param param2 <description>
-   * @return <description>
-   */
-  public int compare(Object param1, Object param2) {
-    Object obj1;
-    Object obj2;
+  public int compare(final Object param1, final Object param2) {
+    final Object obj1;
+    final Object obj2;
     try {
-      final Map requestMap = facesContext.getExternalContext().getRequestMap();
+      final Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
       requestMap.put(var, param1);
       obj1 = valueBinding.getValue(facesContext);
       requestMap.put(var, param2);
       obj2 = valueBinding.getValue(facesContext);
 
-    } catch (Exception e) {
+    } catch (final Exception e) {
       LOG.error(e.getMessage(), e);
       return 0;
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueExpressionComparator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueExpressionComparator.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueExpressionComparator.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ValueExpressionComparator.java Fri Nov 15 17:10:58 2013
@@ -37,37 +37,41 @@ public class ValueExpressionComparator e
 
   private ValueExpression valueExpression;
 
-  public ValueExpressionComparator(FacesContext facesContext, String var, ValueExpression valueExpression) {
+  public ValueExpressionComparator(
+      final FacesContext facesContext, final String var, final ValueExpression valueExpression) {
     this.facesContext = facesContext;
     this.var = var;
     this.valueExpression = valueExpression;
   }
 
-  public ValueExpressionComparator(FacesContext facesContext, String var, ValueExpression valueExpression,
-      boolean reverse) {
+  public ValueExpressionComparator(
+      final FacesContext facesContext, final String var, final ValueExpression valueExpression,
+      final boolean reverse) {
     super(reverse);
     this.facesContext = facesContext;
     this.var = var;
     this.valueExpression = valueExpression;
   }
 
-  public ValueExpressionComparator(FacesContext facesContext, String var,
-      ValueExpression valueExpression, Comparator comparator) {
+  public ValueExpressionComparator(
+      final FacesContext facesContext, final String var,
+      final ValueExpression valueExpression, final Comparator comparator) {
     super(comparator);
     this.facesContext = facesContext;
     this.var = var;
     this.valueExpression = valueExpression;
   }
 
-  public ValueExpressionComparator(FacesContext facesContext, String var,
-      ValueExpression valueExpression, boolean reverse, Comparator comparator) {
+  public ValueExpressionComparator(
+      final FacesContext facesContext, final String var,
+      final ValueExpression valueExpression, final boolean reverse, final Comparator comparator) {
     super(reverse, comparator);
     this.facesContext = facesContext;
     this.var = var;
     this.valueExpression = valueExpression;
   }
 
-  public boolean equals(Object o) {
+  public boolean equals(final Object o) {
     if (this == o) {
       return true;
     }
@@ -109,9 +113,9 @@ public class ValueExpressionComparator e
    * @param param2 <description>
    * @return <description>
    */
-  public int compare(Object param1, Object param2) {
-    Object obj1;
-    Object obj2;
+  public int compare(final Object param1, final Object param2) {
+    final Object obj1;
+    final Object obj2;
     try {
       final Map requestMap = facesContext.getExternalContext().getRequestMap();
       requestMap.put(var, param1);
@@ -119,7 +123,7 @@ public class ValueExpressionComparator e
       requestMap.put(var, param2);
       obj2 = valueExpression.getValue(facesContext.getELContext());
 
-    } catch (Exception e) {
+    } catch (final Exception e) {
       LOG.error(e.getMessage(), e);
       return 0;
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/VariableResolverUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/VariableResolverUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/VariableResolverUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/VariableResolverUtils.java Fri Nov 15 17:10:58 2013
@@ -33,7 +33,7 @@ public final class VariableResolverUtils
   /**
    * Returns the requested object configured in the faces-config or from library.
    */
-  public static Object resolveVariable(FacesContext context, String variable) {
+  public static Object resolveVariable(final FacesContext context, final String variable) {
     final ELContext elContext = context.getELContext();
     return elContext.getELResolver().getValue(elContext, null, variable);
   }
@@ -41,7 +41,7 @@ public final class VariableResolverUtils
   /**
    * Returns the ClientProperties object configured in the faces-config.
    */
-  public static ClientProperties resolveClientProperties(FacesContext facesContext) {
+  public static ClientProperties resolveClientProperties(final FacesContext facesContext) {
     return (ClientProperties) resolveVariable(facesContext, ClientProperties.MANAGED_BEAN_NAME);
   }
   
@@ -51,7 +51,7 @@ public final class VariableResolverUtils
    * to save memory without the knowledge of the scope.
    * Also useful to enforce a new creation of a managed-bean.
    */
-  public static void clearVariable(FacesContext context, String variable) {
+  public static void clearVariable(final FacesContext context, final String variable) {
     final ELContext elContext = context.getELContext();
     elContext.getELResolver().setValue(elContext, null, variable, null);
   }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/XmlUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/XmlUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/XmlUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/XmlUtils.java Fri Nov 15 17:10:58 2013
@@ -48,8 +48,8 @@ public final class XmlUtils {
     if (null == s) {
       return "";
     }
-    int len = s.length();
-    StringBuilder buffer = new StringBuilder(len);
+    final int len = s.length();
+    final StringBuilder buffer = new StringBuilder(len);
     for (int i = 0; i < len; i++) {
       appendEntityRef(buffer, s.charAt(i), isAttributeValue);
     }
@@ -60,7 +60,7 @@ public final class XmlUtils {
     if (null == chars) {
       return "";
     }
-    StringBuilder buffer = new StringBuilder(length);
+    final StringBuilder buffer = new StringBuilder(length);
     for (int i = offset; i < length; i++) {
       appendEntityRef(buffer, chars[i], isAttributeValue);
     }
@@ -104,46 +104,46 @@ public final class XmlUtils {
   @Deprecated
   public static void load(final Properties properties, final InputStream stream)
       throws IOException {
-    Document document;
+    final Document document;
     try {
       document = createDocument(stream);
-    } catch (SAXException e) {
+    } catch (final SAXException e) {
       throw new RuntimeException("Invalid properties format", e);
     }
-    Element propertiesElement = (Element) document.getChildNodes().item(
+    final Element propertiesElement = (Element) document.getChildNodes().item(
         document.getChildNodes().getLength() - 1);
     importProperties(properties, propertiesElement);
   }
 
   private static Document createDocument(final InputStream stream)
       throws SAXException, IOException {
-    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+    final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
     factory.setIgnoringElementContentWhitespace(true);
     factory.setValidating(false);
     factory.setCoalescing(true);
     factory.setIgnoringComments(true);
     try {
-      DocumentBuilder builder = factory.newDocumentBuilder();
+      final DocumentBuilder builder = factory.newDocumentBuilder();
       builder.setEntityResolver(new Resolver());
-      InputSource source = new InputSource(stream);
+      final InputSource source = new InputSource(stream);
       return builder.parse(source);
-    } catch (ParserConfigurationException e) {
+    } catch (final ParserConfigurationException e) {
       throw new Error(e);
     }
   }
 
   static void importProperties(final Properties properties, final Element propertiesElement) {
-    NodeList entries = propertiesElement.getChildNodes();
-    int numEntries = entries.getLength();
-    int start = numEntries > 0
+    final NodeList entries = propertiesElement.getChildNodes();
+    final int numEntries = entries.getLength();
+    final int start = numEntries > 0
         && entries.item(0).getNodeName().equals("comment") ? 1 : 0;
     for (int i = start; i < numEntries; i++) {
-      Node child = entries.item(i);
+      final Node child = entries.item(i);
       if (child instanceof Element) {
-        Element entry = (Element) child;
+        final Element entry = (Element) child;
         if (entry.hasAttribute("key")) {
-          Node node = entry.getFirstChild();
-          String value = (node == null) ? "" : node.getNodeValue();
+          final Node node = entry.getFirstChild();
+          final String value = (node == null) ? "" : node.getNodeValue();
           properties.setProperty(entry.getAttribute("key"), value);
         }
       }
@@ -154,12 +154,12 @@ public final class XmlUtils {
 
     public InputSource resolveEntity(final String publicId, final String systemId)
         throws SAXException {
-      String dtd = "<!ELEMENT properties (comment?, entry*)>"
+      final String dtd = "<!ELEMENT properties (comment?, entry*)>"
           + "<!ATTLIST properties version CDATA #FIXED '1.0'>"
           + "<!ELEMENT comment (#PCDATA)>"
           + "<!ELEMENT entry (#PCDATA)>"
           + "<!ATTLIST entry key CDATA #REQUIRED>";
-      InputSource inputSource = new InputSource(new StringReader(dtd));
+      final InputSource inputSource = new InputSource(new StringReader(dtd));
       inputSource.setSystemId("http://java.sun.com/dtd/properties.dtd");
       return inputSource;
     }



Mime
View raw message