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 [12/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/skin/StyleSheetEntry.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java Sun Aug  6 16:12:37 2006
@@ -100,8 +100,8 @@
   StyleSheetEntry(
     String                 styleSheetName,
     StyleSheetDocument     document,
-    List <IconNode>        icons,
-    List <SkinPropertyNode> skinProperties
+    List<IconNode>         icons,
+    List<SkinPropertyNode> skinProperties
 
     )
   {
@@ -312,11 +312,11 @@
   private static class CheckModifiedEntry extends StyleSheetEntry
   {
     public CheckModifiedEntry(
-      String             styleSheetName,
-      StyleSheetDocument document,
-      List               icons,
-      List               properties,
-      NameResolver       resolver
+      String                 styleSheetName,
+      StyleSheetDocument     document,
+      List<IconNode>         icons,
+      List<SkinPropertyNode> properties,
+      NameResolver           resolver
       )
     {
       super(styleSheetName, document, icons, properties);
@@ -329,6 +329,7 @@
     // Override of checkModified() which uses the
     // InputStreamProvider to check for changes to the
     // style sheet source files.
+    @Override
     public boolean checkModified(StyleContext context)
     {
       // We would synchronize here, but at the moment synchronization

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java Sun Aug  6 16:12:37 2006
@@ -277,6 +277,7 @@
       super(url);
     }
 
+    @Override
     public boolean hasSourceChanged()
     {
       return false;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/BaseImageIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/BaseImageIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/BaseImageIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/BaseImageIcon.java Sun Aug  6 16:12:37 2006
@@ -79,6 +79,7 @@
   /**
    * Implementation of ImageIcon.getImageURI().
    */
+  @Override
   public Object getImageURI(
     FacesContext        context,
     RenderingContext arc)
@@ -101,6 +102,7 @@
   /**
    * Implementation of Icon.getImageWidth().
    */
+  @Override
   public Integer getImageWidth(RenderingContext arc)
   {
     return _width;
@@ -109,6 +111,7 @@
   /**
    * Implementation of Icon.getImageHeight().
    */
+  @Override
   public Integer getImageHeight(RenderingContext arc)
   {
     return _height;
@@ -117,10 +120,11 @@
   /**
    * Implementation of Icon.renderIcon().
    */
+  @Override
   public void renderIcon(
     FacesContext        context,
-    RenderingContext arc,
-    Map              attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     ) throws IOException
   {
     ResponseWriter writer = context.getResponseWriter();
@@ -250,7 +254,7 @@
 
   // Returns the alt text for the image
   private Object _getAltText(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     if (attrs == null)
@@ -261,7 +265,7 @@
 
   // Returns the ID for the image
   private Object _getId(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     if (attrs == null)
@@ -272,8 +276,8 @@
 
   // Returns the width of the icon
   private Object _getWidth(
-    RenderingContext arc,
-    Map                 attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     )
   {
     Object width = null;
@@ -293,7 +297,7 @@
   // Returns the height of the icon
   private Object _getHeight(
     RenderingContext arc,
-    Map                 attrs
+    Map<String, Object> attrs
     )
   {
     Object height = null;
@@ -313,7 +317,7 @@
   // Write out the vertical alignment
   private void  _writeVerticalAlignment(
     ResponseWriter   writer,
-    Map              attrs
+    Map<String, Object> attrs
     ) throws IOException
   {
     if (attrs != null)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ContextImageIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ContextImageIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ContextImageIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ContextImageIcon.java Sun Aug  6 16:12:37 2006
@@ -110,6 +110,7 @@
   /**
    * Override of Icon.getImageIcon().
    */
+  @Override
   public InputStreamProvider getImageData(
     FacesContext        context,
     RenderingContext arc
@@ -138,6 +139,7 @@
    * RenderingContext. context.getProperty(MARLIN_NAMESPACE, 
    * _TERMINATED_CONTEXT_URI_PROPERTY)
    */
+  @Override
   protected String getBaseURI(
   FacesContext        context,
   RenderingContext arc)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/Icon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/Icon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/Icon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/Icon.java Sun Aug  6 16:12:37 2006
@@ -65,8 +65,8 @@
    */
   abstract public void renderIcon(
     FacesContext        context,
-    RenderingContext arc,
-    Map              attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     ) throws IOException;
 
   /**

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/NullIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/NullIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/NullIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/NullIcon.java Sun Aug  6 16:12:37 2006
@@ -30,15 +30,17 @@
     return _ICON;
   }
 
+  @Override
   public void renderIcon(
     FacesContext        context,
-    RenderingContext arc,
-    Map              attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     )
   {
     // null icons don't render anything
   }
 
+  @Override
   public boolean isNull()
   {
     return true;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ReferenceIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ReferenceIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ReferenceIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/ReferenceIcon.java Sun Aug  6 16:12:37 2006
@@ -38,10 +38,11 @@
     _name = name;
   }
   
+  @Override
   public void renderIcon(
     FacesContext        context,
-    RenderingContext arc,
-    Map              attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     ) throws IOException
   {
     // do nothing.

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/TextIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/TextIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/TextIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/TextIcon.java Sun Aug  6 16:12:37 2006
@@ -82,10 +82,11 @@
    *             Icon.EMBEDDED_KEY. It does not render SHORT_DESC_KEY if it
    *             is null or "", because there is no point to this for TextIcons.
    */
+  @Override
   public void renderIcon(
     FacesContext        context,
-    RenderingContext arc,
-    Map              attrs
+    RenderingContext    arc,
+    Map<String, Object> attrs
     ) throws IOException
   {
     // See if we have an id
@@ -245,7 +246,7 @@
 
   // Returns the inlineStyle for the icon
   private Object _getInlineStyle(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     assert (attrs != null);
@@ -255,7 +256,7 @@
 
   // Returns the styleClasses for the icon
   private Object _getStyles(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     assert (attrs != null);
@@ -265,7 +266,7 @@
 
   // Returns the title text for the icon
   private Object _getTitle(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     assert (attrs != null);
@@ -274,7 +275,7 @@
   }
 
   private boolean _isEmbedded(
-    Map              attrs
+    Map<String, Object> attrs
     )
   {
     assert (attrs != null);

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/URIImageIcon.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/URIImageIcon.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/URIImageIcon.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/icon/URIImageIcon.java Sun Aug  6 16:12:37 2006
@@ -98,8 +98,9 @@
    * The base URI for URIImageIcon is always null,
    * as a full URI has already been provided.
    */
+  @Override
   protected String getBaseURI(
-    FacesContext        context,
+    FacesContext     context,
     RenderingContext arc)
   {
     return null;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/BaseStyle.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/BaseStyle.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/BaseStyle.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/BaseStyle.java Sun Aug  6 16:12:37 2006
@@ -43,25 +43,23 @@
    * @param properties The properties of this style.  The
    *   values must be Strings.
    */
-  public BaseStyle(Map properties)
+  public BaseStyle(Map<String, String> properties)
   {
     if ((properties != null) && (properties.size() > 0))
     {
       // Initialize the properties array
       int length = properties.size() * 2;
-      _properties = new Object[length];
+      _properties = new String[length];
 
-      Iterator keys = properties.keySet().iterator();
       int i = 0;
-      while (keys.hasNext())
+      for(Map.Entry<String, String> entry : properties.entrySet())
       {
-        Object key = keys.next();
-        Object value = properties.get(key);
+        String key   = entry.getKey();
+        String value = entry.getValue();
 
-        assert (key instanceof String);
-        assert (value instanceof String);
-
-        _properties[i*2] = ((String)key).toLowerCase();
+        // -= Simon Lessard =-
+        // FIXME: If key is ever null, NullPointerException will occurs
+        _properties[i*2]   = key.toLowerCase();
         _properties[i*2+1] = value;
         i++;
       }
@@ -73,13 +71,12 @@
    */
   public BaseStyle(Style style)
   {
-
     if ( style != null)
     {
 
       // First, loop through to get the property count
       int propertyCount = 0;
-      Iterator e = style.getPropertyNames();
+      Iterator<Object> e = style.getPropertyNames();
       while (e.hasNext())
       {
         e.next();
@@ -94,7 +91,7 @@
 
       // Now, loop through to initialize the properties
       int i = 0;
-      Iterator names = style.getPropertyNames();
+      Iterator<Object> names = style.getPropertyNames();
       while (names.hasNext())
       {
         String name = (String)names.next();
@@ -115,7 +112,7 @@
    * <p>
    * The property names can be any valid property name.
    */
-  public Iterator getPropertyNames()
+  public Iterator<Object> getPropertyNames()
   {
     return ArrayMap.getKeys(_properties);
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/CSSStyle.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/CSSStyle.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/CSSStyle.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/CSSStyle.java Sun Aug  6 16:12:37 2006
@@ -45,7 +45,7 @@
    * @param properties The properties of this style.  The
    *   values must be Strings.
    */
-  public CSSStyle(Map properties)
+  public CSSStyle(Map<String, String> properties)
   {
     super(properties);
   }
@@ -64,6 +64,7 @@
    * Converts the style to a String suitable for use as an inline style
    * attribute value.
    */
+  @Override
   public String toInlineString()
   {
     String inline = _inline;
@@ -71,7 +72,7 @@
     if (inline != null)
       return inline;
 
-    Iterator e = getPropertyNames();
+    Iterator<Object> e = getPropertyNames();
     StringBuffer buffer = new StringBuffer(_DEFAULT_BUFFER_SIZE);
     boolean first = true;
 
@@ -106,6 +107,7 @@
   /**
    * Sets the specified property value.
    */
+  @Override
   public void setProperty(String name, String value)
   {
     super.setProperty(name, value);
@@ -120,6 +122,7 @@
   /**
    * Parses the property for the specified key.
    */
+  @Override
   protected Object parseProperty(Object key)
     throws PropertyParseException
   {
@@ -165,6 +168,7 @@
     return value;
   }
 
+  @Override
   public String toString()
   {
     return "CSSStyle[css=" + toInlineString() + "]"; 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/Style.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/Style.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/Style.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/Style.java Sun Aug  6 16:12:37 2006
@@ -117,7 +117,11 @@
   /**
    * Returns the names of the properties defined by this style.
    */
-  public Iterator getPropertyNames();
+  // -= Simon Lessard =-
+  // FIXME: This should be changed to <String> once the issues 
+  //        with ArrayMap are fixed. ATM (2006-08-04) ArrayMap 
+  //        have huge problem working with anything but Object
+  public Iterator<Object> getPropertyNames();
 
   /**
    * Returns the value of the property with the specified name.

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/UserStyleSheet.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/UserStyleSheet.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/UserStyleSheet.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/UserStyleSheet.java Sun Aug  6 16:12:37 2006
@@ -53,9 +53,9 @@
    * @param namedStyles A Map or names Style objects, hashed by name
    */
   public UserStyleSheet(
-    String     id,
-    Map styles,
-    Map namedStyles
+    String             id,
+    Map<String, Style> styles,
+    Map<String, Style> namedStyles
     )
   {
     _init(id, styles, namedStyles);
@@ -86,14 +86,16 @@
     UserStyleSheet styleSheet2
     )
   {
-    Hashtable namedStyles = new Hashtable();
-    Hashtable styles = new Hashtable();
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is required
+    Hashtable<String, Style> namedStyles = new Hashtable<String, Style>();
+    Hashtable<String, Style> styles = new Hashtable<String, Style>();
 
     // First, put all of the styles from style sheet 2 into our hash tables
     if (styleSheet2 != null)
     {
       // First, do the named styles
-      Iterator e = styleSheet2.getNames();
+      Iterator<Object> e = styleSheet2.getNames();
       if (e != null)
       {
         while (e.hasNext())
@@ -121,7 +123,7 @@
     if (styleSheet1 != null)
     {
       // First merge the named styles
-      Iterator e = styleSheet1.getNames();
+      Iterator<Object> e = styleSheet1.getNames();
       if (e != null)
       {
         while (e.hasNext())
@@ -177,7 +179,7 @@
    * by calling getStyle().
    * @see #getStyle
    */
-  public Iterator getSelectors()
+  public Iterator<Object> getSelectors()
   {
     return ArrayMap.getKeys(_styles);
   }
@@ -189,7 +191,7 @@
    * by calling getNamedStyle().
    * @see #getNamedStyle
    */
-  public Iterator getNames()
+  public Iterator<Object> getNames()
   {
     return ArrayMap.getKeys(_namedStyles);
   }
@@ -213,6 +215,7 @@
   /**
    * Tests for equality.
    */
+  @Override
   public boolean equals(Object o)
   {
     if (!(o instanceof UserStyleSheet))
@@ -246,6 +249,7 @@
   /**
    * Returns the hash code.
    */
+  @Override
   public int hashCode()
   {
     return _hashCode;
@@ -256,7 +260,7 @@
   // resulting ArrayMap is actually sorted lexicographically by key.  This
   // is done to support fast comparisons between two UserStyleSheet
   // instances.
-  private Object[] _createSortedMap(Map styles)
+  private Object[] _createSortedMap(Map<String, Style> styles)
   {
     if ((styles == null) || (styles.size() == 0))
       return _EMPTY_MAP;
@@ -264,10 +268,10 @@
     // First, copy all of the style keys into an Array
     int i = 0;
     String keys[] = new String[styles.size()];
-    Iterator e = styles.keySet().iterator();
+    Iterator<String> e = styles.keySet().iterator();
 
     while (e.hasNext())
-      keys[i++] = (String)e.next();
+      keys[i++] = e.next();
 
     // Now, sort the array
     Arrays.sort(keys);
@@ -279,7 +283,7 @@
     for (i = 0; i < keys.length; i++)
     {
       String key = keys[i];
-      Style style = new SortedStyle((Style)styles.get(key));
+      Style style = new SortedStyle(styles.get(key));
       int index = i * 2;
       map[index] = key;
       map[index + 1] = style;
@@ -305,9 +309,9 @@
 
   // Initializes a new UserStyleSheet instance
   private void _init(
-    String     id,
-    Map styles,
-    Map namedStyles)
+    String             id,
+    Map<String, Style> styles,
+    Map<String, Style> namedStyles)
   {
     assert (id != null);
 
@@ -324,12 +328,12 @@
   // the properties of the two styles are merged, with the properties
   // of the new style taking precedence.
   private static void _mergeStyle(
-    Map styles,
-    String     id,
-    Style      style
+    Map<String, Style> styles,
+    String             id,
+    Style              style
     )
   {
-    Style oldStyle = (Style)styles.get(id);
+    Style oldStyle = styles.get(id);
     if (oldStyle == null)
     {
       styles.put(id, style);
@@ -338,10 +342,11 @@
 
     // If we already had a style with the same ID, merge the properties
     // from the two styles.
-    ArrayMap properties = new ArrayMap(10);
+    ArrayMap<String, String> properties = 
+      new ArrayMap<String, String>(10);
 
     // First, copy in properties from the old style
-    Iterator names = oldStyle.getPropertyNames();
+    Iterator<Object> names = oldStyle.getPropertyNames();
     while (names.hasNext())
     {
       String name = (String)names.next();
@@ -374,10 +379,12 @@
     public SortedStyle(Style style)
     {
       // First, copy the property names into an array
-      Vector v = new Vector();
-      Iterator e = style.getPropertyNames();
+      // -= Simon Lessard =- 
+      // TODO: Check if synchronization is truly required
+      Vector<String> v = new Vector<String>();
+      Iterator<Object> e = style.getPropertyNames();
       while (e.hasNext())
-        v.addElement(e.next());
+        v.addElement((String)e.next());
 
       String[] names = new String[v.size()];
       v.copyInto(names);
@@ -399,7 +406,7 @@
       _properties = properties;
     }
 
-    public Iterator getPropertyNames()
+    public Iterator<Object> getPropertyNames()
     {
       return ArrayMap.getKeys(_properties);
     }
@@ -423,6 +430,7 @@
       return null;
     }
 
+    @Override
     public int hashCode()
     {
       // Hashcode doesn't need to be very fast, as it is
@@ -437,6 +445,7 @@
       return hashCode;
     }
 
+    @Override
     public boolean equals(Object o)
     {
       SortedStyle style = (SortedStyle)o;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java Sun Aug  6 16:12:37 2006
@@ -78,6 +78,10 @@
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/cache/FileSystemStyleCache.java#0 $) $Date: 10-nov-2005.18:58:54 $
  * @author The Oracle ADF Faces Team
  */
+// -= Simon Lessard =- 
+// TODO: Synchronization does not seem to be needed since there's 
+//       synchronized blocks in the code, using HashMap hence 
+//       looks like a better choice than Hashtable.
 public class FileSystemStyleCache implements StyleProvider
 {
   /**
@@ -113,10 +117,10 @@
       throw new IllegalArgumentException("No target specified.");
 
     // First, get the key to use to look up the cache
-    Object key = _getSharedCacheKey(source, target);
+    String key = _getSharedCacheKey(source, target);
 
     // See if we've got a shared cache
-    StyleProvider cache = (StyleProvider)_sSharedCaches.get(key);
+    StyleProvider cache = _sSharedCaches.get(key);
 
     // If we didn't find a shared cache, create a new cache
     // and cache it in the shared cache cache.  :-)
@@ -130,7 +134,7 @@
       // _sSharedCaches.
       synchronized (_sSharedCaches)
       {
-        StyleProvider tmp = (StyleProvider)_sSharedCaches.get(key);
+        StyleProvider tmp = _sSharedCaches.get(key);
         if (tmp != null)
         {
           // Stick with tmp
@@ -244,7 +248,7 @@
    * @return A Map which maps the full style class names to
    *   the shorter equivalents.
    */
-  public Map getShortStyleClasses(StyleContext context)
+  public Map<String, String> getShortStyleClasses(StyleContext context)
   {
     return _shortStyleClassMap;
   }
@@ -352,10 +356,10 @@
   // And Entry contains the style sheet URI.
   private Entry _getEntry(StyleContext context)
   {
-    Hashtable cache = null;
-    Hashtable entryCache = null;
+    Hashtable<Key, Entry> cache = null;
+    Hashtable<Object, Entry> entryCache = null;
     StyleSheetDocument document = null;
-    Map shortStyleClassMap = null;
+    Map<String, String> shortStyleClassMap = null;
 
     boolean checkModified  = context.checkStylesModified();
 
@@ -394,9 +398,9 @@
       // synchronization.  Thus the somewhat ugly explicit references
       // to Hashtable everywhere.
       if (_cache == null)
-        _cache = new Hashtable();
+        _cache = new Hashtable<Key, Entry>();
       if (_entryCache == null)
-        _entryCache = new Hashtable(19);
+        _entryCache = new Hashtable<Object, Entry>(19);
 
       cache = _cache;
       entryCache = _entryCache;
@@ -437,11 +441,11 @@
 
   // Returns the cache entry with the specified key
   private Entry _getEntry(
-    Hashtable cache,
-    Key       key,
-    boolean   checkModified)
+    Hashtable<Key, Entry> cache,
+    Key                   key,
+    boolean               checkModified)
   {
-    Entry entry = (Entry)cache.get(key);
+    Entry entry = cache.get(key);
     if (entry == null)
       return null;
 
@@ -467,13 +471,13 @@
   // This generates a style sheet for the specific StyleContext
   // (locale, direction, etc), and puts that style sheet's uri in the Entry.
   private Entry _createEntry(
-    StyleContext       context,
-    StyleSheetDocument document,
-    Hashtable          cache,
-    Key                key,
-    Hashtable          entryCache,
-    Map                shortStyleClassMap,
-    boolean            checkModified
+    StyleContext             context,
+    StyleSheetDocument       document,
+    Hashtable<Key, Entry>    cache,
+    Key                      key,
+    Hashtable<Object, Entry> entryCache,
+    Map<String, String>      shortStyleClassMap,
+    boolean                  checkModified
     )
   {
     // Next, get the fully resolved styles for this context. This will be
@@ -506,16 +510,16 @@
 
   // Look in the entry cache for a compatible entry.
   private Entry _getCompatibleEntry(
-    StyleContext       context,
-    StyleSheetDocument document,
-    Hashtable          cache,
-    Key                key,
-    Hashtable          entryCache,
-    boolean            checkModified
+    StyleContext             context,
+    StyleSheetDocument       document,
+    Hashtable<Key, Entry>    cache,
+    Key                      key,
+    Hashtable<Object, Entry> entryCache,
+    boolean                  checkModified
     )
   {
     DerivationKey derivationKey = _getDerivationKey(context, document);
-    Entry entry = (Entry)entryCache.get(derivationKey);
+    Entry entry = entryCache.get(derivationKey);
     if (entry == null)
       return null;
 
@@ -549,8 +553,10 @@
   {
     // Entries with the same style sheet derivation are compatible.
     // Get the style sheet derivation list.
-    Iterator e = document.getStyleSheets(context);
-    Vector v = _copyIterator(e);
+    Iterator<StyleSheetNode> e = document.getStyleSheets(context);
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is truly required
+    Vector<StyleSheetNode> v = _copyIterator(e);
     StyleSheetNode[] styleSheets;
     if (v == null)
     {
@@ -600,7 +606,7 @@
     StyleSheetDocument document
     )
   {
-    Iterator e = document.getStyles(context);
+    Iterator<StyleNode> e = document.getStyles(context);
     if (e == null)
     {
       if (_LOG.isWarning())
@@ -608,7 +614,9 @@
       return null;
     }
 
-    Vector v = new Vector();
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is truly required
+    Vector<StyleNode> v = new Vector<StyleNode>();
     while (e.hasNext())
       v.addElement(e.next());
 
@@ -620,12 +628,12 @@
 
   // Generates the CSS file for the specified context and styles.
   // Returns the name of the generated CSS file.
-  private String       _createStyleSheetFile(
-    StyleContext       context,
-    StyleSheetDocument document,
-    StyleNode[]        styles,
-    Map                shortStyleClassMap,
-    boolean            checkModified)
+  private String        _createStyleSheetFile(
+    StyleContext        context,
+    StyleSheetDocument  document,
+    StyleNode[]         styles,
+    Map<String, String> shortStyleClassMap,
+    boolean             checkModified)
   {
     // Get a name for the new style sheet
     File outputFile = _getOutputFile(context, document);
@@ -804,7 +812,7 @@
           // so we use a smaller hash table.  Also, always enable
           // modification checking.
           resolver = new CachingNameResolver(resolver,
-                                             new Hashtable(17),
+                                             new Hashtable<Object, InputStreamProvider>(17),
                                              true);
         }
 
@@ -814,12 +822,12 @@
   }
 
   // Copies an enumeration into a Vector
-  private Vector _copyIterator(Iterator e)
+  private <T> Vector<T> _copyIterator(Iterator<T> e)
   {
     if (e == null)
       return null;
 
-    Vector v = new Vector();
+    Vector<T> v = new Vector<T>();
     while (e.hasNext())
       v.addElement(e.next());
 
@@ -828,7 +836,7 @@
 
   // Return a key which we can use to look up the cache with
   // the specifeid properties
-  private static Object _getSharedCacheKey(String source, String target)
+  private static String _getSharedCacheKey(String source, String target)
   {
     // Make sure we used canonical paths when looking up the cache.
     // Otherwise, slight difference in how the paths are specified might
@@ -842,26 +850,26 @@
   }
 
   // Create the map of full style classes to short style classes
-  private static Map _getShortStyleClassMap(
+  private static Map<String, String> _getShortStyleClassMap(
     StyleContext       context,
     StyleSheetDocument document)
   {
     // Use a HashMap to avoid unnecessary synchronization of Hashtable
-    HashMap map = new HashMap();
+    Map<String, String> map = new HashMap<String, String>();
 
     assert (document != null);
 
-    Iterator styleSheets = document.getStyleSheets(context);
+    Iterator<StyleSheetNode> styleSheets = document.getStyleSheets(context);
     assert (styleSheets != null);
 
     while (styleSheets.hasNext())
     {
-      StyleSheetNode styleSheet = (StyleSheetNode)styleSheets.next();
-      Iterator styles = styleSheet.getStyles();
+      StyleSheetNode styleSheet = styleSheets.next();
+      Iterator<StyleNode> styles = styleSheet.getStyles();
       assert (styles != null);
       while (styles.hasNext())
       {
-        StyleNode style = (StyleNode)styles.next();
+        StyleNode style = styles.next();
         String selector = style.getSelector();
 
         if (selector != null)
@@ -879,12 +887,14 @@
           }
           else
           {
-            Iterator styleClasses = CSSGenerationUtils.getStyleClasses(selector);
+            Iterator<String> styleClasses = 
+              CSSGenerationUtils.getStyleClasses(selector);
+            
             if (styleClasses != null)
             {
               while (styleClasses.hasNext())
               {
-                String styleClass = (String)styleClasses.next();
+                String styleClass = styleClasses.next();
 
                 if (!map.containsKey(styleClass))
                   map.put(styleClass, _getShortStyleClass(map.size()));
@@ -894,7 +904,7 @@
 
           // now go through the selectors and get the list of af| selectors and
           // put those into the map
-          Iterator afSelectors =
+          Iterator<String> afSelectors =
             CSSGenerationUtils.getNamespacedSelectors(selector,
                                                       AF_STYLE_NAMESPACE,
                                                       _STYLE_KEY_MAP);
@@ -902,7 +912,7 @@
           {
             while (afSelectors.hasNext())
             {
-              String styleClass = (String)afSelectors.next();
+              String styleClass = afSelectors.next();
 
               if (!map.containsKey(styleClass))
                 map.put(styleClass, _getShortStyleClass(map.size()));
@@ -918,7 +928,7 @@
     // each time it is requested.
     // =-ags We could just clone the Map and wrap it in a Map
     //       if we want to allow clients to modify the Map.
-    return new ImmutableMapAdapter(map);
+    return new ImmutableMapAdapter<String, String>(map);
   }
 
   // Helper method used by _getShortStyleClassMap().  Returns a new
@@ -941,7 +951,7 @@
   //        add this as a generic utility method somewhere, but where?
   private static String _getCanonicalPath(String path)
   {
-    String canonicalPath = (String)_sCanonicalPaths.get(path);
+    String canonicalPath = _sCanonicalPaths.get(path);
     if (canonicalPath != null)
       return canonicalPath;
 
@@ -984,6 +994,7 @@
        true);
     }
 
+    @Override
     public int hashCode()
     {
       // We treat the UserStyleSheet specially.  We want to have one and
@@ -1007,6 +1018,7 @@
                userStyleSheetHashCode);
     }
 
+    @Override
     public boolean equals(Object o)
     {
       // As documented in our hashCode() implementation, we treat
@@ -1110,6 +1122,7 @@
       _short = true;
     }
 
+    @Override
     public boolean equals(Object o)
     {
       if (o == this)
@@ -1149,6 +1162,7 @@
       return true;
     }
 
+    @Override
     public int hashCode()
     {
       int hashCode = 0;
@@ -1212,11 +1226,11 @@
 
     // Do all of the real work
     private Style _getStyle(
-      StyleContext context,
-      Map   map,
-      String       id,
-      String       prefix,
-      boolean      isName
+      StyleContext       context,
+      Map<String, Style> map,
+      String             id,
+      String             prefix,
+      boolean            isName
       )
     {
       CSSStyle style = (CSSStyle)map.get(id);
@@ -1252,10 +1266,10 @@
       style = new CSSStyle();
 
       // Add in the properties for the style
-      Iterator e = styleNode.getProperties();
+      Iterator<PropertyNode> e = styleNode.getProperties();
       while (e.hasNext())
       {
-        PropertyNode property = (PropertyNode)e.next();
+        PropertyNode property = e.next();
         String name = property.getName();
         String value = property.getValue();
 
@@ -1267,70 +1281,81 @@
     }
 
     // Creates a map of the specified size
-    private Hashtable _createMap()
+    private Hashtable<String, Style> _createMap()
     {
-      return new Hashtable(19);
+      return new Hashtable<String, Style>(19);
     }
 
 
     // Our local Style maps
-    private Hashtable _selectorMap;
-    private Hashtable _classMap;
-    private Hashtable _nameMap;
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is truly needed
+    private Hashtable<String, Style> _selectorMap;
+    private Hashtable<String, Style> _classMap;
+    private Hashtable<String, Style> _nameMap;
   }
 
   // Wraps a Map in an immutable Map
-  private static class ImmutableMapAdapter extends HashMap
+  // -= Simon Lessard =-
+  // FIXME: WAHHHH! This is BAD... extending HashMap creates a
+  //        big array that will never be used... Furthermore,
+  //        Collections.unmodifiableMap does just that!!!
+  private static class ImmutableMapAdapter<K, V> extends HashMap<K, V>
   {
-    public ImmutableMapAdapter(Map map)
+    public ImmutableMapAdapter(Map<K, V> map)
     {
       _map = map;
     }
 
+    @Override
     public int size()
     {
       return _map.size();
     }
 
+    @Override
     public boolean isEmpty()
     {
       return _map.isEmpty();
     }
 
-    public Iterator keys()
+    public Iterator<K> keys()
     {
-      Set keys = _map.keySet();
+      Set<K> keys = _map.keySet();
       if (keys == null)
         return null;
 
       return keys.iterator();
     }
 
-    public Iterator elements()
+    public Iterator<V> elements()
     {
-      Collection values = _map.values();
+      Collection<V> values = _map.values();
       if (values == null)
         return null;
 
       return values.iterator();
     }
 
-    public Object get(Object key)
+    @Override
+    public V get(Object key)
     {
       return _map.get(key);
     }
 
-    public Object put(Object key, Object value)
+    @Override
+    public V put(K key, V value)
     {
       throw new IllegalArgumentException();
     }
 
-    public Object remove(Object key)
+    @Override
+    public V remove(Object key)
     {
       throw new IllegalArgumentException();
     }
 
-    private final Map _map;
+    private final Map<K, V> _map;
   }
 
 
@@ -1347,15 +1372,15 @@
   private StyleSheetDocument _document;
 
   // The cache of style sheet URIs
-  private Hashtable _cache;
+  private Hashtable<Key, Entry> _cache;
 
   // We cache Entry objects, hashed by DerivationKey (ie.
   // hashed based on the StyleSheetNode derivation list).
-  private Hashtable _entryCache;
+  private Hashtable<Object, Entry> _entryCache;
 
   // Map which maps from full style class names to
   // our compressed names.
-  private Map _shortStyleClassMap;
+  private Map<String, String> _shortStyleClassMap;
 
   // Constants
 
@@ -1368,14 +1393,15 @@
   // Table of shared FileSystemStyleCaches, hashed by path.
   // Note on table size: We don't expect to have very many instances
   // running in a single VM - table can be small.
-  private static final Hashtable _sSharedCaches = new Hashtable(19);
+  private static final Hashtable<String, StyleProvider> _sSharedCaches = 
+    new Hashtable<String, StyleProvider>(19);
 
   // Java name for UTF8 encoding
   private static String _UTF8_ENCODING = "UTF8";
 
   // Stub StyleSheetDocument instance
   private static final StyleSheetDocument _EMPTY_DOCUMENT =
-    new StyleSheetDocument(null, null);
+    new StyleSheetDocument(null, null, StyleSheetDocument.UNKNOWN_TIMESTAMP);
 
   // Style used to represent misses in the StyleMap.
   // Package private to allow access from nested StyleMapImpl class
@@ -1384,7 +1410,9 @@
   // Prefix to use for short style classes
   private static final String _SHORT_CLASS_PREFIX = "x";
 
-  private static final Hashtable _sCanonicalPaths = new Hashtable(19);
+  // -= Simon Lessard =- 
+  // TODO: Check if synchronization is truly needed
+  private static final Hashtable<String, String> _sCanonicalPaths = new Hashtable<String, String>(19);
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(FileSystemStyleCache.class);
 
 
@@ -1394,9 +1422,11 @@
   // names may. We write out the shortened version of the mapped
   // selector names to the css file.
   // jmw. @todo Need to find a better spot for this, like the skin?
-  private static final Map _STYLE_KEY_MAP = new HashMap();
+  private static final Map<String, String> _STYLE_KEY_MAP;
+  
   static
   {
+    _STYLE_KEY_MAP =  new HashMap<String, String>();
     // we don't use a styleClass on tr:body. Instead we use the html element
     // BODY to style it. This makes it easier for users to use an external
     // stylesheet and not have to know our styleClass names.

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java Sun Aug  6 16:12:37 2006
@@ -16,7 +16,6 @@
 
 package org.apache.myfaces.trinidadinternal.style.util;
 
-import java.awt.Color;
 import java.util.Date;
 import java.util.Map;
 import java.util.HashMap;
@@ -60,13 +59,13 @@
    *   to their base names (e.g., 'af|menuPath::step' maps to 'af|menuPath A')
    */
   public static void writeCSS(
-    StyleContext context,
-    StyleNode[]  styles,
-    PrintWriter  out,
-    File         outputFile,
-    Map          shortStyleClassMap,
-    String       selectorNamespace,
-    Map          afSelectorMap
+    StyleContext        context,
+    StyleNode[]         styles,
+    PrintWriter         out,
+    File                outputFile,
+    Map<String, String> shortStyleClassMap,
+    String              selectorNamespace,
+    Map<String, String> afSelectorMap
     )
   {
     // writeCSS() attempts to produce a minimal set of style rules
@@ -94,7 +93,8 @@
 
     // We track styles with matching properties in the following HashMap
     // which maps property strings to StyleNode[]s.
-    HashMap matchingStylesMap = new HashMap(101);
+    HashMap<String, StyleNode[]> matchingStylesMap = 
+      new HashMap<String, StyleNode[]>(101);
 
     // We also keep an array of the property strings that we generate
     // during this pass, since we need these strings during the second
@@ -112,8 +112,7 @@
         String propertyString = _getSortedPropertyString(style);
 
         // See if we already have a StyleNode with the same properties
-        StyleNode[] matchingStyles = (StyleNode[])matchingStylesMap.get(
-                                                    propertyString);
+        StyleNode[] matchingStyles = matchingStylesMap.get(propertyString);
 
         if (matchingStyles == null)
         {
@@ -130,7 +129,7 @@
           int length = matchingStyles.length;
 
           StyleNode[] newMatchingStyles = new StyleNode[length + 1];
-          System.arraycopy((StyleNode[])matchingStyles,
+          System.arraycopy(matchingStyles,
                            0,
                            newMatchingStyles,
                            0,
@@ -161,8 +160,7 @@
       if (propertyString != null)
       {
         // Get all of the styles which share this property string.
-        StyleNode[] matchingStyles = (StyleNode[])matchingStylesMap.get(
-                                                    propertyString);
+        StyleNode[] matchingStyles = matchingStylesMap.get(propertyString);
 
         // Actually, we should always have at least one StyleNode here
         assert (matchingStyles != null);
@@ -244,12 +242,12 @@
         // of the properties as specified in the XSS document.  So,
         // we get the properties from the StyleNode object instead of
         // using the propertyString
-        Iterator properties = style.getProperties();
+        Iterator<PropertyNode> properties = style.getProperties();
         boolean first = true;
 
         while (properties.hasNext())
         {
-          PropertyNode property = (PropertyNode)properties.next();
+          PropertyNode property = properties.next();
           String propName = property.getName();
           String propValue = property.getValue();
 
@@ -304,9 +302,9 @@
    * with ".OraNav1Enabled" and ".text".
    * .OraLink:visited returns .OraLink
    */
-  public static Iterator getStyleClasses(String selector)
+  public static Iterator<String> getStyleClasses(String selector)
   {
-    ArrayList styleClasses = null;
+    ArrayList<String> styleClasses = null;
     int styleClassStartIndex = -1;
     int length = selector.length();
 
@@ -344,7 +342,7 @@
         {
           String styleClass = selector.substring(styleClassStartIndex + 1, i);
           if (styleClasses == null)
-            styleClasses = new ArrayList(3);
+            styleClasses = new ArrayList<String>(3);
 
           styleClasses.add(styleClass);
 
@@ -373,10 +371,10 @@
    * e.g., "af|menuPath::step" maps to "af|menuPath A", so
    * ".OraNav1Enabled af|menuPath::step" returns "af|menuPath"
    */
-  public static Iterator getNamespacedSelectors(
-    String selector,
-    String namespace,
-    Map    afSelectorMap)
+  public static Iterator<String> getNamespacedSelectors(
+    String              selector,
+    String              namespace,
+    Map<String, String> afSelectorMap)
   {
     int afIndex = selector.indexOf(namespace);
 
@@ -384,7 +382,7 @@
     if ((selector == null) || (afIndex == -1))
       return null;
 
-    ArrayList afUnmappedSelectorList = new ArrayList();
+    ArrayList<String> afUnmappedSelectorList = new ArrayList<String>();
 
     // now find each af| component selector and map
     // e.g., af|menuPath::step maps to af|menuPath A
@@ -413,17 +411,17 @@
     // af|xxx component selectors. Now map them, and return the base key
     // in the selector.
     // loop through again and map them
-    ArrayList afSelectorList = new ArrayList();
+    ArrayList<String> afSelectorList = new ArrayList<String>();
 
     int size = afUnmappedSelectorList.size();
     for (int i=0; i < size; i++)
     {
-      String afComponentSelector = (String)afUnmappedSelectorList.get(i);
+      String afComponentSelector = afUnmappedSelectorList.get(i);
       String mappedSelector = null;
 
       if (afSelectorMap != null)
       {
-        mappedSelector = (String)afSelectorMap.get(afComponentSelector);
+        mappedSelector = afSelectorMap.get(afComponentSelector);
 
       }
       if (mappedSelector != null)
@@ -508,9 +506,9 @@
   // there is a short version. does not shorten styles that start with the
   // namespace
   private static String _getShortSelector(
-    String selector,
-    Map    shortStyleClassMap,
-    String selectorNamespace)
+    String              selector,
+    Map<String, String> shortStyleClassMap,
+    String              selectorNamespace)
   {
     if (shortStyleClassMap == null)
       return null;
@@ -521,8 +519,7 @@
     // selectors are "af|inputText" or ".AFFoo .AFBar" or ".foo:hover"
     if (isSingleStyleClassSelector(selector))
     {
-      String shortStyleClass = (String)shortStyleClassMap.get(
-                                         selector.substring(1));
+      String shortStyleClass = shortStyleClassMap.get(selector.substring(1));
 
       return (shortStyleClass == null) ? null : "." + shortStyleClass;
     }
@@ -574,7 +571,7 @@
           String shortStyleClass = null;
           // don't shorten the styles that start with the namespace
           if (!styleClass.startsWith(selectorNamespace))
-            shortStyleClass = (String)shortStyleClassMap.get(styleClass);
+            shortStyleClass = shortStyleClassMap.get(styleClass);
 
 
           if (shortStyleClass == null)
@@ -622,10 +619,10 @@
    * @return            the selector, mapped.
    */
   private static String _getMappedNSSelector (
-    Map     map,
-    String  namespace,
-    String  selector,
-    boolean shorten)
+    Map<String, String> map,
+    String              namespace,
+    String              selector,
+    boolean             shorten)
   {
     // break apart by spaces
     // map each piece; if namespace is not in the piece,
@@ -670,10 +667,10 @@
   }
 
   private static String _getEachMappedSelector(
-    Map     map,
-    String  namespace,
-    String  selector,
-    boolean shorten)
+    Map<String, String> map,
+    String              namespace,
+    String              selector,
+    boolean             shorten)
   {
     // break apart the selector into 3 parts:
     // main
@@ -775,7 +772,7 @@
       
     // now I have the pieces of the selector. I'll need to map each piece,
     // then piece back together.
-    String mappedMain = (String)map.get(pieces.getMain());
+    String mappedMain = map.get(pieces.getMain());
     if (mappedMain != null)
       buffer.append(mappedMain);
     else
@@ -784,7 +781,7 @@
     List <String> pseudoClasses = pieces.getPseudoClasses();
     for (String pseudoClass : pseudoClasses )
     {
-      String mappedPseudoClass = (String)map.get(pseudoClass);
+      String mappedPseudoClass = map.get(pseudoClass);
       if (mappedPseudoClass != null)
         buffer.append(mappedPseudoClass);
       else
@@ -947,8 +944,13 @@
   private static String _getSortedPropertyString(StyleNode style)
   {
     // First, pull the properties out of the StyleNode
-    Vector v = new Vector();
-    Iterator e = style.getProperties();
+    // -= Simon Lessard =- 
+    // TODO: Check if synchronization is needed, otherwise uses
+    //       an ArrayList instead. Even if synchronization is needed 
+    //       Collections.synchronizedList(ArrayList) would probably be
+    //       a better choice.
+    Vector<PropertyNode> v = new Vector<PropertyNode>();
+    Iterator<PropertyNode> e = style.getProperties();
     while (e.hasNext())
       v.addElement(e.next());
 
@@ -1037,17 +1039,17 @@
   }
   
   // Comparator that sorts PropertyNodes by name
-  private static class PropertyNodeComparator implements Comparator
+  private static class PropertyNodeComparator implements Comparator<PropertyNode>
   {
-    public static Comparator sharedInstance()
+    public static Comparator<PropertyNode> sharedInstance()
     {
       return _sInstance;
     }
 
-    public int compare(Object o1, Object o2)
+    public int compare(PropertyNode o1, PropertyNode o2)
     {
-      String name1 = (o1 == null) ? null : ((PropertyNode)o1).getName();
-      String name2 = (o2 == null) ? null : ((PropertyNode)o2).getName();
+      String name1 = (o1 == null) ? null : o1.getName();
+      String name2 = (o2 == null) ? null : o2.getName();
 
       if ((name1 == null) || (name2 == null) )
       {
@@ -1064,7 +1066,8 @@
 
     private PropertyNodeComparator() {}
 
-    private static final Comparator _sInstance = new PropertyNodeComparator();
+    private static final Comparator<PropertyNode> _sInstance = 
+      new PropertyNodeComparator();
   }
   
 }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSUtils.java Sun Aug  6 16:12:37 2006
@@ -215,7 +215,8 @@
     if ((value == null) || (value.length() == 0))
       return null;
 
-    Vector v = new Vector();
+    // TODO: -= Simon Lessard
+    Vector<String> v = new Vector<String>();
     StringTokenizer tokens = new StringTokenizer(value, ",\"");
     while (tokens.hasMoreTokens())
     {
@@ -549,7 +550,7 @@
 
   private static Color _getSharedColor(int rgb)
   {
-    Color sharedColor = (Color)_sColorCache.get(new Integer(rgb));
+    Color sharedColor = _sColorCache.get(new Integer(rgb));
 
     if (sharedColor == null)
     {
@@ -622,8 +623,8 @@
   // We keep a cache of shared Color instances, hashed by RGB value, so
   // that we don't end up with one Color instance for each color in each
   // cache key in the Tecate image cache.
-  private static final Map _sColorCache = 
-    Collections.synchronizedMap(new LRUCache(50));
+  private static final Map<Integer, Color> _sColorCache = 
+    Collections.synchronizedMap(new LRUCache<Integer, Color>(50));
 
   // CSS named color values
   private static final Object[] _NAMED_COLORS = new Object[]

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/FontProxy.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/FontProxy.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/FontProxy.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/FontProxy.java Sun Aug  6 16:12:37 2006
@@ -89,6 +89,7 @@
   /**
    * Tests for equality.
    */
+  @Override
   public boolean equals(Object o)
   {
     if (this == o)
@@ -112,11 +113,13 @@
   /**
    * Returns a hashcode for this FontProxy.
    */
+  @Override
   public int hashCode()
   {
     return _hashCode;
   }
 
+  @Override
   public String toString()
   {
     return 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/GraphicsUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/GraphicsUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/GraphicsUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/GraphicsUtils.java Sun Aug  6 16:12:37 2006
@@ -163,7 +163,7 @@
 
   // Called by FontLoader thread upon completion
   static void __setFontsLoaded(
-    Map names
+    Map<String, Boolean> names
     )
   {
     synchronized (GraphicsUtils.class)
@@ -178,7 +178,9 @@
         _LOG.warning(_FONT_FAILURE_MESSAGE);
 
         // If we didn't get any fonts, just use the built-in JAVA virutal fonts
-        ArrayMap defaultFonts = new ArrayMap(_DEFAULT_FONT_NAMES.length);
+        ArrayMap<String, Boolean> defaultFonts = 
+          new ArrayMap<String, Boolean>(_DEFAULT_FONT_NAMES.length);
+        
         for (int i = 0; i < _DEFAULT_FONT_NAMES.length; i++)
           defaultFonts.put(_DEFAULT_FONT_NAMES[i].toLowerCase(), Boolean.TRUE);
 
@@ -267,6 +269,10 @@
           else if ((current - start) > abortTimeout)
           {
             // Stop the graphics loader thread
+            // -= Simon Lessard =-
+            // FIXME: stop() is bad, especially with all that synchronized 
+            //        class used, it's deadlock prone, should stop it 
+            //        differently.
             if (_sGraphicsLoaderThread != null)
               _sGraphicsLoaderThread.stop();
 
@@ -347,7 +353,9 @@
     public void run()
     {
       GraphicsEnvironment ge = null;
-      Hashtable fontNames = null;
+      // -= Simon Lessard =-
+      // TODO: Check if synchronization is required
+      Hashtable<String, Boolean> fontNames = null;
 
       try
       {
@@ -359,7 +367,7 @@
 
           if ((families != null) && (families.length > 0))
           {
-            fontNames = new Hashtable(families.length);
+            fontNames = new Hashtable<String, Boolean>(families.length);
             for (int i = 0; i < families.length; i++)
             {
               String name = families[i].toLowerCase();
@@ -387,7 +395,7 @@
   private static boolean _sIsGraphical = false;
 
   // Map of valid font names
-  private static Map _sFontNames = null;
+  private static Map<String, Boolean> _sFontNames = null;
 
   // Have we loaded the graphical environment yet?
   private static boolean _sGraphicsLoaded = false;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java Sun Aug  6 16:12:37 2006
@@ -296,8 +296,10 @@
       StyleSheetDocument document)
   {
     // Copy the matching style sheets into an array
-    Iterator e = document.getStyleSheets(context);
-    Vector v = new Vector();
+    Iterator<StyleSheetNode> e = document.getStyleSheets(context);
+    // -= Simon Lessard =-
+    // TODO: Check if synchronization is truly required.
+    Vector<StyleSheetNode> v = new Vector<StyleSheetNode>();
     while (e.hasNext())
       v.addElement(e.next());
     StyleSheetNode[] styleSheets = new StyleSheetNode[v.size()];
@@ -512,10 +514,10 @@
 
     for (int i = 0; i < styleSheets.length; i++)
     {
-      Iterator e = styleSheets[i].getLocales();
+      Iterator<Locale> e = styleSheets[i].getLocales();
       while (e.hasNext())
       {
-        Locale tmpLocale = (Locale)e.next();
+        Locale tmpLocale = e.next();
 
         if (language.equals(tmpLocale.getLanguage()))
         {
@@ -631,7 +633,7 @@
   }
 
   // Tests whether the enumeration is empty.
-  private static final boolean _isIteratorEmpty(Iterator e)
+  private static final boolean _isIteratorEmpty(Iterator<?> e)
   {
     if (e == null)
       return true;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/StyleUtils.java Sun Aug  6 16:12:37 2006
@@ -60,7 +60,7 @@
    * @return A Map which maps the full style class names to
    *   the shorter equivalents.
    */
-  public static Map getShortStyleClasses(
+  public static Map<String, String> getShortStyleClasses(
     StyleContext  context,
     StyleProvider provider)
   {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java Sun Aug  6 16:12:37 2006
@@ -146,7 +146,8 @@
                                       document2.getDocumentTimestamp());
 
     // Now get the merged set of StyleSheetNodes
-    ArrayList styleSheetsList = new ArrayList();
+    List<StyleSheetNode> styleSheetsList = 
+      new ArrayList<StyleSheetNode>();
 
     _addStyleSheets(styleSheetsList, document1);
     _addStyleSheets(styleSheetsList, document2);
@@ -165,13 +166,13 @@
   // Adds the StyleSheetNodes from the specified StyleSheetDocument
   // into the List of StyleSheetNodes.
   private static void _addStyleSheets(
-    List               styleSheets,
-    StyleSheetDocument document
+    List<StyleSheetNode> styleSheets,
+    StyleSheetDocument   document
     )
   {
-    Iterator e = document.getStyleSheets();
+    Iterator<StyleSheetNode> e = document.getStyleSheets();
     while (e.hasNext())
-      styleSheets.add((StyleSheetNode)e.next());
+      styleSheets.add(e.next());
   }
 
   // Merges the StyleSheetDocument versions of two documents
@@ -223,7 +224,7 @@
 
   private static void _registerFactory(
     ParserManager manager,
-    Class expectedType,
+    Class<?> expectedType,
     String baseName
     )
   {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CSSStyleParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CSSStyleParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CSSStyleParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CSSStyleParser.java Sun Aug  6 16:12:37 2006
@@ -38,6 +38,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -50,6 +51,7 @@
   /**
    * Implementation of NodeParser.startChildElement()
    */
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -71,6 +73,7 @@
     return null;
   }
 
+  @Override
   public void endChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -88,6 +91,7 @@
     _propertyValue = null;
   }
 
+  @Override
   public void addText(
     ParseContext context,
     char[]       text,
@@ -106,7 +110,8 @@
   }
 
   // The properties that have already been parsed
-  private ArrayMap  _properties = new ArrayMap(1);
+  private ArrayMap<String, String> _properties = 
+    new ArrayMap<String, String>(1);
 
   // The name of the current property
   private String    _propertyName;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorNodeParser.java Sun Aug  6 16:12:37 2006
@@ -36,6 +36,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -49,6 +50,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -67,6 +69,7 @@
   /**
    * Implementation of NodeParser.addText()
    */
+  @Override
   public void addText(
     ParseContext context,
     char[]       text,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorPropertyNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorPropertyNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorPropertyNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorPropertyNode.java Sun Aug  6 16:12:37 2006
@@ -33,6 +33,7 @@
   }
 
   // Package-level accessor necessary to support deprecated color properties
+  @Override
   boolean __isColorProperty()
   {
     return true;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNode.java Sun Aug  6 16:12:37 2006
@@ -68,14 +68,17 @@
   /**
    * Returns an Iterator of ColorNodes contained by this ColorSchemeNode
    */
-  public Iterator getColors()
+  @SuppressWarnings("unchecked")
+  public Iterator<ColorNode> getColors()
   {
     if(_colors!=null)
     {
       return (Arrays.asList(_colors)).iterator();  
     }
     else
+    {
       return (Collections.EMPTY_LIST).iterator();
+    }
   }
 
   private String      _namespace;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/ColorSchemeNodeParser.java Sun Aug  6 16:12:37 2006
@@ -41,6 +41,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -57,6 +58,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -80,6 +82,7 @@
   /**
    * Implementation of NodeParser.startChildElement()
    */
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -96,6 +99,7 @@
   /**
    * Implementation of NodeParser.addCompletedChild().
    */
+  @Override
   public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -106,15 +110,17 @@
     if (child instanceof ColorNode)
     {
       if (_colors == null)
-        _colors = new Vector();
+        _colors = new Vector<ColorNode>();
 
-      _colors.addElement(child);
+      _colors.addElement((ColorNode)child);
     }
   }
 
   private String _namespace;
   private String _name;
-  private Vector _colors;
+  // -= Simon Lessard =-
+  // TODO: Check if synchronization is truly required.
+  private Vector<ColorNode> _colors;
 
   private static final String _DEPRECATED_ERROR =
     "The <colorScheme> element is deprecated.  Colors must be explicitly specified using <property> elements.";

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNode.java Sun Aug  6 16:12:37 2006
@@ -62,7 +62,8 @@
    * Returns an Iterator of values - which can be either Strings or
    * IncludePropertyNodes.
    */
-  public Iterator getValues()
+  @SuppressWarnings("unchecked")
+  public Iterator<Object> getValues()
   {
     if (_values!=null)
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/CompoundPropertyNodeParser.java Sun Aug  6 16:12:37 2006
@@ -43,6 +43,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -56,6 +57,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -78,6 +80,7 @@
   /**
    * Implementation of NodeParser.startChildElement()
    */
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -109,6 +112,7 @@
   /**
    * Implementation of NodeParser.addCompletedChild().
    */
+  @Override
   public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -148,7 +152,9 @@
   }
 
   private String  _name;
-  private Vector  _values = new Vector();
+  // -= Simon Lessard =-
+  // TODO: Check if synchronization is truly required.
+  private Vector<Object> _values = new Vector<Object>();
 
   private static final String _INCLUDE_PROPERTY_ERROR =
     "The use of the includeProperty element inside of a compoundProperty element is now deprecated.  Please use the includeValue element instead.";

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java Sun Aug  6 16:12:37 2006
@@ -38,6 +38,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public Object getNodeValue(
     ParseContext context,
     String       namespaceURI,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IntegerArrayEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IntegerArrayEnumeration.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IntegerArrayEnumeration.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IntegerArrayEnumeration.java Sun Aug  6 16:12:37 2006
@@ -28,7 +28,7 @@
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/IntegerArrayEnumeration.java#0 $) $Date: 10-nov-2005.18:58:09 $
  * @author The Oracle ADF Faces Team
  */
-class IntegerArrayEnumeration implements Enumeration
+class IntegerArrayEnumeration implements Enumeration<Integer>
 {
   /**
    * Creates an Enumeration for the specified array.
@@ -53,7 +53,7 @@
   /**
    * Implementation of Enumeration.nextElement().
    */
-  public Object nextElement()
+  public Integer nextElement()
   {
     return IntegerUtils.getInteger(_array[_index++]);
   }

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java Sun Aug  6 16:12:37 2006
@@ -42,6 +42,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -58,6 +59,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -87,6 +89,7 @@
   /**
    * Implementation of NodeParser.addText()
    */
+  @Override
   public void addText(
     ParseContext context,
     char[]       text,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java Sun Aug  6 16:12:37 2006
@@ -136,7 +136,8 @@
   /**
    * Implementation of StyleNode.getProperties().
    */
-  public Iterator getProperties()
+  @SuppressWarnings("unchecked")
+  public Iterator<PropertyNode> getProperties()
   {
   if (_properties == null) 
   {
@@ -149,7 +150,8 @@
   /**
    * Returns an Iterator containing Strings and IncludePropertyNodes.
    */
-  public Iterator getCompoundProperties()
+  @SuppressWarnings("unchecked")
+  public Iterator<CompoundPropertyNode> getCompoundProperties()
   {
     if (_compoundProperties == null) 
     {
@@ -162,7 +164,8 @@
   /**
    * Returns an Iterator of IncludeStyleNodes.
    */
-  public Iterator getIncludedStyles()
+  @SuppressWarnings("unchecked")
+  public Iterator<IncludeStyleNode> getIncludedStyles()
   {
     if (_includedStyles == null) 
     {
@@ -175,7 +178,8 @@
   /**
    * Returns an Iterator of IncludePropertyNodes.
    */
-  public Iterator getIncludedProperties()
+  @SuppressWarnings("unchecked")
+  public Iterator<IncludePropertyNode> getIncludedProperties()
   {
     if(_includedProperties == null) 
     {

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java?rev=429208&r1=429207&r2=429208&view=diff
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java Sun Aug  6 16:12:37 2006
@@ -43,6 +43,7 @@
   /**
    * Implementation of NodeParser.startElement()
    */
+  @Override
   public void startElement(
     ParseContext context,
     String       namespaceURI,
@@ -63,6 +64,7 @@
   /**
    * Implementation of NodeParser.endElement()
    */
+  @Override
   public Object endElement(
     ParseContext context,
     String       namespaceURI,
@@ -113,6 +115,7 @@
   /**
    * Implementation of NodeParser.startChildElement()
    */
+  @Override
   public NodeParser startChildElement(
     ParseContext context,
     String       namespaceURI,
@@ -151,7 +154,7 @@
       else
       {
         if (_includedStyles == null)
-          _includedStyles = new Vector();
+          _includedStyles = new Vector<IncludeStyleNode>();
 
         _includedStyles.addElement(new IncludeStyleNode(name, selector));
       }
@@ -167,6 +170,7 @@
   /**
    * Implementation of NodeParser.addCompletedChild().
    */
+  @Override
   public void addCompletedChild(
     ParseContext context,
     String       namespaceURI,
@@ -180,7 +184,7 @@
       if (child != null)
       {
         if (_properties == null)
-          _properties = new Vector();
+          _properties = new Vector<PropertyNode>();
 
         if (!(child instanceof PropertyNode))
         {
@@ -188,7 +192,7 @@
         }
 
         if (child instanceof PropertyNode)
-          _properties.addElement(child);
+          _properties.addElement((PropertyNode)child);
       }
     }
     else if (localName.equals(COMPOUND_PROPERTY_NAME))
@@ -201,9 +205,9 @@
       if (child instanceof CompoundPropertyNode)
       {
         if (_compoundProperties == null)
-          _compoundProperties = new Vector();
+          _compoundProperties = new Vector<CompoundPropertyNode>();
 
-        _compoundProperties.addElement(child);
+        _compoundProperties.addElement((CompoundPropertyNode)child);
       }
 
     }
@@ -217,9 +221,9 @@
       if (child instanceof IncludePropertyNode)
       {
         if (_includedProperties == null)
-          _includedProperties = new Vector();
+          _includedProperties = new Vector<IncludePropertyNode>();
 
-        _includedProperties.addElement(child);
+        _includedProperties.addElement((IncludePropertyNode)child);
       }
     }
   }
@@ -227,10 +231,12 @@
   private String  _name;
   private String  _selector;
   private boolean _resetProperties;
-  private Vector  _properties;
-  private Vector  _compoundProperties;
-  private Vector  _includedStyles;
-  private Vector  _includedProperties;
+  // -= Simon Lessard =-
+  // TODO: Check if synchronization is truly required
+  private Vector<PropertyNode>  _properties;
+  private Vector<CompoundPropertyNode>  _compoundProperties;
+  private Vector<IncludeStyleNode>  _includedStyles;
+  private Vector<IncludePropertyNode>  _includedProperties;
 
   // Error messages
   private static final String _INCLUDE_STYLE_ID_ERROR =



Mime
View raw message