click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From med...@apache.org
Subject svn commit: r1384775 - /click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java
Date Fri, 14 Sep 2012 13:38:06 GMT
Author: medgar
Date: Fri Sep 14 13:38:06 2012
New Revision: 1384775

URL: http://svn.apache.org/viewvc?rev=1384775&view=rev
Log:
improve handling of empty paths

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java?rev=1384775&r1=1384774&r2=1384775&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/filter/PerformanceFilter.java Fri
Sep 14 13:38:06 2012
@@ -495,10 +495,16 @@ public class PerformanceFilter implement
                 String path = paths[i].trim();
 
                 if (path.endsWith("*")) {
-                    includeDirs.add(path.substring(0, path.length() - 1));
+                    String value = path.substring(0, path.length() - 1);
+                    if (!includeDirs.contains(value)) {
+                        includeDirs.add(value);
+                    }
 
                 } else if (path.startsWith("*")) {
-                    includeFiles.add(path.substring(1));
+                    String value = path.substring(1);
+                    if (!includeFiles.contains(value)) {
+                        includeFiles.add(value);
+                    }
 
                 } else {
                     String message = "cacheable-path '" + path + "' ignored, "
@@ -517,10 +523,16 @@ public class PerformanceFilter implement
                 String path = paths[i].trim();
 
                 if (path.endsWith("*")) {
-                    includeDirs.add(path.substring(0, path.length() - 1));
+                    String value = path.substring(0, path.length() - 1);
+                    if (!includeDirs.contains(value)) {
+                        includeDirs.add(value);
+                    }
 
                 } else if (path.startsWith("*")) {
-                    includeFiles.add(path.substring(1));
+                    String value = path.substring(1);
+                    if (!includeFiles.contains(value)) {
+                        includeFiles.add(value);
+                    }
 
                 } else {
                     String message = "cachable-path '" + path + "' ignored, "



Mime
View raw message