svn commit: r585578 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r585578 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java

doogie-3
Author: doogie
Date: Wed Oct 17 10:12:17 2007
New Revision: 585578

URL: http://svn.apache.org/viewvc?rev=585578&view=rev
Log:
Add internString(), which protects against NPE.  Closes
 https://issues.apache.org/jira/browse/OFBIZ-1307.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java?rev=585578&r1=585577&r2=585578&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java Wed Oct 17 10:12:17 2007
@@ -41,6 +41,10 @@
     
     public static final String module = StringUtil.class.getName();
 
+    public static String internString(String value) {
+        return value != null ? value.intern() : null;
+    }
+
     /**
      * Replaces all occurances of oldString in mainString with newString
      * @param mainString The original string