incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r429208 [2/14] - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/co...
Date Sun, 06 Aug 2006 23:12:54 GMT
Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityKey.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityKey.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityKey.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityKey.java Sun Aug  6 16:12:37 2006
@@ -106,11 +106,13 @@
     return null;
   }
 
+  @Override
   public boolean equals(Object obj)
   {
     return this == obj;
   }
 
+  @Override
   public int hashCode()
   {
     return _capIndex;
@@ -126,6 +128,7 @@
     return key;
   }
 
+  @Override
   public String toString()
   {
     return _capName;
@@ -136,7 +139,8 @@
 
   static final private int DEFAULT_SIZE = 50;
 
-  static private HashMap _capKeyNames = new HashMap();
+  static private HashMap<String, CapabilityKey> _capKeyNames = 
+    new HashMap<String, CapabilityKey>();
   static private CapabilityKey[] _keys = new CapabilityKey[DEFAULT_SIZE];
   private static int _count = 0;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityMap.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityMap.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityMap.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityMap.java Sun Aug  6 16:12:37 2006
@@ -30,7 +30,10 @@
  * -- Also this impl assumes that the number of keys **will** change (increase) after init.
  *
  */
-public class CapabilityMap extends AbstractMap implements Cloneable
+// FIXME -= Simon Lessard =-
+//       This is another map that can accept both String and another type as keys.
+//       Shouldn't we force type safety with a single key type ?
+public class CapabilityMap extends AbstractMap<Object, Object> implements Cloneable
 {
 
   private CapabilityMap()
@@ -99,7 +102,7 @@
    * @param capabilities
    * @return  returns a new capability map that merges key/values of the provided map
    */
-  public CapabilityMap merge(Map capabilities)
+  public CapabilityMap merge(Map<Object, Object> capabilities)
   {
     if ((capabilities == null) || (capabilities.isEmpty()))
       return this;
@@ -155,6 +158,7 @@
    * @param key
    * @return
    */
+  @Override
   public Object get(Object key)
   {
     if (key == null)
@@ -171,6 +175,7 @@
    * @param value
    * @return
    */
+  @Override
   public Object put(Object key, Object value)
   {
     return new UnsupportedOperationException();
@@ -179,7 +184,8 @@
   /**
    * @return
    */
-  public Set entrySet()
+  @Override
+  public Set<Map.Entry<Object, Object>> entrySet()
   {
     if (_entrySet == null)
       _createEntrySet();
@@ -187,12 +193,13 @@
     return _entrySet;
   }
 
+  @Override
   public Object clone()
   {
     try
     {
       CapabilityMap that = (CapabilityMap) super.clone();
-      that._indexedValues = (Object[]) _indexedValues.clone();
+      that._indexedValues = _indexedValues.clone();
       that._entrySet = null;
       return that;
     }
@@ -220,8 +227,9 @@
   {
     if (_entrySet == null)
     {
-      HashSet hs = new HashSet();
-      Iterator iter = new KeyIterator();
+      HashSet<Map.Entry<Object, Object>> hs = 
+        new HashSet<Map.Entry<Object, Object>>();
+      Iterator<Object> iter = new KeyIterator();
       while (iter.hasNext())
       {
         CapabilityKey capKey = (CapabilityKey) iter.next();
@@ -241,9 +249,9 @@
   }
 
 
-  private Object[] _getMapAsArray(Map capabilities)
+  private Object[] _getMapAsArray(Map<Object, Object> capabilities)
   {
-    Iterator iter = capabilities.keySet().iterator();
+    Iterator<Object> iter = capabilities.keySet().iterator();
     Object[] caps = new Object[capabilities.size() * 2];
     int i = 0;
     while (iter.hasNext())
@@ -260,7 +268,7 @@
 
 
   //KeyIterator
-  private class KeyIterator implements Iterator
+  private class KeyIterator implements Iterator<Object>
   {
     public KeyIterator()
     {
@@ -315,7 +323,7 @@
 
 
   //Map Entry
-  private class CEntry implements Entry
+  private class CEntry implements Entry<Object, Object>
   {
 
     private Object key;
@@ -327,6 +335,7 @@
       this.value = value;
     }
 
+    @Override
     public boolean equals(Object o)
     {
       if (this == o)
@@ -355,6 +364,7 @@
       throw new UnsupportedOperationException();
     }
 
+    @Override
     public int hashCode()
     {
       return key.hashCode() ^ (value == null ? 0 : value.hashCode());
@@ -363,5 +373,5 @@
 
 
   private Object[] _indexedValues;
-  private Set _entrySet;
+  private Set<Map.Entry<Object, Object>> _entrySet;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityValue.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityValue.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityValue.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/CapabilityValue.java Sun Aug  6 16:12:37 2006
@@ -72,5 +72,5 @@
     return value;
   }
   
-  private static HashMap _values = new HashMap(32);
+  private static HashMap<Object, Object> _values = new HashMap<Object, Object>(32);
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/DefaultAgent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/DefaultAgent.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/DefaultAgent.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/DefaultAgent.java Sun Aug  6 16:12:37 2006
@@ -91,7 +91,7 @@
    *
    * @return Map of capability name and value for the current Agent.
    */
-  public Map getCapabilities ()
+  public Map<Object, Object> getCapabilities ()
   {
     return null;
   }  

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgent.java Sun Aug  6 16:12:37 2006
@@ -267,6 +267,7 @@
    * based on it (like Netscape 6).
    * @deprecated since 2.2.0. Use {@link #APPLICATION_GECKO}.
    */
+  @Deprecated
   static public final int APPLICATION_MOZILLA   = APPLICATION_GECKO;
 
   /**

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgentImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgentImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgentImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/TrinidadAgentImpl.java Sun Aug  6 16:12:37 2006
@@ -121,7 +121,7 @@
   /**
    * @return Map of capability name and value for the current Agent.
    */
-  public Map getCapabilities()
+  public Map<Object, Object> getCapabilities()
   {
     return _capMap;
   }
@@ -154,6 +154,7 @@
   }
 
 
+  @Override
   public Object clone()
   {
     try
@@ -170,6 +171,7 @@
   }
 
 
+  @Override
   public String toString()
   {
     StringBuffer buffer = new StringBuffer("Agent[");
@@ -231,7 +233,7 @@
       _major = _getMajorVersion(getAgentVersion());
 
     _capMap = _getCapabilityMap(context);
-    Map requestCaps = _delegate.getCapabilities();
+    Map<Object, Object> requestCaps = _delegate.getCapabilities();
     if (requestCaps != null)
     {
       _capMap = _capMap.merge(requestCaps);
@@ -370,7 +372,7 @@
     return (int) version;
   }
 
-  void __mergeCapabilities(Map capabilities)
+  void __mergeCapabilities(Map<Object, Object> capabilities)
   {
     _capMap = _capMap.merge(capabilities);
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocument.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocument.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocument.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocument.java Sun Aug  6 16:12:37 2006
@@ -35,6 +35,7 @@
   {
     _agents = agents;
     _devices = devices;
+    _includeNodeBySrcCaps = new HashMap<URL, Object>();
     _defaultAgentCapabilities = _getDefaultAgentCapabilities(_agents);
   }
 
@@ -174,7 +175,7 @@
    */
   private Object[][] _getCapabilities(Agent agent,
                                       CapabilitiesNode[] capNodes,
-                                      List includedByRefs,
+                                      List<String> includedByRefs,
                                       CapabilitiesNode matchNode)
   {
     assert (matchNode != null);
@@ -187,7 +188,7 @@
 
     //check for circular dependecy
     if (includedByRefs == null)
-      includedByRefs = new ArrayList();
+      includedByRefs = new ArrayList<String>();
 
     if (matchNode.__getId() != null)
     {
@@ -240,7 +241,7 @@
     assert (capNodes != null);
     assert (dcNode != null);
 
-    ArrayList includedByRefs = new ArrayList();
+    ArrayList<String> includedByRefs = new ArrayList<String>();
 
     //process node that includes by reference
     IncludeNode[] refIncludes = dcNode.__getIncludesByRef();
@@ -279,7 +280,7 @@
    */
   private Object[][] _getCapabilities(Agent agent,
                                       CapabilitiesNode[] capNodes,
-                                      List includedByRefs,
+                                      List<String> includedByRefs,
                                       String refId)
   {
     assert (capNodes != null);
@@ -305,15 +306,15 @@
    */
   private Object[] _getCapabilities(URL srcUrl)
   {
-    Object o = includeNodeBySrcCaps.get(srcUrl);
+    Object o = _includeNodeBySrcCaps.get(srcUrl);
     if (o != null)
       return (Object[]) o;
 
     Object[] caps = null;
-    synchronized (includeNodeBySrcCaps)
+    synchronized (_includeNodeBySrcCaps)
     {
       caps = CapabilityDataDocumentParser.parse(srcUrl);
-      includeNodeBySrcCaps.put(srcUrl, caps);
+      _includeNodeBySrcCaps.put(srcUrl, caps);
     }
 
     return caps;
@@ -348,7 +349,7 @@
 
   private CapabilitiesNode[] _agents;
   private DeviceNode[] _devices;
-  private HashMap includeNodeBySrcCaps = new HashMap();
+  private HashMap<URL, Object> _includeNodeBySrcCaps;
   private Object[][] _defaultAgentCapabilities;
 
   static final CapabilitiesDocument EMPTY_DOCUMENT = new CapabilitiesDocument();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocumentParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocumentParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocumentParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesDocumentParser.java Sun Aug  6 16:12:37 2006
@@ -43,7 +43,11 @@
         implements XMLConstants
 {
 
-  private CapabilitiesDocumentParser() {}
+  private CapabilitiesDocumentParser()
+  {
+    _capabilitiesNodes = new ArrayList<CapabilitiesNode>();
+    _deviceNodes = new ArrayList<DeviceNode>();
+  }
 
   static public CapabilitiesDocument createInstance (URL capUrl)
   {
@@ -95,6 +99,7 @@
   }
 
 
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -115,6 +120,7 @@
   }
 
 
+  @Override
   public NodeParser startChildElement(ParseContext context,
                                       String       namespaceURI,
                                       String       localName,
@@ -143,6 +149,7 @@
   }
 
 
+  @Override
   public void addCompletedChild (ParseContext context,
                                  String       namespaceURI,
                                  String       localName,
@@ -153,13 +160,14 @@
       return;
 
     if (ELEMENT_CAPABILITIES.equals(localName))
-      _capabilitiesNodes.add(child);
+      _capabilitiesNodes.add((CapabilitiesNode)child);
 
     if (ELEMENT_DEVICE.equals(localName))
-      _deviceNodes.add(child);
+      _deviceNodes.add((DeviceNode)child);
   }
 
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)
@@ -170,14 +178,14 @@
     CapabilitiesNode[] agents = null;
     if (_capabilitiesNodes.size() > 0)
     {
-      agents = (CapabilitiesNode[]) _capabilitiesNodes.toArray
+      agents = _capabilitiesNodes.toArray
               (new CapabilitiesNode[_capabilitiesNodes.size()]);
     }
 
     DeviceNode[] devices = null;
     if (_deviceNodes.size() > 0)
     {
-      devices = (DeviceNode[]) _deviceNodes.toArray
+      devices = _deviceNodes.toArray
               (new DeviceNode[_deviceNodes.size()]);
     }
 
@@ -185,8 +193,8 @@
     return document;
   }
 
-  private List _capabilitiesNodes = new ArrayList();
-  private List _deviceNodes = new ArrayList();
+  private List<CapabilitiesNode> _capabilitiesNodes;
+  private List<DeviceNode> _deviceNodes;
 
   static final String __BASE_URL = "baseURL";
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilitiesNodeParser.java Sun Aug  6 16:12:37 2006
@@ -33,7 +33,12 @@
  */
 class CapabilitiesNodeParser extends BaseNodeParser implements XMLConstants
 {
-
+  CapabilitiesNodeParser()
+  {
+    _includeNodes = new ArrayList<IncludeNode>();
+  }
+  
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -84,6 +89,7 @@
   }
 
 
+  @Override
   public NodeParser startChildElement(ParseContext context,
                                       String       namespaceURI,
                                       String       localName,
@@ -98,6 +104,7 @@
   }
 
 
+  @Override
   public void addCompletedChild (ParseContext context,
                                  String       namespaceURI,
                                  String       localName,
@@ -108,9 +115,10 @@
       return;
 
     if (ELEMENT_INCLUDE.equals(localName))
-      _includeNodes.add(child);
+      _includeNodes.add((IncludeNode)child);
   }
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)
@@ -118,19 +126,19 @@
     if ((_id == null) && (_agent == null))
       return null;
 
-    ArrayList nodesWithRefList = new ArrayList(_includeNodes.size());
-    ArrayList nodesWithSrcList = new ArrayList(_includeNodes.size());
+    ArrayList<IncludeNode> nodesWithRefList = new ArrayList<IncludeNode>(_includeNodes.size());
+    ArrayList<IncludeNode> nodesWithSrcList = new ArrayList<IncludeNode>(_includeNodes.size());
     for (int i = 0; i < _includeNodes.size(); i++)
     {
-      IncludeNode node = (IncludeNode) _includeNodes.get(i);
+      IncludeNode node = _includeNodes.get(i);
       if (node.__getRefId() != null)
         nodesWithRefList.add(node);
       else
         nodesWithSrcList.add(node);
     }
-    IncludeNode[] nodesWithRef = (IncludeNode[])
+    IncludeNode[] nodesWithRef = 
             nodesWithRefList.toArray(new IncludeNode[nodesWithRefList.size()]);
-    IncludeNode[] nodesWithSrc = (IncludeNode[])
+    IncludeNode[] nodesWithSrc = 
             nodesWithSrcList.toArray(new IncludeNode[nodesWithSrcList.size()]);
 
     return new CapabilitiesNode(_id, _isDefault, _agent,
@@ -143,7 +151,7 @@
   private boolean _isDefault;
   private NameVersion _agent;
   private NameVersion _platform;
-  private List _includeNodes = new ArrayList();
+  private List<IncludeNode> _includeNodes;
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(CapabilitiesNodeParser.class);
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilityDataDocumentParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilityDataDocumentParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilityDataDocumentParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/CapabilityDataDocumentParser.java Sun Aug  6 16:12:37 2006
@@ -45,6 +45,7 @@
 
   private CapabilityDataDocumentParser()
   {
+    _capList = new ArrayList<Object>();
   }
 
   static public Object[] parse (URL srcUrl)
@@ -92,6 +93,7 @@
     return new Object[0];
   }
 
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -105,6 +107,7 @@
     }
   }
 
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -144,6 +147,7 @@
   }
 
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)
@@ -154,7 +158,7 @@
     return null;
   }
 
-  private List _capList = new ArrayList();
+  private List<Object> _capList;
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(CapabilityDataDocumentParser.class);
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/ComponentNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/ComponentNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/ComponentNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/ComponentNodeParser.java Sun Aug  6 16:12:37 2006
@@ -29,7 +29,12 @@
  */
 class ComponentNodeParser extends BaseNodeParser implements XMLConstants
 {
-
+  ComponentNodeParser()
+  {
+    _includeNodes = new ArrayList<IncludeNode>();
+  }
+  
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -46,6 +51,7 @@
 
   }
 
+  @Override
   public NodeParser startChildElement(ParseContext context,
                                       String       namespaceURI,
                                       String       localName,
@@ -60,6 +66,7 @@
   }
 
 
+  @Override
   public void addCompletedChild (ParseContext context,
                                  String       namespaceURI,
                                  String       localName,
@@ -69,30 +76,31 @@
     if (child == null)
       return;
 
-    _includeNodes.add(child);
+    _includeNodes.add((IncludeNode)child);
   }
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)
   {
-    ArrayList nodesWithRefList = new ArrayList(_includeNodes.size());
-    ArrayList nodesWithSrcList = new ArrayList(_includeNodes.size());
+    ArrayList<IncludeNode> nodesWithRefList = new ArrayList<IncludeNode>(_includeNodes.size());
+    ArrayList<IncludeNode> nodesWithSrcList = new ArrayList<IncludeNode>(_includeNodes.size());
     for (int i = 0; i < _includeNodes.size(); i++)
     {
-      IncludeNode node = (IncludeNode) _includeNodes.get(i);
+      IncludeNode node = _includeNodes.get(i);
       if (node.__getRefId() != null)
         nodesWithRefList.add(node);
       else
         nodesWithSrcList.add(node);
     }
-    IncludeNode[] nodesWithRef = (IncludeNode[])
+    IncludeNode[] nodesWithRef = 
             nodesWithRefList.toArray(new IncludeNode[nodesWithRefList.size()]);
-    IncludeNode[] nodesWithSrc = (IncludeNode[])
+    IncludeNode[] nodesWithSrc = 
             nodesWithSrcList.toArray(new IncludeNode[nodesWithSrcList.size()]);
     return new DeviceComponentNode(_type, nodesWithRef, nodesWithSrc);    
   }
 
-  private List _includeNodes = new ArrayList();
+  private List<IncludeNode> _includeNodes;
   private String _type;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNode.java Sun Aug  6 16:12:37 2006
@@ -47,8 +47,12 @@
     return _makeModel.match(makeModel, null);
   }
 
+  // -= Simon Lessard =-
+  // FIXME: _id and _extendsId are never read locally
+  @SuppressWarnings("unused")
   private String _id;
   private NameVersion _makeModel;
+  @SuppressWarnings("unused")
   private String _extendsId;
   private DeviceComponentNode[] _componentNodes;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/DeviceNodeParser.java Sun Aug  6 16:12:37 2006
@@ -31,6 +31,12 @@
  */
 class DeviceNodeParser extends BaseNodeParser implements XMLConstants
 {
+  DeviceNodeParser()
+  {
+    _componentNodes = new ArrayList<DeviceComponentNode>();
+  }
+  
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -71,6 +77,7 @@
   }
 
 
+  @Override
   public NodeParser startChildElement(ParseContext context,
                                       String       namespaceURI,
                                       String       localName,
@@ -85,6 +92,7 @@
 
   }
 
+  @Override
   public void addCompletedChild (ParseContext context,
                                  String       namespaceURI,
                                  String       localName,
@@ -94,9 +102,10 @@
     if (child == null)
       return;
 
-    _componentNodes.add(child);
+    _componentNodes.add((DeviceComponentNode)child);
   }
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)
@@ -104,7 +113,7 @@
     if ((_id == null) && (_model == null))
       return null;
 
-    DeviceComponentNode[] cNodes = (DeviceComponentNode[])
+    DeviceComponentNode[] cNodes = 
             _componentNodes.toArray(
                     new DeviceComponentNode[_componentNodes.size()]);
     return new DeviceNode(_id, _model, _extendsId, cNodes);
@@ -114,7 +123,7 @@
   private String _id;
   private NameVersion _model;
   private String _extendsId;
-  private List _componentNodes = new ArrayList();
+  private List<DeviceComponentNode> _componentNodes;
 
   static private final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(DeviceNodeParser.class);
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/IncludeNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/IncludeNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/IncludeNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/IncludeNodeParser.java Sun Aug  6 16:12:37 2006
@@ -30,6 +30,7 @@
 class IncludeNodeParser extends BaseNodeParser implements XMLConstants
 {
 
+  @Override
   public void startElement (ParseContext context,
                             String       namespaceURI,
                             String       localName,
@@ -57,6 +58,7 @@
     _refId = refId;
   }
 
+  @Override
   public Object endElement (ParseContext context,
                             String       namespaceURI,
                             String       localName)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/NameVersion.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/NameVersion.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/NameVersion.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/NameVersion.java Sun Aug  6 16:12:37 2006
@@ -107,7 +107,7 @@
     int i = 0;
     char ch = data[i];
 
-    ArrayList entries = new ArrayList(5);
+    ArrayList<Object[]> entries = new ArrayList<Object[]>(5);
     VersionEntry vEntry = null;
     NameEntry head, curr;
     head = curr = new NameEntry();
@@ -173,7 +173,9 @@
           }
           else
           {
-            while (!Character.isSpace(ch) && (ch != (char) 0x1000000))
+            // 2006-08-02: -= Simon Lessard =-
+            //while (!Character.isSpace(ch) && (ch != (char) 0x1000000))
+            while (!Character.isWhitespace(ch) && (ch != (char) 0x1000000))
               ch = data[++i];
           }
 
@@ -207,7 +209,9 @@
           i++;
           break;
         default:
-          if ((!inQuote) && (Character.isSpace(ch)))
+          // 2006-08-02: -= Simon Lessard =-
+          //if ((!inQuote) && (Character.isSpace(ch)))
+          if ((!inQuote) && (Character.isWhitespace(ch)))
           {
             if (start != i)
             {
@@ -228,7 +232,9 @@
             }
             //Skip space
             ch = data[++i];
-            while (Character.isSpace(ch))
+            // 2006-08-02: -= Simon Lessard =-
+            //while (Character.isSpace(ch))
+            while (Character.isWhitespace(ch))
               ch = data[++i];
             start = i;
           }
@@ -280,7 +286,9 @@
           version = value.substring(0, i);
           for (++i; i < length; i++)
           {
-            if (!Character.isSpace(ch))
+            // 2006-08-02: -= Simon Lessard =-
+            //if (!Character.isSpace(ch))
+            if (!Character.isWhitespace(ch))
               throw new ParseException("Unexpected char.", offset + i);
           }
           //if the version string was simpley "*" or "+"
@@ -370,15 +378,15 @@
 
     if (entry._type == VersionEntry.STAR_TYPE)
     {
-      Iterator vIterator1 = version.iterator();
-      Iterator vIterator2 = entry._versionId.iterator();
+      Iterator<String> vIterator1 = version.iterator();
+      Iterator<String> vIterator2 = entry._versionId.iterator();
 
       //Check upto where both have values
       int matchedParts = 0;
       while ((vIterator1.hasNext()) && (vIterator2.hasNext()))
       {
-        String part1 = (String) vIterator1.next();
-        String part2 = (String) vIterator2.next();
+        String part1 = vIterator1.next();
+        String part2 = vIterator2.next();
         if (!part1.equals(part2))
           return NO_MATCH;
         matchedParts++;
@@ -388,7 +396,7 @@
       //parts (sub versions), then it must be .0's
       while (vIterator2.hasNext())
       {
-        if (!"0".equals((String) vIterator2.next()))
+        if (!"0".equals(vIterator2.next()))
           return NO_MATCH;
       }
 
@@ -405,16 +413,16 @@
     }
     else if (entry._type == VersionEntry.PLUS_TYPE)
     {
-      Iterator vIterator1 = version.iterator();
-      Iterator vIterator2 = entry._versionId.iterator();
+      Iterator<String> vIterator1 = version.iterator();
+      Iterator<String> vIterator2 = entry._versionId.iterator();
 
       //Check upto where both have values
       while ((vIterator1.hasNext()) && (vIterator2.hasNext()))
       {
         try
         {
-          int v1 = Integer.parseInt((String) vIterator1.next());
-          int v2 = Integer.parseInt((String) vIterator2.next());
+          int v1 = Integer.parseInt(vIterator1.next());
+          int v2 = Integer.parseInt(vIterator2.next());
           if (v1 > v2)
             return (VERSION_GE_MATCH * (entry._versionId.getVersion() / version.getVersion()));
           else if (v1 < v2)
@@ -432,7 +440,7 @@
       {
         try
         {
-          if (Integer.parseInt((String) vIterator2.next()) != 0)
+          if (Integer.parseInt(vIterator2.next()) != 0)
             return NO_MATCH;
         }
         catch (NumberFormatException npe)
@@ -446,27 +454,27 @@
     else
     {
       //exact match
-      Iterator vIterator1 = version.iterator();
-      Iterator vIterator2 = entry._versionId.iterator();
+      Iterator<String> vIterator1 = version.iterator();
+      Iterator<String> vIterator2 = entry._versionId.iterator();
 
       //Check upto where both have values
       while ((vIterator1.hasNext()) && (vIterator2.hasNext()))
       {
-        String part1 = (String) vIterator1.next();
-        String part2 = (String) vIterator2.next();
+        String part1 = vIterator1.next();
+        String part2 = vIterator2.next();
         if (!part1.equals(part2))
           return NO_MATCH;
       }
 
       while (vIterator1.hasNext())
       {
-        if (!"0".equals((String) vIterator1.next()))
+        if (!"0".equals(vIterator1.next()))
           return NO_MATCH;
       }
 
       while (vIterator2.hasNext())
       {
-        if (!"0".equals((String) vIterator2.next()))
+        if (!"0".equals(vIterator2.next()))
           return NO_MATCH;
       }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/VersionId.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/VersionId.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/VersionId.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/parse/VersionId.java Sun Aug  6 16:12:37 2006
@@ -32,6 +32,7 @@
     _version = _parseVersion(version);
   }
 
+  @Override
   public String toString()
   {
     return _versionString;
@@ -53,7 +54,7 @@
         char currChar = _versionString.charAt(currIndex);
         if ((currChar >= '0') && (currChar <= '9'))
         {
-          double addValue = (double) (currChar - '0');
+          double addValue = (currChar - '0');
           if (hasDecimal)
           {
             // handle digits to right of decimal
@@ -88,7 +89,7 @@
   }
 
 
-  public Iterator iterator()
+  public Iterator<String> iterator()
   {
     return new VIterator();
   }
@@ -112,7 +113,9 @@
     while (i < length + 1)
     {
       //Ignore spaces. TODO: This should happen only for start and end (trim).
-      while (Character.isSpace(ch))
+      // 2006-08-02: -= Simon Lessard =-
+      //while (Character.isSpace(ch))
+      while (Character.isWhitespace(ch))
         ch = data[++i];
 
       switch (ch)
@@ -151,7 +154,7 @@
     Entry next;
   }
 
-  private class VIterator implements Iterator
+  private class VIterator implements Iterator<String>
   {
     public VIterator()
     {
@@ -168,7 +171,7 @@
       return (null != _current);
     }
 
-    public Object next()
+    public String next()
     {
       String part = _current.text;
       _current = _current.next;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/NavigationHandlerImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/NavigationHandlerImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/NavigationHandlerImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/NavigationHandlerImpl.java Sun Aug  6 16:12:37 2006
@@ -29,6 +29,7 @@
     _dialogPrefix = null;
   }
 
+  @Override
   public void handleNavigation(
     FacesContext context,
     String       fromAction,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java Sun Aug  6 16:12:37 2006
@@ -169,6 +169,8 @@
     return root;
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public SerializedView saveSerializedView(FacesContext context)
   {
     if (!isSavingStateInClient(context))
@@ -183,8 +185,8 @@
 
     // See if we're going to use the application view cache for
     // this request
-    Map applicationViewCache = null;
-    Map perSessionApplicationViewCache = null;
+    Map<String, Object> applicationViewCache = null;
+    Map<String, Object> perSessionApplicationViewCache = null;
     if (_useApplicationViewCache(context))
     {
       // OK, we are: so find the application cache and
@@ -225,12 +227,14 @@
         assert(cache != null);
 
         // Store bits of the session as subkeys off of the session
-        Map stateMap = new SubKeyMap(
+        Map<String, Object> stateMap = new SubKeyMap(
                          context.getExternalContext().getSessionMap(),
                          _VIEW_CACHE_KEY + ".");
         // Sadly, we can't save just a SerializedView, because we should
         // save a serialized object, and SerializedView is a *non*-static
         // inner class of StateManager
+        // -= Simon Lessard =-
+        // FIXME: pageState is never read
         PageState pageState = new PageState(
             structure,
             state,
@@ -278,12 +282,15 @@
     return view;
   }
 
+  @Override
   public void writeState(FacesContext context,
                          SerializedView state) throws IOException
   {
     _delegate.writeState(context, state);
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public UIViewRoot restoreView(FacesContext context, String viewId,
                                 String renderKitId)
   {
@@ -312,8 +319,8 @@
       // Load from the application cache
       if (_APPLICATION_CACHE_TOKEN.equals(token))
       {
-        Map cache = _getApplicationViewCache(context);
-        Map perSessionCache =
+        Map<String, Object> cache = _getApplicationViewCache(context);
+        Map<String, Object> perSessionCache =
           _getPerSessionApplicationViewCache(context);
 
         // Synchronize on the application-level cache.
@@ -336,10 +343,10 @@
       }
       else
       {
-        Map stateMap = new SubKeyMap(
+        Map<String, Object> stateMap = new SubKeyMap(
                          context.getExternalContext().getSessionMap(),
                          _VIEW_CACHE_KEY + ".");
-        viewState = (PageState) stateMap.get((String) token);
+        viewState = (PageState) stateMap.get(token);
 
         // Make sure that if the view state is present, the cache still
         // has the token, and vice versa
@@ -380,7 +387,7 @@
         // newRoot.getChildren().addAll(root.getChildren());
         // because "root"'s child List is being mutated as the List
         // is traversed.
-        List temp = new ArrayList(root.getChildCount());
+        List<UIComponent> temp = new ArrayList<UIComponent>(root.getChildCount());
         temp.addAll(root.getChildren());
         newRoot.getChildren().addAll(temp);
 
@@ -448,6 +455,7 @@
     return null;
   }
 
+  @Override
   public boolean isSavingStateInClient(FacesContext context)
   {
     return _delegate.isSavingStateInClient(context);
@@ -457,22 +465,26 @@
   // Protected APIs: we don't want
   //
 
+  @Override
   protected Object getTreeStructureToSave(FacesContext context)
   {
     throw new UnsupportedOperationException();
   }
 
+  @Override
   protected Object getComponentStateToSave(FacesContext context)
   {
     throw new UnsupportedOperationException();
   }
 
+  @Override
   protected UIViewRoot restoreTreeStructure
     (FacesContext context, String viewId, String renderKitId)
   {
     throw new UnsupportedOperationException();
   }
 
+  @Override
   protected void restoreComponentState
     (FacesContext context, UIViewRoot viewRoot, String renderKitId)
   {
@@ -530,15 +542,16 @@
   // @todo Map is a bad structure
   // @todo a static size is bad
   //
-  static private Map _getApplicationViewCache(FacesContext context)
+  @SuppressWarnings("unchecked")
+  static private Map<String, Object> _getApplicationViewCache(FacesContext context)
   {
     synchronized (_APPLICATION_VIEW_CACHE_LOCK)
     {
-      Map appMap = context.getExternalContext().getApplicationMap();
-      Map cache = (Map) appMap.get(_APPLICATION_VIEW_CACHE_KEY);
+      Map<String, Object> appMap = context.getExternalContext().getApplicationMap();
+      Map<String, Object> cache = (Map<String, Object>) appMap.get(_APPLICATION_VIEW_CACHE_KEY);
       if (cache == null)
       {
-        cache = new HashMap(128);
+        cache = new HashMap<String, Object>(128);
         appMap.put(_APPLICATION_VIEW_CACHE_KEY, cache);
       }
 
@@ -546,22 +559,24 @@
     }
   }
 
-  static private Map _getPerSessionApplicationViewCache(FacesContext context)
+  @SuppressWarnings("unchecked")
+  static private Map<String, Object> _getPerSessionApplicationViewCache(FacesContext context)
   {
     ExternalContext external = context.getExternalContext();
     Object session = external.getSession(true);
     assert(session != null);
 
-    Map cache;
+    Map<String, Object> cache;
     // Synchronize on the session object to ensure that
     // we don't ever create two different caches
     synchronized (session)
     {
-      cache = (Map) external.getSessionMap().get(_APPLICATION_VIEW_CACHE_KEY);
+      Map<String, Object> sessionMap = external.getSessionMap();
+      cache = (Map<String, Object>) sessionMap.get(_APPLICATION_VIEW_CACHE_KEY);
       if (cache == null)
       {
         cache = _createPerSessionApplicationViewCache();
-        external.getSessionMap().put(_APPLICATION_VIEW_CACHE_KEY, cache);
+        sessionMap.put(_APPLICATION_VIEW_CACHE_KEY, cache);
       }
     }
 
@@ -572,9 +587,9 @@
   // For the per-session mirror of the application view cache,
   // use an LRU LinkedHashMap to store the latest 16 pages.
   //
-  static private Map _createPerSessionApplicationViewCache()
+  static private Map<String, Object> _createPerSessionApplicationViewCache()
   {
-    return new LRUCache(_MAX_PER_SESSION_APPLICATION_SIZE);
+    return new LRUCache<String, Object>(_MAX_PER_SESSION_APPLICATION_SIZE);
   }
 
   static private final int _MAX_PER_SESSION_APPLICATION_SIZE = 16;
@@ -648,20 +663,21 @@
     return kit.getResponseStateManager();
   }
 
+  @SuppressWarnings("unchecked")
   static private void _removeTransientComponents(
     UIComponent root)
   {
-    List components = new ArrayList();
+    List<UIComponent> components = new ArrayList<UIComponent>();
     _gatherTransientComponents(root, components);
-    Iterator iter = components.iterator();
+    Iterator<UIComponent> iter = components.iterator();
     while (iter.hasNext())
     {
-      UIComponent kid = (UIComponent) iter.next();
+      UIComponent kid = iter.next();
       UIComponent parent = kid.getParent();
       // First, see if its a child
       if (parent.getChildCount() > 0)
       {
-        List children = parent.getChildren();
+        List<UIComponent> children = parent.getChildren();
         if (children.remove(kid))
         {
           continue;
@@ -669,13 +685,21 @@
       }
 
       // Nope, guess it's a facet
-      Iterator facetNames = parent.getFacets().keySet().iterator();
-      while (facetNames.hasNext())
+      // 2006-08-02: -= Simon Lessard
+      //             Not 1.5 structure and inefficient loop
+      //             values() is more efficient as you don't have 
+      //             to do a second lookup for the value.
+      Map<String, UIComponent> facets = parent.getFacets();
+      for(Iterator<UIComponent> facetIter = facets.values().iterator(); 
+          facetIter.hasNext();)
       {
-        String name = (String) facetNames.next();
-        if (parent.getFacet(name) == kid)
+        if(facetIter.next() == kid)
         {
-          parent.getFacets().remove(name);
+          facetIter.remove();
+          // FIXME: -= Simon Lessard
+          //        Is that continue need to labeled to go all the way up to 
+          //        the first while? Currently it won't cause any problem, but 
+          //        it's a performance loss.
           continue;
         }
       }
@@ -686,13 +710,14 @@
     }
   }
 
+  @SuppressWarnings("unchecked")
   static private void _gatherTransientComponents(
-    UIComponent component, List componentsToRemove)
+    UIComponent component, List<UIComponent> componentsToRemove)
   {
-    Iterator kids = component.getFacetsAndChildren();
+    Iterator<UIComponent> kids = component.getFacetsAndChildren();
     while (kids.hasNext())
     {
-      UIComponent kid = (UIComponent) kids.next();
+      UIComponent kid = kids.next();
       // UIXComponentBase doesn't mind transient components
       // in its saved state, so don't bother with this.
       if (!(component instanceof UIXComponentBase) &&
@@ -715,6 +740,7 @@
                  getRequestMap().get(_CACHED_SERIALIZED_VIEW);
   }
 
+  @SuppressWarnings("unchecked")
   private void _saveCachedSerializedView(
     FacesContext context, SerializedView state)
   {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/Structure.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/Structure.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/Structure.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/Structure.java Sun Aug  6 16:12:37 2006
@@ -35,6 +35,22 @@
  * <p>
  * @author The Oracle ADF Faces Team
  */
+// -= Simon Lessard =-
+//     Why using an ArrayList as a map again? It is not type-safe.
+//     Using an object to store the key/value seems like a decent
+//     compromise memory wise. Or better, I would suggest a TreeMap 
+//     to lower the complexity to O(log(n)) instead of O(n) at 
+//     minimal memory cost. If balancing is still considered too 
+//     expensive and an additional class is not wanted, then parallel
+//     lists would also do the trick
+// =-=Adam Winer =-=
+//   To answer the question:  the explicit intent of this
+//   class is entirely to produce an optimal, minimally-sized
+//   structure for state saving.  Everything is iterated through
+//   straight away.  Type-safety is nearly irrelevant (it's
+//   one, self-encapsulated structure, with no relevant external API);
+//   everything is iterated through directly (there is no O(log n) anything)
+//   relevant.  Of overriding importance here is size and efficiency.
 final class Structure implements Externalizable
 {
   /**
@@ -59,33 +75,34 @@
   /**
    * Re-create a component from a structure object
    */
+  @SuppressWarnings("unchecked")
   public UIComponent createComponent()
     throws ClassNotFoundException, InstantiationException,
            IllegalAccessException
   {
-    Class clazz = ClassLoaderUtils.loadClass(_class);
+    Class<?> clazz = ClassLoaderUtils.loadClass(_class);
     UIComponent component = (UIComponent) clazz.newInstance();
     if (_id != null)
       component.setId(_id);
     // Create any facets
     if (_facets != null)
     {
-      Map facets = component.getFacets();
+      Map<String, UIComponent> facets = component.getFacets();
       for (int i = 0 ; i < _facets.size(); i += 2)
       {
         UIComponent facet = ((Structure) _facets.get(i + 1)).
                                  createComponent();
-        facets.put(_facets.get(i), facet);
+        facets.put((String)_facets.get(i), facet);
       }
     }
 
     // Create any children
     if (_children != null)
     {
-      List children = component.getChildren();
+      List<UIComponent> children = component.getChildren();
       for (int i = 0 ; i < _children.size(); i++)
       {
-        UIComponent child = ((Structure) _children.get(i)).createComponent();
+        UIComponent child = _children.get(i).createComponent();
         children.add(child);
       }
     }
@@ -121,9 +138,14 @@
     else
     {
       out.writeShort(_children.size());
+      
+      // 2006-08-02: -= Simon Lessard =-
+      //             get(index) is inefficient if the List ever
+      //             become something else than ArrayList
+      // =-=Adam Winer=-=:  yep, so we won't change it to be something else.
       for (int i = 0; i < _children.size(); i++)
       {
-        ((Structure) _children.get(i)).writeExternal(out);
+        _children.get(i).writeExternal(out);
       }
     }
   }
@@ -138,7 +160,7 @@
     short facetCount = in.readShort();
     if (facetCount > 0)
     {
-      _facets = new ArrayList(facetCount);
+      _facets = new ArrayList<Object>(facetCount);
       for (int i = 0; i < facetCount; i += 2)
       {
         _facets.add(in.readObject());
@@ -152,7 +174,7 @@
     short childCount = in.readShort();
     if (childCount > 0)
     {
-      _children = new ArrayList(childCount);
+      _children = new ArrayList<Structure>(childCount);
       for (int i = 0; i < childCount; i++)
       {
         Structure newStruct = new Structure();
@@ -165,18 +187,17 @@
   /**
    * Store the structure of all the children.
    */
-  private List _getChildren(UIComponent component)
+  @SuppressWarnings("unchecked")
+  private List<Structure> _getChildren(UIComponent component)
   {
     if (component.getChildCount() == 0)
       return null;
 
-    List children = component.getChildren();
-    ArrayList list = new ArrayList(children.size());
+    List<UIComponent> children = component.getChildren();
+    ArrayList<Structure> list = new ArrayList<Structure>(children.size());
 
-    Iterator childIterator = children.iterator();
-    while (childIterator.hasNext())
+    for(UIComponent child : children)
     {
-      UIComponent child = (UIComponent) childIterator.next();
       if ((child != null) && !child.isTransient())
       {
         list.add(new Structure(child));
@@ -193,9 +214,10 @@
   /**
    * Store the structure of all the facets.
    */
-  private List _getFacets(UIComponent component)
+  @SuppressWarnings("unchecked")
+  private List<Object> _getFacets(UIComponent component)
   {
-    Iterator facetNames;
+    Iterator<String> facetNames;
     if (component instanceof UIXComponentBase)
     {
       facetNames = ((UIXComponentBase) component).getFacetNames();
@@ -208,12 +230,12 @@
     if (!facetNames.hasNext())
       return null;
 
-    Map facets = component.getFacets();
-    ArrayList list = new ArrayList(facets.size() * 2);
+    Map<String, UIComponent> facets = component.getFacets();
+    ArrayList<Object> list = new ArrayList<Object>(facets.size() * 2);
     while (facetNames.hasNext())
     {
-      Object name = facetNames.next();
-      UIComponent facet = (UIComponent) facets.get(name);
+      String name = facetNames.next();
+      UIComponent facet = facets.get(name);
       if ((facet != null) && !facet.isTransient())
       {
         list.add(name);
@@ -245,8 +267,8 @@
 
   private String _class;
   private String _id;
-  private List _facets;
-  private List _children;
+  private List<Object> _facets;
+  private List<Structure> _children;
 
 
   static private final String _COMMON_CLASS_PREFIX =

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java Sun Aug  6 16:12:37 2006
@@ -64,20 +64,23 @@
     ViewHandler delegate)
   {
     _delegate = delegate;
-    _timestamps = new HashMap();
+    _timestamps = new HashMap<String, Long>();
     _loadInternalViews();
   }
 
+  @Override
   public Locale calculateLocale(FacesContext context)
   {
     return _delegate.calculateLocale(context);
   }
 
+  @Override
   public String calculateRenderKitId(FacesContext context)
   {
     return _delegate.calculateRenderKitId(context);
   }
 
+  @Override
   public UIViewRoot createView(FacesContext context, String viewId)
   {
     _initIfNeeded(context);
@@ -98,7 +101,7 @@
         String path = _getPath(viewId);
         synchronized (_timestamps)
         {
-          Long ts = (Long) _timestamps.get(path);
+          Long ts = _timestamps.get(path);
           if (ts != _NOT_FOUND)
           {
             URL url = context.getExternalContext().getResource(path);
@@ -116,6 +119,7 @@
     return _delegate.createView(context, viewId);
   }
 
+  @Override
   public String getActionURL(FacesContext context, String viewId)
   {
     String actionURL = _delegate.getActionURL(context, viewId);
@@ -130,6 +134,7 @@
     return actionURL;
   }
 
+  @Override
   public String getResourceURL(
     FacesContext context,
     String       path)
@@ -138,6 +143,7 @@
   }
 
 
+  @Override
   public void renderView(
     FacesContext context,
     UIViewRoot   viewToRender) throws IOException, FacesException
@@ -181,6 +187,7 @@
     }
   }
 
+  @Override
   public UIViewRoot restoreView(
     FacesContext context,
     String       viewId)
@@ -216,7 +223,7 @@
         String path = _getPath(viewId);
         synchronized (_timestamps)
         {
-          Long ts = (Long)_timestamps.get(path);
+          Long ts = _timestamps.get(path);
           if (ts != _NOT_FOUND)
           {
             URL url = context.getExternalContext().getResource(path);
@@ -261,6 +268,7 @@
     return result;
   }
 
+  @Override
   public void writeState(
     FacesContext context) throws IOException
   {
@@ -294,10 +302,10 @@
         try
         {
           ClassLoader loader = Thread.currentThread().getContextClassLoader();
-          Class c = loader.loadClass(alternateViewHandler);
+          Class<?> c = loader.loadClass(alternateViewHandler);
           try
           {
-            Constructor constructor = c.getConstructor(
+            Constructor<?> constructor = c.getConstructor(
                new Class[]{ViewHandler.class});
             viewHandlerInstance =
                (ViewHandler) constructor.newInstance(new Object[]{_delegate});
@@ -393,16 +401,16 @@
   //
   private void _loadInternalViews()
   {
-    _internalViews = new HashMap();
-    List<URL> list = new ArrayList();
+    _internalViews = new HashMap<String, InternalView>();
+    List<URL> list = new ArrayList<URL>();
     ClassLoader loader = _getClassLoader();
     try
     {
-      Enumeration en = loader.getResources(
+      Enumeration<URL> en = loader.getResources(
                "META-INF/org.apache.myfaces.trinidad.render.InternalView.properties");
       while (en.hasMoreElements())
       {
-        list.add((URL) en.nextElement());
+        list.add(en.nextElement());
       }
 
       // And, for some temporary backwards compatibility, also load
@@ -411,7 +419,7 @@
                "META-INF/org.apache.myfaces.trinidad.InternalView.properties");
       while (en.hasMoreElements())
       {
-        list.add((URL) en.nextElement());
+        list.add(en.nextElement());
       }
 
 
@@ -432,11 +440,11 @@
         _LOG.fine("Loading internal views from {0}",  url);
         properties.load(url.openStream());
 
-        for (Map.Entry entry : properties.entrySet())
+        for (Map.Entry<Object, Object> entry : properties.entrySet())
         {
           String name = (String) entry.getKey();
           String className = (String) entry.getValue();
-          Class clazz = loader.loadClass(className);
+          Class<?> clazz = loader.loadClass(className);
           InternalView view = (InternalView) clazz.newInstance();
           _internalViews.put(name, view);
         }
@@ -472,7 +480,7 @@
   private Boolean           _checkTimestamp;
   // Mostly final, but see _initIfNeeded()
   private ViewHandler       _delegate;
-  private final Map         _timestamps;
+  private final Map<String, Long> _timestamps;
   private boolean           _inited;
   private Map<String, InternalView> _internalViews;
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java Sun Aug  6 16:12:37 2006
@@ -24,6 +24,7 @@
   {
   }
 
+  @Override
   public void setProperty(PropertyKey key, Object value)
   {
     super.setProperty(key, value);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java Sun Aug  6 16:12:37 2006
@@ -25,6 +25,7 @@
   {
   }
 
+  @Override
   public Type getType()
   {
     return _type;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java Sun Aug  6 16:12:37 2006
@@ -42,6 +42,7 @@
     super(base);
   }
 
+  @Override
   public Object getValue(FacesContext context)
   {
     Object o = super.getValue(context);
@@ -56,7 +57,8 @@
     return new Character(text.charAt(accessKeyIndex + 1));
   }
 
-  public Class getType(FacesContext context)
+  @Override
+  public Class<?> getType(FacesContext context)
   {
     return Character.class;
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java Sun Aug  6 16:12:37 2006
@@ -42,6 +42,7 @@
     super(base);
   }
 
+  @Override
   public Object getValue(FacesContext context)
   {
     Object o = super.getValue(context);
@@ -56,7 +57,8 @@
     return StringUtils.stripMnemonic(text);
   }
 
-  public Class getType(FacesContext context)
+  @Override
+  public Class<?> getType(FacesContext context)
   {
     return String.class;
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/ValueBindingAdapter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/ValueBindingAdapter.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/ValueBindingAdapter.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/ValueBindingAdapter.java Sun Aug  6 16:12:37 2006
@@ -36,22 +36,26 @@
     _base = base;
   }
 
+  @Override
   public Object getValue(FacesContext context)
   {
     return _base.getValue(context);
   }
 
+  @Override
   public void setValue(FacesContext context, Object value)
   {
     throw new PropertyNotFoundException("Can't set value");
   }
   
+  @Override
   public boolean isReadOnly(FacesContext context)
   {
     return true;
   }
 
-  public Class getType(FacesContext context)
+  @Override
+  public Class<?> getType(FacesContext context)
   {
     return _base.getType(context);
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/BaseChangeManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/BaseChangeManager.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/BaseChangeManager.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/BaseChangeManager.java Sun Aug  6 16:12:37 2006
@@ -57,6 +57,7 @@
    * @todo =-=pu : Maybe we need to allow adding Changes for specific viewId's -
    *  BIBeans req. - external customizer dialog
    */
+  @Override
   public void addComponentChange(
     FacesContext facesContext,
     UIComponent uiComponent,
@@ -94,6 +95,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   public void addDocumentChange(
     FacesContext facesContext,
     UIComponent uiComponent,
@@ -140,7 +142,8 @@
   /**
    * {@inheritDoc}
    */
-  public Iterator getComponentChanges(
+  @Override
+  public Iterator<ComponentChange> getComponentChanges(
     FacesContext facesContext,
     UIComponent uiComponent)
   {
@@ -148,14 +151,14 @@
       return null;
 
     String viewId = facesContext.getViewRoot().getViewId();
-    Map componentToChangesMap =
+    Map<String, List<ComponentChange>> componentToChangesMap =
        getComponentToChangesMapForView(facesContext, viewId, false);
 
     if (componentToChangesMap == null)
       return null;
 
     String uniqueIdForComponent = _getUniqueIdForComponent(uiComponent);
-    List changesList = (List) componentToChangesMap.get(uniqueIdForComponent);
+    List<ComponentChange> changesList = componentToChangesMap.get(uniqueIdForComponent);
     if (changesList == null)
       return null;
 
@@ -165,10 +168,11 @@
   /**
    * {@inheritDoc}
    */
-  public Iterator getComponentIdsWithChanges(FacesContext facesContext)
+  @Override
+  public Iterator<String> getComponentIdsWithChanges(FacesContext facesContext)
   {
     String viewId = facesContext.getViewRoot().getViewId();
-    Map componentToChangesMap =
+    Map<String, List<ComponentChange>> componentToChangesMap =
        getComponentToChangesMapForView(facesContext, viewId, false);
 
     if (componentToChangesMap == null)
@@ -187,7 +191,7 @@
    *        already present
    * @return Map of componentID tokens to Lists of Changes
    */
-  protected abstract Map getComponentToChangesMapForView(
+  protected abstract Map<String, List<ComponentChange>> getComponentToChangesMapForView(
     FacesContext facesContext,
     String viewId,
     boolean createIfNecessary);
@@ -203,18 +207,18 @@
   {
     String viewId = facesContext.getViewRoot().getViewId();
 
-    Map componentToChangesMap = getComponentToChangesMapForView(facesContext,
+    Map<String, List<ComponentChange>> componentToChangesMap = getComponentToChangesMapForView(facesContext,
                                                                 viewId,
                                                                 true);
 
     String uniqueIdForComponent = _getUniqueIdForComponent(uiComponent);
 
-    List changeListForComponent =
-      (List) componentToChangesMap.get(uniqueIdForComponent);
+    List<ComponentChange> changeListForComponent = 
+      componentToChangesMap.get(uniqueIdForComponent);
 
     if (changeListForComponent == null)
     {
-      changeListForComponent = new LinkedList();
+      changeListForComponent = new LinkedList<ComponentChange>();
       componentToChangesMap.put(uniqueIdForComponent, changeListForComponent);
     }
 
@@ -283,11 +287,11 @@
   {
     if (document instanceof DocumentTraversal)
     {
-      List idPath = _getIdPath(component);
+      List<String> idPath = _getIdPath(component);
 
       if (!idPath.isEmpty())
       {
-        Iterator pathIds = idPath.iterator();
+        Iterator<String> pathIds = idPath.iterator();
 
         DocumentTraversal traversalFactory = (DocumentTraversal)document;
         TreeWalker walker = traversalFactory.createTreeWalker(
@@ -296,9 +300,9 @@
                                    null,
                                    true);
 
-        Node currElement = (Element)walker.getCurrentNode();
+        Node currElement = walker.getCurrentNode();
         Node stopElement = walker.getRoot();
-        String neededID = (String)pathIds.next();
+        String neededID = pathIds.next();
 
         do
         {
@@ -319,7 +323,7 @@
                 return currElement;
 
               // update the id we need
-              neededID = (String)pathIds.next();
+              neededID = pathIds.next();
 
               // don't pop back up to this parent
               stopElement = currElement;
@@ -391,7 +395,8 @@
    * @param component
    * @return
    */
-  private List _getIdPath(UIComponent component)
+  @SuppressWarnings("unchecked")
+  private List<String> _getIdPath(UIComponent component)
   {
     String componentID = component.getId();
 
@@ -399,7 +404,7 @@
     if ((componentID == null) || (componentID.length() == 0))
       return Collections.EMPTY_LIST;
 
-    LinkedList pathList = new LinkedList();
+    LinkedList<String> pathList = new LinkedList<String>();
     pathList.addFirst(componentID);
 
     UIComponent currAncestor = component.getParent();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/NullChangeManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/NullChangeManager.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/NullChangeManager.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/NullChangeManager.java Sun Aug  6 16:12:37 2006
@@ -34,6 +34,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   public void addComponentChange(
     FacesContext facesContext,
     UIComponent uiComponent,
@@ -45,7 +46,8 @@
   /**
    * {@inheritDoc}
    */
-  public Iterator getComponentChanges(FacesContext facesContext,
+  @Override
+  public Iterator<ComponentChange> getComponentChanges(FacesContext facesContext,
                              UIComponent uiComponent)
   {
     return null;
@@ -54,7 +56,8 @@
   /**
    * {@inheritDoc}
    */
-  public Iterator getComponentIdsWithChanges(FacesContext facesContext)
+  @Override
+  public Iterator<String> getComponentIdsWithChanges(FacesContext facesContext)
   {
     return null;
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/SessionChangeManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/SessionChangeManager.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/SessionChangeManager.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/change/SessionChangeManager.java Sun Aug  6 16:12:37 2006
@@ -17,10 +17,12 @@
 package org.apache.myfaces.trinidadinternal.change;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.faces.context.FacesContext;
 
+import org.apache.myfaces.trinidad.change.ComponentChange;
 import org.w3c.dom.Document;
 
 /**
@@ -42,29 +44,32 @@
    *        already present
    * @return Map of componentID tokens to Lists of Changes
    */
-  protected Map getComponentToChangesMapForView(
+  @SuppressWarnings("unchecked")
+  @Override
+  protected Map<String, List<ComponentChange>> getComponentToChangesMapForView(
     FacesContext facesContext,
     String viewId,
     boolean createIfNecessary)
   {
-    Map sessMap = facesContext.getExternalContext().getSessionMap();
+    Map<String, Object> sessMap = facesContext.getExternalContext().getSessionMap();
     //pu: Get datastructure #1 described at the end of this file.
-    Map viewToChangesMap = (Map) sessMap.get(_CHANGE_KEY);
+    Map<String, Map<String, List<ComponentChange>>> viewToChangesMap = 
+      (Map<String, Map<String, List<ComponentChange>>>)sessMap.get(_CHANGE_KEY);
     if (viewToChangesMap == null)
     {
       if (!createIfNecessary)
         return null;
-      viewToChangesMap = new HashMap();
+      viewToChangesMap = new HashMap<String, Map<String, List<ComponentChange>>>();
       sessMap.put(_CHANGE_KEY, viewToChangesMap);
     }
     
     //pu: Get datastructure #2 described at the end of this file.
-    Map componentToChangesMap = (Map) viewToChangesMap.get(viewId);
+    Map<String, List<ComponentChange>> componentToChangesMap = viewToChangesMap.get(viewId);
     if (componentToChangesMap == null)
     {
       if (!createIfNecessary)
         return null;
-      componentToChangesMap = new HashMap();
+      componentToChangesMap = new HashMap<String, List<ComponentChange>>();
       viewToChangesMap.put(viewId, componentToChangesMap);
     }
     return componentToChangesMap;
@@ -73,6 +78,7 @@
   /** 
    * We don't support DocumentAspect persistence
    */
+  @Override
   protected Document getDocument(FacesContext context)
   {
     return null;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java Sun Aug  6 16:12:37 2006
@@ -46,17 +46,19 @@
     _context = context;
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public void pushView(UIViewRoot viewRoot)
   {
     FacesContext context = _getFacesContext();
     Object savedOld = StateManagerImpl.saveViewRoot(context, viewRoot);
 
-    List list = (List) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
+    List<Object> list = (List<Object>) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
     if (list == null)
-      list = new ArrayList(1);
+      list = new ArrayList<Object>(1);
     else
     {
-      List tmp = new ArrayList(list.size() + 1);
+      List<Object> tmp = new ArrayList<Object>(list.size() + 1);
       tmp.addAll(list);
       list = tmp;
     }
@@ -67,6 +69,8 @@
     _LOG.fine("Pushed view {0}", viewRoot.getViewId());
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public void popView(boolean navigateToPoppedView)
   {
     FacesContext context = _getFacesContext();
@@ -86,7 +90,7 @@
     }
 
     // Make a copy of the List;  never mutate the original list
-    List list = (List) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
+    List<Object> list = (List<Object>) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
     if (list == null)
     {
       // For starters, this should only happen if we weren't navigating
@@ -100,18 +104,20 @@
     }
     else
     {
-      list = new ArrayList(list);
+      list = new ArrayList<Object>(list);
       list.remove(list.size() - 1);
       _getPageFlowScope().put(_PUSHED_VIEWS_KEY, list);
     }
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public UIViewRoot peekView()
   {
     FacesContext context = _getFacesContext();
     Object savedRoot = null;
 
-    List list = (List) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
+    List<Object> list = (List<Object>) _getPageFlowScope().get(_PUSHED_VIEWS_KEY);
     if (list != null)
       savedRoot = list.get(list.size() - 1);
 
@@ -140,8 +146,10 @@
     return null;
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public boolean returnFromDialog(Object returnValue,
-                                  Map returnParameters)
+                                  Map<Object, Object> returnParameters)
   {
     FacesContext context = _getFacesContext();
     context.getExternalContext().getSessionMap().
@@ -172,7 +180,7 @@
     // do that;  we'll mark the response as complete, because we'll need
     // the AdfFacesFilter to re-execute the faces lifecycle with the
     // new parameters
-    Map launchParameters = (Map)
+    Map<Object, Object> launchParameters = (Map<Object, Object>)
       poppedView.getAttributes().get(RequestContextImpl.LAUNCH_PARAMETERS);
 
     if (launchParameters != null)
@@ -181,7 +189,7 @@
       // AdfFacesFilterImpl and ViewHandlerImpl
       poppedView.getAttributes().remove(RequestContextImpl.LAUNCH_PARAMETERS);
 
-      Map requestMap = context.getExternalContext().getRequestMap();
+      Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
       requestMap.put(RequestContextImpl.LAUNCH_PARAMETERS, launchParameters);
       requestMap.put(RequestContextImpl.LAUNCH_VIEW, poppedView);
 
@@ -194,12 +202,14 @@
 
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public ReturnEvent getReturnEvent(UIComponent source)
   {
     FacesContext context = _getFacesContext();
     if (TrinidadFilterImpl.isExecutingDialogReturn(context))
     {
-      Map parameterMap = context.getExternalContext().getRequestParameterMap();
+      Map<String, Object> parameterMap = context.getExternalContext().getRequestParameterMap();
       Object returnParam = parameterMap.get(_RETURN_PARAM);
       if (returnParam == null)
         return null;
@@ -225,11 +235,11 @@
              remove(_DIALOG_RETURN_KEY);
 
     Object returnValue = null;
-    Map    returnParams = null;
+    Map<Object, Object> returnParams = null;
     if (o != null)
     {
       returnValue = ((Object[]) o)[0];
-      returnParams = (Map) ((Object[]) o)[1];
+      returnParams = (Map<Object, Object>)((Object[]) o)[1];
     }
 
     ReturnEvent returnEvent =
@@ -241,6 +251,7 @@
     return returnEvent;
   }
 
+  @Override
   public void queueLaunchEvent(UIViewRoot viewRoot)
   {
     UIComponent source = getCurrentLaunchSource();
@@ -254,9 +265,10 @@
     }
   }
 
+  @Override
   public void queueReturnEvent(
     Object returnValue,
-    Map    returnParams)
+    Map<Object, Object> returnParams)
   {
     UIComponent source = getCurrentLaunchSource();
     if (source == null)
@@ -274,15 +286,17 @@
    * Launch a dialog.
    * @todo Don't save parameters for state-saving, page-flow scope, etc.
    */
+  @SuppressWarnings("unchecked")
+  @Override
   public void launchDialog(
     UIViewRoot  dialogRoot,
-    Map         dialogParameters,
+    Map<String, Object> dialogParameters,
     UIComponent source,
     boolean     useWindow,
-    Map         windowProperties)
+    Map<String, Object> windowProperties)
   {
     if (dialogParameters == null)
-      dialogParameters = new HashMap();
+      dialogParameters = new HashMap<String, Object>();
 
     FacesContext context = _getFacesContext();
 
@@ -323,7 +337,7 @@
       // Save the parameters used to launch the dialog so we can
       // simulate a postback when coming back to the dialog;  and
       // write in a "returnId" with the "id" that will be used.
-      Map savedRequestParameters = new HashMap();
+      Map<String, Object> savedRequestParameters = new HashMap<String, Object>();
       savedRequestParameters.putAll(
             context.getExternalContext().getRequestParameterValuesMap());
       if (source != null)
@@ -365,7 +379,8 @@
     return _context.__getFacesContext();
   }
 
-  private Map _getPageFlowScope()
+  @SuppressWarnings("unchecked")
+  private Map<String, Object> _getPageFlowScope()
   {
     return _context.getPageFlowScope();
   }
@@ -374,7 +389,7 @@
     FacesContext context)
   {
     RenderKit rk = context.getRenderKit();
-    DialogRenderKitService service = (DialogRenderKitService)
+    DialogRenderKitService service = 
        Service.getService(rk, DialogRenderKitService.class);
 
     if (service == null)
@@ -391,15 +406,16 @@
    * Execute any "binding" attributes so that a popped view
    * is properly set up
    */
+  @SuppressWarnings("unchecked")
   private void _executeBindings(FacesContext context, UIComponent component)
   {
     ValueBinding binding = component.getValueBinding("binding");
     if (binding != null)
       binding.setValue(context, component);
 
-    Iterator kids = component.getFacetsAndChildren();
+    Iterator<UIComponent> kids = component.getFacetsAndChildren();
     while (kids.hasNext())
-      _executeBindings(context, (UIComponent) kids.next());
+      _executeBindings(context, kids.next());
   }
 
   private RequestContextImpl _context;
@@ -417,6 +433,7 @@
       super(source, viewRoot);
     }
 
+    @Override
     public void launchDialog(boolean useWindow)
     {
       RequestContext afContext = RequestContext.getCurrentInstance();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/ExternalContextDecorator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/ExternalContextDecorator.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/ExternalContextDecorator.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/ExternalContextDecorator.java Sun Aug  6 16:12:37 2006
@@ -35,175 +35,217 @@
  */
 abstract public class ExternalContextDecorator extends ExternalContext
 {
+  @Override
   public void dispatch(String path) throws IOException
   {
     getExternalContext().dispatch(path);
   }
 
-
+  @Override
   public Object getContext()
   { 
     return getExternalContext().getContext();
   }
   
+  @Override
   public Object getRequest()
   {
     return getExternalContext().getRequest(); 
   }
   
+  @Override
   public Object getResponse()
   {
     return getExternalContext().getResponse();
   }
   
+  @Override
   public Object getSession(boolean create)
   {
     return getExternalContext().getSession(create);
   }
   
+  @Override
   public String getRequestContextPath()
   {
     return getExternalContext().getRequestContextPath();
   }
 
+  @Override
   public String getRequestPathInfo()
   {
     return getExternalContext().getRequestPathInfo();
   }
 
+  @Override
   public String getRequestServletPath()
   {
     return getExternalContext().getRequestServletPath();
   }
 
+  @Override
   public String getInitParameter(String name)
   {
     return getExternalContext().getInitParameter(name);
   }
   
+  @Override
   public String encodeResourceURL(String url)
   {
     return getExternalContext().encodeResourceURL(url);
   }
 
+  @Override
   public String encodeActionURL(String url)
   {
     return getExternalContext().encodeActionURL(url);
   }
 
+  @Override
   public String encodeNamespace(String ns)
   {
     return getExternalContext().encodeNamespace(ns);
   }
 
+  @Override
   public String getAuthType()
   {
     return getExternalContext().getAuthType();
   }
 
+  @Override
   public String getRemoteUser()
   {
     return getExternalContext().getRemoteUser();
   }
 
+  @Override
   public Principal getUserPrincipal()
   {
     return getExternalContext().getUserPrincipal();
   }
 
+  @Override
   public boolean isUserInRole(String role)
   {
     return getExternalContext().isUserInRole(role);
   }
 
+  @Override
   public URL getResource(String path) throws MalformedURLException
   {
     return getExternalContext().getResource(path);
   }
 
+  @Override
   public InputStream getResourceAsStream(String path)
   {
     return getExternalContext().getResourceAsStream(path);
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Set getResourcePaths(String path)
   {
     return getExternalContext().getResourcePaths(path);
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestParameterMap()
   {
     return getExternalContext().getRequestParameterMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestParameterValuesMap()
   {
     return getExternalContext().getRequestParameterValuesMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Iterator getRequestParameterNames()
   {
     return getExternalContext().getRequestParameterNames();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestCookieMap()
   {
     return getExternalContext().getRequestCookieMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestHeaderMap()
   {
     return getExternalContext().getRequestHeaderMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestHeaderValuesMap()
   {
     return getExternalContext().getRequestHeaderValuesMap();
   }
 
-
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getInitParameterMap()
   {
     return getExternalContext().getInitParameterMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getApplicationMap()
   {
     return getExternalContext().getApplicationMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getSessionMap()
   {
     return getExternalContext().getSessionMap();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Map getRequestMap()
   {
     return getExternalContext().getRequestMap();
   }
 
-
+  @Override
   public Locale getRequestLocale()
   {
     return getExternalContext().getRequestLocale();
   }
 
+  @SuppressWarnings("unchecked")
+  @Override
   public Iterator getRequestLocales()
   {
     return getExternalContext().getRequestLocales();
   }
 
-
+  @Override
   public void log(String message)
   {
     getExternalContext().log(message);
   }
 
+  @Override
   public void log(String message, Throwable t)
   {
     getExternalContext().log(message, t);
   }
 
+  @Override
   public void redirect(String url) throws IOException
   {
     getExternalContext().redirect(url);



Mime
View raw message