openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1759663 [2/4] - in /openjpa/trunk: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/identifier/ openjpa-jdbc/src/main/jav...
Date Wed, 07 Sep 2016 19:04:20 GMT
Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Wed Sep  7 19:04:18 2016
@@ -49,7 +49,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
 import org.apache.openjpa.lib.conf.Configurations;
@@ -1745,7 +1745,7 @@ public class PCEnhancer {
     private void translateFromStateManagerMethod(Method m,
         boolean isDirtyCheckMethod) {
         // form the name of the method by prepending 'pc' to the sm method
-        String name = PRE + StringUtils.capitalize(m.getName());
+        String name = PRE + StringUtil.capitalize(m.getName());
         Class[] params = m.getParameterTypes();
         Class returnType = m.getReturnType();
 
@@ -2682,7 +2682,7 @@ public class PCEnhancer {
         throws NoSuchMethodException {
         String name = "get";
         if (type.isPrimitive())
-            name += StringUtils.capitalize(type.getName());
+            name += StringUtil.capitalize(type.getName());
         return Reflection.class.getMethod(name, new Class[] { Object.class, 
             argType }); 
     }
@@ -3771,9 +3771,9 @@ public class PCEnhancer {
      * performs any necessary field tracking.
      */
     private void addSubclassGetMethod(FieldMetaData fmd) {
-        String methName = "get" + StringUtils.capitalize(fmd.getName());
+        String methName = "get" + StringUtil.capitalize(fmd.getName());
         if (_managedType.getMethods(methName, new Class[0]).length == 0)
-            methName = "is" + StringUtils.capitalize(fmd.getName());
+            methName = "is" + StringUtil.capitalize(fmd.getName());
         BCMethod getter = _pc.declareMethod(methName, fmd.getDeclaredType(),
             null);
         setVisibilityToSuperMethod(getter);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCSubclassValidator.java Wed Sep  7 19:04:18 2016
@@ -25,7 +25,7 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.meta.AccessCode;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.FieldMetaData;
@@ -184,7 +184,7 @@ public class PCSubclassValidator {
     private Method setterForField(FieldMetaData fmd) {
         try {
             return fmd.getDeclaringType().getDeclaredMethod(
-                "set" + StringUtils.capitalize(fmd.getName()),
+                "set" + StringUtil.capitalize(fmd.getName()),
                 new Class[]{ fmd.getDeclaredType() });
         }
         catch (NoSuchMethodException e) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/Reflection.java Wed Sep  7 19:04:18 2016
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ReferenceMap;
@@ -107,7 +107,7 @@ public class Reflection {
         if (m != null) {
             return m;
         }
-        String capProp = StringUtils.capitalize(prop);
+        String capProp = StringUtil.capitalize(prop);
         try {
             // this algorithm searches for a get<prop> or is<prop> method in
             // a breadth-first manner.
@@ -168,7 +168,7 @@ public class Reflection {
         if (m != null) {
             return m;
         }
-        String name = "set" + StringUtils.capitalize(prop);
+        String name = "set" + StringUtil.capitalize(prop);
         try {
             for (Class c = cls; c != null && c != Object.class;
                 c = c.getSuperclass()) {
@@ -863,7 +863,7 @@ public class Reflection {
             if (m.getName().startsWith("get")) {
                 if (!canReflect(m))
                     continue;
-                String prop = StringUtils.capitalize(m.getName()
+                String prop = StringUtil.capitalize(m.getName()
                     .substring("get".length()));
                 Class<?> rtype = m.getReturnType();
                 try {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java Wed Sep  7 19:04:18 2016
@@ -29,6 +29,7 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.ReentrantLock;
@@ -39,7 +40,7 @@ import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
 import org.apache.commons.collections.set.MapBackedSet;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.audit.Auditor;
 import org.apache.openjpa.conf.BrokerValue;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
@@ -189,7 +190,7 @@ public abstract class AbstractBrokerFact
         try {
             assertOpen();
             
-            if(StringUtils.isNotEmpty(cf1Name)) {
+            if(StringUtil.isNotEmpty(cf1Name)) {
                 // If the cfName has been set on the broker try looking up now.
                 try { 
                     _conf.getConnectionFactory();
@@ -575,8 +576,8 @@ public abstract class AbstractBrokerFact
             // we don't need to synchronize on brokers since one JTA transaction
             // can never be active on multiple concurrent threads.
             for (Broker broker : brokers) {
-                if (StringUtils.equals(broker.getConnectionUserName(), user) 
-                 && StringUtils.equals(broker.getConnectionPassword(), pass))
+                if (Objects.equals(broker.getConnectionUserName(), user)
+                 && Objects.equals(broker.getConnectionPassword(), pass))
                     return broker;
             }
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Wed Sep  7 19:04:18 2016
@@ -47,7 +47,7 @@ import javax.transaction.Synchronization
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.collections.set.MapBackedSet;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.Compatibility;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.datacache.DataCache;
@@ -5167,7 +5167,7 @@ public class BrokerImpl implements Broke
      * Set the 'JTA' ConnectionFactoryName. Input will be trimmed to null before being stored. 
      */
     public void setConnectionFactoryName(String connectionFactoryName) {
-        this._connectionFactoryName = StringUtils.trimToNull(connectionFactoryName);
+        this._connectionFactoryName = StringUtil.trimToNull(connectionFactoryName);
     }
 
     /**
@@ -5181,7 +5181,7 @@ public class BrokerImpl implements Broke
      * Set the 'NonJTA' ConnectionFactoryName. Input will be trimmed to null before being stored. 
      */
     public void setConnectionFactory2Name(String connectionFactory2Name) {
-        this._connectionFactory2Name = StringUtils.trimToNull(connectionFactory2Name);
+        this._connectionFactory2Name = StringUtil.trimToNull(connectionFactory2Name);
     }
     
     /**
@@ -5190,7 +5190,7 @@ public class BrokerImpl implements Broke
      * @return the JTA connection factory or null if connectionFactoryName is blank.
      */
     public Object getConnectionFactory() {
-        if(StringUtils.isNotBlank(_connectionFactoryName)) { 
+        if(StringUtil.isNotBlank(_connectionFactoryName)) {
             return Configurations.lookup(_connectionFactoryName, "openjpa.ConnectionFactory", _log );
         }
         else {
@@ -5204,7 +5204,7 @@ public class BrokerImpl implements Broke
      * @return the NonJTA connection factory or null if connectionFactoryName is blank.
      */
     public Object getConnectionFactory2() { 
-        if(StringUtils.isNotBlank(_connectionFactory2Name)) { 
+        if(StringUtil.isNotBlank(_connectionFactory2Name)) {
             return  Configurations.lookup(_connectionFactory2Name, "openjpa.ConnectionFactory2", _log);
         }
         else {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Wed Sep  7 19:04:18 2016
@@ -29,9 +29,10 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.lib.rop.EagerResultList;
 import org.apache.openjpa.lib.rop.ListResultObjectProvider;
@@ -350,7 +351,7 @@ public class FetchConfigurationImpl
     }
      
     private FetchConfiguration addFetchGroup(String name, boolean recomputeIsDefault) {
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             throw new UserException(_loc.get("null-fg"));
 
         lock();
@@ -505,7 +506,7 @@ public class FetchConfigurationImpl
     }
 
     public FetchConfiguration addField(String field) {
-        if (StringUtils.isEmpty(field))
+        if (StringUtil.isEmpty(field))
             throw new UserException(_loc.get("null-field"));
 
         lock();
@@ -920,7 +921,7 @@ public class FetchConfigurationImpl
         if (rdepth != FetchGroup.DEPTH_INFINITE && rdepth <= 0)
             return FETCH_NONE;
 
-        if (StringUtils.equals(_directRelationOwner, fieldName))
+        if (Objects.equals(_directRelationOwner, fieldName))
             return FETCH_REF;
         return FETCH_LOAD;
     }
@@ -940,7 +941,7 @@ public class FetchConfigurationImpl
         clone._fromField = fm.getFullName(false);
         clone._fromType = type;
         clone._availableRecursion = getAvailableRecursionDepth(fm, type, fm.getFullName(false), true);
-        if (StringUtils.equals(_directRelationOwner, fm.getFullName(false)))
+        if (Objects.equals(_directRelationOwner, fm.getFullName(false)))
             clone._load = false;
         else
             clone._load = _load;
@@ -986,7 +987,7 @@ public class FetchConfigurationImpl
         // see if there's a previous limit
         int avail = Integer.MIN_VALUE;
         for (FetchConfigurationImpl f = this; f != null; f = f._parent) {
-            if (StringUtils.equals(f._fromField, fromField) 
+            if (Objects.equals(f._fromField, fromField)
                 && ImplHelper.isAssignable(f._fromType, type)) {
                 avail = f._availableRecursion;
                 if (traverse)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/MethodStoreQuery.java Wed Sep  7 19:04:18 2016
@@ -29,7 +29,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.rop.ListResultObjectProvider;
 import org.apache.openjpa.lib.rop.RangeResultObjectProvider;
 import org.apache.openjpa.lib.rop.ResultObjectProvider;
@@ -224,7 +224,7 @@ public class MethodStoreQuery
                 return;
 
             String methName = q.getContext().getQueryString();
-            if (StringUtils.isEmpty(methName))
+            if (StringUtil.isEmpty(methName))
                 throw new UserException(_loc.get("no-method"));
 
             int dotIdx = methName.lastIndexOf('.');

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Wed Sep  7 19:04:18 2016
@@ -34,7 +34,8 @@ import java.util.concurrent.locks.Reentr
 
 import org.apache.commons.collections.map.LinkedMap;
 import java.util.Objects;
-import org.apache.commons.lang3.StringUtils;
+
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.apache.openjpa.kernel.exps.AggregateListener;
@@ -575,7 +576,7 @@ public class QueryImpl
         try {
             assertOpen();
             assertNotReadOnly();
-            _params = StringUtils.trimToNull(params);
+            _params = StringUtil.trimToNull(params);
             invalidateCompilation();
         } finally {
             unlock();
@@ -1205,7 +1206,7 @@ public class QueryImpl
      */
     private void logExecution(int op, Map<Object, Object> params) {
         String s = _query;
-        if (StringUtils.isEmpty(s))
+        if (StringUtil.isEmpty(s))
             s = toString();
 
         String msg = "executing-query";
@@ -1843,8 +1844,8 @@ public class QueryImpl
 
             CompilationKey key = (CompilationKey) other;
             if (key.queryType != queryType
-                || !StringUtils.equals(key.query, query)
-                || !StringUtils.equals(key.language, language))
+                || !Objects.equals(key.query, query)
+                || !Objects.equals(key.language, language))
                 return false;
             if (key.subclasses != subclasses)
                 return false;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java Wed Sep  7 19:04:18 2016
@@ -36,7 +36,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.util.OpenJPAException;
@@ -305,7 +305,7 @@ public class ResultPacker {
      */
     private static Member findSet(String alias, Class<?> type, Field[] fields,
         Method[] methods) {
-        if (StringUtils.isEmpty(alias))
+        if (StringUtil.isEmpty(alias))
             return null;
         if (type == Object.class)
             type = null;
@@ -332,7 +332,7 @@ public class ResultPacker {
         }
 
         // check setter methods
-        String setName = "set" + StringUtils.capitalize(alias);
+        String setName = "set" + StringUtil.capitalize(alias);
         Method method = null;
         boolean eqName = false;
         Class<?>[] params;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Wed Sep  7 19:04:18 2016
@@ -35,10 +35,11 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.TimeZone;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.enhance.DynamicPersistenceCapable;
 import org.apache.openjpa.enhance.FieldManager;
@@ -2161,7 +2162,7 @@ public class StateManagerImpl implements
     public void settingStringField(PersistenceCapable pc, int field,
         String curVal, String newVal, int set) {
         if (set != SET_REMOTE) {
-            if (StringUtils.equals(newVal, curVal) && _loaded.get(field))
+            if (Objects.equals(newVal, curVal) && _loaded.get(field))
                 return;
             assertNoPrimaryKeyChange(field);
         }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java Wed Sep  7 19:04:18 2016
@@ -42,7 +42,7 @@ import java.util.Set;
 import java.util.zip.ZipFile;
 import java.util.zip.ZipInputStream;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
 import org.apache.openjpa.lib.meta.ClassArgParser;
@@ -100,7 +100,7 @@ public abstract class AbstractCFMetaData
      * directories supplied by user via auto-configuration.
      */
     public void setFiles(String files) {
-        if (StringUtils.isEmpty(files))
+        if (StringUtil.isEmpty(files))
             this.files = null;
         else {
             String[] strs = StringUtil.split(files, ";", 0);
@@ -128,7 +128,7 @@ public abstract class AbstractCFMetaData
      * supplied by user via auto-configuration.
      */
     public void setURLs(String urls) {
-        if (StringUtils.isEmpty(urls))
+        if (StringUtil.isEmpty(urls))
             this.urls = null;
         else {
             String[] strs = StringUtil.split(urls, ";", 0);
@@ -155,7 +155,7 @@ public abstract class AbstractCFMetaData
      */
     public void setResources(String rsrcs) {
         // keep list mutable so subclasses can add implicit locations
-        this.rsrcs = (StringUtils.isEmpty(rsrcs)) ? null
+        this.rsrcs = (StringUtil.isEmpty(rsrcs)) ? null
           : new ArrayList<String>(Arrays.asList(StringUtil.split(rsrcs, ";", 0)));
     }
 
@@ -173,7 +173,7 @@ public abstract class AbstractCFMetaData
      */
     public void setClasspathScan(String cpath) {
         // keep list mutable so subclasses can add implicit locations
-        this.cpath = (StringUtils.isEmpty(cpath)) ? null
+        this.cpath = (StringUtil.isEmpty(cpath)) ? null
           : new ArrayList<String>(Arrays.asList(StringUtil.split(cpath, ";", 0)));
     }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataFactory.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractMetaDataFactory.java Wed Sep  7 19:04:18 2016
@@ -25,7 +25,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.meta.ClassArgParser;
@@ -60,7 +60,7 @@ public abstract class AbstractMetaDataFa
      * auto-configuration.
      */
     public void setTypes(String types) {
-        this.types = (StringUtils.isEmpty(types)) ? null
+        this.types = (StringUtil.isEmpty(types)) ? null
             : new HashSet(Arrays.asList(StringUtil.split(types, ";", 0)));
     }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java Wed Sep  7 19:04:18 2016
@@ -33,10 +33,11 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeMap;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.datacache.CacheDistributionPolicy;
 import org.apache.openjpa.datacache.DataCache;
@@ -1511,7 +1512,7 @@ public class ClassMetaData
      */
     public String getDataCacheName() {
         if (DEFAULT_STRING.equals(_cacheName)) {
-            if (_super != null && StringUtils.isNotEmpty(getPCSuperclassMetaData().getDataCacheName())) {
+            if (_super != null && StringUtil.isNotEmpty(getPCSuperclassMetaData().getDataCacheName())) {
                 _cacheName = getPCSuperclassMetaData().getDataCacheName();
             } else {
                 _cacheName = DataCache.NAME_DEFAULT;
@@ -2000,8 +2001,8 @@ public class ClassMetaData
 
         String superCache = getPCSuperclassMetaData().getDataCacheName();
         
-        if (!StringUtils.isEmpty(superCache)) {  
-            if (!StringUtils.equals(cache, superCache)) {
+        if (!StringUtil.isEmpty(superCache)) {
+            if (!Objects.equals(cache, superCache)) {
                 throw new MetaDataException(_loc.get("cache-names", new Object[] { _type, cache, _super, superCache }));
             }
         }
@@ -2371,7 +2372,7 @@ public class ClassMetaData
      * the same name.
      */
     public FetchGroup addDeclaredFetchGroup(String name) {
-    	if (StringUtils.isEmpty(name))
+    	if (StringUtil.isEmpty(name))
     		throw new MetaDataException(_loc.get("empty-fg-name", this));
         if (_fgMap == null)
             _fgMap = new HashMap<String,FetchGroup>();

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/Extensions.java Wed Sep  7 19:04:18 2016
@@ -23,10 +23,10 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.Localizer;
@@ -442,8 +442,8 @@ public abstract class Extensions
             if (other == this)
                 return true;
             HashKey hk = (HashKey) other;
-            return StringUtils.equals(vendor, hk.vendor)
-                && StringUtils.equals(key, hk.key);
+            return Objects.equals(vendor, hk.vendor)
+                && Objects.equals(key, hk.key);
         }
     }
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FetchGroup.java Wed Sep  7 19:04:18 2016
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import java.util.Objects;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.util.MetaDataException;
@@ -142,7 +142,7 @@ public class FetchGroup
     public void addDeclaredInclude(String fgName) {
         if (_readOnly)
             throw new UnsupportedOperationException();
-        if (StringUtils.isEmpty(fgName))
+        if (StringUtil.isEmpty(fgName))
             throw new MetaDataException(_loc.get("null-include-fg", this));
         if (_includes == null)
             _includes = new ArrayList<String>();

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Wed Sep  7 19:04:18 2016
@@ -46,7 +46,6 @@ import java.util.Set;
 import java.util.TimeZone;
 
 import org.apache.commons.collections.comparators.ComparatorChain;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.kernel.StoreContext;
@@ -771,7 +770,7 @@ public class FieldMetaData
      * class that declared this field or any of its persistent superclasses.
      */
     public void setInFetchGroup(String fg, boolean in) {
-        if (StringUtils.isEmpty(fg))
+        if (StringUtil.isEmpty(fg))
             throw new MetaDataException(_loc.get("empty-fg-name", this));
         if (fg.equals(FetchGroup.NAME_ALL))
             return;
@@ -1235,7 +1234,7 @@ public class FieldMetaData
      * the field's elements.
      */
     public void setOrderDeclaration(String dec) {
-        _orderDec = StringUtils.trimToNull(dec);
+        _orderDec = StringUtil.trimToNull(dec);
         _orders = null;
     }
 
@@ -1621,7 +1620,7 @@ public class FieldMetaData
      * @return the method for invocation
      */
     private Method findMethodByNameAndType(String method, Class<?> type) {
-        if (StringUtils.isEmpty(method))
+        if (StringUtil.isEmpty(method))
             return null;
 
         // get class name and get package name divide on the last '.', so the
@@ -2455,7 +2454,7 @@ public class FieldMetaData
     }
 
     public String getSetterName() {
-        String setterName = "set" + StringUtils.capitalize(_name);
+        String setterName = "set" + StringUtil.capitalize(_name);
         if (_name.length() > 1 && Character.isLowerCase(_name.charAt(0)) && Character.isUpperCase(_name.charAt(1))) {
             // We have the special case where the first char is lower, and the
             // following char is capital. We need to support using the
@@ -2467,7 +2466,7 @@ public class FieldMetaData
                 return setterName;
             } catch (Exception e) {
             }
-            setterName = "set" + StringUtils.capitalize(_name);
+            setterName = "set" + StringUtil.capitalize(_name);
             try {
                 type.getDeclaredMethod(setterName, getType());
             } catch (Exception e) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/InterfaceImplGenerator.java Wed Sep  7 19:04:18 2016
@@ -27,7 +27,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.WeakHashMap;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.enhance.PCEnhancer;
 import org.apache.openjpa.util.InternalException;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
@@ -144,7 +144,7 @@ class InterfaceImplGenerator {
         field.setAccessFlags(Constants.ACCESS_PRIVATE);
 
         // getter
-        name = StringUtils.capitalize(name);
+        name = StringUtil.capitalize(name);
         String prefix = isGetter(iface, fmd) ? "get" : "is";
         BCMethod meth = bc.declareMethod(prefix + name, type, null);
         meth.makePublic();
@@ -223,7 +223,7 @@ class InterfaceImplGenerator {
         try {
             Method meth = AccessController.doPrivileged(
                 J2DoPrivHelper.getDeclaredMethodAction(iface, "is" +
-                    StringUtils.capitalize(fmd.getName()), (Class[]) null));
+                    StringUtil.capitalize(fmd.getName()), (Class[]) null));
             return meth == null;
         } catch (PrivilegedActionException pae) {}
         return true;

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java Wed Sep  7 19:04:18 2016
@@ -30,11 +30,11 @@ import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.enhance.DynamicPersistenceCapable;
 import org.apache.openjpa.enhance.PCEnhancer;
@@ -2409,7 +2409,7 @@ public class MetaDataRepository implemen
                 return false;
 
             QueryKey qk = (QueryKey) obj;
-            return StringUtils.equals(clsName, qk.clsName) && StringUtils.equals(name, qk.name);
+            return Objects.equals(clsName, qk.clsName) && Objects.equals(name, qk.name);
         }
     }
 
@@ -2449,8 +2449,7 @@ public class MetaDataRepository implemen
      * Create a new metadata, populate it with default information, add it to the repository, and
      * return it.
      * 
-     * @param access
-     *            the access type to use in populating metadata
+     * @param type the access type to use in populating metadata
      */
     public XMLClassMetaData addXMLClassMetaData(Class<?> type) {
         XMLClassMetaData meta = newXMLClassMetaData(type);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/QueryMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/QueryMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/QueryMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/QueryMetaData.java Wed Sep  7 19:04:18 2016
@@ -23,7 +23,7 @@ import java.io.Serializable;
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.kernel.Query;
 import org.apache.openjpa.kernel.jpql.JPQLParser;
 import org.apache.openjpa.lib.meta.SourceTracker;
@@ -210,7 +210,7 @@ public class QueryMetaData
     public void setInto(Query query) {
         if (_candidate != null)
             query.setCandidateType(_candidate, true);
-        if (!StringUtils.isEmpty(_query))
+        if (!StringUtil.isEmpty(_query))
             query.setQuery(_query);
         if (_res != null)
             query.setResultType(_res);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/SequenceMetaData.java Wed Sep  7 19:04:18 2016
@@ -23,7 +23,7 @@ import java.io.Serializable;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.SeqValue;
 import org.apache.openjpa.kernel.Seq;
 import org.apache.openjpa.lib.conf.Configurations;
@@ -384,7 +384,7 @@ public class SequenceMetaData
      * is null or empty string.
      */
     protected void appendProperty(StringBuilder props, String name, String val) {
-        if (StringUtils.isEmpty(val))
+        if (StringUtil.isEmpty(val))
             return;
         if (props.length() > 0)
             props.append(",");

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java Wed Sep  7 19:04:18 2016
@@ -19,8 +19,9 @@
 package org.apache.openjpa.meta;
 
 import java.util.HashMap;
+import java.util.Objects;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 public class XMLClassMetaData implements XMLMetaData     
 {
@@ -71,7 +72,7 @@ public class XMLClassMetaData implements
 
     public void setXmlnamespace(String name) {
         // avoid JAXB XML bind default name
-        if (!StringUtils.equals(defaultName, name))
+        if (!Objects.equals(defaultName, name))
             _xmlnamespace = name;
     }
     

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,9 @@
  */
 package org.apache.openjpa.meta;
 
-import org.apache.commons.lang3.StringUtils;
+import java.util.Objects;
+
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * Contains metadata about an xml element or attribute
@@ -82,7 +84,7 @@ public class XMLFieldMetaData implements
     
     public void setXmlnamespace(String name) {
         // avoid JAXB XML bind default name
-        if (!StringUtils.equals(defaultName, name))
+        if (!Objects.equals(defaultName, name))
             _xmlnamespace = name;
     }
     

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java Wed Sep  7 19:04:18 2016
@@ -49,7 +49,6 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.Queue;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.enhance.AsmAdaptor;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.lib.util.ClassUtil;
@@ -57,10 +56,10 @@ import org.apache.openjpa.lib.util.Files
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.Options;
+import org.apache.openjpa.lib.util.StringUtil;
 
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.openjpa.lib.util.StringUtil;
 import serp.bytecode.BCClass;
 import serp.bytecode.BCField;
 import serp.bytecode.BCMethod;
@@ -1352,7 +1351,7 @@ public class ProxyManagerImpl
             match = null;
             try {
                 match = helper.getMethod("before" 
-                    + StringUtils.capitalize(meths[i].getName()), params);
+                    + StringUtil.capitalize(meths[i].getName()), params);
             } catch (NoSuchMethodException nsme) {
             } catch (Exception e) {
                 throw new GeneralException(e);
@@ -1364,7 +1363,7 @@ public class ProxyManagerImpl
                     meths[i].getReturnType(), (match == null) 
                     ? void.class : match.getReturnType());
                 after = helper.getMethod("after" 
-                    + StringUtils.capitalize(meths[i].getName()), afterParams);
+                    + StringUtil.capitalize(meths[i].getName()), afterParams);
             } catch (NoSuchMethodException nsme) {
             } catch (Exception e) {
                 throw new GeneralException(e);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StringId.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StringId.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StringId.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/StringId.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,7 @@
  */
 package org.apache.openjpa.util;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * {@link OpenJPAId} subclass appropriate for String fields.
@@ -31,12 +31,12 @@ public final class StringId extends Open
 
     public StringId(Class<?> cls, String key) {
         super(cls);
-        this.key = (key == null) ? "" : StringUtils.stripEnd(key, null);
+        this.key = (key == null) ? "" : StringUtil.stripEnd(key, null);
     }
 
     public StringId(Class<?> cls, String key, boolean subs) {
         super(cls, subs);
-        this.key = (key == null) ? "" : StringUtils.stripEnd(key, null);
+        this.key = (key == null) ? "" : StringUtil.stripEnd(key, null);
     }
 
     public String getId() {

Modified: openjpa/trunk/openjpa-lib/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/pom.xml?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/pom.xml (original)
+++ openjpa/trunk/openjpa-lib/pom.xml Wed Sep  7 19:04:18 2016
@@ -58,10 +58,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.ant</groupId>
             <artifactId>ant</artifactId>
             <scope>provided</scope>

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java Wed Sep  7 19:04:18 2016
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.conf.Configuration;
 import org.apache.openjpa.lib.conf.ConfigurationImpl;
 import org.apache.openjpa.lib.conf.ConfigurationProvider;
@@ -167,7 +167,7 @@ public abstract class AbstractTask exten
         String propertiesResource = _conf.getPropertiesResource();
         if ( propertiesResource == null) {            
             cp = ProductDerivations.loadDefaults(getConfigPropertiesResourceLoader());           
-        } else if (_conf.isDeferResourceLoading() && !StringUtils.isEmpty(propertiesResource)) {
+        } else if (_conf.isDeferResourceLoading() && !StringUtil.isEmpty(propertiesResource)) {
             Map<String, String> result = Configurations.parseConfigResource(propertiesResource);
             String path = result.get(Configurations.CONFIG_RESOURCE_PATH);
             String anchor = result.get(Configurations.CONFIG_RESOURCE_ANCHOR);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Wed Sep  7 19:04:18 2016
@@ -50,12 +50,12 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.MissingResourceException;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.log.LogFactory;
 import org.apache.openjpa.lib.log.LogFactoryImpl;
@@ -256,7 +256,7 @@ public class ConfigurationImpl
     /**
      * Gets the registered Value for the given propertyName.
      * 
-     * @param propertyName can be either fully-qualified name or the simple name
+     * @param property can be either fully-qualified name or the simple name
      * with which the value has been registered. A value may have multiple
      * equivalent names and this method searches with all equivalent names.
      */
@@ -370,8 +370,12 @@ public class ConfigurationImpl
         ObjectValue val;
         for(Value v : _vals) { 
             if (v instanceof Closeable) {
-                try { ((Closeable)v).close(); }
-                catch (Exception e) {} 
+                try {
+                    ((Closeable)v).close();
+                }
+                catch (Exception e) {
+                    // noop
+                }
                 continue;
             }
 
@@ -502,9 +506,9 @@ public class ConfigurationImpl
 
         try {
             pd.setReadMethod(getClass().getMethod("get"
-                + StringUtils.capitalize(prop), (Class[]) null));
+                + StringUtil.capitalize(prop), (Class[]) null));
             pd.setWriteMethod(getClass().getMethod("set"
-                + StringUtils.capitalize(prop), new Class[]
+                + StringUtil.capitalize(prop), new Class[]
                 { pd.getReadMethod().getReturnType() }));
         } catch (Throwable t) {
             // if an error occurs, it might be because the value is a
@@ -665,8 +669,8 @@ public class ConfigurationImpl
                 continue;
             if (o instanceof String) {
                 // OPENJPA-1830 Do not overwrite existing string values with "******"
-                if ((!StringUtils.equals((String) o, val.getString())) &&
-                        (!StringUtils.equals((String) o, Value.INVISIBLE)))
+                if ((!Objects.equals((String) o, val.getString())) &&
+                        (!Objects.equals((String) o, Value.INVISIBLE)))
                     val.setString((String) o);
             } else {
                 ser &= o instanceof Serializable;

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java Wed Sep  7 19:04:18 2016
@@ -35,7 +35,6 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.util.ClassUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
@@ -86,7 +85,7 @@ public class Configurations {
     private static String getPluginComponent(String plugin, boolean clsName) {
         if (plugin != null)
             plugin = plugin.trim();
-        if (StringUtils.isEmpty(plugin))
+        if (StringUtil.isEmpty(plugin))
             return null;
 
         int openParen = -1;
@@ -111,9 +110,9 @@ public class Configurations {
      * Combine the given class name and properties into a plugin string.
      */
     public static String getPlugin(String clsName, String props) {
-        if (StringUtils.isEmpty(clsName))
+        if (StringUtil.isEmpty(clsName))
             return props;
-        if (StringUtils.isEmpty(props))
+        if (StringUtil.isEmpty(props))
             return clsName;
         return clsName + "(" + props + ")";
     }
@@ -124,17 +123,17 @@ public class Configurations {
      * same properties of <code>orig</code>.
      */
     public static String combinePlugins(String orig, String override) {
-        if (StringUtils.isEmpty(orig))
+        if (StringUtil.isEmpty(orig))
             return override;
-        if (StringUtils.isEmpty(override))
+        if (StringUtil.isEmpty(override))
             return orig;
 
         String origCls = getClassName(orig);
         String overrideCls = getClassName(override);
         String cls;
-        if (StringUtils.isEmpty(origCls))
+        if (StringUtil.isEmpty(origCls))
             cls = overrideCls;
-        else if (StringUtils.isEmpty(overrideCls))
+        else if (StringUtil.isEmpty(overrideCls))
             cls = origCls;
         else if (!origCls.equals(overrideCls))
             return override; // completely different plugin
@@ -143,9 +142,9 @@ public class Configurations {
 
         String origProps = getProperties(orig);
         String overrideProps = getProperties(override);
-        if (StringUtils.isEmpty(origProps))
+        if (StringUtil.isEmpty(origProps))
             return getPlugin(cls, overrideProps);
-        if (StringUtils.isEmpty(overrideProps))
+        if (StringUtil.isEmpty(overrideProps))
             return getPlugin(cls, origProps);
 
         Properties props = parseProperties(origProps);
@@ -219,7 +218,7 @@ public class Configurations {
      */
     static Object newInstance(String clsName, Value val, Configuration conf,
         ClassLoader loader, boolean fatal) {
-        if (StringUtils.isEmpty(clsName))
+        if (StringUtil.isEmpty(clsName))
             return null;
 
         Class<?> cls = loadClass(clsName, findDerivedLoader(conf, loader));
@@ -337,7 +336,7 @@ public class Configurations {
     public static void populateConfiguration(Configuration conf, Options opts) {
         String props = opts.removeProperty("properties", "p", null);
         ConfigurationProvider provider;
-        if (!StringUtils.isEmpty(props)) {
+        if (!StringUtil.isEmpty(props)) {
             Map<String, String> result = parseConfigResource(props);
             String path = result.get(CONFIG_RESOURCE_PATH);
             String anchor = result.get(CONFIG_RESOURCE_ANCHOR);
@@ -454,7 +453,7 @@ public class Configurations {
             return;
 
         Properties props = null;
-        if (!StringUtils.isEmpty(properties))
+        if (!StringUtil.isEmpty(properties))
             props = parseProperties(properties);
         configureInstance(obj, conf, props, configurationName);
     }
@@ -576,7 +575,7 @@ public class Configurations {
      */
     public static Options parseProperties(String properties) {
         Options opts = new Options();
-        properties = StringUtils.trimToNull(properties);
+        properties = StringUtil.trimToNull(properties);
         if (properties == null)
             return opts;
 
@@ -639,7 +638,7 @@ public class Configurations {
      * Looks up the given name in JNDI. If the name is null, null is returned.
      */
     public static Object lookup(String name, String userKey, Log log) {
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             return null;
 
         Context ctx = null;

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/DoubleValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/DoubleValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/DoubleValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/DoubleValue.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,7 @@
  */
 package org.apache.openjpa.lib.conf;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * A double {@link Value}.
@@ -60,7 +60,7 @@ public class DoubleValue extends Value {
     }
 
     protected void setInternalString(String val) {
-        if (StringUtils.isEmpty(val))
+        if (StringUtil.isEmpty(val))
             set(0D);
         else
             set(Double.parseDouble(val));

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/IntValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/IntValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/IntValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/IntValue.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,7 @@
  */
 package org.apache.openjpa.lib.conf;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * An int {@link Value}.
@@ -60,7 +60,7 @@ public class IntValue extends Value {
     }
 
     protected void setInternalString(String val) {
-        if (StringUtils.isEmpty(val))
+        if (StringUtil.isEmpty(val))
             set(0);
         else
             set(Integer.parseInt(val));

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginListValue.java Wed Sep  7 19:04:18 2016
@@ -22,7 +22,7 @@ import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * A list of plugins. Defaults and aliases on plugin lists apply only
@@ -123,9 +123,9 @@ public class PluginListValue extends Obj
      * properties string.
      */
     public void setString(String str) {
-        if (StringUtils.isEmpty(str))
+        if (StringUtil.isEmpty(str))
             str = getDefault();
-        if (StringUtils.isEmpty(str)) {
+        if (StringUtil.isEmpty(str)) {
             _names = EMPTY;
             _props = EMPTY;
             set(null, true);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,8 @@
  */
 package org.apache.openjpa.lib.conf;
 
-import org.apache.commons.lang3.StringUtils;
+import java.util.Objects;
+
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.log.LogFactory;
 import org.apache.openjpa.lib.util.Localizer;
@@ -71,7 +72,7 @@ public class PluginValue extends ObjectV
         assertChangeable();
         String oldName = _name;
         _name = name;
-        if (!StringUtils.equals(oldName, name)) {
+        if (!Objects.equals(oldName, name)) {
             if (_singleton)
                 set(null, true);
             valueChanged();
@@ -91,7 +92,7 @@ public class PluginValue extends ObjectV
     public void setProperties(String props) {
         String oldProps = _props;
         _props = props;
-        if (!StringUtils.equals(oldProps, props)) {
+        if (!Objects.equals(oldProps, props)) {
             if (_singleton)
                 set(null, true);
             valueChanged();

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ProductDerivations.java Wed Sep  7 19:04:18 2016
@@ -32,7 +32,7 @@ import java.util.MissingResourceExceptio
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.MultiClassLoader;
@@ -260,7 +260,7 @@ public class ProductDerivations {
      */
     public static ConfigurationProvider load(String resource, String anchor, 
         ClassLoader loader) {
-        if (StringUtils.isEmpty(resource))
+        if (StringUtil.isEmpty(resource))
             return null;
         if (loader == null)
             loader = AccessController.doPrivileged(

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringListValue.java Wed Sep  7 19:04:18 2016
@@ -20,8 +20,9 @@ package org.apache.openjpa.lib.conf;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ParseException;
 
@@ -99,8 +100,8 @@ public class StringListValue extends Val
                 retv.append(',');
             
             for (int x = 0; x < aliases.length; x += 2)
-                if (StringUtils.equals(iString, aliases[x])
-                    || StringUtils.equals(iString, aliases[x + 1])) {
+                if (Objects.equals(iString, aliases[x])
+                    || Objects.equals(iString, aliases[x + 1])) {
                     retv.append(aliases[x + 1]);
                     found = true;
                     break;
@@ -120,7 +121,7 @@ public class StringListValue extends Val
     }
 
     protected String getInternalString() {
-        return StringUtils.join(_values, ", ");
+        return StringUtil.join(_values, ", ");
     }
 
     protected void setInternalString(String val) {

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringValue.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringValue.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/StringValue.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,8 @@
  */
 package org.apache.openjpa.lib.conf;
 
-import org.apache.commons.lang3.StringUtils;
+import java.util.Objects;
+
 
 /**
  * A string {@link Value}.
@@ -51,7 +52,7 @@ public class StringValue extends Value {
         assertChangeable();
         String oldValue = this.value;
         this.value = value;
-        if (!StringUtils.equals(value, oldValue))
+        if (!Objects.equals(value, oldValue))
             valueChanged();
     }
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Value.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Value.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Value.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Value.java Wed Sep  7 19:04:18 2016
@@ -24,9 +24,9 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.lib.util.ParseException;
 
@@ -241,7 +241,7 @@ public abstract class Value implements C
 
         boolean empty = str != null && str.length() == 0;
         for (int i = 1; i < aliases.length; i += 2)
-            if (StringUtils.equals(str, aliases[i])
+            if (Objects.equals(str, aliases[i])
                 || (empty && aliases[i] == null))
                 return aliases[i - 1];
         return (nullNotFound) ? null : str;
@@ -267,8 +267,8 @@ public abstract class Value implements C
             str = def;
         if (aliases != null)
             for (int i = 0; i < aliases.length; i += 2)
-                if (StringUtils.equals(str, aliases[i])
-                    || StringUtils.equals(str, aliases[i + 1])
+                if (Objects.equals(str, aliases[i])
+                    || Objects.equals(str, aliases[i + 1])
                     || (empty && aliases[i] == null))
                     return aliases[i + 1];
 
@@ -542,8 +542,8 @@ public abstract class Value implements C
         String thisStr = (isDynamic()) ? getOriginalValue() : getString();
         String thatStr = (isDynamic()) ? o.getOriginalValue() : o.getString();
         return (isDynamic() == o.isDynamic())
-            && StringUtils.equals(prop, o.getProperty())
-            && StringUtils.equals(thisStr, thatStr);
+            && Objects.equals(prop, o.getProperty())
+            && Objects.equals(thisStr, thatStr);
     }
 
     public Object clone() {

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierRule.java Wed Sep  7 19:04:18 2016
@@ -21,7 +21,7 @@ package org.apache.openjpa.lib.identifie
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * The standard identifier rule.  Rules are used for specific configuration
@@ -188,7 +188,7 @@ public class IdentifierRule {
                 }
             }
             // Look for special characters
-            if (StringUtils.contains(getSpecialCharacters(), ch)) {
+            if (StringUtil.contains(getSpecialCharacters(), ch)) {
                 return true;
             }
         }

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierUtilImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierUtilImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierUtilImpl.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/identifier/IdentifierUtilImpl.java Wed Sep  7 19:04:18 2016
@@ -20,7 +20,7 @@ package org.apache.openjpa.lib.identifie
 
 import java.util.ArrayList;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.conf.Configurable;
 import org.apache.openjpa.lib.conf.Configuration;
 import org.apache.openjpa.lib.util.Localizer;
@@ -221,7 +221,7 @@ public class IdentifierUtilImpl implemen
      *         ex. schema.table --> { schema, table }
      */    
     public String[] splitName(IdentifierRule nrule, String name, String nameDelim) {
-        if (!canSplit(nrule, name, nameDelim) || StringUtils.isEmpty(name)) {
+        if (!canSplit(nrule, name, nameDelim) || StringUtil.isEmpty(name)) {
             return new String[] {name};
         }
         // "schema"."table"
@@ -234,7 +234,7 @@ public class IdentifierUtilImpl implemen
 
         // for each name
         int ndLen = nameDelim.length();
-        while (!StringUtils.isEmpty(name)) {
+        while (!StringUtil.isEmpty(name)) {
             pname = splitNameCharDelimiters(name, nameDelim);
             names.add(pname);
             if ((pname.length() + ndLen) >= name.length()) {
@@ -305,7 +305,7 @@ public class IdentifierUtilImpl implemen
     }
     
     public String delimit(IdentifierConfiguration config, IdentifierRule rule, String name, boolean force) {
-        if (!rule.getCanDelimit() || StringUtils.isEmpty(name)) {
+        if (!rule.getCanDelimit() || StringUtil.isEmpty(name)) {
             return name;
         }
 

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/CFMetaDataParser.java Wed Sep  7 19:04:18 2016
@@ -20,7 +20,7 @@ package org.apache.openjpa.lib.meta;
 
 import java.security.AccessController;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.ClassUtil;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
@@ -99,7 +99,7 @@ public class CFMetaDataParser extends XM
         if (depth == 0)
             return true;
         
-        if (StringUtils.contains(name, ':')) {
+        if (StringUtil.contains(name, ':')) {
             int index = name.indexOf(':');
             name = name.substring(index + 1);
         }
@@ -139,7 +139,7 @@ public class CFMetaDataParser extends XM
         if (depth == 0)
             return;
         
-        if (StringUtils.contains(name, ':')) {
+        if (StringUtil.contains(name, ':')) {
             int index = name.indexOf(':');
             name = name.substring(index + 1);
         }
@@ -208,7 +208,7 @@ public class CFMetaDataParser extends XM
         throws SAXException {
         if (getClassAttributeName() != null) {
             _class = attrs.getValue(getClassAttributeName());
-            if (!StringUtils.isEmpty(_package) && _class.indexOf('.') == -1)
+            if (!StringUtil.isEmpty(_package) && _class.indexOf('.') == -1)
                 _class = _package + "." + _class;
         }
         return true;
@@ -222,7 +222,7 @@ public class CFMetaDataParser extends XM
             _class = null;
         else {
             _class = currentText();
-            if (!StringUtils.isEmpty(_package) && _class.indexOf('.') == -1)
+            if (!StringUtil.isEmpty(_package) && _class.indexOf('.') == -1)
                 _class = _package + "." + _class;
         }
     }
@@ -331,14 +331,14 @@ public class CFMetaDataParser extends XM
      */
     public static Class<?> classForName(String name, String pkg,
         boolean resolve, ClassLoader loader) {
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             return null;
 
         if (loader == null)
             loader = AccessController.doPrivileged(
                 J2DoPrivHelper.getContextClassLoaderAction());
         boolean fullName = name.indexOf('.') != -1;
-        boolean noPackage = StringUtils.isEmpty(pkg);
+        boolean noPackage = StringUtil.isEmpty(pkg);
         try {
             if (fullName || noPackage)
                 return ClassUtil.toClass(name, resolve, loader);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Files.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Files.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Files.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Files.java Wed Sep  7 19:04:18 2016
@@ -36,7 +36,7 @@ import java.net.URLDecoder;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * Utility operations on files.
@@ -149,7 +149,7 @@ public class Files {
         if (base == null)
             base = new File(AccessController.doPrivileged(
                 J2DoPrivHelper.getPropertyAction("user.dir")));
-        if (StringUtils.isEmpty(pkg)) {
+        if (StringUtil.isEmpty(pkg)) {
             if (mkdirs && !(AccessController.doPrivileged(
                 J2DoPrivHelper.existsAction(base))).booleanValue())
                 AccessController.doPrivileged(

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Options.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Options.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Options.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/Options.java Wed Sep  7 19:04:18 2016
@@ -32,7 +32,6 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.TreeSet;
 
-import org.apache.commons.lang3.StringUtils;
 
 /**
  * A specialization of the {@link Properties} map type with the added
@@ -109,7 +108,7 @@ public class Options extends TypedProper
             if (i == args.length || args[i].startsWith("-")) {
                 key = trimQuote(key);
                 if (key != null) {
-                    if (!StringUtils.isEmpty(value))
+                    if (!StringUtil.isEmpty(value))
                         setProperty(key, trimQuote(value));
                     else
                         setProperty(key, "true");
@@ -267,7 +266,7 @@ public class Options extends TypedProper
                 if (params[0].isArray())
                     continue;
 
-                names.add(StringUtils.capitalize(
+                names.add(StringUtil.capitalize(
                     meths[i].getName().substring(3)));
             }
         }
@@ -275,7 +274,7 @@ public class Options extends TypedProper
         // check for public fields
         Field[] fields = type.getFields();
         for (int i = 0; i < fields.length; i++)
-            names.add(StringUtils.capitalize(fields[i].getName()));
+            names.add(StringUtil.capitalize(fields[i].getName()));
 
         return names;
     }
@@ -295,14 +294,14 @@ public class Options extends TypedProper
      */
     private static boolean matchOptionToMember(String key, Object[] match)
         throws Exception {
-        if (StringUtils.isEmpty(key))
+        if (StringUtil.isEmpty(key))
             return false;
 
         // unfortunately we can't use bean properties for setters; any
         // setter with more than 1 argument is ignored; calculate setter and getter
         // name to look for
         String[] find = StringUtil.split(key, ".", 2);
-        String base = StringUtils.capitalize(find[0]);
+        String base = StringUtil.capitalize(find[0]);
         String set = "set" + base;
         String get = "get" + base;
 
@@ -339,7 +338,7 @@ public class Options extends TypedProper
         Member getter = getMeth;
         if (setter == null) {
             Field[] fields = type.getFields();
-            String uncapBase = StringUtils.uncapitalize(find[0]);
+            String uncapBase = StringUtil.uncapitalize(find[0]);
             for (int i = 0; i < fields.length; i++) {
                 if (fields[i].getName().equals(base)
                     || fields[i].getName().equals(uncapBase)) {
@@ -613,7 +612,7 @@ public class Options extends TypedProper
     }
 
     /**
-     * Specialization of {@link Properties#removeProperty} to allow
+     * Specialization of {@link Properties#remove(Object)} to allow
      * a value to appear under either of two keys; useful for short and
      * long versions of command-line flags.
      */

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/StringUtil.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/StringUtil.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/StringUtil.java (original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/StringUtil.java Wed Sep  7 19:04:18 2016
@@ -16,12 +16,11 @@
  */
 package org.apache.openjpa.lib.util;
 
-import org.apache.commons.lang3.StringUtils;
-
 import java.util.ArrayList;
 import java.util.List;
 
 
+
 public final class StringUtil {
 
     private static final String[] EMPTY_STRING_ARRAY = new String[0];
@@ -39,6 +38,88 @@ public final class StringUtil {
     }
 
     /**
+     * @return {@code true} if the given string is null or empty.
+     */
+    public static boolean isEmpty(String val) {
+        return val == null || val.isEmpty();
+    }
+
+    public static boolean isNotEmpty(String val) {
+        return !isEmpty(val);
+    }
+
+    /**
+     * <p>Checks if a CharSequence is whitespace, empty ("") or null.</p>
+     *
+     * <pre>
+     * StringUtils.isBlank(null)      = true
+     * StringUtils.isBlank("")        = true
+     * StringUtils.isBlank(" ")       = true
+     * StringUtils.isBlank("bob")     = false
+     * StringUtils.isBlank("  bob  ") = false
+     * </pre>
+     *
+     * Ported over from Apache commons-lang3
+     *
+     * @param cs  the CharSequence to check, may be null
+     * @return {@code true} if the CharSequence is null, empty or whitespace
+     */
+    public static boolean isBlank(final CharSequence cs) {
+        int strLen;
+        if (cs == null || (strLen = cs.length()) == 0) {
+            return true;
+        }
+        for (int i = 0; i < strLen; i++) {
+            if (Character.isWhitespace(cs.charAt(i)) == false) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * <p>Checks if a CharSequence is not empty (""), not null and not whitespace only.</p>
+     *
+     * <pre>
+     * StringUtils.isNotBlank(null)      = false
+     * StringUtils.isNotBlank("")        = false
+     * StringUtils.isNotBlank(" ")       = false
+     * StringUtils.isNotBlank("bob")     = true
+     * StringUtils.isNotBlank("  bob  ") = true
+     * </pre>
+     *
+     * Ported over from Apache commons-lang3
+     *
+     * @param cs  the CharSequence to check, may be null
+     * @return {@code true} if the CharSequence is not empty and not null and not whitespace
+     */
+    public static boolean isNotBlank(final CharSequence cs) {
+        return !isBlank(cs);
+    }
+
+
+    /**
+     * @param val the string to search in
+     * @param charToSearchFor the character to search for
+     * @return {@code true} if the charToSearchFor is contained in the String val
+     */
+    public static boolean contains(String val, char charToSearchFor) {
+        return val != null && val.indexOf(charToSearchFor) > -1;
+    }
+
+
+    public static boolean equalsIgnoreCase(String str1, String str2) {
+        if (str1 == null || str2 == null) {
+            return str1 == str2;
+        }
+        else if (str1 == str2) {
+            return true;
+        }
+
+        return str1.equalsIgnoreCase(str2);
+    }
+
+    /**
      * Splits the given string on the given token. Follows the semantics
      * of the Java 1.4 {@link String#split(String, int)} method, but does
      * not treat the given token as a regular expression.
@@ -111,9 +192,55 @@ public final class StringUtil {
             return str;
         }
         String[] split = split(str, from, Integer.MAX_VALUE);
-        return StringUtils.join(split, to);
+        return join(split, to);
     }
 
+
+    /**
+     * Null-safe {@link String#trim()}
+     */
+    public static String trim(final String str) {
+        return str == null ? null : str.trim();
+    }
+
+    /**
+     * @return the trimmed string str or {@code null} if the trimmed string would be empty.
+     */
+    public static String trimToNull(String str) {
+        if (str == null || str.isEmpty()) {
+            return null;
+        }
+        str = str.trim();
+        if (str.isEmpty()) {
+            return null;
+        }
+        return str;
+    }
+
+    public static String join(Object[] values, String joinToken) {
+        if (values == null) {
+            return null;
+        }
+        if (values.length == 0) {
+            return "";
+        }
+        if (values.length == 1) {
+            return values[0].toString();
+        }
+        if (joinToken == null) {
+            joinToken = "null"; // backward compat with commons-lang StringUtils...
+        }
+
+        StringBuilder sb = new StringBuilder(values.length * (16 + joinToken.length()));
+        sb.append(values[0]);
+        for (int i = 1; i < values.length; i++) {
+            sb.append(joinToken).append(values[i]);
+        }
+        return sb.toString();
+    }
+
+
+
     /**
      * Parse the given
      *
@@ -184,6 +311,139 @@ public final class StringUtil {
         throw new IllegalArgumentException("Unsupported type: " + type.getCanonicalName());
     }
 
+    /**
+     * <p>Capitalizes a String changing the first letter to title case as
+     * per {@link Character#toTitleCase(char)}. No other letters are changed.</p>
+     *
+     *
+     * <pre>
+     * StringUtil.capitalize(null)  = null
+     * StringUtil.capitalize("")    = ""
+     * StringUtil.capitalize("cat") = "Cat"
+     * StringUtil.capitalize("cAt") = "CAt"
+     * </pre>
+     *
+     * Ported over from Apache commons-lang3
+     *
+     * @param str the String to capitalize, may be null
+     * @return the capitalized String, {@code null} if null String input
+     * @see #uncapitalize(String)
+     */
+    public static String capitalize(final String str) {
+        int strLen;
+        if (str == null || (strLen = str.length()) == 0) {
+            return str;
+        }
+
+        final char firstChar = str.charAt(0);
+        if (Character.isTitleCase(firstChar)) {
+            // already capitalized
+            return str;
+        }
+
+        return new StringBuilder(strLen)
+                .append(Character.toTitleCase(firstChar))
+                .append(str.substring(1))
+                .toString();
+    }
+
+    /**
+     * <p>Uncapitalizes a String changing the first letter to title case as
+     * per {@link Character#toLowerCase(char)}. No other letters are changed.</p>
+     *
+     * <pre>
+     * StringUtil.uncapitalize(null)  = null
+     * StringUtil.uncapitalize("")    = ""
+     * StringUtil.uncapitalize("Cat") = "cat"
+     * StringUtil.uncapitalize("CAT") = "cAT"
+     * </pre>
+     *
+     * Ported over from Apache commons-lang3
+     *
+     * @param str the String to uncapitalize, may be null
+     * @return the uncapitalized String, {@code null} if null String input
+     * @see #capitalize(String)
+     */
+    public static String uncapitalize(final String str) {
+        int strLen;
+        if (str == null || (strLen = str.length()) == 0) {
+            return str;
+        }
+
+        final char firstChar = str.charAt(0);
+        if (Character.isLowerCase(firstChar)) {
+            // already uncapitalized
+            return str;
+        }
+
+        return new StringBuilder(strLen)
+                .append(Character.toLowerCase(firstChar))
+                .append(str.substring(1))
+                .toString();
+    }
+
+    public static boolean endsWithIgnoreCase(String str, String suffix) {
+        if (str == null || suffix == null) {
+            return str == null && suffix == null;
+        }
+        int strlen = str.length();
+        if (suffix.length() > strlen) {
+            return false;
+        }
+
+        return str.substring(str.length() - suffix.length(), strlen).equalsIgnoreCase(suffix);
+    }
+
+
+    /**
+     * <p>Strips any of a set of characters from the end of a String.</p>
+     *
+     * <p>A {@code null} input String returns {@code null}.
+     * An empty string ("") input returns the empty string.</p>
+     *
+     * <p>If the stripChars String is {@code null}, whitespace is
+     * stripped as defined by {@link Character#isWhitespace(char)}.</p>
+     *
+     * <pre>
+     * StringUtils.stripEnd(null, *)          = null
+     * StringUtils.stripEnd("", *)            = ""
+     * StringUtils.stripEnd("abc", "")        = "abc"
+     * StringUtils.stripEnd("abc", null)      = "abc"
+     * StringUtils.stripEnd("  abc", null)    = "  abc"
+     * StringUtils.stripEnd("abc  ", null)    = "abc"
+     * StringUtils.stripEnd(" abc ", null)    = " abc"
+     * StringUtils.stripEnd("  abcyx", "xyz") = "  abc"
+     * StringUtils.stripEnd("120.00", ".0")   = "12"
+     * </pre>
+     *
+     * Ported over from Apache commons-lang3
+     *
+     * @param str  the String to remove characters from, may be null
+     * @param stripChars  the set of characters to remove, null treated as whitespace
+     * @return the stripped String, {@code null} if null String input
+     */
+    public static String stripEnd(final String str, final String stripChars) {
+        int end;
+        if (str == null || (end = str.length()) == 0) {
+            return str;
+        }
+
+        if (stripChars == null) {
+            while (end != 0 && Character.isWhitespace(str.charAt(end - 1))) {
+                end--;
+            }
+        } else if (stripChars.isEmpty()) {
+            return str;
+        } else {
+            while (end != 0 && stripChars.indexOf(str.charAt(end - 1)) != -1) {
+                end--;
+            }
+        }
+        return str.substring(0, end);
+    }
+
+
+
     private static Character parseCharString(String val) {
         if (val.length() ==  0) {
             return Character.valueOf((char) 0);
@@ -193,4 +453,5 @@ public final class StringUtil {
         }
         throw new IllegalArgumentException("'" + val + "' is longer than one character.");
     }
+
 }



Mime
View raw message