jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1294523 - in /jmeter/trunk: src/core/org/apache/jmeter/util/JMeterUtils.java xdocs/changes.xml
Date Tue, 28 Feb 2012 08:27:33 GMT
Author: pmouawad
Date: Tue Feb 28 08:27:33 2012
New Revision: 1294523

URL: http://svn.apache.org/viewvc?rev=1294523&view=rev
Log:
Bug 52783 - oro.patterncache.size property never used due to early init

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1294523&r1=1294522&r2=1294523&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Tue Feb 28 08:27:33 2012
@@ -67,10 +67,12 @@ import org.xml.sax.XMLReader;
  */
 public class JMeterUtils implements UnitTestManager {
     private static final Logger log = LoggingManager.getLoggerForClass();
-
-    private static final PatternCacheLRU patternCache = new PatternCacheLRU(
-            getPropDefault("oro.patterncache.size",1000), // $NON-NLS-1$
-            new Perl5Compiler());
+    
+    private static class LazyPatternCacheHolder {
+        public static final PatternCacheLRU INSTANCE = new PatternCacheLRU(
+                getPropDefault("oro.patterncache.size",1000), // $NON-NLS-1$
+                new Perl5Compiler());
+    }
 
     private static final String EXPERT_MODE_PROPERTY = "jmeter.expertMode"; // $NON-NLS-1$
     
@@ -247,7 +249,7 @@ public class JMeterUtils implements Unit
     }
 
     public static PatternCacheLRU getPatternCache() {
-        return patternCache;
+        return LazyPatternCacheHolder.INSTANCE;
     }
 
     /**
@@ -276,7 +278,7 @@ public class JMeterUtils implements Unit
      *
      */
     public static Pattern getPattern(String expression, int options){
-        return patternCache.getPattern(expression, options);
+        return LazyPatternCacheHolder.INSTANCE.getPattern(expression, options);
     }
 
     public void initializeProperties(String file) {
@@ -838,7 +840,7 @@ public class JMeterUtils implements Unit
         }
         return ans;
     }
-
+    
     /**
      * Get the value of a JMeter property.
      *

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1294523&r1=1294522&r2=1294523&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Feb 28 08:27:33 2012
@@ -109,6 +109,7 @@ When doing replacement of User Defined V
 <li>Bug 52728 - CSV Data Set Config element cannot coexist with BSF Sampler in same
Thread Plan</li>
 <li>Bug 52762 - Problem with multiples certificates: first index not used until indexes
are restarted</li>
 <li>Bug 52741 - TestBeanGUI default values do not work at second time or later</li>
+<li>Bug 52783 - oro.patterncache.size property never used due to early init</li>
 </ul>
 
 <!-- =================== Improvements =================== -->



Mime
View raw message