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 [11/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/c...
Date Sun, 06 Aug 2006 23:12:54 GMT
Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceSupport.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceSupport.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceSupport.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceSupport.java Sun Aug  6 16:12:37 2006
@@ -70,28 +70,7 @@
  */
 class NamespaceSupport
 {
-  ////////////////////////////////////////////////////////////////////
-  // Constants.
-  ////////////////////////////////////////////////////////////////////
-
-
-  /**
-     * The XML Namespace as a constant.
-     *
-     * <p>This is the Namespace URI that is automatically mapped
-     * to the "xml" prefix.</p>
-     */
-  public final static String XMLNS =
-    "http://www.w3.org/XML/1998/namespace";
-
-
-    /**
-     * An empty enumeration.
-     */
-  private final static Iterator EMPTY_ITERATOR =
-    new ArrayList().iterator();
-
-
+  
     ////////////////////////////////////////////////////////////////////
     // Constructor.
     ////////////////////////////////////////////////////////////////////
@@ -123,10 +102,10 @@
     // =-=AEW Blow off double-resets (which ParserAdapter was doing)
     if (!_isReset)
     {
-      contexts = new Context[32];
-      contextPos = 0;
-      contexts[contextPos] = currentContext = new Context();
-      currentContext.declarePrefix("xml", XMLNS);
+      _contexts = new Context[32];
+      _contextPos = 0;
+      _contexts[_contextPos] = _currentContext = new Context();
+      _currentContext.declarePrefix("xml", XMLNS);
       _isReset = true;
     }
   }
@@ -150,36 +129,36 @@
   {
     _isReset = false;
 
-    int max = contexts.length;
-    contextPos++;
+    int max = _contexts.length;
+    _contextPos++;
 
     // Extend the array if necessary
-    if (contextPos >= max) {
+    if (_contextPos >= max) {
       Context newContexts[] = new Context[max*2];
-      System.arraycopy(contexts, 0, newContexts, 0, max);
+      System.arraycopy(_contexts, 0, newContexts, 0, max);
       max *= 2;
-      contexts = newContexts;
+      _contexts = newContexts;
     }
 
     // Allocate the context if necessary.
-    currentContext = contexts[contextPos];
+    _currentContext = _contexts[_contextPos];
 
     // Set the parent, if any.
-    if (contextPos > 0)
+    if (_contextPos > 0)
     {
-      if (currentContext == null)
+      if (_currentContext == null)
       {
-        currentContext = new Context(contexts[contextPos - 1]);
-        contexts[contextPos] = currentContext;
+        _currentContext = new Context(_contexts[_contextPos - 1]);
+        _contexts[_contextPos] = _currentContext;
       }
       else
       {
-        currentContext.setParent(contexts[contextPos - 1]);
+        _currentContext.setParent(_contexts[_contextPos - 1]);
       }
     }
-    else if (currentContext == null)
+    else if (_currentContext == null)
     {
-      contexts[contextPos] = currentContext = new Context();
+      _contexts[_contextPos] = _currentContext = new Context();
     }
   }
 
@@ -199,11 +178,11 @@
      */
   public void popContext ()
   {
-    contextPos--;
-    if (contextPos < 0) {
+    _contextPos--;
+    if (_contextPos < 0) {
       throw new EmptyStackException();
     }
-    currentContext = contexts[contextPos];
+    _currentContext = _contexts[_contextPos];
   }
 
 
@@ -246,7 +225,7 @@
     if (prefix.equals("xml") || prefix.equals("xmlns")) {
       return false;
     } else {
-      currentContext.declarePrefix(prefix, uri);
+      _currentContext.declarePrefix(prefix, uri);
       return true;
     }
   }
@@ -302,7 +281,7 @@
       if (isAttribute)
         parts[0] = "";
       else
-        parts[0] = currentContext.getURI("");
+        parts[0] = _currentContext.getURI("");
 
       qName = qName.intern();
       parts[1] = qName;
@@ -311,7 +290,7 @@
     }
     else
     {
-      String myParts[] = currentContext.processName(qName, isAttribute);
+      String myParts[] = _currentContext.processName(qName, isAttribute);
       if (myParts == null) {
         return null;
       } else {
@@ -338,7 +317,7 @@
      */
   public String getURI (String prefix)
   {
-    return currentContext.getURI(prefix);
+    return _currentContext.getURI(prefix);
   }
 
 
@@ -355,9 +334,9 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-  public Iterator getPrefixes ()
+  public Iterator<String> getPrefixes ()
   {
-    return currentContext.getPrefixes();
+    return _currentContext.getPrefixes();
   }
 
 
@@ -384,7 +363,7 @@
      */
   public String getPrefix (String uri)
   {
-    return currentContext.getPrefix(uri);
+    return _currentContext.getPrefix(uri);
   }
 
 
@@ -409,16 +388,19 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-  public Iterator getPrefixes (String uri)
+  public Iterator<String> getPrefixes (String uri)
   {
-    ArrayList prefixes = new ArrayList();
-    Iterator allPrefixes = getPrefixes();
-    while (allPrefixes.hasNext()) {
-      String prefix = (String)allPrefixes.next();
-      if (uri.equals(getURI(prefix))) {
+    ArrayList<String> prefixes = new ArrayList<String>();
+    Iterator<String> allPrefixes = getPrefixes();
+    while (allPrefixes.hasNext())
+    {
+      String prefix = allPrefixes.next();
+      if (uri.equals(getURI(prefix)))
+      {
         prefixes.add(prefix);
       }
     }
+    
     return prefixes.iterator();
   }
 
@@ -435,19 +417,39 @@
      * @see #getPrefixes
      * @see #getURI
      */
-  public Iterator getDeclaredPrefixes ()
+  public Iterator<String> getDeclaredPrefixes ()
   {
-    return currentContext.getDeclaredPrefixes();
+    return _currentContext.getDeclaredPrefixes();
   }
 
+  
+  ////////////////////////////////////////////////////////////////////
+  // Constants.
+  ////////////////////////////////////////////////////////////////////
+
+  /**
+     * The XML Namespace as a constant.
+     *
+     * <p>This is the Namespace URI that is automatically mapped
+     * to the "xml" prefix.</p>
+     */
+  public final static String XMLNS =
+    "http://www.w3.org/XML/1998/namespace";
+  
+    /**
+     * An empty enumeration.
+     */
+  private final static Iterator<String> _EMPTY_ITERATOR =
+    new ArrayList<String>().iterator();
+
 
   ////////////////////////////////////////////////////////////////////
   // Internal state.
   ////////////////////////////////////////////////////////////////////
 
-  private Context contexts[];
-  private Context currentContext;
-  private int contextPos;
+  private Context _contexts[];
+  private Context _currentContext;
+  private int _contextPos;
 
   private boolean _isReset;
 
@@ -485,13 +487,13 @@
 
     void setParent(Context parent)
     {
-      declarations = null;
-      prefixTable = parent.prefixTable;
-      uriTable = parent.uriTable;
-      elementNameTable = parent.elementNameTable;
-      attributeNameTable = parent.attributeNameTable;
-      defaultNS = parent.defaultNS;
-      tablesSharedWithParent = true;
+      _declarations = null;
+      _prefixTable = parent._prefixTable;
+      _uriTable = parent._uriTable;
+      _elementNameTable = parent._elementNameTable;
+      _attributeNameTable = parent._attributeNameTable;
+      _defaultNS = parent._defaultNS;
+      _tablesSharedWithParent = true;
     }
 
     /**
@@ -504,27 +506,27 @@
     void declarePrefix (String prefix, String uri)
     {
       // Lazy processing...
-      if (tablesSharedWithParent) {
+      if (_tablesSharedWithParent) {
         copyTables();
       }
 
-      if (declarations == null) {
-        declarations = new ArrayList();
+      if (_declarations == null) {
+        _declarations = new ArrayList<String>();
       }
 
       prefix = prefix.intern();
       uri = uri.intern();
       if ("".equals(prefix)) {
         if ("".equals(uri)) {
-          defaultNS = null;
+          _defaultNS = null;
         } else {
-          defaultNS = uri;
+          _defaultNS = uri;
         }
       } else {
-        prefixTable.put(prefix, uri);
-        uriTable.put(uri, prefix); // may wipe out another prefix
+        _prefixTable.put(prefix, uri);
+        _uriTable.put(uri, prefix); // may wipe out another prefix
       }
-      declarations.add(prefix);
+      _declarations.add(prefix);
     }
 
 
@@ -542,28 +544,38 @@
     String [] processName (String qName, boolean isAttribute)
     {
       String name[];
-      Hashtable table;
+      Hashtable<String, String[]> table;
 
       // Select the appropriate table.
-      if (isAttribute) {
-        table = elementNameTable;
+      if (isAttribute)
+      {
+        table = _elementNameTable;
         // =-=AEW Lazily allocate this table
         if (table == null)
+        {
           // =-=AEW Make this one big
-          elementNameTable = table = new Hashtable();
-      } else {
-        table = attributeNameTable;
+          table = new Hashtable<String, String[]>();
+          _elementNameTable = table;
+        }
+      }
+      else
+      {
+        table = _attributeNameTable;
         // =-=AEW Lazily allocate this table
         if (table == null)
+        {
           // =-=AEW Leave this one a little big...
-          elementNameTable = table = new Hashtable(37);
+          table = new Hashtable<String, String[]>(37);
+          _elementNameTable = table;
+        }
       }
 
       // Start by looking in the cache, and
       // return immediately if the name
       // is already known in this content
-      name = (String[])table.get(qName);
-      if (name != null) {
+      name = table.get(qName);
+      if (name != null)
+      {
         return name;
       }
 
@@ -575,10 +587,10 @@
 
       // No prefix.
       if (index == -1) {
-        if (isAttribute || defaultNS == null) {
+        if (isAttribute || _defaultNS == null) {
           name[0] = "";
         } else {
-          name[0] = defaultNS;
+          name[0] = _defaultNS;
         }
         name[1] = qName.intern();
         name[2] = name[1];
@@ -613,12 +625,17 @@
      */
     String getURI (String prefix)
     {
-      if ("".equals(prefix)) {
-        return defaultNS;
-      } else if (prefixTable == null) {
+      if ("".equals(prefix))
+      {
+        return _defaultNS;
+      }
+      else if (_prefixTable == null)
+      {
         return null;
-      } else {
-        return (String)prefixTable.get(prefix);
+      }
+      else
+      {
+        return _prefixTable.get(prefix);
       }
     }
 
@@ -635,10 +652,13 @@
      */
     String getPrefix (String uri)
     {
-      if (uriTable == null) {
+      if (_uriTable == null)
+      {
         return null;
-      } else {
-        return (String)uriTable.get(uri);
+      }
+      else
+      {
+        return _uriTable.get(uri);
       }
     }
 
@@ -649,12 +669,15 @@
      * @return An enumeration of prefixes (possibly empty).
      * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
      */
-    Iterator getDeclaredPrefixes ()
+    Iterator<String> getDeclaredPrefixes ()
     {
-      if (declarations == null) {
-        return EMPTY_ITERATOR;
-      } else {
-        return declarations.iterator();
+      if (_declarations == null)
+      {
+        return _EMPTY_ITERATOR;
+      }
+      else
+      {
+        return _declarations.iterator();
       }
     }
 
@@ -668,12 +691,15 @@
      * @return An enumeration of prefixes (never empty).
      * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
      */
-    Iterator getPrefixes ()
+    Iterator<String> getPrefixes ()
     {
-      if (prefixTable == null) {
-        return EMPTY_ITERATOR;
-      } else {
-        return prefixTable.keySet().iterator();
+      if (_prefixTable == null)
+      {
+        return _EMPTY_ITERATOR;
+      }
+      else
+      {
+        return _prefixTable.keySet().iterator();
       }
     }
 
@@ -690,39 +716,49 @@
      * <p>This class is optimized for the normal case where most
      * elements do not contain Namespace declarations.</p>
      */
+    @SuppressWarnings("unchecked")
     private void copyTables ()
     {
       // =-=AEW Use small tables for the actual namespaces
-      if (prefixTable != null) {
-        prefixTable = (ArrayMap)prefixTable.clone();
-      } else {
-        prefixTable = new ArrayMap(5);
+      if (_prefixTable != null)
+      {
+        _prefixTable = (ArrayMap<String, String>)_prefixTable.clone();
       }
-      if (uriTable != null) {
-        uriTable = (ArrayMap) uriTable.clone();
-      } else {
-        uriTable = new ArrayMap(5);
+      else
+      {
+        _prefixTable = new ArrayMap<String, String>(5);
+      }
+      
+      if (_uriTable != null)
+      {
+        _uriTable = (ArrayMap<String, String>) _uriTable.clone();
+      }
+      else
+      {
+        _uriTable = new ArrayMap<String, String>(5);
       }
 
       // =-=AEW Lazily allocate these tables (so we can
       //  use NamespaceSupport just for keeping track of prefixes)
       //elementNameTable = new Hashtable();
-      elementNameTable = null;
+      _elementNameTable = null;
 
       // =-=AEW Leave this one a little big...
       //attributeNameTable = new Hashtable(37);
-      attributeNameTable = null;
+      _attributeNameTable = null;
 
-      tablesSharedWithParent = false;
+      _tablesSharedWithParent = false;
     }
 
 
-    private ArrayMap prefixTable;
-    private ArrayMap uriTable;
-    private Hashtable elementNameTable;
-    private Hashtable attributeNameTable;
-    private String defaultNS;
-    private ArrayList declarations;
-    private boolean tablesSharedWithParent;
+    private ArrayMap<String, String> _prefixTable;
+    private ArrayMap<String, String> _uriTable;
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is truly required.
+    private Hashtable<String, String[]> _elementNameTable;
+    private Hashtable<String, String[]> _attributeNameTable;
+    private String _defaultNS;
+    private ArrayList<String> _declarations;
+    private boolean _tablesSharedWithParent;
   }
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceURI.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceURI.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceURI.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/NamespaceURI.java Sun Aug  6 16:12:37 2006
@@ -50,6 +50,7 @@
     return _name;
   }
 
+  @Override
   public boolean equals(Object obj)
   {
     if (obj instanceof NamespaceURI)
@@ -60,6 +61,7 @@
     return false;
   }
 
+  @Override
   public int hashCode()
   {
     // =-= ACW: we need a better function to combine hashcodes. for now lets
@@ -124,6 +126,7 @@
    * @deprecated since 2.2.0. use
    * {@link #create(ExpressionContext,String,String)}
    */
+  @Deprecated
   public static NamespaceURI create(ParseContext context,
                                     String qname,
                                     String defaultURI)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContext.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContext.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContext.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContext.java Sun Aug  6 16:12:37 2006
@@ -37,7 +37,7 @@
    * @param localName the local name of the XML element
    */
   public NodeParser getParser(
-    Class      expectedType,
+    Class<?>   expectedType,
     String     namespaceURI,
     String     localName);
 
@@ -70,6 +70,7 @@
    * @deprecated since 2.2.0 use {@link #getExpressionContext()} and
    * {@link ExpressionContext#getPrefixMapper()}
    */
+  @Deprecated
   public String getNamespaceURI(String prefix);
 
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextImpl.java Sun Aug  6 16:12:37 2006
@@ -84,7 +84,7 @@
    * @param localName the local name of the XML element
    */
   public NodeParser getParser(
-    Class      expectedType,
+    Class<?>   expectedType,
     String     namespaceURI,
     String     localName)
   {
@@ -128,6 +128,7 @@
    * @deprecated since 2.2.0 use {@link #getExpressionContext()} and
    * {@link ExpressionContext#getPrefixMapper()}
    */
+  @Deprecated
   public String getNamespaceURI(String prefix)
   {
     return null;
@@ -179,6 +180,7 @@
   /**
    *
    */
+  @Override
   public Object clone()
   {
     try

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextWrapper.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextWrapper.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParseContextWrapper.java Sun Aug  6 16:12:37 2006
@@ -56,6 +56,7 @@
     final NSFunctionMapper fmapper =
       new NSFunctionMapper()
       {
+        @Override
         public Function resolveFunction(String namespaceURI,
                                         String name)
         {
@@ -87,7 +88,7 @@
    * @param localName the local name of the XML element
    */
   public NodeParser getParser(
-    Class      expectedType,
+    Class<?>   expectedType,
     String     namespaceURI,
     String     localName)
   {
@@ -135,6 +136,7 @@
    * @deprecated since 2.2.0 use {@link #getExpressionContext()} and
    * {@ExpressionContext#getPrefixMapper()}
    */
+  @Deprecated
   public final String getNamespaceURI(String prefix)
   {
     return getExpressionContext().getPrefixMapper().getNamespaceURI(prefix);
@@ -179,6 +181,7 @@
   /**
    *
    */
+  @Override
   public Object clone()
   {
     return _base.clone();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserExtension.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserExtension.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserExtension.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserExtension.java Sun Aug  6 16:12:37 2006
@@ -45,7 +45,7 @@
     ParseContext context,
     String       namespaceURI,
     String       localName,
-    Map   attributes) throws SAXParseException;
+    Map<?, ?>    attributes) throws SAXParseException;
 
 
   /**
@@ -86,5 +86,5 @@
     String       namespaceURI,
     String       localName,
     Object       parsed,
-    Map   values) throws SAXParseException;
+    Map<?, ?>    values) throws SAXParseException;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserManager.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserManager.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserManager.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/ParserManager.java Sun Aug  6 16:12:37 2006
@@ -54,7 +54,7 @@
    */
   final public NodeParser getParser(
     ParseContext context,
-    Class        expectedType,
+    Class<?>     expectedType,
     String       namespaceURI,
     String       localName)
   {
@@ -71,8 +71,8 @@
    * Gets the factory registered for the namespace.
    */
   public ParserFactory getFactory(
-    Class  expectedType,
-    String namespaceURI)
+    Class<?> expectedType,
+    String   namespaceURI)
   {
     return (ParserFactory)
       _factories.get(resolveNamespaceAlias(namespaceURI),
@@ -84,7 +84,7 @@
    * Registers a factory for a type and namespace.
    */
   synchronized public void registerFactory(
-     Class         expectedType,
+     Class<?>      expectedType,
      String        namespaceURI,
      ParserFactory factory)
   {
@@ -99,8 +99,8 @@
    * Unregisters a factory for a type and namespace.
    */
   synchronized public void unregisterFactory(
-    Class  expectedType,
-    String namespaceURI)
+    Class<?> expectedType,
+    String   namespaceURI)
   {
     _unshareState();
     _factories.remove(resolveNamespaceAlias(namespaceURI),
@@ -114,8 +114,7 @@
   public ParserExtension getExtension(
     String namespaceURI)
   {
-    return (ParserExtension)
-      _extensions.get(resolveNamespaceAlias(namespaceURI));
+    return _extensions.get(resolveNamespaceAlias(namespaceURI));
   }
 
 
@@ -123,7 +122,7 @@
    * Registers an extension for a namespace.
    */
   synchronized public void registerExtension(
-     String        namespaceURI,
+     String          namespaceURI,
      ParserExtension extension)
   {
     _unshareState();
@@ -179,13 +178,7 @@
    */
   public final ExpressionParser getExpressionParser(String name)
   {
-    if (name == null)
-      return _defaultExpressionParser;
-    else
-    {
-      ExpressionParser parser = (ExpressionParser) _bindingParsers.get(name);
-      return parser;
-    }
+    return name == null ? _defaultExpressionParser : _bindingParsers.get(name);
   }
 
   /**
@@ -230,6 +223,7 @@
   /**
    * Makes a deep copy of the ParserManager.
    */
+  @Override
   synchronized public Object clone()
   {
     try
@@ -250,15 +244,16 @@
 
   // Unshare any parts of the state that have been shared.
   // Must be called by synchronized functions!
+  @SuppressWarnings("unchecked")
   private synchronized void _unshareState()
   {
     if (_sharedState)
     {
-      _functions = (NamespaceMap) _functions.clone();
-      _factories = (NamespaceMap) _factories.clone();
-      _extensions = (ArrayMap)    _extensions.clone();
-      _aliases = (ArrayMap)       _aliases.clone();
-      _bindingParsers = (ArrayMap) _bindingParsers.clone();
+      _functions      = (NamespaceMap) _functions.clone();
+      _factories      = (NamespaceMap) _factories.clone();
+      _extensions     = (ArrayMap<String, ParserExtension>)  _extensions.clone();
+      _aliases        = (ArrayMap<String, String>)           _aliases.clone();
+      _bindingParsers = (ArrayMap<String, ExpressionParser>) _bindingParsers.clone();
 
       _sharedState = false;
     }
@@ -266,9 +261,9 @@
 
   private NamespaceMap _functions = new NamespaceMap();
   private NamespaceMap _factories = new NamespaceMap();
-  private ArrayMap     _extensions = new ArrayMap(5);
-  private ArrayMap     _aliases    = new ArrayMap(5);
-  private ArrayMap     _bindingParsers = new ArrayMap(2);
+  private ArrayMap<String, ParserExtension>  _extensions     = new ArrayMap<String, ParserExtension>(5);
+  private ArrayMap<String, String>           _aliases        = new ArrayMap<String, String>(5);
+  private ArrayMap<String, ExpressionParser> _bindingParsers = new ArrayMap<String, ExpressionParser>(2);
   private ExpressionParser _defaultExpressionParser = null;
 
   // If true, our state is shared with another parser manager - so

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/StringParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/StringParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/StringParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/StringParser.java Sun Aug  6 16:12:37 2006
@@ -33,6 +33,7 @@
   {
   }
 
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -41,6 +42,7 @@
     return _buffer.toString();
   }
 
+  @Override
   public void addText(
     ParseContext context,
     char[]       text,
@@ -56,6 +58,7 @@
     _buffer.append(text, start, length);
   }
   
+  @Override
   public void addWhitespace(
     ParseContext context,
     char[]       text,
@@ -72,6 +75,7 @@
     }
   }
 
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/TreeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/TreeBuilder.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/TreeBuilder.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/TreeBuilder.java Sun Aug  6 16:12:37 2006
@@ -61,7 +61,7 @@
    * @param rootClass the desired type of object to return as the root
    */
   public TreeBuilder(ParserManager manager,
-                     Class         rootClass)
+                     Class<?>      rootClass)
   {
     // Allow a null ParserManager.  It may sound wacky,
     // but it's sometimes easiest to always explicitly state
@@ -175,7 +175,7 @@
     public Handler(ParseContextWrapper context, NodeParser rootParser)
     {
       _context = context;
-      _parsers = new Stack();
+      _parsers = new Stack<StackEntry>();
       _rootParser = rootParser;
     }
 
@@ -542,7 +542,7 @@
           // Trim whitespace from both ends of the text.
           while (start <= end)
           {
-            if (!Character.isSpace(text[start]))
+            if (!Character.isWhitespace(text[start]))
               break;
 
             start++;
@@ -556,7 +556,7 @@
           int savedEnd = end;
           while (end > start + 1)
           {
-            if (!Character.isSpace(text[end]))
+            if (!Character.isWhitespace(text[end]))
               break;
 
             end--;
@@ -686,7 +686,7 @@
 
     private StackEntry _popParser()
     {
-      StackEntry entry = (StackEntry) _parsers.pop();
+      StackEntry entry = _parsers.pop();
       if (entry != null)
       {
         _current = _getLastNonNullParser();
@@ -732,7 +732,9 @@
 
     // A stack of parsers (stored in StackEntries);  null at any position means the
     // parser didn't change
-    private Stack            _parsers;
+    // -= Simon Lessard =- 
+    // TODO:  Check if synchronization is required since Stack is bad.
+    private Stack<StackEntry> _parsers;
 
     // The current parser.  This will always equal the last
     // non-null parser
@@ -790,19 +792,22 @@
     }
 
     // Get the index'th dictionary
-    public Map getMap(int index)
+    @SuppressWarnings("unchecked")
+    public Map<Object, Object> getMap(int index)
     {
-      return (Map) _dictionaries[index * 2 + 1];
+      return (Map<Object, Object>) _dictionaries[index * 2 + 1];
     }
 
     // Add a namespace/key value to the entry
+    @SuppressWarnings("unchecked")
     public void put(String namespace, Object key, Object value)
     {
-      Map subDict = (Map) ArrayMap.get(_dictionaries,
-                                                     namespace);
+      Map<Object, Object> subDict = 
+        (Map<Object, Object>) ArrayMap.get(_dictionaries, namespace);
+      
       if (subDict == null)
       {
-        subDict = new ArrayMap(5, 5);
+        subDict = new ArrayMap<Object, Object>(5, 5);
         _dictionaries = ArrayMap.put(_dictionaries, namespace, subDict);
       }
 
@@ -814,7 +819,7 @@
     private Object[]   _dictionaries;
   }
 
-  final Class                  _rootClass;
+  final Class<?>               _rootClass;
   private EntityResolver       _entityResolver;
   final private ParserManager  _manager;
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(TreeBuilder.class);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java Sun Aug  6 16:12:37 2006
@@ -60,7 +60,7 @@
     ParserManager manager,
     NameResolver  resolver,
     String        sourceName,
-    Class         expectedType) throws IOException, SAXException
+    Class<?>      expectedType) throws IOException, SAXException
   {
     if (manager == null)
       throw new NullPointerException();
@@ -119,10 +119,11 @@
    * @param sourceName the name of the target, relative to the current file
    * @param expectedType the expected Java type of the target.
    */
+  @SuppressWarnings("unchecked")
   static public Object parseInclude(
     ParseContext context,
     String       sourceName,
-    Class        expectedType) throws IOException, SAXException
+    Class<?>     expectedType) throws IOException, SAXException
   {
     // Step 1. Find the name resolver.
     NameResolver resolver = getResolver(context);
@@ -142,8 +143,8 @@
     }
 
     // Step 3. Detect if this will be a circular include.
-    ArrayList list = (ArrayList) context.getProperty(_SHARE_NAMESPACE,
-                                                     "_includeStack");
+    ArrayList<Object> list = 
+      (ArrayList<Object>) context.getProperty(_SHARE_NAMESPACE, "_includeStack");
     Object identifier = provider.getIdentifier();
 
     if ((list != null) && (list.contains(identifier)))
@@ -168,9 +169,9 @@
     // Add the current identifer to the stack (used for detecting
     // circular includes) placed on the ParseContext
     if (list == null)
-      list = new ArrayList();
+      list = new ArrayList<Object>();
     else
-      list = (ArrayList) list.clone();
+      list = (ArrayList<Object>) list.clone();
     list.add(identifier);
     newContext.setProperty(_SHARE_NAMESPACE, "_includeStack", list);
 
@@ -341,7 +342,7 @@
     if (stringValue == null)
       return null;
 
-    ArrayList list = new ArrayList(5);
+    ArrayList<String> list = new ArrayList<String>(5);
 
     int     length = stringValue.length();
     boolean inSpace = true;
@@ -356,7 +357,7 @@
       // function instead of "isWhitespace"?  We're following XML rules
       // here for the meaning of whitespace, which specifically
       // EXCLUDES general Unicode spaces.
-      if (Character.isSpace(ch))
+      if (Character.isWhitespace(ch))
       {
         if (!inSpace)
         {
@@ -382,7 +383,7 @@
     if (list.isEmpty())
       return null;
 
-    return (String[]) list.toArray(new String[list.size()]);
+    return list.toArray(new String[list.size()]);
   }
 
   /**
@@ -391,8 +392,10 @@
    * @param klass only the public static methods declared on this class are
    * inspected
    */
-  public static void registerFunctions(ParserManager manager,
-                                       String namespace, Class klass)
+  public static void registerFunctions(
+      ParserManager manager,
+      String namespace,
+      Class<?> klass)
   {
     Method[] methods = klass.getDeclaredMethods();
     for(int i=0; i<methods.length; i++)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BasePropertyDef.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BasePropertyDef.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BasePropertyDef.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BasePropertyDef.java Sun Aug  6 16:12:37 2006
@@ -27,6 +27,7 @@
  */
 abstract public class BasePropertyDef extends PropertyDef
 {
+  @Override
   public Object parseText(
     ParseContext context,
     String       text) throws IllegalArgumentException

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParser.java Sun Aug  6 16:12:37 2006
@@ -18,9 +18,8 @@
 import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
-
-
+import java.util.List;
+import java.util.Map;
 
 import org.xml.sax.Attributes;
 
@@ -52,6 +51,7 @@
     _beanDef = beanDef;
   }
 
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -99,6 +99,7 @@
     }
   }
 
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -120,7 +121,7 @@
       // An array - get a parser for the component type of the array
       if (_currentPropDefIsArray)
       {
-        Class cls = _currentPropDef.getPropertyType().getComponentType();
+        Class<?> cls = _currentPropDef.getPropertyType().getComponentType();
         return context.getParser(cls,
                                  namespaceURI,
                                  localName);
@@ -159,6 +160,7 @@
     return null;
   }
 
+  @Override
   public void endChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -182,6 +184,7 @@
     _currentPropDef = null;
   }
 
+  @Override
   public void addText(
     ParseContext context,
     char[]       text,
@@ -203,8 +206,7 @@
     }
   }
 
-
-
+  @Override
   public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -227,7 +229,7 @@
       // Inline arrays - add the child to the correct list
       if (_currentPropDefInline)
       {
-        ((ArrayList) _inlineArrays.get(_currentPropDef)).add(child);
+        _inlineArrays.get(_currentPropDef).add(child);
         _currentPropDef = null;
       }
       else
@@ -247,6 +249,7 @@
     }
   }
 
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -277,11 +280,10 @@
     // If we have any inline arrays, set those
     if (_inlineArrays != null)
     {
-      Iterator defs = _inlineArrays.keySet().iterator();
-      while (defs.hasNext())
+      for(Map.Entry<PropertyDef, List<Object>> entry : _inlineArrays.entrySet())
       {
-        PropertyDef def = (PropertyDef) defs.next();
-        Object[] array = _getArray(def, (ArrayList) _inlineArrays.get(def));
+        PropertyDef def = entry.getKey();
+        Object[] array = _getArray(def, entry.getValue());
         def.setValue(context, _bean, array);
       }
     }
@@ -338,7 +340,7 @@
     Attributes   attrs,
     PropertyDef def)
   {
-    Class cls = def.getPropertyType();
+    Class<?> cls = def.getPropertyType();
     boolean isArray = cls.isArray();
     if (isArray)
       cls = cls.getComponentType();
@@ -359,13 +361,17 @@
       if (isArray)
       {
         if (_inlineArrays == null)
-          _inlineArrays = new HashMap(3);
+        {
+          _inlineArrays = new HashMap<PropertyDef, List<Object>>(3);
+        }
 
         // =-=AEW  This assumes that either BeanDef is returning
         // the same PropertyDef each time, or PropertyDef implements
         // equals() correctly.
         if (_inlineArrays.get(def) == null)
-          _inlineArrays.put(def, new ArrayList());
+        {
+          _inlineArrays.put(def, new ArrayList<Object>());
+        }
       }
     }
 
@@ -402,7 +408,7 @@
     _currentPropDefIsArray = def.getPropertyType().isArray();
     if (_currentPropDefIsArray)
     {
-      _currentArray = new ArrayList();
+      _currentArray = new ArrayList<Object>();
     }
 
     return this;
@@ -550,7 +556,7 @@
   //
   static private Object[] _getArray(
     PropertyDef def,
-    ArrayList   list)
+    List<Object> list)
   {
     Object[] array = (Object[])
       Array.newInstance(def.getPropertyType().getComponentType(),
@@ -586,10 +592,10 @@
 
   // The list of the current property definition - used
   // only for "envelope" elements
-  private       ArrayList    _currentArray;
+  private       List<Object> _currentArray;
 
   // A map of all the "inline" array properties
-  private       HashMap      _inlineArrays;
+  private       Map<PropertyDef, List<Object>> _inlineArrays;
 
   // Text being accumulated for the default property
   private       String       _defaultPropertyText;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParserFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParserFactory.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParserFactory.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/BeanParserFactory.java Sun Aug  6 16:12:37 2006
@@ -38,9 +38,9 @@
    *          BeanDef objects
    */
   public BeanParserFactory(
-    Class       parserType,
-    String      namespaceURI,
-    Map  beanTypes)
+    Class<?>             parserType,
+    String               namespaceURI,
+    Map<String, BeanDef> beanTypes)
   {
     _parserType   = parserType;
     _namespaceURI = namespaceURI;
@@ -76,7 +76,7 @@
     String namespaceURI,
     String localName)
   {
-    return (BeanDef)_beanTypes.get(localName);
+    return _beanTypes.get(localName);
   }
 
   protected NodeParser createBeanParser(
@@ -86,7 +86,7 @@
     return new BeanParser(beanDef);
   }
 
-  private Class       _parserType;
-  private String      _namespaceURI;
-  private Map  _beanTypes;
+  private Class<?>             _parserType;
+  private String               _namespaceURI;
+  private Map<String, BeanDef> _beanTypes;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionBeanDef.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionBeanDef.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionBeanDef.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionBeanDef.java Sun Aug  6 16:12:37 2006
@@ -67,19 +67,19 @@
     _defaultProperty = defaultProperty;
   }
 
-
-
+  @Override
   public PropertyDef getPropertyDef(String name)
   {
-    Map defs = _getPropertyDefs();
+    Map<String, PropertyDef> defs = _getPropertyDefs();
     if (defs != null)
     {
-      return (PropertyDef) defs.get(name);
+      return defs.get(name);
     }
 
     return null;
   }
 
+  @Override
   public PropertyDef getPropertyDef(String namespace, String name)
   {
     if ("".equals(namespace))
@@ -88,30 +88,33 @@
     return null;
   }
 
-
-
+  @Override
   public Object createBean(
     String    namespaceURI,
     String    localName) throws ClassNotFoundException,
                                 InstantiationException,
                                 IllegalAccessException
   {
-    Class cls = _getClass();
+    Class<?> cls = _getClass();
     return cls.newInstance();
   }
 
-
+  @Override
   public Object finishBean(Object bean)
   {
     return bean;
   }
 
+  @Override
   public PropertyDef getElementPropertyDef(
-    String namespace, String name, Attributes attrs)
+    String namespace, 
+    String name, 
+    Attributes attrs)
   {
     return getPropertyDef(namespace, name);
   }
 
+  @Override
   public PropertyDef getDefaultPropertyDef()
   {
     if (_defaultProperty == null)
@@ -120,9 +123,11 @@
     return getPropertyDef(_defaultProperty);
   }
 
-
+  @Override
   public boolean isInlineChildProperty(
-    String namespace, String name, PropertyDef def)
+    String namespace, 
+    String name, 
+    PropertyDef def)
   {
     return false;
   }
@@ -136,17 +141,17 @@
   {
     if (_defs == null)
     {
-      Map defs;
+      Map<String, PropertyDef> defs;
 
       try
       {
-        Class objClass = _getClass();
+        Class<?> objClass = _getClass();
         // Grab all the getters and setters using JavaBeans
         BeanInfo info = JavaIntrospector.getBeanInfo(objClass);
         PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
 
         int length = (descriptors != null) ? descriptors.length : 0;
-        defs = new HashMap(Math.max(length, 1));
+        defs = new HashMap<String, PropertyDef>(Math.max(length, 1));
         _defs = defs;
 
         for (int i = 0; i < length; i++)
@@ -162,7 +167,7 @@
       catch (Exception e)
       {
         // =-=AEW ERROR???
-        _defs = new HashMap(1);
+        _defs = new HashMap<String, PropertyDef>(1);
       }
     }
   }
@@ -194,7 +199,7 @@
   }
 
   // Lazily retrive property defs.
-  private Map _getPropertyDefs()
+  private Map<String, PropertyDef> _getPropertyDefs()
   {
     // Force the properties to be loaded
     loadProperties();
@@ -202,17 +207,19 @@
   }
 
   // Lazily retrive the class.
-  private Class _getClass() throws ClassNotFoundException
+  private Class<?> _getClass() throws ClassNotFoundException
   {
     if (_class == null)
+    {
       _class = ClassLoaderUtils.loadClass(_className);
+    }
 
     return _class;
   }
 
 
-  private final String   _className;
-  private final String   _defaultProperty;
-  private Class        _class;
-  private Map          _defs;
+  private final String _className;
+  private final String _defaultProperty;
+  private Class<?>     _class;
+  private Map<String, PropertyDef> _defs;
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionPropertyDef.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionPropertyDef.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionPropertyDef.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/IntrospectionPropertyDef.java Sun Aug  6 16:12:37 2006
@@ -49,16 +49,19 @@
   /**
    * Returns the name of the property definition.
    */
+  @Override
   public String getName()
   {
     return _descriptor.getName();
   }
 
-  public Class getPropertyType()
+  @Override
+  public Class<?> getPropertyType()
   {
     return _descriptor.getPropertyType();
   }
 
+  @Override
   public Object getValue(ParseContext context, Object bean)
   {
     Method read = _descriptor.getReadMethod();
@@ -83,6 +86,7 @@
     return null;
   }
 
+  @Override
   public void setValue(ParseContext context, Object bean, Object value)
   {
     Method write = _descriptor.getWriteMethod();

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/PropertyDef.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/PropertyDef.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/PropertyDef.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/beans/PropertyDef.java Sun Aug  6 16:12:37 2006
@@ -57,8 +57,7 @@
    *
    * @return  the property type
    */
-  abstract public Class getPropertyType();
-
+  abstract public Class<?> getPropertyType();
 
   /**
    * Parses a string into the correct Java type for this

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/Skin.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/Skin.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/Skin.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/Skin.java Sun Aug  6 16:12:37 2006
@@ -16,7 +16,6 @@
 package org.apache.myfaces.trinidadinternal.skin;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -215,7 +214,7 @@
     if (iconName == null)
       throw new NullPointerException("Null iconName");
 
-    Icon icon = (Icon)_icons.get(iconName);
+    Icon icon = _icons.get(iconName);
     if (resolveIcon)
     {
       if (icon instanceof ReferenceIcon)
@@ -238,7 +237,7 @@
    */
   private Icon _resolveReferenceIcon(
     ReferenceIcon refIcon,
-    Stack         referencedIconStack)
+    Stack<String> referencedIconStack)
   {
     String refName = refIcon.getName();
 
@@ -249,8 +248,11 @@
         _LOG.warning(_CIRCULAR_INCLUDE_ERROR + refName);
       return null;
     }
+    
     if (referencedIconStack == null)
-      referencedIconStack = new Stack();
+    {
+      referencedIconStack = new Stack<String>();
+    }
 
     referencedIconStack.push(refName);
 
@@ -268,7 +270,7 @@
   }
 
     // Tests whether the value is present in the (possibly null) stack.
-  private static boolean _stackContains(Stack stack, Object value)
+  private static boolean _stackContains(Stack<String> stack, Object value)
   {
     if (stack == null)
       return false;
@@ -314,7 +316,9 @@
       throw new NullPointerException("Null styleSheetName");
 
     if (_extensionStyleSheetNames == null)
-      _extensionStyleSheetNames = new ArrayList();
+    {
+      _extensionStyleSheetNames = new ArrayList<String>();
+    }
 
     _extensionStyleSheetNames.add(styleSheetName);
   }
@@ -368,7 +372,7 @@
     )
   {
     if (_properties == null)
-      _properties = new OptimisticHashMap();
+      _properties = new OptimisticHashMap<Object, Object>();
 
     _properties.put(key, value);
   }
@@ -430,26 +434,23 @@
         if (_skinStyleSheet != null)
         {
           // register icons
-          List icons = _skinStyleSheet.getIcons();
+          List<IconNode> icons = _skinStyleSheet.getIcons();
           if (icons != null)
           {
-            Iterator e = icons.listIterator();
-            while (e.hasNext())
+            for(IconNode iconNode : icons)
             {
-              IconNode iconNode = (IconNode)e.next();
-              registerIcon(iconNode.getIconName(),
-                           iconNode.getIcon());
-
+              registerIcon(iconNode.getIconName(), iconNode.getIcon());
             }
           }
+          
           // register properties
-          List skinProperties = _skinStyleSheet.getSkinProperties();
+          List<SkinPropertyNode> skinProperties = 
+            _skinStyleSheet.getSkinProperties();
+          
           if (skinProperties != null)
           {
-            Iterator e = skinProperties.listIterator();
-            while (e.hasNext())
+            for(SkinPropertyNode property : skinProperties)
             {
-              SkinPropertyNode property = (SkinPropertyNode)e.next();
               Object propValueObj = property.getPropertyValue();
               // convert to a type if possible first
               // =-=jmw should I get the type for af|breadCrumbs-ora-show-last-item or just
@@ -461,7 +462,7 @@
               String key = property.getPropertySelector() +
                            property.getPropertyName();
               // look up in map to get conversion
-              Class type = (Class)_PROPERTY_CLASS_TYPE_MAP.get(key);
+              Class<?> type = _PROPERTY_CLASS_TYPE_MAP.get(key);
               if (type != null)
               {
                 try
@@ -530,7 +531,9 @@
     // reason (maybe we don't have any style sheet, maybe there were
     // I/O problems), create a empty StyleSheetDocument so that we
     // don't repeatedly try to re-create the document.
-    return new StyleSheetDocument(null, null);
+    return new StyleSheetDocument(null, 
+                                  null, 
+                                  StyleSheetDocument.UNKNOWN_TIMESTAMP);
   }
 
   // Gets the StyleSheetEntries for UIExtensions
@@ -541,33 +544,30 @@
 
     // Create a list to hold our StyleSheetEntries
     int count = _extensionStyleSheetNames.size();
-    ArrayList entries = new ArrayList(count);
+    List<StyleSheetEntry> entries = new ArrayList<StyleSheetEntry>(count);
 
     // Loop through all registered style sheet names and
     // try to create a StyleSheetEntry for each name.
-    Iterator iter = _extensionStyleSheetNames.iterator();
-    if (iter != null)
+    for(String name : _extensionStyleSheetNames)
     {
-      while (iter.hasNext())
+      StyleSheetEntry entry = StyleSheetEntry.createEntry(context, name);
+      if (entry != null)
       {
-        String name = (String)iter.next();
-        StyleSheetEntry entry = StyleSheetEntry.createEntry(context, name);
-        if (entry != null)
-          entries.add(entry);
+        entries.add(entry);
       }
     }
 
     if (!entries.isEmpty())
     {
       _extensionStyleSheets = new StyleSheetEntry[entries.size()];
-      return (StyleSheetEntry[])entries.toArray(_extensionStyleSheets);
+      return entries.toArray(_extensionStyleSheets);
     }
 
     return null;
   }
 
   // HashMap that maps icon name to Icons
-  private OptimisticHashMap _icons = new OptimisticHashMap();
+  private OptimisticHashMap<String, Icon> _icons = new OptimisticHashMap<String, Icon>();
 
   // The StyleSheetDocument which contains all of the styles
   // for this Skin - including styles contributed by UIExtensions.
@@ -579,18 +579,20 @@
   private StyleSheetEntry _skinStyleSheet;
 
   // List of extension style sheet names
-  private List _extensionStyleSheetNames;
+  private List<String> _extensionStyleSheetNames;
 
   // Array of UIExtension StyleSheetEntries
   private StyleSheetEntry[] _extensionStyleSheets;
 
   // HashMap of Skin properties
-  private OptimisticHashMap _properties;
+  private OptimisticHashMap<Object, Object> _properties;
 
   // Map of property to class type
-  private static final Map _PROPERTY_CLASS_TYPE_MAP = new HashMap();
+  private static final Map<String, Class<?>> _PROPERTY_CLASS_TYPE_MAP;
   static
   {
+    _PROPERTY_CLASS_TYPE_MAP = new HashMap<String, Class<?>>();
+    
     _PROPERTY_CLASS_TYPE_MAP.put(
       XhtmlConstants.AF_NAVIGATIONPATH_SHOW_LAST_ITEM_PROPERTY_KEY, Boolean.class);
     _PROPERTY_CLASS_TYPE_MAP.put(

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java Sun Aug  6 16:12:37 2006
@@ -79,7 +79,7 @@
   public void startSelector()
   {
     _inStyleRule = true;
-    _propertyNodeList = new ArrayList();
+    _propertyNodeList = new ArrayList<PropertyNode>();
   }
    
   /**
@@ -91,7 +91,7 @@
    * The selectors in the List are 
    * ".AFDefaultFont" and "af|breadCrumbs::font"
   */
-  public void endSelector(List selectors)
+  public void endSelector(List<String> selectors)
   {
     if (selectors == null)
       return;
@@ -100,7 +100,7 @@
     
     for (int i = 0; i < selectorNum; i++)
     {
-       String selector = (String)selectors.get(i);
+       String selector = selectors.get(i);
        CompleteSelectorNode node =
          _createCompleteSelectorNode(selector, 
                                      _propertyNodeList,
@@ -224,7 +224,7 @@
    // additional info, like 'rtl' direction
   private CompleteSelectorNode _createCompleteSelectorNode(
     String selector, 
-    List  propertyNodeList,
+    List<PropertyNode> propertyNodeList,
     int[] selectorAgents,
     int[] selectorPlatforms)
   {
@@ -264,10 +264,11 @@
     * @return a List of SkinStyleSheetNodes
     */
   private List <SkinStyleSheetNode> _createSkinStyleSheetNodes(
-    List <CompleteSelectorNode> selectorList, 
-    Map namespaceMap)
+    List<CompleteSelectorNode> selectorList, 
+    Map<String, String> namespaceMap)
   {  
-    List <SkinStyleSheetNode> skinStyleSheetNodes = new ArrayList();
+    List<SkinStyleSheetNode> skinStyleSheetNodes = 
+      new ArrayList<SkinStyleSheetNode>();
      
     for (CompleteSelectorNode completeSelectorNode : selectorList) 
     {
@@ -322,7 +323,7 @@
     {
       String types = atRule.substring(firstSpace, openBrace);
       String[] typeArray = types.split(",");
-      List <Integer> list = new ArrayList();
+      List<Integer> list = new ArrayList<Integer>();
       
       if (type == _AT_AGENT)
       {
@@ -395,7 +396,7 @@
   {
     public CompleteSelectorNode(
       String selectorName,
-      List   propertyNodes,
+      List<PropertyNode> propertyNodes,
       int    direction,
       int[]  agents,
       int[]  platforms
@@ -454,7 +455,7 @@
   // below are properties that we set and reset 
   // as the methods of this documentHandler get called.
   private boolean _inStyleRule = false;
-  private List _propertyNodeList = null;
+  private List<PropertyNode> _propertyNodeList = null;
   // we build this list as we parse the skinning css file. We use this 
   // list to create a list of SkinStyleSheetNodes
   private List <CompleteSelectorNode> _completeSelectorNodeList = 
@@ -463,7 +464,7 @@
   // are currently parsing in this document.
   private int[] _selectorPlatforms = null;
   private int[] _selectorAgents = null;
-  private Map _namespaceMap = new HashMap();
+  private Map<String, String> _namespaceMap = new HashMap<String, String>();
   
 }  
    

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSParser.java Sun Aug  6 16:12:37 2006
@@ -49,7 +49,7 @@
       _documentHandler = documentHandler;
       _scanner = new CSSScanner(in);
       _documentHandler.startDocument();
-      List selectorList = null;
+      List<String> selectorList = null;
 
       // start scanning the document
       // return comments /* xxx */
@@ -97,7 +97,7 @@
    * further into a list of selectors.
    * (the selectors are deliminated by commas)
    */
-  private List _parseSelectorString(
+  private List<String> _parseSelectorString(
     String selectors)
   {
     // give a list of selectors, deliminated by commas, parse into a List.
@@ -105,7 +105,7 @@
     if (selectors == null)
       return null;
 
-    List selectorList = new ArrayList();
+    List<String> selectorList = new ArrayList<String>();
 
     // pull apart by the regexp that means
     // (zero or more whitespace) then (comma) then (zero or more whitespace)
@@ -116,12 +116,17 @@
       // the first selector might have extra }
       // this is a common typo, to have extra }s.
       if (i == 0)
+      {
         trimmedSelector = _trimChar(selector[i].trim(), '}');
+      }
       else
+      {
         trimmedSelector = selector[i].trim();
+      }
 
       selectorList.add(trimmedSelector);
     }
+    
     return selectorList;
   }
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java Sun Aug  6 16:12:37 2006
@@ -114,6 +114,7 @@
   /**
    * Returns the id of this custom Skin.
    */
+  @Override
   public String getId()
   {
     return _id;
@@ -123,6 +124,7 @@
    * Returns the name of the Skin family that this
    * SkinExtension belongs to.
    */
+  @Override
   public String getFamily()
   {
     return _family;
@@ -133,6 +135,7 @@
    * on has been set
    * @see setStyleSheetName
    */
+  @Override
   public String getStyleSheetName()
   {
     return _styleSheetName;
@@ -141,6 +144,7 @@
   /**
    * Returns the name of the render-kit-id for this Skin.
    */
+  @Override
   public String getRenderKitId()
   {
     return _renderKitId;
@@ -150,6 +154,7 @@
   /**
    * Returns the name of the bundle for the extension.
    */
+  @Override
   public String getBundleName()
   {
     if (_bundleName != null)
@@ -168,6 +173,7 @@
   /**
    * Override of Skin.registerIcon().
    */
+  @Override
   public void registerIcon(
     String  iconName,
     Icon    icon
@@ -187,6 +193,7 @@
    * supports pulling translations from component providers
    * as well as the base Skin.
    */
+  @Override
   public Object getTranslatedValue(
     LocaleContext lContext,
     String        key
@@ -253,6 +260,7 @@
    * This means you cannot set a local property to null and expect it to
    * "null out" a property on the base skin.
    */
+  @Override
   public Object getProperty(Object key)
   {
     Object value = super.getProperty(key);
@@ -271,6 +279,7 @@
    * Override of Skin.getIcon() to look in the base skin for the icon
    * if it isn't registered yet with this skin.
    */
+  @Override
   public Icon getIcon(
     String  iconName,
     boolean resolve
@@ -350,6 +359,7 @@
    * styles from the base Skin's style sheet and the
    * SkinExtension's style sheet.
    */
+  @Override
   public StyleSheetDocument getStyleSheetDocument(StyleContext context)
   {
     // The SkinExtension's StyleSheetDocument is produced
@@ -399,8 +409,7 @@
     Locale locale = lContext.getTranslationLocale();
 
     // Get all of the translations for the current translation Locale
-    OptimisticHashMap localeTranslations =
-      (OptimisticHashMap)_translations.get(locale);
+    Map<String, Object> localeTranslations = _translations.get(locale);
 
     if (localeTranslations != null)
       return localeTranslations.get(key);
@@ -425,14 +434,13 @@
     Locale locale = lContext.getTranslationLocale();
 
     // Get all of the translations for the current translation locale
-    OptimisticHashMap localeTranslations =
-      (OptimisticHashMap)_translations.get(locale);
+    Map<String, Object> localeTranslations = _translations.get(locale);
 
     if (localeTranslations == null)
     {
       // If we didn't previously have any translations for this
       // Locale, create storage for translations now...
-      localeTranslations = new OptimisticHashMap();
+      localeTranslations = new OptimisticHashMap<String, Object>();
       _translations.put(locale, localeTranslations);
     }
 
@@ -455,19 +463,21 @@
     if (bundleName == null)
       return false;
 
-    Map keys = _getTranslationKeys(lContext);
+    Map<String, Boolean> keys = _getTranslationKeys(lContext);
 
     return keys.containsKey(key);
   }
 
   // Returns the a Map which contains the translation keys for
   // the specified locale.
-  private Map _getTranslationKeys(
+  @SuppressWarnings("unchecked")
+  private Map<String, Boolean> _getTranslationKeys(
     LocaleContext lContext
     )
   {
    // We store the translation keys map in the translation cache
-    Map keys = (Map)_getCachedTranslatedValue(lContext,
+    Map<String, Boolean> keys = 
+      (Map<String, Boolean>)_getCachedTranslatedValue(lContext,
                                               _TRANSLATION_KEYS_KEY);
 
     if (keys == null)
@@ -475,7 +485,7 @@
       String bundleName = getBundleName();
       assert bundleName != null;
 
-      keys = new HashMap();
+      keys = new HashMap<String, Boolean>();
 
       ResourceBundle bundle = null;
 
@@ -494,7 +504,7 @@
 
       if (bundle != null)
       {
-        Enumeration en = bundle.getKeys();
+        Enumeration<String> en = bundle.getKeys();
 
         if (en != null)
         {
@@ -524,7 +534,7 @@
    */
   private Icon _resolveReferenceIcon(
     ReferenceIcon refIcon,
-    Stack         referencedIconStack)
+    Stack<String> referencedIconStack)
   {
 
     String refName = refIcon.getName();
@@ -536,8 +546,13 @@
         _LOG.warning(_CIRCULAR_INCLUDE_ERROR + refName);
       return null;
     }
+    
     if (referencedIconStack == null)
-      referencedIconStack = new Stack();
+    {
+      // -= Simon Lessard =- 
+      // TODO: Check if something better than Stack can be used
+      referencedIconStack = new Stack<String>();
+    }
 
     referencedIconStack.push(refName);
     //
@@ -578,7 +593,9 @@
   }
 
     // Tests whether the value is present in the (possibly null) stack.
-  private static boolean _stackContains(Stack stack, Object value)
+  private static boolean _stackContains(
+      Stack<String> stack, 
+      Object value)
   {
     if (stack == null)
       return false;
@@ -592,10 +609,11 @@
   // Icon class that we use as a placeholder for null icons
   private static class NullIcon extends Icon
   {
+    @Override
     public void renderIcon(
       FacesContext        context,
-      RenderingContext arc,
-      Map              attrs
+      RenderingContext    arc,
+      Map<String, Object> attrs
       ) throws IOException
     {
       // null icons don't render anything
@@ -622,7 +640,8 @@
   //
   // This HashMap hashes Locales -> HashMaps.
   // The HashMaps map translation key to message.
-  private OptimisticHashMap _translations = new OptimisticHashMap(13);
+  private OptimisticHashMap<Locale, Map<String, Object>> _translations = 
+    new OptimisticHashMap<Locale, Map<String, Object>>(13);
 
   // The StyleSheetDocument for the base LookAndFeel's style sheet
   private StyleSheetDocument _baseStyleSheetDocument;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactory.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactory.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactory.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactory.java Sun Aug  6 16:12:37 2006
@@ -17,6 +17,8 @@
 
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
+
 import javax.faces.context.FacesContext;
 
 
@@ -34,7 +36,7 @@
   {
     synchronized (_FACTORIES)
     {
-      return (SkinFactory) _FACTORIES.get(_getClassLoader());
+      return _FACTORIES.get(_getClassLoader());
     }
   }
 
@@ -106,7 +108,7 @@
    * identifiers registered with this factory.
    * </p>
    */
-  public abstract Iterator getSkinIds();
+  public abstract Iterator<String> getSkinIds();
 
 
   static private ClassLoader _getClassLoader()
@@ -114,5 +116,6 @@
     return Thread.currentThread().getContextClassLoader();
   }
 
-  static private final HashMap _FACTORIES = new HashMap();
+  static private final Map<ClassLoader, SkinFactory> _FACTORIES = 
+    new HashMap<ClassLoader, SkinFactory>();
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinFactoryImpl.java Sun Aug  6 16:12:37 2006
@@ -17,6 +17,8 @@
 
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
+
 import javax.faces.context.FacesContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -36,10 +38,11 @@
   public SkinFactoryImpl()
   {
     super();
-    _skins = new HashMap();
+    _skins = new HashMap<String, Skin>();
 
   }
 
+  @Override
   public  void addSkin(
     String skinId,
     Skin   skin)
@@ -63,6 +66,7 @@
    * @param skinId
    * @return Skin that is in this SkinFactory and has the skinId.
    */
+  @Override
   public Skin getSkin(
     FacesContext context,
     String       skinId)
@@ -79,7 +83,7 @@
     {
       if (_skins.containsKey(skinId))
       {
-        skin = (Skin) _skins.get(skinId);
+        skin = _skins.get(skinId);
       }
     }
 
@@ -94,6 +98,7 @@
    * @param renderKitId RenderKit identifier of the requested
    *  {@link Skin} instance
    */
+  @Override
   public Skin getSkin(
     FacesContext context,
     String       family,
@@ -112,15 +117,9 @@
 
     // loop through each skin in the SkinFactory
     // and see if the family and the renderKitId match
-    Iterator skinIterator = getSkinIds();
-
-    Skin skin = null;
-
-    while (skinIterator.hasNext())
+    
+    for(Skin skin : _skins.values())
     {
-      String skinId = (String)skinIterator.next();
-      skin = getSkin(context, skinId);
-
       if (family.equalsIgnoreCase(skin.getFamily()) &&
           renderKitId.equalsIgnoreCase(skin.getRenderKitId()))
       {
@@ -150,14 +149,15 @@
 
   }
 
-  public Iterator getSkinIds()
+  @Override
+  public Iterator<String> getSkinIds()
   {
     return (_skins.keySet().iterator());
   }
 
 
   // Stores all the Skins in this SkinFactory
-  private HashMap _skins = null;
+  private Map<String, Skin> _skins = null;
 
   static private final String _RENDER_KIT_ID_CORE = "org.apache.myfaces.trinidad.desktop";
   static private final String _RENDER_KIT_ID_PDA = "org.apache.myfaces.trinidad.pda";

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinNotAvailable.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinNotAvailable.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinNotAvailable.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinNotAvailable.java Sun Aug  6 16:12:37 2006
@@ -34,6 +34,7 @@
     return _INSTANCE;
   }
 
+  @Override
   public String getStyleSheetName()
   {
     return null;
@@ -48,6 +49,7 @@
     return "!!!No Skin[" + key + "]!!!";
   }
   
+  @Override
   protected String getBundleName()
   {
     return null;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinSelectorPropertiesNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinSelectorPropertiesNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinSelectorPropertiesNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinSelectorPropertiesNode.java Sun Aug  6 16:12:37 2006
@@ -18,6 +18,8 @@
 
 import java.util.List;
 
+import org.apache.myfaces.trinidadinternal.style.xml.parse.PropertyNode;
+
 /**
  * Stores each selector and its properties that
  * was found in the css file. This is similar to StyleNode
@@ -35,7 +37,7 @@
 
     SkinSelectorPropertiesNode(
       String selectorName,
-      List   propertyNodes
+      List<PropertyNode> propertyNodes
       )
     {
       _selectorName  = selectorName;
@@ -46,12 +48,12 @@
     {
       return _selectorName;
     }
-    public List getPropertyNodes()
+    public List<PropertyNode> getPropertyNodes()
     {
       return _propertyNodes;
     }
   
     private String _selectorName;
-    private List   _propertyNodes;
+    private List<PropertyNode> _propertyNodes;
 
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java Sun Aug  6 16:12:37 2006
@@ -66,17 +66,17 @@
 
     // Create the key object that we use to look up our
     // shared SkinStyleProvider instance
-    Object key = new ProviderKey(skin, 
-                                 targetDirectoryPath);
+    ProviderKey key = new ProviderKey(skin, 
+                                      targetDirectoryPath);
 
     // Get our cache of existing StyleProviders
-    Map providers = _getProviders();
+    Map<ProviderKey, StyleProvider> providers = _getProviders();
 
     StyleProvider provider = null;
 
     synchronized (providers)
     {
-      provider = (StyleProvider)providers.get(key);
+      provider = providers.get(key);
 
       if (provider == null)
       {
@@ -126,6 +126,7 @@
    * Merges the Skin's styles with custom styles to
    * produce a single StyleSheetDocument
    */
+  @Override
   protected StyleSheetDocument createStyleSheetDocument(
     StyleContext context
     )
@@ -155,6 +156,7 @@
    * Override of FileSystemStyleCache.hasSourceDocumentChanged()
    * which checks for changes to the Skin's style sheet.
    */
+  @Override
   protected boolean hasSourceDocumentChanged(StyleContext context)
   {
     if (super.hasSourceDocumentChanged(context))
@@ -173,6 +175,7 @@
   /**
    * Override of FileSystemStyleCache.getTargetStyleSheetName().
    */
+  @Override
   protected String getTargetStyleSheetName(
     StyleContext       context,
     StyleSheetDocument document
@@ -201,7 +204,7 @@
 
   // Returns a Map which hashes ProviderKeys to shared instances
   // of SkinStyleProviders.
-  private static Map _getProviders()
+  private static Map<ProviderKey, StyleProvider> _getProviders()
   {
     // =-=ags For now, we just use a global variable.  But 
     //        really, our cache should probably be hanging off
@@ -223,6 +226,7 @@
     }
 
     // Test for equality
+    @Override
     public boolean equals(Object o)
     {
       ProviderKey key = (ProviderKey)o;
@@ -232,6 +236,7 @@
     }
 
     // Produce the hash code
+    @Override
     public int hashCode()
     {
       int hashCode = _skin.hashCode();
@@ -263,5 +268,6 @@
   private StyleSheetDocument _skinDocument;
 
   // Cache of shared SkinStyleProvider instances
-  private static final Map _sSharedProviders = new HashMap(31);
+  private static final Map<ProviderKey, StyleProvider> _sSharedProviders = 
+    new HashMap<ProviderKey, StyleProvider>(31);
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java Sun Aug  6 16:12:37 2006
@@ -38,7 +38,7 @@
     
     SkinStyleSheetNode(
       List <SkinSelectorPropertiesNode> skinSelectorNodeList,
-      Map  namespaceMap,
+      Map<String, String> namespaceMap,
       int  direction,
       int[] agents
       )
@@ -51,7 +51,7 @@
     
   
   SkinStyleSheetNode(
-    Map  namespaceMap,
+    Map<String, String> namespaceMap,
     int  direction,
     int[] agents,
     int[] platforms
@@ -66,7 +66,10 @@
   public void add(SkinSelectorPropertiesNode node)
   {
     if (_skinSelectorNodeList == null)
-      _skinSelectorNodeList = new ArrayList();
+    {
+      _skinSelectorNodeList = new ArrayList<SkinSelectorPropertiesNode>();
+    }
+    
     _skinSelectorNodeList.add(node);
   } 
   
@@ -75,7 +78,7 @@
    * @return Map containing Strings keys/values of namespace prefix and 
    * namespaces specified in the style sheet.
    */
-    public Map getNamespaceMap()
+    public Map<String, String> getNamespaceMap()
     {
       return _namespaceMap;
     }
@@ -134,7 +137,7 @@
       return Arrays.equals(a1, a2); 
     }
     
-    private Map  _namespaceMap;
+    private Map<String, String> _namespaceMap;
     private List <SkinSelectorPropertiesNode> _skinSelectorNodeList;
     private int  _direction;  // reading direction
     private int[] _agents;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java Sun Aug  6 16:12:37 2006
@@ -24,7 +24,6 @@
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.faces.context.ExternalContext;
@@ -73,7 +72,7 @@
     ParseContext  context,
     NameResolver  resolver,
     String        sourceName,
-    Class         expectedType) throws IOException
+    Class<?>      expectedType) throws IOException
   {
 
     if (expectedType == null)
@@ -182,9 +181,9 @@
     // styleNodeList. Also, build one iconNodeList and one skinPropertyNodeList.
     
     // initialize
-    List <IconNode> iconNodeList = new ArrayList();
-    List skinPropertyNodeList = new ArrayList();
-    List <StyleSheetNode> ssNodeList = new ArrayList();
+    List<IconNode> iconNodeList = new ArrayList<IconNode>();
+    List<SkinPropertyNode> skinPropertyNodeList = new ArrayList<SkinPropertyNode>();
+    List<StyleSheetNode> ssNodeList = new ArrayList<StyleSheetNode>();
     
     for (SkinStyleSheetNode skinSSNode : skinSSNodeList) 
     {
@@ -195,13 +194,13 @@
       //Map namespaceMap = styleSheetNode.getNamespaceMap();
      
       // initialize
-      List <StyleNode> styleNodeList = new ArrayList();
+      List <StyleNode> styleNodeList = new ArrayList<StyleNode>();
   
       for (SkinSelectorPropertiesNode cssSelector : selectorNodeList) 
       {
 
         String selectorName = cssSelector.getSelectorName();
-        List propertyList = cssSelector.getPropertyNodes();
+        List<PropertyNode> propertyList = cssSelector.getPropertyNodes();
         int direction     = skinSSNode.getDirection();
   
         ResolvedSkinProperties resolvedProperties =
@@ -212,7 +211,8 @@
   
         skinPropertyNodeList.addAll(resolvedProperties.getSkinPropertyNodeList());
   
-        List noOraPropertyList = resolvedProperties.getNoOraPropertyList();
+        List<PropertyNode> noOraPropertyList = 
+          resolvedProperties.getNoOraPropertyList();
   
         // =-=jmw There is no good way to tell if this is an icon.
         // for now, I look at the selector name.
@@ -310,14 +310,16 @@
    */
   private static ResolvedSkinProperties _resolveProperties(
     String selectorName,
-    List   propertyNodeList,
+    List<PropertyNode> propertyNodeList,
     String baseURI,
     String sourceName)
   {
 
-    List   noOraPropertyList = new ArrayList();
-    List   oraRuleRefList = new ArrayList();
-    List   skinPropertyNodeList = new ArrayList();
+    List<PropertyNode> noOraPropertyList = new ArrayList<PropertyNode>();
+    List<String> oraRuleRefList = new ArrayList<String>();
+    List<SkinPropertyNode> skinPropertyNodeList = 
+      new ArrayList<SkinPropertyNode>();
+    
     boolean oraTextAntialias = false;
 
     // loop through each property in the propertyList
@@ -328,11 +330,8 @@
     // skinPropertyNodeList (all other properties that start with -ora-)
     // These properties are all stored in th ResolvedSkinProperties inner class.
 
-    Iterator propertyIter = propertyNodeList.listIterator();
-
-    while (propertyIter.hasNext())
+    for(PropertyNode propertyNode : propertyNodeList)
     {
-      PropertyNode propertyNode = (PropertyNode)propertyIter.next();
       String propertyName = propertyNode.getName();
       String propertyValue = propertyNode.getValue();
 
@@ -401,9 +400,9 @@
    * @param iconNodeList
    */
   private static void _addIconNode(
-    String  selectorName,
-    List    noOraPropertyNodeList,
-    List <IconNode>    iconNodeList)
+    String             selectorName,
+    List<PropertyNode> noOraPropertyNodeList,
+    List<IconNode>     iconNodeList)
   {
 
     // these are icon properties.
@@ -440,10 +439,8 @@
     // inline style
     CSSStyle inlineStyle = new CSSStyle();
 
-    Iterator propertyIter = noOraPropertyNodeList.listIterator();
-    while (propertyIter.hasNext())
+    for(PropertyNode propertyNode : noOraPropertyNodeList)
     {
-      PropertyNode propertyNode = (PropertyNode)propertyIter.next();
       String propertyName = propertyNode.getName();
       String propertyValue = propertyNode.getValue();
       if (propertyName.equals("width"))
@@ -546,11 +543,11 @@
    * @param styleNodeList
    */
   private static void _addStyleNode(
-    String  selectorName,
-    List    propertyNodeList,
-    List    oraRuleRefList,
-    boolean oraTextAntialias,
-    List    <StyleNode> styleNodeList)
+    String             selectorName,
+    List<PropertyNode> propertyNodeList,
+    List<String>       oraRuleRefList,
+    boolean            oraTextAntialias,
+    List<StyleNode>    styleNodeList)
   {
 
     // these are the styles.
@@ -577,21 +574,16 @@
     }
     // convert to a PropertyNode[], because StyleNode takes this type.
     PropertyNode[] propertyArray =
-      (PropertyNode[])(propertyNodeList.toArray(
-                        new PropertyNode[propertyNodeList.size()]));
+      propertyNodeList.toArray(new PropertyNode[propertyNodeList.size()]);
 
     // if the oraRuleRefList is not empty, create IncludeStyleNodes.
     int length = oraRuleRefList.size();
-    List <IncludeStyleNode> includeStyleNodes = new ArrayList();
+    List<IncludeStyleNode> includeStyleNodes = new ArrayList<IncludeStyleNode>();
 
     if (length > 0)
     {
-      Iterator oraRuleRefIter = oraRuleRefList.listIterator();
-
-      while (oraRuleRefIter.hasNext())
+      for(String value : oraRuleRefList)
       {
-        String value = (String)oraRuleRefIter.next();
-
         // parse the value, which will be of this form:
         // -ora-rule-ref: selector(".AFBaseFont:alias") selector(".Foo")
         // where you have more than one selector in an -ora-rule-ref definition
@@ -632,8 +624,7 @@
       // selector(".AFBaseFont:alias")
       // if it ends with :alias, it is a namedstyle.
 
-
-      List <String> selectors = new ArrayList();
+      List<String> selectors = new ArrayList<String>();
       String[] test = value.split("selector\\(");
       for (int i=0; i < test.length; i++)
       {
@@ -651,7 +642,7 @@
 
       for (int i=0; i < size; i++)
       {
-        String includeStyle = (String)selectors.get(i);
+        String includeStyle = selectors.get(i);
         // if it has :alias at the end it is a named style
         if (includeStyle.endsWith(":alias"))
         {
@@ -897,9 +888,9 @@
 
 
     ResolvedSkinProperties(
-      List noOraPropertyList,
-      List oraRuleRefList,
-      List skinPropertyNodeList,
+      List<PropertyNode> noOraPropertyList,
+      List<String> oraRuleRefList,
+      List<SkinPropertyNode> skinPropertyNodeList,
       boolean oraTextAntialias)
     {
       _noOraPropertyList = noOraPropertyList;
@@ -908,17 +899,17 @@
       _oraTextAntialias = oraTextAntialias;
     }
 
-    public List getNoOraPropertyList()
+    public List<PropertyNode> getNoOraPropertyList()
     {
       return _noOraPropertyList;
     }
 
-    public List getOraRuleRefList()
+    public List<String> getOraRuleRefList()
     {
       return _oraRuleRefList;
     }
 
-    public List getSkinPropertyNodeList()
+    public List<SkinPropertyNode> getSkinPropertyNodeList()
     {
       return _skinPropertyNodeList;
     }
@@ -928,10 +919,10 @@
       return _oraTextAntialias;
     }
 
-    private List    _noOraPropertyList;
-    private List    _oraRuleRefList;
-    private List    _skinPropertyNodeList;
-    private boolean _oraTextAntialias;
+    private List<PropertyNode>     _noOraPropertyList;
+    private List<String>           _oraRuleRefList;
+    private List<SkinPropertyNode> _skinPropertyNodeList;
+    private boolean                _oraTextAntialias;
   }
 
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java Sun Aug  6 16:12:37 2006
@@ -270,7 +270,7 @@
   // Registers a ParserFactory for the LAF namespace
   static private void _registerFactory(
     ParserManager manager,
-    Class expectedType,
+    Class<?> expectedType,
     String baseName
     )
   {



Mime
View raw message