incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r488791 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
Date Tue, 19 Dec 2006 20:04:05 GMT
Author: awiner
Date: Tue Dec 19 12:04:05 2006
New Revision: 488791

URL: http://svn.apache.org/viewvc?view=rev&rev=488791
Log:
ADFFACES-335: generated css file has errors as a result of empty styleclass removal optimization

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java

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?view=diff&rev=488791&r1=488790&r2=488791
==============================================================================
--- 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
Tue Dec 19 12:04:05 2006
@@ -896,6 +896,8 @@
     assert (styleSheets != null);
 
     Set<String> emptySelectors = new HashSet<String>();
+    Set<String> nonEmptySelectors = new HashSet<String>(512);
+
     while (styleSheets.hasNext())
     {
       StyleSheetNode styleSheet = styleSheets.next();
@@ -920,7 +922,7 @@
             if (style.isEmpty())
               emptySelectors.add(styleClass);
             else
-              emptySelectors.remove(styleClass);
+              nonEmptySelectors.add(styleClass);
           }
           else
           {
@@ -937,7 +939,7 @@
                   map.put(styleClass, _getShortStyleClass(map.size()));
                 
                 // Don't remove any styleclass that is referred to
-                emptySelectors.remove(styleClass);
+                nonEmptySelectors.add(styleClass);
               }
             }
             
@@ -965,7 +967,7 @@
                   }
                   else
                   {
-                    emptySelectors.remove(styleClass);
+                    nonEmptySelectors.add(styleClass);
                   }
                   
                   isFirst = false;
@@ -973,11 +975,11 @@
               }
             }
           }
-
-
         }
       }
     }
+
+    emptySelectors.removeAll(nonEmptySelectors);
 
     // Replace all empty keys with an empty string as the selector
     for (String emptyKey : emptySelectors)



Mime
View raw message