Revision: 17566
          http://sourceforge.net/p/gate/code/17566
Author:   johann_p
Date:     2014-03-06 15:05:48 +0000 (Thu, 06 Mar 2014)
Log Message:
-----------
precompile the pattern for matching variable names

Modified Paths:
--------------
    gate/trunk/src/main/gate/Utils.java

Modified: gate/trunk/src/main/gate/Utils.java
===================================================================
--- gate/trunk/src/main/gate/Utils.java 2014-03-06 14:59:10 UTC (rev 17565)
+++ gate/trunk/src/main/gate/Utils.java 2014-03-06 15:05:48 UTC (rev 17566)
@@ -1084,7 +1084,7 @@
   public static String replaceVariablesInString(
           String string, Object... sources)
   {
-    Matcher matcher = 
Pattern.compile("(\\$\\$?)([a-zA-Z]*)\\{([^}]+)\\}").matcher(string);
+    Matcher matcher = varnamePattern.matcher(string);
     int findFrom = 0;
     int lastEnd = 0;
     StringBuilder sb = new StringBuilder(string.length()*2);
@@ -1163,6 +1163,7 @@
     }
     return sb.toString();    
   }
+  static private Pattern varnamePattern = 
Pattern.compile("(\\$\\$?)([a-zA-Z]*)\\{([^}]+)\\}");
   
   
   

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to