Revision: 18584
          http://sourceforge.net/p/gate/code/18584
Author:   johann_p
Date:     2015-02-21 18:48:27 +0000 (Sat, 21 Feb 2015)
Log Message:
-----------
Prevent NPE, shortcut return.

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

Modified: gate/trunk/src/main/gate/Utils.java
===================================================================
--- gate/trunk/src/main/gate/Utils.java 2015-02-21 02:20:29 UTC (rev 18583)
+++ gate/trunk/src/main/gate/Utils.java 2015-02-21 18:48:27 UTC (rev 18584)
@@ -1085,6 +1085,9 @@
   public static String replaceVariablesInString(
           String string, Object... sources)
   {
+    // shortcut for strings where no replacement is possible (minimum content 
+    // would have to be $pr{x}
+    if(string == null || string.isEmpty() || string.length() < 6) { return 
string; }
     Matcher matcher = varnamePattern.matcher(string);
     int findFrom = 0;
     int lastEnd = 0;

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


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to