myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sless...@apache.org
Subject svn commit: r698799 [2/4] - in /myfaces/core/branches/2_0_0: api/src/main/java/javax/faces/ api/src/main/java/javax/faces/application/ api/src/test/java/javax/faces/application/ impl/src/main/java/org/apache/myfaces/application/ impl/src/main/java/org/...
Date Thu, 25 Sep 2008 02:03:49 GMT
Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java Wed Sep 24 19:03:47 2008
@@ -18,6 +18,17 @@
  */
 package org.apache.myfaces.config.impl.digester;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.render.RenderKitFactory;
+
 import org.apache.myfaces.config.FacesConfigDispenser;
 import org.apache.myfaces.config.element.ManagedBean;
 import org.apache.myfaces.config.element.NavigationRule;
@@ -30,16 +41,6 @@
 import org.apache.myfaces.config.impl.digester.elements.RenderKit;
 import org.apache.myfaces.config.impl.digester.elements.ResourceBundle;
 
-import javax.faces.render.RenderKitFactory;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
  */
@@ -83,38 +84,36 @@
     public void feed(FacesConfig config)
     {
         configs.add(config);
-        for (Iterator iterator = config.getFactories().iterator(); iterator
-                .hasNext();)
+        for (Iterator<Factory> iterator = config.getFactories().iterator(); iterator.hasNext();)
         {
-            Factory factory = (Factory) iterator.next();
+            Factory factory = iterator.next();
             applicationFactories.addAll(factory.getApplicationFactory());
             facesContextFactories.addAll(factory.getFacesContextFactory());
             lifecycleFactories.addAll(factory.getLifecycleFactory());
             renderKitFactories.addAll(factory.getRenderkitFactory());
         }
+        
         components.putAll(config.getComponents());
         validators.putAll(config.getValidators());
 
-        for (Iterator iterator = config.getApplications().iterator(); iterator
-                .hasNext();)
+        for (Iterator<Application> iterator = config.getApplications().iterator(); iterator.hasNext();)
         {
-            Application application = (Application) iterator.next();
+            Application application = iterator.next();
             if (!application.getDefaultRenderkitId().isEmpty())
             {
-                defaultRenderKitId = application
-                        .getDefaultRenderkitId().get(
-                                application.getDefaultRenderkitId().size() - 1);
+                defaultRenderKitId = application.getDefaultRenderkitId().get(application.getDefaultRenderkitId().size() - 1);
             }
+            
             if (!application.getMessageBundle().isEmpty())
             {
-                messageBundle = application.getMessageBundle().get(
-                        application.getMessageBundle().size() - 1);
+                messageBundle = application.getMessageBundle().get(application.getMessageBundle().size() - 1);
             }
+            
             if (!application.getLocaleConfig().isEmpty())
             {
-                localeConfig = application.getLocaleConfig()
-                        .get(application.getLocaleConfig().size() - 1);
+                localeConfig = application.getLocaleConfig().get(application.getLocaleConfig().size() - 1);
             }
+            
             actionListeners.addAll(application.getActionListener());
             navigationHandlers.addAll(application.getNavigationHandler());
             resourceHandlers.addAll(application.getResourceHandler());
@@ -125,28 +124,24 @@
             resourceBundles.addAll(application.getResourceBundle());
             elResolvers.addAll(application.getElResolver());
         }
-        for (Iterator iterator = config.getConverters().iterator(); iterator
-                .hasNext();)
+        
+        for (Iterator<Converter> iterator = config.getConverters().iterator(); iterator.hasNext();)
         {
-            Converter converter = (Converter) iterator.next();
+            Converter converter = iterator.next();
 
             if (converter.getConverterId() != null)
             {
-                converterById.put(converter.getConverterId(), converter
-                        .getConverterClass());
+                converterById.put(converter.getConverterId(), converter.getConverterClass());
             }
             else
             {
-                converterByClass.put(converter.getForClass(), converter
-                        .getConverterClass());
+                converterByClass.put(converter.getForClass(), converter.getConverterClass());
             }
 
-            converterConfigurationByClassName.put(
-                    converter.getConverterClass(), converter);
+            converterConfigurationByClassName.put(converter.getConverterClass(), converter);
         }
 
-        for (Iterator iterator = config.getRenderKits().iterator(); iterator
-                .hasNext();)
+        for (Iterator<RenderKit> iterator = config.getRenderKits().iterator(); iterator.hasNext();)
         {
             RenderKit renderKit = (RenderKit) iterator.next();
             String renderKitId = renderKit.getId();
@@ -167,6 +162,7 @@
                 existing.merge(renderKit);
             }
         }
+        
         lifecyclePhaseListeners.addAll(config.getLifecyclePhaseListener());
         managedBeans.addAll(config.getManagedBeans());
         navigationRules.addAll(config.getNavigationRules());
@@ -343,19 +339,25 @@
     /**
      * @return Iterator over supported locale names
      */
-    public Iterator getSupportedLocalesIterator()
+    public Iterator<String> getSupportedLocalesIterator()
     {
+        List<String> locale;
         if (localeConfig != null)
         {
-            return localeConfig.getSupportedLocales().iterator();
+            locale = localeConfig.getSupportedLocales();
+        }
+        else
+        {
+            locale = Collections.emptyList();
         }
-        return Collections.EMPTY_LIST.iterator();
+        
+        return locale.iterator();
     }
 
     /**
      * @return Iterator over all defined component types
      */
-    public Iterator getComponentTypes()
+    public Iterator<String> getComponentTypes()
     {
         return components.keySet().iterator();
     }
@@ -413,9 +415,9 @@
     /**
      * @return Iterator over all defined validator ids
      */
-    public Iterator getValidatorIds()
+    public Collection<String> getValidatorIds()
     {
-        return validators.keySet().iterator();
+        return validators.keySet();
     }
 
     /**
@@ -430,26 +432,26 @@
      * @return Iterator over
      *         {@link org.apache.myfaces.config.element.ManagedBean ManagedBean}s
      */
-    public Iterator<ManagedBean> getManagedBeans()
+    public Collection<ManagedBean> getManagedBeans()
     {
-        return managedBeans.iterator();
+        return managedBeans;
     }
 
     /**
      * @return Iterator over
      *         {@link org.apache.myfaces.config.element.NavigationRule NavigationRule}s
      */
-    public Iterator<NavigationRule> getNavigationRules()
+    public Collection<NavigationRule> getNavigationRules()
     {
-        return navigationRules.iterator();
+        return navigationRules;
     }
 
     /**
      * @return Iterator over all defined renderkit ids
      */
-    public Iterator<String> getRenderKitIds()
+    public Collection<String> getRenderKitIds()
     {
-        return renderKits.keySet().iterator();
+        return renderKits.keySet();
     }
 
     /**
@@ -457,8 +459,7 @@
      */
     public String getRenderKitClass(String renderKitId)
     {
-        RenderKit renderKit = renderKits.get(renderKitId);
-        return renderKit.getRenderKitClass();
+        return renderKits.get(renderKitId).getRenderKitClass();
     }
 
     /**
@@ -466,29 +467,28 @@
      *         {@link org.apache.myfaces.config.element.Renderer Renderer}s for
      *         the given renderKitId
      */
-    public Iterator<Renderer> getRenderers(String renderKitId)
+    public Collection<Renderer> getRenderers(String renderKitId)
     {
-        RenderKit renderKit = renderKits.get(renderKitId);
-        return renderKit.getRenderer().iterator();
+        return renderKits.get(renderKitId).getRenderer();
     }
 
     /**
      * @return Iterator over {@link javax.faces.event.PhaseListener}
      *         implementation class names
      */
-    public Iterator<String> getLifecyclePhaseListeners()
+    public Collection<String> getLifecyclePhaseListeners()
     {
-        return lifecyclePhaseListeners.iterator();
+        return lifecyclePhaseListeners;
     }
 
-    public Iterator<ResourceBundle> getResourceBundles()
+    public Collection<ResourceBundle> getResourceBundles()
     {
-        return resourceBundles.iterator();
+        return resourceBundles;
     }
 
-    public Iterator<String> getElResolvers()
+    public Collection<String> getElResolvers()
     {
-        return elResolvers.iterator();
+        return elResolvers;
     }
 
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/DigesterFacesConfigUnmarshallerImpl.java Wed Sep 24 19:03:47 2008
@@ -20,7 +20,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.List;
 import javax.faces.context.ExternalContext;
 
 import org.apache.myfaces.config.FacesConfigUnmarshaller;
@@ -201,24 +200,17 @@
         //Fix for http://issues.apache.org/jira/browse/MYFACES-236
         FacesConfig config = (FacesConfig) digester.parse(is);
 
-        List li =config.getApplications();
-
-        for (int i = 0; i < li.size(); i++)
+        for (Application application : config.getApplications())
         {
-            Application application = (Application) li.get(i);
-            List localeList = application.getLocaleConfig();
-
-            for (int j = 0; j < localeList.size(); j++)
+            for (LocaleConfig localeConfig : application.getLocaleConfig())
             {
-                LocaleConfig localeConfig = (LocaleConfig) localeList.get(j);
-
                 if(!localeConfig.getSupportedLocales().contains(localeConfig.getDefaultLocale()))
+                {
                     localeConfig.getSupportedLocales().add(localeConfig.getDefaultLocale());
+                }
             }
         }
 
         return config;
     }
-
-
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Attribute.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Attribute.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Attribute.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Attribute.java Wed Sep 24 19:03:47 2008
@@ -18,10 +18,10 @@
  */
 package org.apache.myfaces.config.impl.digester.elements;
 
-import java.util.List;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 
 /**
  * @author Martin Marinschek
@@ -52,49 +52,61 @@
     public void addDescription(String value)
     {
         if(_description == null)
+        {
             _description = new ArrayList<String>();
-
+        }
+        
         _description.add(value);
     }
 
-    public Iterator<String> getDescriptions()
+    public Collection<? extends String> getDescriptions()
     {
-        if(_description==null)
-            return Collections.EMPTY_LIST.iterator();
-
-        return _description.iterator();
+        if(_description == null)
+        {
+            return Collections.emptyList();
+        }
+        
+        return _description;
     }
 
     public void addDisplayName(String value)
     {
         if(_displayName == null)
+        {
             _displayName = new ArrayList<String>();
+        }
 
         _displayName.add(value);
     }
 
-    public Iterator<String> getDisplayNames()
+    public Collection<? extends String> getDisplayNames()
     {
-        if(_displayName==null)
-            return Collections.EMPTY_LIST.iterator();
-
-        return _displayName.iterator();
+        if(_displayName == null)
+        {
+            return Collections.emptyList();
+        }
+        
+        return _displayName;
     }
 
     public void addIcon(String value)
     {
         if(_icon == null)
+        {
             _icon = new ArrayList<String>();
-
+        }
+        
         _icon.add(value);
     }
 
-    public Iterator<String> getIcons()
+    public Collection<? extends String> getIcons()
     {
-        if(_icon==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_icon == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _icon.iterator();
+        return _icon;
     }
 
     public void setAttributeName(String attributeName)
@@ -140,16 +152,20 @@
     public void addAttributeExtension(String attributeExtension)
     {
         if(_attributeExtension == null)
+        {
             _attributeExtension = new ArrayList<String>();
+        }
 
         _attributeExtension.add(attributeExtension);
     }
 
-    public Iterator<String> getAttributeExtensions()
+    public Collection<? extends String> getAttributeExtensions()
     {
-        if(_attributeExtension==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_attributeExtension == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _attributeExtension.iterator();
+        return _attributeExtension;
     }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Converter.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Converter.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Converter.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Converter.java Wed Sep 24 19:03:47 2008
@@ -19,9 +19,9 @@
 package org.apache.myfaces.config.impl.digester.elements;
 
 import java.util.ArrayList;
-import java.util.List;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 
 
 /**
@@ -74,33 +74,41 @@
 
     public void addProperty(Property value)
     {
-        if(_properties==null)
+        if(_properties == null)
+        {
             _properties = new ArrayList<Property>();
+        }
 
         _properties.add(value);
     }
 
-    public Iterator<Property> getProperties()
+    public Collection<? extends Property> getProperties()
     {
-        if(_properties==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_properties == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _properties.iterator();
+        return _properties;
     }
     
     public void addAttribute(Attribute value)
     {
         if(_attributes == null)
+        {
             _attributes = new ArrayList<Attribute>();
+        }
 
         _attributes.add(value);
     }
 
-    public Iterator<Attribute> getAttributes()
+    public Collection<? extends Attribute> getAttributes()
     {
-        if(_attributes==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_attributes == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _attributes.iterator();
+        return _attributes;
     }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedBean.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedBean.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedBean.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedBean.java Wed Sep 24 19:03:47 2008
@@ -18,12 +18,12 @@
  */
 package org.apache.myfaces.config.impl.digester.elements;
 
-import org.apache.myfaces.shared_impl.util.ClassUtils;
-
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.List;
 
+import org.apache.myfaces.shared_impl.util.ClassUtils;
+
 
 /**
  * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
@@ -34,7 +34,7 @@
     private String description;
     private String name;
     private String beanClassName;
-    private Class beanClass;
+    private Class<?> beanClass;
     private String scope;
     private List<ManagedProperty> property = new ArrayList<ManagedProperty>();
     private MapEntries mapEntries;
@@ -107,16 +107,18 @@
     }
 
 
-    public Class getManagedBeanClass()
+    public Class<?> getManagedBeanClass()
     {
         if (beanClassName == null)
         {
             return null;
         }
+        
         if (beanClass == null)
         {
             beanClass = ClassUtils.simpleClassForName(beanClassName);
         }
+        
         return beanClass;
     }
 
@@ -145,8 +147,8 @@
     }
 
 
-    public Iterator<ManagedProperty> getManagedProperties()
+    public Collection<? extends ManagedProperty> getManagedProperties()
     {
-        return property.iterator();
+        return property;
     }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedProperty.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedProperty.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedProperty.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/ManagedProperty.java Wed Sep 24 19:03:47 2008
@@ -47,70 +47,59 @@
     {
         return _type;
     }
-
-
+    
     public org.apache.myfaces.config.element.MapEntries getMapEntries()
     {
         return _mapEntries;
     }
-
-
+    
     public void setMapEntries(MapEntries mapEntries)
     {
         _mapEntries = mapEntries;
         _type = TYPE_MAP;
     }
-
-
+    
     public org.apache.myfaces.config.element.ListEntries getListEntries()
     {
         return _listEntries;
     }
-
-
+    
     public void setListEntries(ListEntries listEntries)
     {
         _listEntries = listEntries;
         _type = TYPE_LIST;
     }
-
-
+    
     public String getPropertyName()
     {
         return _propertyName;
     }
-
-
+    
     public void setPropertyName(String propertyName)
     {
         _propertyName = propertyName;
     }
-
-
+    
     public String getPropertyClass()
     {
         return _propertyClass;
     }
-
-
+    
     public void setPropertyClass(String propertyClass)
     {
         _propertyClass = propertyClass;
     }
-
-
+    
     public boolean isNullValue()
     {
         return _type == TYPE_NULL;
     }
-
-
+    
     public void setNullValue()
     {
         _type = TYPE_NULL;
     }
-
-
+    
     public void setValue(String value)
     {
         _value = value;
@@ -121,8 +110,7 @@
     {
         return _value;
     }
-
-
+    
     public Object getRuntimeValue(FacesContext facesContext)
     {
         getValueBinding(facesContext);
@@ -130,8 +118,7 @@
         return (_valueBinding == DUMMY_VB)
             ? _value : _valueBinding.getValue(facesContext);
     }
-
-
+    
     public ValueBinding getValueBinding(FacesContext facesContext)
     {
         if (_valueBinding == null)
@@ -143,14 +130,12 @@
         }
         return _valueBinding;
     }
-
-
+    
     public boolean isValueReference()
     {
         return ContainerUtils.isValueReference(_value);
     }
-
-
+    
     private static class DummyValueBinding extends ValueBinding
     {
         public String getExpressionString()
@@ -158,7 +143,7 @@
             throw new UnsupportedOperationException();
         }
 
-        public Class getType(FacesContext facesContext)
+        public Class<?> getType(FacesContext facesContext)
         {
             throw new UnsupportedOperationException();
         }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Property.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Property.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Property.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/config/impl/digester/elements/Property.java Wed Sep 24 19:03:47 2008
@@ -18,10 +18,10 @@
  */
 package org.apache.myfaces.config.impl.digester.elements;
 
-import java.util.List;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 
 /**
  * @author Martin Marinschek
@@ -59,44 +59,54 @@
         _description.add(value);
     }
 
-    public Iterator<String> getDescriptions()
+    public Collection<? extends String> getDescriptions()
     {
-        if(_description==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_description == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _description.iterator();
+        return _description;
     }
 
     public void addDisplayName(String value)
     {
         if(_displayName == null)
+        {
             _displayName = new ArrayList<String>();
+        }
 
         _displayName.add(value);
     }
 
-    public Iterator<String> getDisplayNames()
+    public Collection<? extends String> getDisplayNames()
     {
         if(_displayName==null)
-            return Collections.EMPTY_LIST.iterator();
+        {
+            return Collections.emptyList();
+        }
 
-        return _displayName.iterator();
+        return _displayName;
     }
 
     public void addIcon(String value)
     {
         if(_icon == null)
+        {
             _icon = new ArrayList<String>();
+        }
 
         _icon.add(value);
     }
 
-    public Iterator<String> getIcons()
+    public Collection<? extends String> getIcons()
     {
-        if(_icon==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_icon == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _icon.iterator();
+        return _icon;
     }
 
     public void setPropertyName(String propertyName)
@@ -142,17 +152,21 @@
     public void addPropertyExtension(String propertyExtension)
     {
         if(_propertyExtension == null)
+        {
             _propertyExtension = new ArrayList<String>();
+        }
 
         _propertyExtension.add(propertyExtension);
     }
 
-    public Iterator<String> getPropertyExtensions()
+    public Collection<? extends String> getPropertyExtensions()
     {
-        if(_propertyExtension==null)
-            return Collections.EMPTY_LIST.iterator();
+        if(_propertyExtension == null)
+        {
+            return Collections.emptyList();
+        }
 
-        return _propertyExtension.iterator();
+        return _propertyExtension;
     }
 
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/FacesContextWrapper.java Wed Sep 24 19:03:47 2008
@@ -58,7 +58,7 @@
         return _facesContext.getApplication();
     }
 
-    public Iterator getClientIdsWithMessages()
+    public Iterator<String> getClientIdsWithMessages()
     {
         return _facesContext.getClientIdsWithMessages();
     }
@@ -73,12 +73,12 @@
         return _facesContext.getMaximumSeverity();
     }
 
-    public Iterator getMessages()
+    public Iterator<FacesMessage> getMessages()
     {
         return _facesContext.getMessages();
     }
 
-    public Iterator getMessages(String clientId)
+    public Iterator<FacesMessage> getMessages(String clientId)
     {
         return _facesContext.getMessages(clientId);
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/ApplicationMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/ApplicationMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/ApplicationMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/ApplicationMap.java Wed Sep 24 19:03:47 2008
@@ -66,7 +66,7 @@
     }
 
     @Override
-    public void putAll(Map t)
+    public void putAll(Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/InitParameterMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/InitParameterMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/InitParameterMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/InitParameterMap.java Wed Sep 24 19:03:47 2008
@@ -85,7 +85,7 @@
     }
     
     @Override
-    public void putAll(Map t)
+    public void putAll(Map<? extends String, ? extends String> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java Wed Sep 24 19:03:47 2008
@@ -69,7 +69,7 @@
     }
 
     @Override
-    public void putAll(Map t)
+    public void putAll(Map<? extends String, ? extends String> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/RequestMap.java Wed Sep 24 19:03:47 2008
@@ -66,7 +66,7 @@
     }
 
     @Override
-    public void putAll(Map t)
+    public void putAll(Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/SessionMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/SessionMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/SessionMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/portlet/SessionMap.java Wed Sep 24 19:03:47 2008
@@ -81,7 +81,7 @@
     }
 
     @Override
-    public void putAll(Map t)
+    public void putAll(Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }
@@ -91,15 +91,21 @@
      * This will clear the session without invalidation.  If no session has
      * been created, it will simply return.
      */
+    @SuppressWarnings("unchecked")
     @Override
     public void clear()
     {
         PortletSession session = getSession();
-        if (session == null) return;
-        for (Enumeration attributeNames = session.getAttributeNames(PortletSession.PORTLET_SCOPE); 
-             attributeNames.hasMoreElements(); ) {
-            String attributeName = (String)attributeNames.nextElement();
-            session.removeAttribute(attributeName);
+        if (session == null)
+        {
+            return;
+        }
+        
+        Enumeration<String> attributeNames = 
+            (Enumeration<String>)session.getAttributeNames(PortletSession.PORTLET_SCOPE);
+        while (attributeNames.hasMoreElements())
+        {
+            session.removeAttribute(attributeNames.nextElement());
         }
     }
 }
\ No newline at end of file

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ApplicationMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ApplicationMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ApplicationMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ApplicationMap.java Wed Sep 24 19:03:47 2008
@@ -63,7 +63,7 @@
     }
 
 
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/CookieMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/CookieMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/CookieMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/CookieMap.java Wed Sep 24 19:03:47 2008
@@ -34,7 +34,7 @@
  * @author Anton Koinov
  * @version $Revision$ $Date$
  */
-public final class CookieMap extends AbstractAttributeMap<Cookie>
+public final class CookieMap extends AbstractAttributeMap<Object>
 {
     private static final Cookie[] EMPTY_ARRAY = new Cookie[0];
 
@@ -88,13 +88,13 @@
     }
 
     @Override
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    protected Cookie getAttribute(final String key)
+    protected Object getAttribute(final String key)
     {
         final Cookie[] cookies = _httpServletRequest.getCookies();
         if (cookies == null)
@@ -110,7 +110,7 @@
         return null;
     }
 
-    protected void setAttribute(final String key, final Cookie value)
+    protected void setAttribute(final String key, final Object value)
     {
         throw new UnsupportedOperationException(
             "Cannot set HttpRequest Cookies");

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java Wed Sep 24 19:03:47 2008
@@ -45,132 +45,149 @@
 import javax.servlet.ServletResponse;
 import java.util.*;
 
-
 /**
  * @author Manfred Geiler (latest modification by $Author$)
  * @author Anton Koinov
  * @version $Revision$ $Date$
  */
-public class FacesContextImpl
-        extends FacesContext
+public class FacesContextImpl extends FacesContext
 {
-    //~ Instance fields ----------------------------------------------------------------------------
+    // ~ Instance fields ----------------------------------------------------------------------------
 
-    private List                        _messageClientIds = null;
-    private List                        _messages         = null;
-    private Application                 _application;
-    private ReleaseableExternalContext  _externalContext;
-    private ResponseStream              _responseStream   = null;
-    private ResponseWriter              _responseWriter   = null;
-    private FacesMessage.Severity       _maximumSeverity  = null;
-    private UIViewRoot                  _viewRoot;
-    private boolean                     _renderResponse   = false;
-    private boolean                     _responseComplete = false;
-    private RenderKitFactory            _renderKitFactory;
-    private boolean                     _released = false;
-    private ELContext                   _elContext;
+    
+    // TODO: I think a Map<String, List<FacesMessage>> would more efficient than those two -= Simon Lessard =-
+    private List<FacesMessage> _messages = null;
+    private List<String> _messageClientIds = null;
+    
+    private Application _application;
+    private ReleaseableExternalContext _externalContext;
+    private ResponseStream _responseStream = null;
+    private ResponseWriter _responseWriter = null;
+    private FacesMessage.Severity _maximumSeverity = null;
+    private UIViewRoot _viewRoot;
+    private boolean _renderResponse = false;
+    private boolean _responseComplete = false;
+    private RenderKitFactory _renderKitFactory;
+    private boolean _released = false;
+    private ELContext _elContext;
 
-    //~ Constructors -------------------------------------------------------------------------------
+    // ~ Constructors -------------------------------------------------------------------------------
 
-    public FacesContextImpl(final PortletContext portletContext,
-                            final PortletRequest portletRequest,
+    public FacesContextImpl(final PortletContext portletContext, final PortletRequest portletRequest,
                             final PortletResponse portletResponse)
     {
-        this(new PortletExternalContextImpl(portletContext,
-                                            portletRequest,
-                                            portletResponse));
+        this(new PortletExternalContextImpl(portletContext, portletRequest, portletResponse));
     }
 
-    public FacesContextImpl(final ServletContext servletContext,
-                            final ServletRequest servletRequest,
+    public FacesContextImpl(final ServletContext servletContext, final ServletRequest servletRequest,
                             final ServletResponse servletResponse)
     {
-        this(new ServletExternalContextImpl(servletContext,
-                                            servletRequest,
-                                            servletResponse));
+        this(new ServletExternalContextImpl(servletContext, servletRequest, servletResponse));
     }
 
     private FacesContextImpl(final ReleaseableExternalContext externalContext)
     {
-        _application = ((ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY))
-                .getApplication();
+        _application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();
         _renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
         _externalContext = externalContext;
-        FacesContext.setCurrentInstance(this);  //protected method, therefore must be called from here
+        FacesContext.setCurrentInstance(this); // protected method, therefore must be called from here
     }
 
-    //~ Methods ------------------------------------------------------------------------------------
+    // ~ Methods ------------------------------------------------------------------------------------
 
     public final ExternalContext getExternalContext()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
-        return (ExternalContext)_externalContext;
+        return (ExternalContext) _externalContext;
     }
 
     public final FacesMessage.Severity getMaximumSeverity()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
+        
         return _maximumSeverity;
     }
 
-    public final Iterator getMessages()
+    public final Iterator<FacesMessage> getMessages()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
-        return (_messages != null) ? _messages.iterator() : Collections.EMPTY_LIST.iterator();
+        
+        if (_messages == null)
+        {
+            return NullIterator.instance();
+        }
+        
+        return _messages.iterator();
     }
 
     public final Application getApplication()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
 
         return _application;
     }
-
-    public final Iterator getClientIdsWithMessages()
+    
+    public final Iterator<String> getClientIdsWithMessages()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
+        
         if (_messages == null || _messages.isEmpty())
         {
             return NullIterator.instance();
         }
 
-        final Set uniqueClientIds = new LinkedHashSet(_messageClientIds);
+        final Set<String> uniqueClientIds = new LinkedHashSet<String>(_messageClientIds);
+        
         return uniqueClientIds.iterator();
     }
 
-    public final Iterator getMessages(final String clientId)
+    public final Iterator<FacesMessage> getMessages(final String clientId)
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
+        
         if (_messages == null)
         {
             return NullIterator.instance();
         }
 
-        List lst = new ArrayList();
+        List<FacesMessage> lst = new ArrayList<FacesMessage>();
         for (int i = 0; i < _messages.size(); i++)
         {
             Object savedClientId = _messageClientIds.get(i);
             if (clientId == null)
             {
-                if (savedClientId == null) lst.add(_messages.get(i));
+                if (savedClientId == null)
+                {
+                    lst.add(_messages.get(i));
+                }
             }
             else
             {
-                if (clientId.equals(savedClientId)) lst.add(_messages.get(i));
+                if (clientId.equals(savedClientId))
+                {
+                    lst.add(_messages.get(i));
+                }
             }
         }
+        
         return lst.iterator();
     }
 
@@ -193,7 +210,8 @@
 
     public final boolean getRenderResponse()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         return _renderResponse;
@@ -201,7 +219,8 @@
 
     public final boolean getResponseComplete()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         return _responseComplete;
@@ -209,7 +228,8 @@
 
     public final void setResponseStream(final ResponseStream responseStream)
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         if (responseStream == null)
@@ -221,7 +241,8 @@
 
     public final ResponseStream getResponseStream()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         return _responseStream;
@@ -229,7 +250,8 @@
 
     public final void setResponseWriter(final ResponseWriter responseWriter)
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         if (responseWriter == null)
@@ -241,7 +263,8 @@
 
     public final ResponseWriter getResponseWriter()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         return _responseWriter;
@@ -249,7 +272,8 @@
 
     public final void setViewRoot(final UIViewRoot viewRoot)
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         if (viewRoot == null)
@@ -261,7 +285,8 @@
 
     public final UIViewRoot getViewRoot()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         return _viewRoot;
@@ -269,7 +294,8 @@
 
     public final void addMessage(final String clientId, final FacesMessage message)
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         if (message == null)
@@ -279,13 +305,14 @@
 
         if (_messages == null)
         {
-            _messages             = new ArrayList();
-            _messageClientIds     = new ArrayList();
+            _messages = new ArrayList<FacesMessage>();
+            _messageClientIds = new ArrayList<String>();
         }
         _messages.add(message);
         _messageClientIds.add((clientId != null) ? clientId : null);
-        FacesMessage.Severity serSeverity =  message.getSeverity();
-        if (serSeverity != null) {
+        FacesMessage.Severity serSeverity = message.getSeverity();
+        if (serSeverity != null)
+        {
             if (_maximumSeverity == null)
             {
                 _maximumSeverity = serSeverity;
@@ -299,7 +326,8 @@
 
     public final void release()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         if (_externalContext != null)
@@ -308,20 +336,21 @@
             _externalContext = null;
         }
 
-        _messageClientIds     = null;
-        _messages             = null;
-        _application          = null;
-        _responseStream       = null;
-        _responseWriter       = null;
-        _viewRoot             = null;
+        _messageClientIds = null;
+        _messages = null;
+        _application = null;
+        _responseStream = null;
+        _responseWriter = null;
+        _viewRoot = null;
 
-        _released             = true;
+        _released = true;
         FacesContext.setCurrentInstance(null);
     }
 
     public final void renderResponse()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         _renderResponse = true;
@@ -329,7 +358,8 @@
 
     public final void responseComplete()
     {
-        if (_released) {
+        if (_released)
+        {
             throw new IllegalStateException("FacesContext already released");
         }
         _responseComplete = true;
@@ -340,21 +370,23 @@
     public final void setExternalContext(ReleaseableExternalContext extContext)
     {
         _externalContext = extContext;
-        FacesContext.setCurrentInstance(this); //TODO: figure out if I really need to do this
+        FacesContext.setCurrentInstance(this); // TODO: figure out if I really need to do this
     }
 
-    public final ELContext getELContext() {
-        if (_elContext != null) return _elContext;
-        
-        
+    public final ELContext getELContext()
+    {
+        if (_elContext != null)
+            return _elContext;
+
         _elContext = new FacesELContext(getApplication().getELResolver(), this);
-        
+
         ELContextEvent event = new ELContextEvent(_elContext);
-        for (ELContextListener listener : getApplication().getELContextListeners()) {
+        for (ELContextListener listener : getApplication().getELContextListeners())
+        {
             listener.contextCreated(event);
         }
-        
+
         return _elContext;
     }
-    
+
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/InitParameterMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/InitParameterMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/InitParameterMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/InitParameterMap.java Wed Sep 24 19:03:47 2008
@@ -64,7 +64,7 @@
         return _servletContext.getInitParameterNames();
     }
     
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends String> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java Wed Sep 24 19:03:47 2008
@@ -69,7 +69,7 @@
     }
 
     @Override
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends String> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderValuesMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderValuesMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderValuesMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestHeaderValuesMap.java Wed Sep 24 19:03:47 2008
@@ -44,6 +44,7 @@
         _httpServletRequest = httpServletRequest;
     }
 
+    @SuppressWarnings("unchecked")
     protected String[] getAttribute(final String key)
     {
         String[] ret = _valueCache.get(key);

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/RequestMap.java Wed Sep 24 19:03:47 2008
@@ -67,7 +67,7 @@
     }
 
     @Override
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java Wed Sep 24 19:03:47 2008
@@ -63,7 +63,7 @@
     private Map<String, String[]> _requestParameterValuesMap;
     private Map<String, String> _requestHeaderMap;
     private Map<String, String[]> _requestHeaderValuesMap;
-    private Map _requestCookieMap;
+    private Map<String, Object> _requestCookieMap;
     private Map<String, String> _initParameterMap;
     private HttpServletRequest _httpServletRequest;
     private String _requestServletPath;
@@ -224,8 +224,9 @@
         return _requestHeaderValuesMap;
     }
 
+    // FIXME: See with the EG if we can get the return value changed to Map<String, Cookie> as it
+    //        would be more elegant -= Simon Lessard =-
     @Override
-    @SuppressWarnings("unchecked")
     public Map<String, Object> getRequestCookieMap()
     {
         if (_requestCookieMap == null)
@@ -233,6 +234,7 @@
             checkHttpServletRequest();
             _requestCookieMap = new CookieMap(_httpServletRequest);
         }
+        
         return _requestCookieMap;
     }
 

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/SessionMap.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/SessionMap.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/SessionMap.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/SessionMap.java Wed Sep 24 19:03:47 2008
@@ -80,7 +80,7 @@
     }
 
     @Override
-    public void putAll(final Map t)
+    public void putAll(final Map<? extends String, ? extends Object> t)
     {
         throw new UnsupportedOperationException();
     }
@@ -88,16 +88,20 @@
     /**
      * This will clear the session without invalidation. If no session has been created, it will simply return.
      */
+    @SuppressWarnings("unchecked")
     @Override
     public void clear()
     {
         final HttpSession session = getSession();
         if (session == null)
+        {
             return;
-        for (final Enumeration attributeNames = session.getAttributeNames(); attributeNames.hasMoreElements();)
+        }
+        
+        Enumeration<String> attributeNames = (Enumeration<String>)session.getAttributeNames();
+        while (attributeNames.hasMoreElements())
         {
-            final String attributeName = (String) attributeNames.nextElement();
-            session.removeAttribute(attributeName);
+            session.removeAttribute(attributeNames.nextElement());
         }
     }
 }
\ No newline at end of file

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/CompositeELResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/CompositeELResolver.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/CompositeELResolver.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/CompositeELResolver.java Wed Sep 24 19:03:47 2008
@@ -34,12 +34,18 @@
  */
 public class CompositeELResolver extends javax.el.CompositeELResolver
 {
-    private Collection<ELResolver> _elResolvers = Collections.EMPTY_LIST;
+    private Collection<ELResolver> _elResolvers;
 
     @Override
     public Iterator<FeatureDescriptor> getFeatureDescriptors(final ELContext context, final Object base)
     {
-        return new CompositeIterator(context, base, _elResolvers.iterator());
+        Collection<ELResolver> resolvers = _elResolvers;
+        if (resolvers == null)
+        {
+            resolvers = Collections.emptyList();
+        }
+        
+        return new CompositeIterator(context, base, resolvers.iterator());
     }
 
     /**
@@ -49,9 +55,9 @@
     {
         super.add(elResolver);
 
-        if (_elResolvers == Collections.EMPTY_LIST)
+        if (_elResolvers == null)
         {
-            _elResolvers = new ArrayList();
+            _elResolvers = new ArrayList<ELResolver>();
         }
 
         _elResolvers.add(elResolver);

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java Wed Sep 24 19:03:47 2008
@@ -40,8 +40,7 @@
     // ----------------------------------------
 
     @Override
-    public Object getValue(final Object base, final Object property) throws EvaluationException,
-            PropertyNotFoundException
+    public Object getValue(final Object base, final Object property) throws EvaluationException, PropertyNotFoundException
     {
         return invokeResolver(new ResolverInvoker<Object>(base, property)
         {
@@ -60,11 +59,11 @@
 
     @Override
     public void setValue(final Object base, final Object property, final Object newValue) throws EvaluationException,
-            PropertyNotFoundException
+                                                                                         PropertyNotFoundException
     {
         if (base == null || property == null)
             throw new PropertyNotFoundException();
-        
+
         invokeResolver(new ResolverInvoker<Object>(base, property)
         {
             @Override
@@ -87,17 +86,22 @@
     {
         if (base == null)
             throw new PropertyNotFoundException();
-        
-        if (base instanceof Object[]) {
-            if (index < 0 || index>=((Object[])base).length) {
+
+        if (base instanceof Object[])
+        {
+            if (index < 0 || index >= ((Object[]) base).length)
+            {
                 throw new PropertyNotFoundException();
             }
-        } else if (base instanceof List) {
-            if (index < 0 || index>=((List)base).size()) {
+        }
+        else if (base instanceof List)
+        {
+            if (index < 0 || index >= ((List<?>) base).size())
+            {
                 throw new PropertyNotFoundException();
             }
         }
-        
+
         setValue(base, Integer.valueOf(index), newValue);
     }
 
@@ -124,10 +128,10 @@
     {
         if (base == null || property == null)
             throw new PropertyNotFoundException();
-        
-        return invokeResolver(new ResolverInvoker<Class>(base, property)
+
+        return invokeResolver(new ResolverInvoker<Class<?>>(base, property)
         {
-            public Class invoke(final ELResolver resolver, final ELContext context)
+            public Class<?> invoke(final ELResolver resolver, final ELContext context)
             {
                 return resolver.getType(context, base, property);
             }
@@ -139,20 +143,25 @@
     {
         if (base == null)
             throw new PropertyNotFoundException();
-        
-        if (base instanceof Object[]) {
-            if (index < 0 || index>=((Object[])base).length) {
+
+        if (base instanceof Object[])
+        {
+            if (index < 0 || index >= ((Object[]) base).length)
+            {
                 throw new PropertyNotFoundException();
             }
-        } else if (base instanceof List) {
-            if (index < 0 || index>=((List)base).size()) {
+        }
+        else if (base instanceof List)
+        {
+            if (index < 0 || index >= ((List<?>) base).size())
+            {
                 throw new PropertyNotFoundException();
             }
         }
-        
+
         return getType(base, Integer.valueOf(index));
     }
-    
+
     // ~ Internal Helper Methods
     // ------------------------------------------------
 
@@ -179,8 +188,7 @@
         }
         catch (javax.el.PropertyNotFoundException e)
         {
-            throw new PropertyNotFoundException("property not found: " + invoker.getMessage() + ": " + e.getMessage(),
-                    e);
+            throw new PropertyNotFoundException("property not found: " + invoker.getMessage() + ": " + e.getMessage(), e);
         }
         catch (ELException e)
         {

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ELResolverToPropertyResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ELResolverToPropertyResolver.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ELResolverToPropertyResolver.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ELResolverToPropertyResolver.java Wed Sep 24 19:03:47 2008
@@ -27,122 +27,166 @@
 import javax.faces.el.PropertyResolver;
 
 /**
- *
+ * 
  * @author Stan Silvert
  */
-public final class ELResolverToPropertyResolver extends PropertyResolver {
-    
+public final class ELResolverToPropertyResolver extends PropertyResolver
+{
+
     private final ELResolver elResolver;
-    
+
     /**
      * Creates a new instance of ELResolverToPropertyResolver
      */
-    public ELResolverToPropertyResolver(final ELResolver elResolver) {
+    public ELResolverToPropertyResolver(final ELResolver elResolver)
+    {
         this.elResolver = elResolver;
     }
 
-    public boolean isReadOnly(final Object base, final int index)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+    public boolean isReadOnly(final Object base, final int index) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.isReadOnly(elContext(), base, Integer.valueOf(index));
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
-        
+
     }
-    
-    public boolean isReadOnly(final Object base, final Object property)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+
+    public boolean isReadOnly(final Object base, final Object property) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.isReadOnly(elContext(), base, property);
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
-        
+
     }
 
-    public Object getValue(final Object base, final int index)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+    public Object getValue(final Object base, final int index) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.getValue(elContext(), base, Integer.valueOf(index));
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
-        
+
     }
 
-    public Object getValue(final Object base, final Object property)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+    public Object getValue(final Object base, final Object property) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.getValue(elContext(), base, property);
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
     }
-    
-    public Class getType(final Object base, int index)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+
+    public Class getType(final Object base, int index) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.getType(elContext(), base, Integer.valueOf(index));
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
     }
-    
-    public Class getType(final Object base, final Object property)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+
+    public Class getType(final Object base, final Object property) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             return elResolver.getType(elContext(), base, property);
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
     }
 
-    public void setValue(final Object base, final Object property, final Object value)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+    public void setValue(final Object base, final Object property, final Object value) throws EvaluationException,
+                                                                                      PropertyNotFoundException
+    {
+
+        try
+        {
             elResolver.setValue(elContext(), base, property, value);
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
     }
 
-    public void setValue(final Object base, int index, final Object value)
-        throws EvaluationException, PropertyNotFoundException {
-        
-        try {
+    public void setValue(final Object base, int index, final Object value) throws EvaluationException, PropertyNotFoundException
+    {
+
+        try
+        {
             elResolver.setValue(elContext(), base, Integer.valueOf(index), value);
-        } catch (javax.el.PropertyNotFoundException e) {
+        }
+        catch (javax.el.PropertyNotFoundException e)
+        {
             throw new javax.faces.el.PropertyNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e);
         }
-        
+
     }
 
-    private ELContext elContext() {
+    private ELContext elContext()
+    {
         return FacesContext.getCurrentInstance().getELContext();
     }
-    
+
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/MethodExpressionToMethodBinding.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/MethodExpressionToMethodBinding.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/MethodExpressionToMethodBinding.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/MethodExpressionToMethodBinding.java Wed Sep 24 19:03:47 2008
@@ -27,75 +27,89 @@
 import javax.faces.el.MethodNotFoundException;
 
 /**
- * Converts a MethodExpression to a MethodBinding.  
- * See JSF 1.2 spec section 5.8.4
- *
- * ATTENTION: If you make changes to this class, treat 
- * javax.faces.component._MethodExpressionToMethodBinding
+ * Converts a MethodExpression to a MethodBinding. See JSF 1.2 spec section 5.8.4
+ * 
+ * ATTENTION: If you make changes to this class, treat javax.faces.component._MethodExpressionToMethodBinding
  * accordingly.
- *
+ * 
  * @author Stan Silvert
  * @see javax.faces.component._MethodExpressionToMethodBinding
  */
-public final class MethodExpressionToMethodBinding extends MethodBinding implements StateHolder {
-    
+public final class MethodExpressionToMethodBinding extends MethodBinding implements StateHolder
+{
+
     private MethodExpression methodExpression;
-    
+
     private boolean isTransient = false;
-    
-    public MethodExpressionToMethodBinding() {
+
+    public MethodExpressionToMethodBinding()
+    {
         methodExpression = null;
     }
 
     /** Creates a new instance of MethodExpressionToMethodBinding */
-    public MethodExpressionToMethodBinding(final MethodExpression methodExpression) {
+    public MethodExpressionToMethodBinding(final MethodExpression methodExpression)
+    {
         this.methodExpression = methodExpression;
     }
-    
+
     @Override
     public String getExpressionString()
     {
         return methodExpression.getExpressionString();
     }
 
-    public Class getType(FacesContext facesContext) 
-        throws MethodNotFoundException {
-        
-        try {
+    public Class getType(FacesContext facesContext) throws MethodNotFoundException
+    {
+
+        try
+        {
             return methodExpression.getMethodInfo(facesContext.getELContext()).getReturnType();
-        } catch (javax.el.MethodNotFoundException e) {
+        }
+        catch (javax.el.MethodNotFoundException e)
+        {
             throw new javax.faces.el.MethodNotFoundException(e);
         }
     }
 
-    public Object invoke(final FacesContext facesContext, final Object[] params)
-        throws EvaluationException, MethodNotFoundException {
-        
-        try {
+    public Object invoke(final FacesContext facesContext, final Object[] params) throws EvaluationException,
+                                                                                MethodNotFoundException
+    {
+
+        try
+        {
             return methodExpression.invoke(facesContext.getELContext(), params);
-        } catch (javax.el.MethodNotFoundException e) {
+        }
+        catch (javax.el.MethodNotFoundException e)
+        {
             throw new javax.faces.el.MethodNotFoundException(e);
-        } catch (ELException e) {
+        }
+        catch (ELException e)
+        {
             throw new EvaluationException(e.getCause());
         }
     }
 
-// -------- StateHolder methods -------------------------------------------    
-    
-    public void restoreState(final FacesContext context, final Object state) {
-        methodExpression = (MethodExpression)state;
+    // -------- StateHolder methods -------------------------------------------
+
+    public void restoreState(final FacesContext context, final Object state)
+    {
+        methodExpression = (MethodExpression) state;
     }
 
-    public Object saveState(final FacesContext context) {
+    public Object saveState(final FacesContext context)
+    {
         return methodExpression;
     }
 
-    public void setTransient(final boolean newTransientValue) {
+    public void setTransient(final boolean newTransientValue)
+    {
         isTransient = newTransientValue;
     }
 
-    public boolean isTransient() {
+    public boolean isTransient()
+    {
         return isTransient;
     }
-    
+
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ValueExpressionToValueBinding.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ValueExpressionToValueBinding.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ValueExpressionToValueBinding.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/convert/ValueExpressionToValueBinding.java Wed Sep 24 19:03:47 2008
@@ -200,8 +200,7 @@
             else
             {
                 Object[] stateArray = (Object[]) state;
-                _valueExpression = (ValueExpression) ClassUtils.newInstance((String) stateArray[0],
-                        ValueExpression.class);
+                _valueExpression = (ValueExpression) ClassUtils.newInstance((String) stateArray[0], ValueExpression.class);
                 ((StateHolder) _valueExpression).restoreState(facesContext, stateArray[1]);
             }
         }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/GuiceResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/GuiceResolver.java?rev=698799&r1=698798&r2=698799&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/GuiceResolver.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/el/unified/resolver/GuiceResolver.java Wed Sep 24 19:03:47 2008
@@ -97,7 +97,7 @@
         return managedBean == null ? null : getValue(ctx, ectx, managedBean.getManagedBeanClass());
     }
 
-    private Object getValue(ELContext ctx, ExternalContext ectx, Class managedBeanClass) {
+    private Object getValue(ELContext ctx, ExternalContext ectx, Class<?> managedBeanClass) {
         
         Injector injector = (Injector) ectx.getApplicationMap().get(KEY);
         



Mime
View raw message