openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1759663 [3/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-lib/src/test/java/org/apache/openjpa/lib/util/StringUtilTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/StringUtilTest.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/StringUtilTest.java (original)
+++ openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/util/StringUtilTest.java Wed Sep  7 19:04:18 2016
@@ -18,7 +18,6 @@ package org.apache.openjpa.lib.util;
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.lang3.StringUtils;
 import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -58,6 +57,42 @@ public class StringUtilTest {
     }
 
     @Test
+    public void testTrimToNull() {
+        Assert.assertNull(StringUtil.trimToNull(null));
+        Assert.assertNull(StringUtil.trimToNull(" "));
+        Assert.assertNull(StringUtil.trimToNull("   "));
+        Assert.assertNull(StringUtil.trimToNull("   \n  "));
+        Assert.assertEquals("A", StringUtil.trimToNull("  A"));
+        Assert.assertEquals("A", StringUtil.trimToNull("A  "));
+        Assert.assertEquals("A", StringUtil.trimToNull("  A  "));
+        Assert.assertEquals("A", StringUtil.trimToNull("  A  \n  "));
+    }
+
+    @Test
+    public void testStringCapitalize() {
+        Assert.assertNull(StringUtil.capitalize(null));
+        Assert.assertEquals("", StringUtil.capitalize(""));
+        Assert.assertEquals(" ", StringUtil.capitalize(" "));
+        Assert.assertEquals("Ahoi", StringUtil.capitalize("ahoi"));
+        Assert.assertEquals("Ahoi", StringUtil.capitalize("Ahoi"));
+        Assert.assertEquals(" ahoi", StringUtil.capitalize(" ahoi")); // no trim
+        Assert.assertEquals("\u00d6hoi", StringUtil.capitalize("\u00f6hoi"));
+        Assert.assertEquals("\u00dfhoi", StringUtil.capitalize("\u00dfhoi"));
+    }
+
+    @Test
+    public void testStringEndsWith() {
+        Assert.assertFalse(StringUtil.endsWithIgnoreCase(null, "bla"));
+        Assert.assertFalse(StringUtil.endsWithIgnoreCase("bla", null));
+        Assert.assertTrue(StringUtil.endsWithIgnoreCase(null, null));
+        Assert.assertTrue(StringUtil.endsWithIgnoreCase(null, null));
+        Assert.assertTrue(StringUtil.endsWithIgnoreCase("I have a cAt", "Cat"));
+        Assert.assertFalse(StringUtil.endsWithIgnoreCase("at", "Cat"));
+        Assert.assertTrue(StringUtil.endsWithIgnoreCase("at", ""));
+    }
+
+
+    @Test
     public void testStringParse() {
 
         try {
@@ -139,6 +174,17 @@ public class StringUtilTest {
     }
 
     @Test
+    public void testStringJoin() {
+        Assert.assertEquals("AAA,BBB,CCC", StringUtil.join(new String[]{"AAA", "BBB", "CCC"}, ","));
+        Assert.assertEquals("AAA", StringUtil.join(new String[]{"AAA"}, ","));
+        Assert.assertEquals("AAAnullBBBnullCCC", StringUtil.join(new String[]{"AAA", "BBB", "CCC"}, null));
+        Assert.assertEquals("", StringUtil.join(new String[]{}, ","));
+        Assert.assertNull(StringUtil.join(null, null));
+        Assert.assertNull(StringUtil.join(null, ","));
+
+    }
+
+    @Test
     @Ignore("only needed for manual performance tests")
     public void stringSplitPerformanceTest() {
         String val = "  asdfsfsfsfafasdf  basdfasf cs d efdfdfdfdfdfdfdf ghai asdf " +
@@ -174,11 +220,11 @@ public class StringUtilTest {
     @Test
     @Ignore("only needed for manual performance tests")
     public void testStringJoinPerformance() {
-        String[] vals = {"A", "BDS", "DSD", "XYZ"};
+        String[] vals = {"A", "BDS", "DSD", "XYZ", "HOHOHO", "AND", "SOMETHING", "ELSE"};
         long start = System.nanoTime();
         for (int i = 1; i < 10000000; i++) {
-            //X Strings.join(vals, ",");
-            StringUtils.join(vals, ",");
+            //X Strings.join(vals, "-.-");
+            StringUtil.join(vals, "-.-");
         }
 
         long stop = System.nanoTime();

Modified: openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/xml/TestXMLWriter.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/xml/TestXMLWriter.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/xml/TestXMLWriter.java (original)
+++ openjpa/trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/xml/TestXMLWriter.java Wed Sep  7 19:04:18 2016
@@ -29,7 +29,6 @@ import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.lib.util.StringUtil;
 
 /**
@@ -72,8 +71,7 @@ public class TestXMLWriter extends TestC
     }
 
     private String fixNewline(String str) {
-        return StringUtils.join(StringUtil.split
-            (str, "\r\n", -1), "\n");
+        return StringUtil.join(StringUtil.split(str, "\r\n", -1), "\n");
     }
 
     public static Test suite() {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java Wed Sep  7 19:04:18 2016
@@ -61,7 +61,7 @@ import javax.persistence.TableGenerator;
 import javax.persistence.Temporal;
 import javax.persistence.UniqueConstraint;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier;
 import org.apache.openjpa.jdbc.identifier.QualifiedDBIdentifier;
@@ -241,7 +241,7 @@ public class AnnotationPersistenceMappin
      */
     private void parseTableGenerator(AnnotatedElement el, TableGenerator gen) {
         String name = gen.name();
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             throw new MetaDataException(_loc.get("no-gen-name", el));
 
         Log log = getLog();
@@ -423,7 +423,7 @@ public class AnnotationPersistenceMappin
         List<Column> jcols;
         JoinTable joinTbl;
         for (AssociationOverride assoc : assocs) {
-            if (StringUtils.isEmpty(assoc.name()))
+            if (StringUtil.isEmpty(assoc.name()))
                 throw new MetaDataException(_loc.get("no-override-name", cm));
             sup = (FieldMapping) cm.getDefinedSuperclassField(assoc.name());
             if (sup == null)
@@ -457,7 +457,7 @@ public class AnnotationPersistenceMappin
         AttributeOverride... attrs) {
         FieldMapping sup;
         for (AttributeOverride attr : attrs) {
-            if (StringUtils.isEmpty(attr.name()))
+            if (StringUtil.isEmpty(attr.name()))
                 throw new MetaDataException(_loc.get("no-override-name", cm));
             sup = (FieldMapping) cm.getDefinedSuperclassField(attr.name());
             if (sup == null)
@@ -485,11 +485,11 @@ public class AnnotationPersistenceMappin
     private Column newColumn(PrimaryKeyJoinColumn join) {
         Column col = new Column();
         col.setFlag(Column.FLAG_PK_JOIN, true);
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit()));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition()));
-        if (!StringUtils.isEmpty(join.referencedColumnName()))
+        if (!StringUtil.isEmpty(join.referencedColumnName()))
             setTargetIdentifier(col, join.referencedColumnName());
         return col;
     }
@@ -506,7 +506,7 @@ public class AnnotationPersistenceMappin
             DBIdentifier sName = DBIdentifier.newTable(table.name(), delimit());
             if (DBIdentifier.isEmpty(sName))
                 throw new MetaDataException(_loc.get("second-name", cm));
-            if (!StringUtils.isEmpty(table.schema())) {
+            if (!StringUtil.isEmpty(table.schema())) {
                 DBIdentifier sSchema = DBIdentifier.newSchema(table.schema(), delimit());
                 sName = QualifiedDBIdentifier.newPath(sSchema, sName);
             }
@@ -550,7 +550,7 @@ public class AnnotationPersistenceMappin
             column.setIdentifier(sColNames[i]);
             uniqueConstraint.addColumn(column);
         }
-        if (!StringUtils.isEmpty(anno.name())) {
+        if (!StringUtil.isEmpty(anno.name())) {
             uniqueConstraint.setIdentifier(DBIdentifier.newConstraint(anno.name(), delimit()));
         }
         return uniqueConstraint;
@@ -574,7 +574,7 @@ public class AnnotationPersistenceMappin
      * Form a qualified table name from a schema and table name.
      */
     private DBIdentifier toTableIdentifier(String schema, String table) {
-        if (StringUtils.isEmpty(table)) {
+        if (StringUtil.isEmpty(table)) {
             return DBIdentifier.NULL;
         }
         DBIdentifier tName = DBIdentifier.newTable(table, delimit());
@@ -612,7 +612,7 @@ public class AnnotationPersistenceMappin
             for (EntityResult entity : anno.entities()) {
                 QueryResultMapping.PCResult entityResult = result.addPCResult
                     (entity.entityClass());
-                if (!StringUtils.isEmpty(entity.discriminatorColumn()))
+                if (!StringUtil.isEmpty(entity.discriminatorColumn()))
                     entityResult.addMapping(entityResult.DISCRIMINATOR,
                         entity.discriminatorColumn());
 
@@ -637,10 +637,10 @@ public class AnnotationPersistenceMappin
     private void parseDiscriminatorColumn(ClassMapping cm,
         DiscriminatorColumn dcol) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(dcol.name())) {
+        if (!StringUtil.isEmpty(dcol.name())) {
             col.setIdentifier(DBIdentifier.newColumn(dcol.name(),delimit()));
         }
-        if (!StringUtils.isEmpty(dcol.columnDefinition())) {
+        if (!StringUtil.isEmpty(dcol.columnDefinition())) {
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(dcol.columnDefinition()));
         }
         Discriminator discrim = cm.getDiscriminator();
@@ -691,7 +691,7 @@ public class AnnotationPersistenceMappin
         MappingOverride... overs) {
         FieldMapping sup;
         for (MappingOverride over : overs) {
-            if (StringUtils.isEmpty(over.name()))
+            if (StringUtil.isEmpty(over.name()))
                 throw new MetaDataException(_loc.get("no-override-name", cm));
             sup = (FieldMapping) cm.getDefinedSuperclassField(over.name());
             if (sup == null)
@@ -717,9 +717,9 @@ public class AnnotationPersistenceMappin
      */
     private void parseDataStoreIdColumn(ClassMapping cm, DataStoreIdColumn id) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(id.name()))
+        if (!StringUtil.isEmpty(id.name()))
             col.setIdentifier(DBIdentifier.newColumn(id.name(), delimit()));
-        if (!StringUtils.isEmpty(id.columnDefinition()))
+        if (!StringUtil.isEmpty(id.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(id.columnDefinition()));
         if (id.precision() != 0)
             col.setSize(id.precision());
@@ -755,7 +755,7 @@ public class AnnotationPersistenceMappin
 
         org.apache.openjpa.jdbc.schema.ForeignKey fk =
             new org.apache.openjpa.jdbc.schema.ForeignKey();
-        if (!StringUtils.isEmpty(name))
+        if (!StringUtil.isEmpty(name))
             fk.setIdentifier(DBIdentifier.newForeignKey(name, delimit()));
         fk.setDeferred(deferred);
         fk.setDeleteAction(toForeignKeyAction(deleteAction));
@@ -764,7 +764,7 @@ public class AnnotationPersistenceMappin
     }
     
     void assertDefault(ForeignKey fk) {
-        boolean isDefault = StringUtils.isEmpty(fk.name()) 
+        boolean isDefault = StringUtil.isEmpty(fk.name())
             && fk.enabled() 
             && !fk.deferred() 
                 && fk.deleteAction() == ForeignKeyAction.RESTRICT
@@ -815,7 +815,7 @@ public class AnnotationPersistenceMappin
 
         org.apache.openjpa.jdbc.schema.Index idx =
             new org.apache.openjpa.jdbc.schema.Index();
-        if (!StringUtils.isEmpty(name))
+        if (!StringUtil.isEmpty(name))
             idx.setIdentifier(DBIdentifier.newConstraint(name, delimit()));
         idx.setUnique(unique);
         info.setIndex(idx);
@@ -834,7 +834,7 @@ public class AnnotationPersistenceMappin
 
         org.apache.openjpa.jdbc.schema.Unique unq = 
             new org.apache.openjpa.jdbc.schema.Unique();
-        if (!StringUtils.isEmpty(anno.name()))
+        if (!StringUtil.isEmpty(anno.name()))
             unq.setIdentifier(DBIdentifier.newIndex(anno.name(), delimit()));
         unq.setDeferred(anno.deferred());
         info.setUnique(unq);
@@ -881,7 +881,7 @@ public class AnnotationPersistenceMappin
             boolean delimit) {
         Column col = new Column();
         col.setTableIdentifier(DBIdentifier.newTable(table, delimit));
-        if (!StringUtils.isEmpty(name))
+        if (!StringUtil.isEmpty(name))
             col.setIdentifier(DBIdentifier.newColumn(name, delimit));
         if (precision != 0)
             col.setSize(precision);
@@ -889,7 +889,7 @@ public class AnnotationPersistenceMappin
             col.setSize(length);
         col.setNotNull(!nullable);
         col.setDecimalDigits(scale);
-        if (!StringUtils.isEmpty(columnDefinition)) {
+        if (!StringUtil.isEmpty(columnDefinition)) {
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(columnDefinition));
             col.setType(Schemas.getJDBCType(col.getTypeIdentifier().getName()));
             col.setJavaType(JavaTypes.getTypeCode(Schemas.getJavaType
@@ -908,7 +908,7 @@ public class AnnotationPersistenceMappin
         XMappingOverride... overs) {
         FieldMapping sup;
         for (XMappingOverride over : overs) {
-            if (StringUtils.isEmpty(over.name()))
+            if (StringUtil.isEmpty(over.name()))
                 throw new MetaDataException(_loc.get("no-override-name", cm));
             sup = (FieldMapping) cm.getDefinedSuperclassField(over.name());
             if (sup == null)
@@ -953,9 +953,9 @@ public class AnnotationPersistenceMappin
      */
     private static Column newColumn(ElementColumn anno, boolean delimit) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(anno.name()))
+        if (!StringUtil.isEmpty(anno.name()))
             col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit));
-        if (!StringUtils.isEmpty(anno.columnDefinition()))
+        if (!StringUtil.isEmpty(anno.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition()));
         if (anno.precision() != 0)
             col.setSize(anno.precision());
@@ -989,13 +989,13 @@ public class AnnotationPersistenceMappin
      */
     private static Column newColumn(KeyJoinColumn join, boolean delimit) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(),delimit));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition()));
-        if (!StringUtils.isEmpty(join.referencedColumnName()))
+        if (!StringUtil.isEmpty(join.referencedColumnName()))
             col.setTargetIdentifier(DBIdentifier.newColumn(join.referencedColumnName(),delimit));
-        if (!StringUtils.isEmpty(join.referencedAttributeName()))
+        if (!StringUtil.isEmpty(join.referencedAttributeName()))
             col.setTargetField(join.referencedAttributeName());
         col.setNotNull(!join.nullable());
         col.setFlag(Column.FLAG_UNINSERTABLE, !join.insertable());
@@ -1580,7 +1580,7 @@ public class AnnotationPersistenceMappin
                 cols.add(newColumn(pcols[i], delimit()));
             }
             if (xmlRootElementClass != null
-                && StringUtils.isEmpty(pcols[i].columnDefinition())
+                && StringUtil.isEmpty(pcols[i].columnDefinition())
                 && (AccessController.doPrivileged(J2DoPrivHelper
                     .isAnnotationPresentAction(fm.getDeclaredType(),
                         (Class<? extends Annotation>) xmlRootElementClass))).booleanValue()) {
@@ -1619,9 +1619,9 @@ public class AnnotationPersistenceMappin
      */
     private static void setupColumn(Column col, javax.persistence.Column anno,
         boolean delimit) {
-        if (!StringUtils.isEmpty(anno.name()))
+        if (!StringUtil.isEmpty(anno.name()))
             col.setIdentifier(DBIdentifier.newColumn(anno.name(),delimit));
-        if (!StringUtils.isEmpty(anno.columnDefinition()))
+        if (!StringUtil.isEmpty(anno.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition()));
         if (anno.precision() != 0)
             col.setSize(anno.precision());
@@ -1736,12 +1736,12 @@ public class AnnotationPersistenceMappin
      */
     private Column newColumn(JoinColumn join) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit()));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); 
         String refColumnName = join.referencedColumnName();
-        if (!StringUtils.isEmpty(refColumnName)) {
+        if (!StringUtil.isEmpty(refColumnName)) {
         	setTargetIdentifier(col, refColumnName);
         }
         col.setNotNull(!join.nullable());
@@ -1788,9 +1788,9 @@ public class AnnotationPersistenceMappin
      */
     private static Column newColumn(KeyColumn anno, boolean delimit) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(anno.name()))
+        if (!StringUtil.isEmpty(anno.name()))
             col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit));
-        if (!StringUtils.isEmpty(anno.columnDefinition()))
+        if (!StringUtil.isEmpty(anno.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition()));
         if (anno.precision() != 0)
             col.setSize(anno.precision());
@@ -1844,13 +1844,13 @@ public class AnnotationPersistenceMappin
      */
     private Column newColumn(XJoinColumn join, boolean delimit) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition()));
-        if (!StringUtils.isEmpty(join.referencedColumnName()))
+        if (!StringUtil.isEmpty(join.referencedColumnName()))
             setTargetIdentifier(col, join.referencedColumnName());
-        if (!StringUtils.isEmpty(join.referencedAttributeName()))
+        if (!StringUtil.isEmpty(join.referencedAttributeName()))
             col.setTargetField(join.referencedAttributeName());
         col.setNotNull(!join.nullable());
         col.setFlag(Column.FLAG_UNINSERTABLE, !join.insertable());
@@ -1876,9 +1876,9 @@ public class AnnotationPersistenceMappin
         }
 
         DBIdentifier nullInd = DBIdentifier.NULL;
-        if (!StringUtils.isEmpty(anno.nullIndicatorAttributeName()))
+        if (!StringUtil.isEmpty(anno.nullIndicatorAttributeName()))
             nullInd = DBIdentifier.newConstant(anno.nullIndicatorAttributeName());
-        else if (!StringUtils.isEmpty(anno.nullIndicatorColumnName()))
+        else if (!StringUtil.isEmpty(anno.nullIndicatorColumnName()))
             nullInd = DBIdentifier.newColumn(anno.nullIndicatorColumnName(), delimit());
         if (DBIdentifier.isNull(nullInd))
             return;
@@ -1965,9 +1965,9 @@ public class AnnotationPersistenceMappin
         }
 
         Column col = new Column();
-        if (!StringUtils.isEmpty(order.name()))
+        if (!StringUtil.isEmpty(order.name()))
             col.setIdentifier(DBIdentifier.newColumn(order.name(), delimit()));
-        if (!StringUtils.isEmpty(order.columnDefinition()))
+        if (!StringUtil.isEmpty(order.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(order.columnDefinition())); 
         if (order.precision() != 0)
             col.setSize(order.precision());
@@ -1983,9 +1983,9 @@ public class AnnotationPersistenceMappin
         javax.persistence.OrderColumn order) {
         
         Column col = new Column();
-        if (!StringUtils.isEmpty(order.name()))
+        if (!StringUtil.isEmpty(order.name()))
             col.setIdentifier(DBIdentifier.newColumn(order.name(), delimit()));
-        if (!StringUtils.isEmpty(order.columnDefinition()))
+        if (!StringUtil.isEmpty(order.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(order.columnDefinition()));
         col.setNotNull(!order.nullable());
         col.setFlag(Column.FLAG_UNINSERTABLE, !order.insertable());
@@ -2016,13 +2016,13 @@ public class AnnotationPersistenceMappin
      */
     private Column newColumn(ElementJoinColumn join, boolean delimit) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition()));
-        if (!StringUtils.isEmpty(join.referencedColumnName()))
+        if (!StringUtil.isEmpty(join.referencedColumnName()))
             setTargetIdentifier(col, join.referencedColumnName());
-        if (!StringUtils.isEmpty(join.referencedAttributeName()))
+        if (!StringUtil.isEmpty(join.referencedAttributeName()))
             col.setTargetField(join.referencedAttributeName());
         col.setNotNull(!join.nullable());
         col.setFlag (Column.FLAG_UNINSERTABLE, !join.insertable ());
@@ -2050,12 +2050,12 @@ public class AnnotationPersistenceMappin
      */
     private void setupMapKeyColumn(FieldMapping fm, Column col, 
         MapKeyColumn anno) {
-        if (!StringUtils.isEmpty(anno.name())) {
+        if (!StringUtil.isEmpty(anno.name())) {
             col.setIdentifier(DBIdentifier.newColumn(anno.name(), delimit()));
         }
         else 
             col.setIdentifier(DBIdentifier.newColumn(fm.getName() + "_" + "KEY", delimit()));
-        if (!StringUtils.isEmpty(anno.columnDefinition()))
+        if (!StringUtil.isEmpty(anno.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(anno.columnDefinition()));
         if (anno.precision() != 0)
             col.setSize(anno.precision());
@@ -2104,11 +2104,11 @@ public class AnnotationPersistenceMappin
      */
     private Column newColumn(MapKeyJoinColumn join) {
         Column col = new Column();
-        if (!StringUtils.isEmpty(join.name()))
+        if (!StringUtil.isEmpty(join.name()))
             col.setIdentifier(DBIdentifier.newColumn(join.name(), delimit()));
-        if (!StringUtils.isEmpty(join.columnDefinition()))
+        if (!StringUtil.isEmpty(join.columnDefinition()))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(join.columnDefinition())); 
-        if (!StringUtils.isEmpty(join.referencedColumnName()))
+        if (!StringUtil.isEmpty(join.referencedColumnName()))
             setTargetIdentifier(col, join.referencedColumnName()); 
         col.setNotNull(!join.nullable());
         col.setFlag(Column.FLAG_UNINSERTABLE, !join.insertable());
@@ -2118,7 +2118,7 @@ public class AnnotationPersistenceMappin
 
     @Override
     protected String normalizeSequenceName(String seqName) {
-        if (StringUtils.isEmpty(seqName)) {
+        if (StringUtil.isEmpty(seqName)) {
             return seqName;
         }
         return DBIdentifier.newSequence(seqName, delimit()).getName();
@@ -2126,7 +2126,7 @@ public class AnnotationPersistenceMappin
     
     @Override
     protected String normalizeSchemaName(String schName) {
-        if (StringUtils.isEmpty(schName)) {
+        if (StringUtil.isEmpty(schName)) {
             return schName;
         }
         return DBIdentifier.newSchema(schName, delimit()).getName();
@@ -2134,7 +2134,7 @@ public class AnnotationPersistenceMappin
 
     @Override
     protected String normalizeCatalogName(String catName) {
-        if (StringUtils.isEmpty(catName)) {
+        if (StringUtil.isEmpty(catName)) {
             return catName;
         }
         return DBIdentifier.newCatalog(catName, delimit()).getName();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingSerializer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingSerializer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingSerializer.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingSerializer.java Wed Sep  7 19:04:18 2016
@@ -45,7 +45,7 @@ import org.apache.openjpa.meta.FieldMeta
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.meta.SequenceMetaData;
 import org.apache.openjpa.meta.MetaDataModes;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -55,6 +55,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.sql.Types;
 import java.lang.annotation.Annotation;
+import java.util.Objects;
 
 import javax.persistence.TemporalType;
 import javax.persistence.EnumType;
@@ -336,9 +337,9 @@ public class AnnotationPersistenceMappin
         for (int i = 0; i < cols.size(); i++) {
             col = cols.get(i);
             col2 = cols2.get(i);
-            if (!StringUtils.equals(col.getName(), col2.getName()))
+            if (!Objects.equals(col.getName(), col2.getName()))
                 return true;
-            if (!StringUtils.equals(col.getTypeName(), col2.getTypeName()))
+            if (!Objects.equals(col.getTypeName(), col2.getTypeName()))
                 return true;
             if (col.getSize() != col2.getSize())
                 return true;
@@ -606,7 +607,7 @@ public class AnnotationPersistenceMappin
         if (columns.length > 1)
             sb.insert(0, "{").append("}");
         ab.add("columnNames", sb.toString());
-        if (StringUtils.isNotEmpty(unique.getName())) {
+        if (StringUtil.isNotEmpty(unique.getName())) {
             ab.add("name", unique.getName());
         }
     }
@@ -718,11 +719,11 @@ public class AnnotationPersistenceMappin
                 abTblGen.add("schema", table.substring(0, dotIdx));
             }
         }
-        if (!StringUtils.isEmpty(seq.getPrimaryKeyColumn()))
+        if (!StringUtil.isEmpty(seq.getPrimaryKeyColumn()))
             abTblGen.add("pkColumnName", seq.getPrimaryKeyColumn());
-        if (!StringUtils.isEmpty(seq.getSequenceColumn()))
+        if (!StringUtil.isEmpty(seq.getSequenceColumn()))
             abTblGen.add("valueColumnName", seq.getSequenceColumn());
-        if (!StringUtils.isEmpty(seq.getPrimaryKeyValue()))
+        if (!StringUtil.isEmpty(seq.getPrimaryKeyValue()))
             abTblGen.add("pkColumnValue", seq.getPrimaryKeyValue());
         if (seq.getAllocate() != 50 && seq.getAllocate() != -1)
             abTblGen.add("allocationSize", seq.getAllocate() + "");

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java Wed Sep  7 19:04:18 2016
@@ -33,7 +33,7 @@ import javax.persistence.EnumType;
 import javax.persistence.InheritanceType;
 import javax.persistence.TemporalType;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier;
 import org.apache.openjpa.jdbc.identifier.QualifiedDBIdentifier;
@@ -338,7 +338,7 @@ public class XMLPersistenceMappingParser
 
     private boolean endName() {
         String name = this.currentText();
-        if (StringUtils.isNotEmpty(name)) {
+        if (StringUtil.isNotEmpty(name)) {
             Object current = currentElement();
             if (current instanceof Unique) {
                 Unique unq = (Unique)current;
@@ -568,7 +568,7 @@ public class XMLPersistenceMappingParser
      */
     private void endDiscriminatorValue() {
         String val = currentText();
-        if (StringUtils.isEmpty(val))
+        if (StringUtil.isEmpty(val))
             return;
 
         ClassMapping cm = (ClassMapping) currentElement();
@@ -587,7 +587,7 @@ public class XMLPersistenceMappingParser
      */
     private void endTemporal() {
         String temp = currentText();
-        if (!StringUtils.isEmpty(temp))
+        if (!StringUtil.isEmpty(temp))
             _temporal = Enum.valueOf(TemporalType.class, temp);
     }
 
@@ -597,7 +597,7 @@ public class XMLPersistenceMappingParser
     private void endMapKeyTemporal() {
         String temp = currentText();
         TemporalType _mapKeyTemporal = null;
-        if (!StringUtils.isEmpty(temp))
+        if (!StringUtil.isEmpty(temp))
             _mapKeyTemporal = Enum.valueOf(TemporalType.class, temp);
         FieldMapping fm = (FieldMapping) currentElement();
         List<Column> cols = fm.getKeyMapping().getValueInfo().getColumns();
@@ -625,7 +625,7 @@ public class XMLPersistenceMappingParser
      */
     private void endEnumerated() {
         String text = currentText();
-        if (StringUtils.isEmpty(text))
+        if (StringUtil.isEmpty(text))
             return;
         EnumType type = Enum.valueOf(EnumType.class, text);
 
@@ -643,7 +643,7 @@ public class XMLPersistenceMappingParser
      */
     private void endMapKeyEnumerated() {
         String text = currentText();
-        if (StringUtils.isEmpty(text))
+        if (StringUtil.isEmpty(text))
             return;
         EnumType type = Enum.valueOf(EnumType.class, text);
 
@@ -1194,7 +1194,7 @@ public class XMLPersistenceMappingParser
 
         QueryResultMapping parent = (QueryResultMapping) currentElement();
         QueryResultMapping.PCResult result = parent.addPCResult(entityClass);
-        if (!StringUtils.isEmpty(discriminator))
+        if (!StringUtil.isEmpty(discriminator))
             result.addMapping(PCResult.DISCRIMINATOR, discriminator);
         pushElement(result);
         return true;
@@ -1519,7 +1519,7 @@ public class XMLPersistenceMappingParser
     
     @Override
     protected String normalizeSequenceName(String seqName) {
-        if (StringUtils.isEmpty(seqName)) {
+        if (StringUtil.isEmpty(seqName)) {
             return seqName;
         }
         return DBIdentifier.newSequence(seqName, delimit()).getName();
@@ -1527,7 +1527,7 @@ public class XMLPersistenceMappingParser
     
     @Override
     protected String normalizeSchemaName(String schName) {
-        if (StringUtils.isEmpty(schName)) {
+        if (StringUtil.isEmpty(schName)) {
             return schName;
         }
         return DBIdentifier.newSchema(schName, delimit()).getName();
@@ -1535,7 +1535,7 @@ public class XMLPersistenceMappingParser
 
     @Override
     protected String normalizeCatalogName(String catName) {
-        if (StringUtils.isEmpty(catName)) {
+        if (StringUtil.isEmpty(catName)) {
             return catName;
         }
         return DBIdentifier.newCatalog(catName, delimit()).getName();
@@ -1566,10 +1566,10 @@ public class XMLPersistenceMappingParser
         
         Column col = new Column();
         String name = attrs.getValue("name");
-        if (!StringUtils.isEmpty(name));
+        if (!StringUtil.isEmpty(name));
             col.setIdentifier(DBIdentifier.newColumn(name, delimit()));
         String columnDefinition= attrs.getValue("column-definition");
-        if (!StringUtils.isEmpty(columnDefinition))
+        if (!StringUtil.isEmpty(columnDefinition))
             col.setTypeIdentifier(DBIdentifier.newColumnDefinition(columnDefinition));
         int precision = Integer.parseInt(attrs.getValue("precision"));
         if (precision != 0)
@@ -1603,7 +1603,7 @@ public class XMLPersistenceMappingParser
 
         org.apache.openjpa.jdbc.schema.Index idx =
             new org.apache.openjpa.jdbc.schema.Index();
-        if (!StringUtils.isEmpty(name))
+        if (!StringUtil.isEmpty(name))
             idx.setIdentifier(DBIdentifier.newConstraint(name, delimit()));
         idx.setUnique(unique);
         info.setIndex(idx);
@@ -1660,7 +1660,7 @@ public class XMLPersistenceMappingParser
 
         org.apache.openjpa.jdbc.schema.ForeignKey fk =
             new org.apache.openjpa.jdbc.schema.ForeignKey();
-        if (!StringUtils.isEmpty(name))
+        if (!StringUtil.isEmpty(name))
             fk.setIdentifier(DBIdentifier.newForeignKey(name, delimit()));
         fk.setDeferred(deferred);
         fk.setDeleteAction(deleteAction);
@@ -1692,7 +1692,7 @@ public class XMLPersistenceMappingParser
     
     private void assertDefault(String name, boolean enabled, boolean deferred, boolean specified,
         int updateAction, int deleteAction) {
-        boolean isDefault = StringUtils.isEmpty(name) 
+        boolean isDefault = StringUtil.isEmpty(name)
             && enabled 
             && !deferred 
                 && deleteAction == org.apache.openjpa.jdbc.schema.ForeignKey.ACTION_RESTRICT
@@ -1766,7 +1766,7 @@ public class XMLPersistenceMappingParser
         
         FieldMapping fm = (FieldMapping) fmd;
         String eagerFetchMode = attrs.getValue("eager-fetch-mode");
-        if (!StringUtils.isEmpty(eagerFetchMode)) {
+        if (!StringUtil.isEmpty(eagerFetchMode)) {
             if (eagerFetchMode.equalsIgnoreCase("NONE")) {
                 fm.setEagerFetchMode(EagerFetchModes.EAGER_NONE);
             } else if (eagerFetchMode.equalsIgnoreCase("JOIN")) {
@@ -1782,7 +1782,7 @@ public class XMLPersistenceMappingParser
         throws SAXException {
         
         String elementClassCriteriaString = attrs.getValue("element-class-criteria");
-        if (!StringUtils.isEmpty(elementClassCriteriaString)) {
+        if (!StringUtil.isEmpty(elementClassCriteriaString)) {
             FieldMapping fm = (FieldMapping) fmd;
             boolean elementClassCriteria = Boolean.parseBoolean(elementClassCriteriaString);
             fm.getElementMapping().getValueInfo().setUseClassCriteria(elementClassCriteria);
@@ -1792,7 +1792,7 @@ public class XMLPersistenceMappingParser
     @Override
     protected void parseStrategy(FieldMetaData fmd, Attributes attrs) {
         String strategy = attrs.getValue("strategy");
-        if (!StringUtils.isEmpty(strategy)) {
+        if (!StringUtil.isEmpty(strategy)) {
             ((FieldMapping) fmd).getMappingInfo().setStrategy(strategy);
         }
     }
@@ -1803,19 +1803,19 @@ public class XMLPersistenceMappingParser
         ClassMapping mapping = (ClassMapping) currentElement();
         
         String strategy = attrs.getValue("strategy");
-        if (!StringUtils.isEmpty(strategy))
+        if (!StringUtil.isEmpty(strategy))
             mapping.getMappingInfo().setStrategy(strategy);
         
         String versionStrat = attrs.getValue("version-strategy");
-        if (!StringUtils.isEmpty(versionStrat))
+        if (!StringUtil.isEmpty(versionStrat))
             mapping.getVersion().getMappingInfo().setStrategy(versionStrat);
         
         String discrimStrat = attrs.getValue("discriminator-strategy");
-        if (!StringUtils.isEmpty(discrimStrat))
+        if (!StringUtil.isEmpty(discrimStrat))
             mapping.getDiscriminator().getMappingInfo().setStrategy(discrimStrat);
         
         String subclassFetchMode = attrs.getValue("subclass-fetch-mode");
-        if (!StringUtils.isEmpty(subclassFetchMode))
+        if (!StringUtil.isEmpty(subclassFetchMode))
             mapping.setSubclassFetchMode(toEagerFetchModeConstant(subclassFetchMode));
         
         return true;

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java Wed Sep  7 19:04:18 2016
@@ -25,10 +25,12 @@ import java.util.Collections;
 import java.util.EnumMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+
 import javax.persistence.EnumType;
 import javax.persistence.TemporalType;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.lib.util.ClassUtil;
 import org.xml.sax.SAXException;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
@@ -293,9 +295,9 @@ public class XMLPersistenceMappingSerial
         for (int i = 0; i < cols.size(); i++) {
             col = cols.get(i);
             col2 = cols2.get(i);
-            if (!StringUtils.equals(col.getName(), col2.getName()))
+            if (!Objects.equals(col.getName(), col2.getName()))
                 return true;
-            if (!StringUtils.equals(col.getTypeName(), col2.getTypeName()))
+            if (!Objects.equals(col.getTypeName(), col2.getTypeName()))
                 return true;
             if (col.getSize() != col2.getSize())
                 return true;
@@ -573,7 +575,7 @@ public class XMLPersistenceMappingSerial
     }
 
     private void serializeUniqueConstraint(Unique unique) throws SAXException {
-        if (StringUtils.isNotEmpty(unique.getName())) {
+        if (StringUtil.isNotEmpty(unique.getName())) {
             addAttribute("name", unique.getName());
         }
         startElement("unique-constraint");
@@ -698,11 +700,11 @@ public class XMLPersistenceMappingSerial
                 addAttribute("schema", table.substring(0, dotIdx));
             }
         }
-        if (!StringUtils.isEmpty(seq.getPrimaryKeyColumn()))
+        if (!StringUtil.isEmpty(seq.getPrimaryKeyColumn()))
             addAttribute("pk-column-name", seq.getPrimaryKeyColumn());
-        if (!StringUtils.isEmpty(seq.getSequenceColumn()))
+        if (!StringUtil.isEmpty(seq.getSequenceColumn()))
             addAttribute("value-column-name", seq.getSequenceColumn());
-        if (!StringUtils.isEmpty(seq.getPrimaryKeyValue()))
+        if (!StringUtil.isEmpty(seq.getPrimaryKeyValue()))
             addAttribute("pk-column-value", seq.getPrimaryKeyValue());
         if (seq.getAllocate() != 50 && seq.getAllocate() != -1)
             addAttribute("allocation-size", seq.getAllocate() + "");

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/meta/strats/AbstractLobTest.java Wed Sep  7 19:04:18 2016
@@ -27,7 +27,6 @@ import java.util.List;
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.datacache.DataCachePCData;
 import org.apache.openjpa.jdbc.sql.DB2Dictionary;
@@ -267,11 +266,11 @@ public abstract class AbstractLobTest ex
     }
 
     protected String createLobData() {
-        return StringUtils.repeat("ooOOOOoo, ", 3000);
+        return repeatString("ooOOOOoo, ", 3000);
     }
 
     protected String createLobData2() {
-        return StringUtils.repeat("iiIIIIii, ", 1000);
+        return repeatString("iiIIIIii, ", 1000);
     }
 
     protected abstract Class getLobEntityClass();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java Wed Sep  7 19:04:18 2016
@@ -22,7 +22,7 @@ import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.event.TransactionEvent;
 import org.apache.openjpa.event.TransactionListener;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
@@ -143,7 +143,7 @@ public class TestBeforeCommit extends Ab
     }
 
     public void beforeCommit(TransactionEvent event) {
-        if(StringUtils.isBlank(ae.getName())) { 
+        if(StringUtil.isBlank(ae.getName())) {
             ae.setName("Ava");
         }
         else {

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java Wed Sep  7 19:04:18 2016
@@ -220,5 +220,14 @@ public abstract class SingleEMFTestCase
     protected DBDictionary getDBDictionary() { 
         return  ((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance();
     }
+
+    protected String repeatString(String val, int nr) {
+        StringBuilder sb = new StringBuilder(val.length() * nr);
+        for (int i = 0; i < nr; i++) {
+            sb.append(val);
+        }
+
+        return sb.toString();
+    }
 }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xmlmapping/query/TestXMLCustomerOrder.java Wed Sep  7 19:04:18 2016
@@ -26,7 +26,6 @@ import javax.persistence.Query;
 
 import junit.textui.TestRunner;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
@@ -353,7 +352,7 @@ public class TestXMLCustomerOrder
         USAAddress address = new ObjectFactory().createUSAAddress();
         address.setName(name);
         // Use a 4000-byte value so the entire XML string is longer than 4000 bytes - ensure Oracle handles this.
-        address.getStreet().add(StringUtils.repeat("12500 Mont", 400));
+        address.getStreet().add(repeatString("12500 Mont", 400));
         address.setCity("San Jose");
         address.setState("CA");
         address.setZIP(95141);

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationBuilder.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationBuilder.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationBuilder.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationBuilder.java Wed Sep  7 19:04:18 2016
@@ -25,8 +25,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.EnumSet;
 import java.lang.annotation.Annotation;
+import java.util.Objects;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 
 /**
  * Helper class to stringify annotation declarations.
@@ -109,7 +110,7 @@ public class AnnotationBuilder {
     private AnnotationEntry find(String key) {
         for(AnnotationEntry ae: components) {
             // null key references considered equal
-            if (StringUtils.equals(ae.key, key))
+            if (Objects.equals(ae.key, key))
                 return ae;
         }
         return null;

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java Wed Sep  7 19:04:18 2016
@@ -140,7 +140,7 @@ import javax.persistence.SequenceGenerat
 import javax.persistence.StoredProcedureParameter;
 import javax.persistence.Version;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.event.BeanLifecycleCallbacks;
 import org.apache.openjpa.event.LifecycleCallbacks;
@@ -573,7 +573,7 @@ public class AnnotationPersistenceMetaDa
                 meta.setEmbeddedOnly(true);
             else {
                 meta.setEmbeddedOnly(false);
-                if (!StringUtils.isEmpty(entity.name()))
+                if (!StringUtil.isEmpty(entity.name()))
                     meta.setTypeAlias(entity.name());
             }
         }
@@ -814,7 +814,7 @@ public class AnnotationPersistenceMetaDa
         while (cls.getEnclosingClass() != null)
             cls = cls.getEnclosingClass();
 
-        String rsrc = StringUtils.replace(cls.getName(), ".", "/");
+        String rsrc = StringUtil.replace(cls.getName(), ".", "/");
         ClassLoader loader = AccessController.doPrivileged(
             J2DoPrivHelper.getClassLoaderAction(cls));
         if (loader == null)
@@ -861,7 +861,7 @@ public class AnnotationPersistenceMetaDa
                     // technically we should have separate system table and
                     // sequence generators, but it's easier to just rely on
                     // the system org.apache.openjpa.Sequence setting for both
-                    if (StringUtils.isEmpty(generator))
+                    if (StringUtil.isEmpty(generator))
                         meta.setIdentitySequenceName(
                             SequenceMetaData.NAME_SYSTEM);
                     else
@@ -903,7 +903,7 @@ public class AnnotationPersistenceMetaDa
             meta.setDataCacheTimeout(timeout);
         }
         String cacheName = name;
-        if (StringUtils.isEmpty(cacheName)) {
+        if (StringUtil.isEmpty(cacheName)) {
             cacheName = org.apache.openjpa.datacache.DataCache.NAME_DEFAULT;
         }
         meta.setDataCacheName(enabled ? cacheName : null);
@@ -922,7 +922,7 @@ public class AnnotationPersistenceMetaDa
         if (detached != null) {
             if (!detached.enabled())
                 meta.setDetachedState(null);
-            else if (StringUtils.isEmpty(detached.fieldName()))
+            else if (StringUtil.isEmpty(detached.fieldName()))
                 meta.setDetachedState(ClassMetaData.SYNTHETIC);
             else
                 meta.setDetachedState(detached.fieldName());
@@ -1106,7 +1106,7 @@ public class AnnotationPersistenceMetaDa
    static void parseFetchGroups(ClassMetaData meta, FetchGroupImpl... groups) {
        org.apache.openjpa.meta.FetchGroup fg;
        for (FetchGroupImpl group : groups) {
-           if (StringUtils.isEmpty(group.name()))
+           if (StringUtil.isEmpty(group.name()))
                throw new MetaDataException(_loc.get("unnamed-fg", meta));
 
            fg = meta.addDeclaredFetchGroup(group.name());
@@ -1289,7 +1289,7 @@ public class AnnotationPersistenceMetaDa
                     break;
                 case EXTERNAL_VALS:
                     if (isMetaDataMode())
-                        fmd.setExternalValues(StringUtils.join(((ExternalValues) anno).value(), ","));
+                        fmd.setExternalValues(StringUtil.join(((ExternalValues) anno).value(), ","));
                     break;
                 case EXTERNALIZER:
                     if (isMetaDataMode())
@@ -1402,7 +1402,7 @@ public class AnnotationPersistenceMetaDa
                     // technically we should have separate system table and
                     // sequence generators, but it's easier to just rely on
                     // the system org.apache.openjpa.Sequence setting for both
-                    if (StringUtils.isEmpty(generator))
+                    if (StringUtil.isEmpty(generator))
                         fmd.setValueSequenceName(SequenceMetaData.NAME_SYSTEM);
                     else
                         fmd.setValueSequenceName(generator);
@@ -1426,7 +1426,7 @@ public class AnnotationPersistenceMetaDa
      */
     private static int getGeneratedValueStrategy(Object context,
         GenerationType strategy, String generator) {
-        if (strategy != AUTO || StringUtils.isEmpty(generator))
+        if (strategy != AUTO || StringUtil.isEmpty(generator))
             return -1;
 
         if (Generator.UUID_HEX.equals(generator))
@@ -1524,7 +1524,7 @@ public class AnnotationPersistenceMetaDa
         if (!anno.optional())
             fmd.setNullValue(FieldMetaData.NULL_EXCEPTION);
 
-        if (isMappingOverrideMode() && !StringUtils.isEmpty(anno.mappedBy()))
+        if (isMappingOverrideMode() && !StringUtil.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         if (anno.targetEntity() != void.class)
             fmd.setTypeOverride(anno.targetEntity());
@@ -1565,7 +1565,7 @@ public class AnnotationPersistenceMetaDa
         }
 
         fmd.setInDefaultFetchGroup(anno.fetch() == FetchType.EAGER);
-        if (isMappingOverrideMode() && !StringUtils.isEmpty(anno.mappedBy()))
+        if (isMappingOverrideMode() && !StringUtil.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         if (anno.targetEntity() != void.class)
             fmd.getElement().setDeclaredType(anno.targetEntity());
@@ -1591,7 +1591,7 @@ public class AnnotationPersistenceMetaDa
         }
 
         fmd.setInDefaultFetchGroup(anno.fetch() == FetchType.EAGER);
-        if (isMappingOverrideMode() && !StringUtils.isEmpty(anno.mappedBy()))
+        if (isMappingOverrideMode() && !StringUtil.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         if (anno.targetEntity() != void.class)
             fmd.getElement().setDeclaredType(anno.targetEntity());
@@ -1604,7 +1604,7 @@ public class AnnotationPersistenceMetaDa
      */
     private void parseMapKey(FieldMetaData fmd, MapKey anno) {
         String name = anno.name();
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             fmd.getKey().setValueMappedBy(ValueMetaData.MAPPED_BY_PK);
         else
             fmd.getKey().setValueMappedBy(name);
@@ -1676,7 +1676,7 @@ public class AnnotationPersistenceMetaDa
                     "Persistent"));
         }
 
-        if (!StringUtils.isEmpty(anno.mappedBy()))
+        if (!StringUtil.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         fmd.setInDefaultFetchGroup(anno.fetch() == FetchType.EAGER);
         if (!anno.optional())
@@ -1705,7 +1705,7 @@ public class AnnotationPersistenceMetaDa
 
         fmd.setPersistentCollection(true); 
         
-        if (!StringUtils.isEmpty(anno.mappedBy()))
+        if (!StringUtil.isEmpty(anno.mappedBy()))
             fmd.setMappedBy(anno.mappedBy());
         fmd.setInDefaultFetchGroup(anno.fetch() == FetchType.EAGER);
         if (anno.elementType() != void.class)
@@ -1813,7 +1813,7 @@ public class AnnotationPersistenceMetaDa
     private void parseSequenceGenerator(AnnotatedElement el,
         SequenceGenerator gen) {
         String name = gen.name();
-        if (StringUtils.isEmpty(name))
+        if (StringUtil.isEmpty(name))
             throw new MetaDataException(_loc.get("no-seq-name", el));
 
         if (_log.isTraceEnabled())
@@ -1844,7 +1844,7 @@ public class AnnotationPersistenceMetaDa
 
         // create plugin string from info
         String clsName, props;
-        if (StringUtils.isEmpty(seq)) {
+        if (StringUtil.isEmpty(seq)) {
             clsName = SequenceMetaData.IMPL_NATIVE;
             props = null;
         } else if (seq.indexOf('(') != -1) // plugin
@@ -1873,9 +1873,9 @@ public class AnnotationPersistenceMetaDa
     private void parseNamedQueries(AnnotatedElement el, NamedQuery... queries) {
         QueryMetaData meta;
         for (NamedQuery query : queries) {
-            if (StringUtils.isEmpty(query.name()))
+            if (StringUtil.isEmpty(query.name()))
                 throw new MetaDataException(_loc.get("no-query-name", el));
-            if (StringUtils.isEmpty(query.query()))
+            if (StringUtil.isEmpty(query.query()))
                 throw new MetaDataException(_loc.get("no-query-string",
                     query.name(), el));
 
@@ -1946,10 +1946,10 @@ public class AnnotationPersistenceMetaDa
         NamedNativeQuery... queries) {
         QueryMetaData meta;
         for (NamedNativeQuery query : queries) {
-            if (StringUtils.isEmpty(query.name()))
+            if (StringUtil.isEmpty(query.name()))
                 throw new MetaDataException(_loc.get("no-native-query-name",
                     el));
-            if (StringUtils.isEmpty(query.query()))
+            if (StringUtil.isEmpty(query.query()))
                 throw new MetaDataException(_loc.get("no-native-query-string",
                     query.name(), el));
 
@@ -1974,7 +1974,7 @@ public class AnnotationPersistenceMetaDa
             else if (!void.class.equals(res))
                 meta.setResultType(res);
 
-            if (!StringUtils.isEmpty(query.resultSetMapping()))
+            if (!StringUtil.isEmpty(query.resultSetMapping()))
                 meta.setResultSetMappingName(query.resultSetMapping());
             for (QueryHint hint : query.hints())
                 meta.addHint(hint.name(), hint.value());
@@ -2182,9 +2182,9 @@ public class AnnotationPersistenceMetaDa
 
     private void parseNamedStoredProcedureQueries(AnnotatedElement el, NamedStoredProcedureQuery... procs) {
         for (NamedStoredProcedureQuery proc : procs) {
-            if (StringUtils.isEmpty(proc.name()))
+            if (StringUtil.isEmpty(proc.name()))
                 throw new MetaDataException(_loc.get("stored-proc-no-name", el));
-            if (StringUtils.isEmpty(proc.procedureName()))
+            if (StringUtil.isEmpty(proc.procedureName()))
                 throw new MetaDataException(_loc.get("stored-proc-no-dbname", el));
 
             // Query metadata name

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataSerializer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataSerializer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataSerializer.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataSerializer.java Wed Sep  7 19:04:18 2016
@@ -38,6 +38,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.Set;
 import java.util.Map.Entry;
@@ -66,7 +67,7 @@ import javax.persistence.SequenceGenerat
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.QueryLanguages;
 import org.apache.openjpa.lib.conf.Configurations;
@@ -1362,7 +1363,7 @@ public class AnnotationPersistenceMetaDa
          */
         public int compare(QueryMetaData o1, QueryMetaData o2) {
             // normal queries before native
-            if (!StringUtils.equals(o1.getLanguage(), o2.getLanguage())) {
+            if (!Objects.equals(o1.getLanguage(), o2.getLanguage())) {
                 if (QueryLanguages.LANG_SQL.equals(o1.getLanguage()))
                     return 1;
                 else
@@ -1486,7 +1487,7 @@ public class AnnotationPersistenceMetaDa
          */
         private int compare(QueryMetaData o1, QueryMetaData o2) {
             // normal queries before native
-            if (!StringUtils.equals(o1.getLanguage(), o2.getLanguage())) {
+            if (!Objects.equals(o1.getLanguage(), o2.getLanguage())) {
                 if (QueryLanguages.LANG_SQL.equals(o1.getLanguage()))
                     return 1;
                 else

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceXMLMetaDataParser.java Wed Sep  7 19:04:18 2016
@@ -24,8 +24,9 @@ import java.lang.reflect.Field;
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.security.AccessController;
+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.lib.log.Log;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
@@ -217,7 +218,7 @@ public class AnnotationPersistenceXMLMet
             populateFromReflection(superclass, meta);
 
         try {
-            if (StringUtils.equals(xmlAccessorValue.invoke(cls.getAnnotation(
+            if (Objects.equals(xmlAccessorValue.invoke(cls.getAnnotation(
                 xmlAccessorTypeClass), new Object[]{}).toString(), "FIELD"))
                 members = cls.getDeclaredFields();
             else
@@ -231,7 +232,7 @@ public class AnnotationPersistenceXMLMet
                     String xmlname = (String) xmlElementName.invoke(el
                         .getAnnotation(xmlElementClass), new Object[]{});
                     // avoid JAXB XML bind default name
-                    if (StringUtils.equals(XMLMetaData.defaultName, xmlname))
+                    if (Objects.equals(XMLMetaData.defaultName, xmlname))
                         xmlname = member.getName();
                     if ((AccessController.doPrivileged(J2DoPrivHelper
                         .isAnnotationPresentAction(((Field) member).getType(),
@@ -260,7 +261,7 @@ public class AnnotationPersistenceXMLMet
                     String xmlname = (String) xmlAttributeName.invoke(
                         el.getAnnotation(xmlAttributeClass), new Object[]{});
                     // avoid JAXB XML bind default name
-                    if (StringUtils.equals(XMLMetaData.defaultName, xmlname))
+                    if (Objects.equals(XMLMetaData.defaultName, xmlname))
                         xmlname = member.getName();
                     field.setXmlname("@"+xmlname);
                     field.setXmlnamespace((String) xmlAttributeNamespace.invoke(

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java Wed Sep  7 19:04:18 2016
@@ -28,7 +28,7 @@ import java.util.Set;
 import javax.persistence.*;
 import javax.persistence.spi.LoadState;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.AutoDetach;
 import org.apache.openjpa.kernel.Broker;
@@ -213,10 +213,10 @@ public class EntityManagerFactoryImpl
         }
         
         if (log != null && log.isTraceEnabled()) {
-            if(StringUtils.isNotEmpty(cfName)) {
+            if(StringUtil.isNotEmpty(cfName)) {
                 log.trace("Found ConnectionFactoryName from props: " + cfName);
             }
-            if(StringUtils.isNotEmpty(cf2Name)) { 
+            if(StringUtil.isNotEmpty(cf2Name)) {
                 log.trace("Found ConnectionFactory2Name from props: " + cf2Name);
             }
         }
@@ -406,7 +406,7 @@ public class EntityManagerFactoryImpl
     }
     
     private void validateCfNameProps(OpenJPAConfiguration conf, String cfName, String cf2Name) {
-        if (StringUtils.isNotEmpty(cfName) || StringUtils.isNotEmpty(cf2Name)) {
+        if (StringUtil.isNotEmpty(cfName) || StringUtil.isNotEmpty(cf2Name)) {
             if (conf.getDataCache() != "false" && conf.getDataCache() != null) {
                 throw new ArgumentException(_loc.get("invalid-cfname-prop", new Object[] {
                     "openjpa.DataCache (L2 Cache)",

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Wed Sep  7 19:04:18 2016
@@ -57,7 +57,6 @@ import javax.persistence.criteria.Criter
 import javax.persistence.criteria.ParameterExpression;
 import javax.persistence.metamodel.Metamodel;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.openjpa.conf.Compatibility;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.ee.ManagedRuntime;
@@ -1174,7 +1173,7 @@ public class EntityManagerImpl
      * Validate that the user provided SQL.
      */
     protected void validateSQL(String query) {
-        if (StringUtils.trimToNull(query) == null)
+        if (StringUtil.trimToNull(query) == null)
             throw new ArgumentException(_loc.get("no-sql"), null, null, false);
     }
     

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/JPAProperties.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/JPAProperties.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/JPAProperties.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/JPAProperties.java Wed Sep  7 19:04:18 2016
@@ -24,7 +24,7 @@ import java.util.Map;
 import javax.persistence.CacheRetrieveMode;
 import javax.persistence.CacheStoreMode;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.kernel.DataCacheRetrieveMode;
 import org.apache.openjpa.kernel.DataCacheStoreMode;
 
@@ -113,7 +113,7 @@ public class JPAProperties {
         String[] parts = key.split(REGEX_DOT);
         StringBuilder buf = new StringBuilder();
         for (int i = 2; i < parts.length; i++) {
-            buf.append(StringUtils.capitalize(parts[i]));
+            buf.append(StringUtil.capitalize(parts[i]));
         }
         return buf.toString();
     }

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java Wed Sep  7 19:04:18 2016
@@ -41,7 +41,7 @@ import javax.persistence.ValidationMode;
 import javax.persistence.spi.PersistenceUnitInfo;
 import javax.persistence.spi.PersistenceUnitTransactionType;
 
-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.conf.OpenJPAConfigurationImpl;
@@ -330,7 +330,7 @@ public class PersistenceProductDerivatio
      */
     public ConfigurationProvider load(String rsrc, String name, Map m)
         throws IOException {
-        boolean explicit = !StringUtils.isEmpty(rsrc);
+        boolean explicit = !StringUtil.isEmpty(rsrc);
         if (!explicit)
             rsrc = RSRC_DEFAULT;
         
@@ -435,10 +435,10 @@ public class PersistenceProductDerivatio
         throws IOException {
         String[] prefixes = ProductDerivations.getConfigurationPrefixes();
         String rsrc = null;
-        for (int i = 0; i < prefixes.length && StringUtils.isEmpty(rsrc); i++)
+        for (int i = 0; i < prefixes.length && StringUtil.isEmpty(rsrc); i++)
            rsrc = AccessController.doPrivileged(J2DoPrivHelper
                 .getPropertyAction(prefixes[i] + ".properties")); 
-        boolean explicit = !StringUtils.isEmpty(rsrc);
+        boolean explicit = !StringUtil.isEmpty(rsrc);
         String anchor = null;
         int idx = (!explicit) ? -1 : rsrc.lastIndexOf('#');
         if (idx != -1) {
@@ -447,7 +447,7 @@ public class PersistenceProductDerivatio
                 anchor = rsrc.substring(idx + 1);
             rsrc = rsrc.substring(0, idx);
         }
-        if (StringUtils.isEmpty(rsrc))
+        if (StringUtil.isEmpty(rsrc))
             rsrc = RSRC_GLOBAL;
         else if (!rsrc.endsWith(".xml"))
             return null;
@@ -606,7 +606,7 @@ public class PersistenceProductDerivatio
             if (isOpenJPAPersistenceProvider(pinfo, loader)) {
                 // if no name given and found unnamed unit, return it.  
                 // otherwise record as default unit unless we find a better match later
-                if (StringUtils.isEmpty(pinfo.getPersistenceUnitName()))
+                if (StringUtil.isEmpty(pinfo.getPersistenceUnitName()))
                     return pinfo;
                 if (ojpa == null)
                     ojpa = pinfo;
@@ -623,7 +623,7 @@ public class PersistenceProductDerivatio
      */
     private static boolean isOpenJPAPersistenceProvider(PersistenceUnitInfo pinfo, ClassLoader loader) {
         String provider = pinfo.getPersistenceProviderClassName();
-        if (StringUtils.isEmpty(provider) || PersistenceProviderImpl.class.getName().equals(provider))
+        if (StringUtil.isEmpty(provider) || PersistenceProviderImpl.class.getName().equals(provider))
             return true;
 
         if (loader == null)
@@ -706,7 +706,7 @@ public class PersistenceProductDerivatio
                 // get overwritten by our implicit setting.  so instead, combine
                 // the global value with our settings
                 String orig = oconf.getMetaDataFactory();
-                if (!StringUtils.isEmpty(orig)) {
+                if (!StringUtil.isEmpty(orig)) {
                     String key = ProductDerivations.getConfigurationKey("MetaDataFactory", getProperties());
                     Object override = getProperties().get(key);
                     if (override instanceof String)

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataParser.java Wed Sep  7 19:04:18 2016
@@ -32,6 +32,7 @@ import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.Stack;
 
@@ -41,7 +42,7 @@ import javax.persistence.LockModeType;
 
 import static javax.persistence.CascadeType.*;
 
-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.event.BeanLifecycleCallbacks;
@@ -1066,7 +1067,7 @@ public class XMLPersistenceMetaDataParse
             }
             meta.setListingIndex(_clsPos);
             String name = attrs.getValue("name");
-            if (!StringUtils.isEmpty(name))
+            if (!StringUtil.isEmpty(name))
                 meta.setTypeAlias(name);
             meta.setAbstract(mappedSuper);
             meta.setEmbeddedOnly(mappedSuper || embeddable);
@@ -1136,7 +1137,7 @@ public class XMLPersistenceMetaDataParse
      * default if string is empty.
      */
     private int toAccessType(String str) {
-        if (StringUtils.isEmpty(str))
+        if (StringUtil.isEmpty(str))
             return AccessCode.UNKNOWN;
         if ("PROPERTY".equals(str))
             return AccessCode.EXPLICIT | AccessCode.PROPERTY;
@@ -1309,7 +1310,7 @@ public class XMLPersistenceMetaDataParse
 
         String strategy = attrs.getValue("strategy");
         String generator = attrs.getValue("generator");
-        GenerationType type = StringUtils.isEmpty(strategy)
+        GenerationType type = StringUtil.isEmpty(strategy)
             ? GenerationType.AUTO : GenerationType.valueOf(strategy);
 
         FieldMetaData fmd = (FieldMetaData) currentElement();
@@ -1821,7 +1822,7 @@ public class XMLPersistenceMetaDataParse
                 throw new MetaDataException(_loc.get(
                     "invalid-orderBy", fmd));
         }
-        if (StringUtils.isEmpty(dec) || dec.equals("ASC"))
+        if (StringUtil.isEmpty(dec) || dec.equals("ASC"))
             dec = Order.ELEMENT + " asc";
         else if (dec.equals("DESC"))
             dec = Order.ELEMENT + " desc";
@@ -2364,7 +2365,7 @@ public class XMLPersistenceMetaDataParse
      * @return true if the source was has already been resolved from a different location. Otherwise return false
      */
     protected boolean isDuplicateClass(ClassMetaData meta) {
-        if (!StringUtils.equals(getSourceName(), meta.getSourceName())) {
+        if (!Objects.equals(getSourceName(), meta.getSourceName())) {
             return true;
         }
 
@@ -2380,7 +2381,7 @@ public class XMLPersistenceMetaDataParse
      * @return true if the QueryMetaData was defined in a different place - e.g. another line in orm.xml.
      */
     protected boolean isDuplicateQuery(QueryMetaData meta) { 
-        if(! StringUtils.equals(getSourceName(), meta.getSourceName())) {
+        if(! Objects.equals(getSourceName(), meta.getSourceName())) {
             return true;
         }
         if(getLineNum() != meta.getLineNumber()) { 
@@ -2406,7 +2407,7 @@ public class XMLPersistenceMetaDataParse
         
         //Set default value if not specified
         String strategy = attrs.getValue("strategy");
-        if (StringUtils.isEmpty(strategy)) {
+        if (StringUtil.isEmpty(strategy)) {
             strategy ="AUTO"    ;
         }
         GenerationType stratType = GenerationType.valueOf(strategy);
@@ -2420,15 +2421,15 @@ public class XMLPersistenceMetaDataParse
     private boolean startDataCache(Attributes attrs) 
             throws SAXException {
         String enabledStr = attrs.getValue("enabled");
-        boolean enabled = (Boolean) (StringUtils.isEmpty(enabledStr) ? true : 
+        boolean enabled = (Boolean) (StringUtil.isEmpty(enabledStr) ? true :
             Boolean.parseBoolean(enabledStr));
         
         String timeoutStr = attrs.getValue("timeout");
-        int timeout = (Integer) (StringUtils.isEmpty(timeoutStr) ? Integer.MIN_VALUE : 
+        int timeout = (Integer) (StringUtil.isEmpty(timeoutStr) ? Integer.MIN_VALUE :
             Integer.parseInt(timeoutStr));
         
         String name = attrs.getValue("name");
-        name = StringUtils.isEmpty(name) ? "" : name;
+        name = StringUtil.isEmpty(name) ? "" : name;
         
         AnnotationPersistenceMetaDataParser.parseDataCache(getRepository().getCachedMetaData(_cls), 
             enabled, name, timeout);
@@ -2589,17 +2590,17 @@ public class XMLPersistenceMetaDataParse
     
     private void parseCommonExtendedAttributes(FieldMetaData fmd, Attributes attrs) {
         String loadFetchGroup = attrs.getValue("load-fetch-group");
-        if (!StringUtils.isEmpty(loadFetchGroup)) {
+        if (!StringUtil.isEmpty(loadFetchGroup)) {
             fmd.setLoadFetchGroup(loadFetchGroup);
         }
         
         String externalizer = attrs.getValue("externalizer");
-        if (!StringUtils.isEmpty(externalizer)) {
+        if (!StringUtil.isEmpty(externalizer)) {
             fmd.setExternalizer(externalizer);
         }
         
         String factory = attrs.getValue("factory");
-        if (!StringUtils.isEmpty(factory)) {
+        if (!StringUtil.isEmpty(factory)) {
             fmd.setFactory(factory);
         }
         
@@ -2631,7 +2632,7 @@ public class XMLPersistenceMetaDataParse
     private void parseDependentAttr(FieldMetaData fmd, Attributes attrs)
         throws SAXException {
         String dependentStr = attrs.getValue("dependent");
-        if (!StringUtils.isEmpty(dependentStr)) {
+        if (!StringUtil.isEmpty(dependentStr)) {
             boolean dependent = Boolean.parseBoolean(dependentStr);
             if (dependent) {
                 fmd.setCascadeDelete(ValueMetaData.CASCADE_AUTO);
@@ -2646,7 +2647,7 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
         
         String elementDependentStr = attrs.getValue("element-dependent");
-        if (!StringUtils.isEmpty(elementDependentStr)) {
+        if (!StringUtil.isEmpty(elementDependentStr)) {
             boolean elementDependent = Boolean.parseBoolean(elementDependentStr);
             if (elementDependent) {
                 fmd.getElement().setCascadeDelete(ValueMetaData.CASCADE_AUTO);
@@ -2661,7 +2662,7 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
         
         String keyDependentStr = attrs.getValue("key-dependent");
-        if (!StringUtils.isEmpty(keyDependentStr)) {
+        if (!StringUtil.isEmpty(keyDependentStr)) {
             boolean keyDependent = Boolean.parseBoolean(keyDependentStr);
             if (keyDependent) {
                 fmd.getKey().setCascadeDelete(ValueMetaData.CASCADE_AUTO);
@@ -2676,7 +2677,7 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
         
 //        String elementClassCriteriaString = attrs.getValue("element-class-criteria");
-//        if (!StringUtils.isEmpty(elementClassCriteriaString)) {
+//        if (!StringUtil.isEmpty(elementClassCriteriaString)) {
 //            FieldMapping fm = (FieldMapping) fmd;
 //            boolean elementClassCriteria = Boolean.parseBoolean(elementClassCriteriaString);
 //            fm.getElementMapping().getValueInfo().setUseClassCriteria(elementClassCriteria);
@@ -2687,10 +2688,9 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
 
         String typeStr = attrs.getValue("type");
-        if (!StringUtils.isEmpty(typeStr)) {
-            if (StringUtils.endsWithIgnoreCase(typeStr, ".class")) {
-                typeStr =
-                    typeStr.substring(0, StringUtils.lastIndexOf(typeStr, '.'));
+        if (!StringUtil.isEmpty(typeStr)) {
+            if (StringUtil.endsWithIgnoreCase(typeStr, ".class")) {
+                typeStr = typeStr.substring(0, typeStr.lastIndexOf('.'));
             }
             Class<?> typeCls = parseTypeStr(typeStr);
 
@@ -2701,7 +2701,7 @@ public class XMLPersistenceMetaDataParse
     private void parseLRSAttr(FieldMetaData fmd, Attributes attrs)
         throws SAXException {
         String lrsStr = attrs.getValue("lrs");
-        if (!StringUtils.isEmpty(lrsStr)) {
+        if (!StringUtil.isEmpty(lrsStr)) {
             boolean lrs = Boolean.parseBoolean(lrsStr);
             fmd.setLRS(lrs);
         }
@@ -2711,10 +2711,9 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
 
         String typeStr = attrs.getValue("element-type");
-        if (!StringUtils.isEmpty(typeStr)) {
-            if (StringUtils.endsWithIgnoreCase(typeStr, ".class")) {
-                typeStr =
-                    typeStr.substring(0, StringUtils.lastIndexOf(typeStr, '.'));
+        if (!StringUtil.isEmpty(typeStr)) {
+            if (StringUtil.endsWithIgnoreCase(typeStr, ".class")) {
+                typeStr = typeStr.substring(0, typeStr.lastIndexOf('.'));
             }
             Class<?> typeCls = parseTypeStr(typeStr);
 
@@ -2726,10 +2725,9 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
 
         String typeStr = attrs.getValue("key-type");
-        if (!StringUtils.isEmpty(typeStr)) {
-            if (StringUtils.endsWithIgnoreCase(typeStr, ".class")) {
-                typeStr =
-                    typeStr.substring(0, StringUtils.lastIndexOf(typeStr, '.'));
+        if (!StringUtil.isEmpty(typeStr)) {
+            if (StringUtil.endsWithIgnoreCase(typeStr, ".class")) {
+                typeStr = typeStr.substring(0, typeStr.lastIndexOf('.'));
             }
             Class<?> typeCls = parseTypeStr(typeStr);
 
@@ -2779,7 +2777,7 @@ public class XMLPersistenceMetaDataParse
         throws SAXException {
         
         String inverseLogical = attrs.getValue("inverse-logical");
-        if (!StringUtils.isEmpty(inverseLogical)) {
+        if (!StringUtil.isEmpty(inverseLogical)) {
             fmd.setInverse(inverseLogical);
         }
     }

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataSerializer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataSerializer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataSerializer.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/XMLPersistenceMetaDataSerializer.java Wed Sep  7 19:04:18 2016
@@ -31,9 +31,10 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.QueryLanguages;
 import org.apache.openjpa.lib.conf.Configurations;
@@ -1315,7 +1316,7 @@ public class XMLPersistenceMetaDataSeria
          */
         public int compare(QueryMetaData o1, QueryMetaData o2) {
             // normal queries before native
-            if (!StringUtils.equals(o1.getLanguage(), o2.getLanguage())) {
+            if (!Objects.equals(o1.getLanguage(), o2.getLanguage())) {
                 if (QueryLanguages.LANG_SQL.equals(o1.getLanguage()))
                     return 1;
                 else
@@ -1439,7 +1440,7 @@ public class XMLPersistenceMetaDataSeria
          */
         private int compare(QueryMetaData o1, QueryMetaData o2) {
             // normal queries before native
-            if (!StringUtils.equals(o1.getLanguage(), o2.getLanguage())) {
+            if (!Objects.equals(o1.getLanguage(), o2.getLanguage())) {
                 if (QueryLanguages.LANG_SQL.equals(o1.getLanguage()))
                     return 1;
                 else

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/validation/ValidatorImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/validation/ValidatorImpl.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/validation/ValidatorImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/validation/ValidatorImpl.java Wed Sep  7 19:04:18 2016
@@ -30,7 +30,7 @@ import javax.validation.ConstraintViolat
 import javax.validation.Validator;
 import javax.validation.ValidatorFactory;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.event.LifecycleEvent;
 import org.apache.openjpa.lib.conf.Configuration;
@@ -219,10 +219,10 @@ public class ValidatorImpl extends Abstr
             vgGrp = new Class<?>[strClasses.length];
             for (int i = 0; i < strClasses.length; i++) {
                 try {
-                    vgGrp[i] =  Class.forName(StringUtils.trim(strClasses[i]));
+                    vgGrp[i] =  Class.forName(StringUtil.trim(strClasses[i]));
                 } catch (Throwable t) {
                     throw new IllegalArgumentException(
-                        _loc.get("invalid-validation-group", StringUtils.trim(strClasses[i]),
+                        _loc.get("invalid-validation-group", StringUtil.trim(strClasses[i]),
                             vgName).getMessage(), t);
                 }
             }            

Modified: openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java?rev=1759663&r1=1759662&r2=1759663&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/src/main/java/org/apache/openjpa/enhance/stats/FetchStatisticsAuxEnhancer.java Wed Sep  7 19:04:18 2016
@@ -20,7 +20,7 @@ package org.apache.openjpa.enhance.stats
 
 import java.util.Locale;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.openjpa.lib.util.StringUtil;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.enhance.PCEnhancer.AuxiliaryEnhancer;
 import org.apache.openjpa.lib.log.Log;
@@ -92,7 +92,7 @@ public class FetchStatisticsAuxEnhancer
             fieldName = methName.substring(5);
         } else if (methName.toLowerCase(Locale.ENGLISH).startsWith("get")) {
             // property access
-            fieldName = StringUtils.uncapitalize(methName.substring(3));
+            fieldName = StringUtil.uncapitalize(methName.substring(3));
         } else if (methName.startsWith("pcis")) {
             fieldName = methName.substring(4).toLowerCase(Locale.ENGLISH);
         }




Mime
View raw message