cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [8/9] cayenne git commit: CAY-2351 Remove dependency on commons-collection release notes final cleanup
Date Mon, 21 Aug 2017 09:29:21 GMT
CAY-2351 Remove dependency on commons-collection
  release notes
  final cleanup


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/3c215ef1
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/3c215ef1
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/3c215ef1

Branch: refs/heads/master
Commit: 3c215ef168b93d2185e3fae61e820ab20ec28b1f
Parents: 7f7aca8
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Aug 17 12:44:46 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Aug 17 12:44:46 2017 +0300

----------------------------------------------------------------------
 cayenne-server/pom.xml                            |  5 -----
 .../cayenne/access/jdbc/RowDescriptorBuilder.java |  1 -
 docs/doc/src/main/resources/RELEASE-NOTES.txt     |  1 +
 modeler/cayenne-wocompat/pom.xml                  |  4 ----
 .../apache/cayenne/wocompat/EOModelProcessor.java | 18 +++++++++++++++---
 pom.xml                                           | 10 ----------
 6 files changed, 16 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/cayenne-server/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-server/pom.xml b/cayenne-server/pom.xml
index 3644697..97847ca 100644
--- a/cayenne-server/pom.xml
+++ b/cayenne-server/pom.xml
@@ -44,11 +44,6 @@
 			<version>${project.version}</version>
 			<scope>compile</scope>
 		</dependency>
-		<dependency>
-			<groupId>commons-collections</groupId>
-			<artifactId>commons-collections</artifactId>
-			<scope>compile</scope>
-		</dependency>
 		<!-- Optional dependencies... things that might have been placed in submodules... -->
 		<dependency>
 			<groupId>com.caucho</groupId>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowDescriptorBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowDescriptorBuilder.java
b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowDescriptorBuilder.java
index 3f4c2c8..4831dc3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowDescriptorBuilder.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowDescriptorBuilder.java
@@ -32,7 +32,6 @@ import java.util.function.Function;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.access.types.ExtendedTypeMap;
-import org.apache.cayenne.util.Util;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 48cfa84..224dbdb 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -21,6 +21,7 @@ CAY-2336 Support for comments in Modeler
 CAY-2339 Compatibility module to support old versions of projects at runtime
 CAY-2345 Own template renderer as a replacement for Velocity
 CAY-2346 Field-based data object with Map-based storage fallback
+CAY-2351 Remove commons-collections usage completely
 
 Bug Fixes:
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/modeler/cayenne-wocompat/pom.xml
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/pom.xml b/modeler/cayenne-wocompat/pom.xml
index fccfedd..590d236 100644
--- a/modeler/cayenne-wocompat/pom.xml
+++ b/modeler/cayenne-wocompat/pom.xml
@@ -40,10 +40,6 @@
 			<artifactId>cayenne-dbsync</artifactId>
 			<version>${project.version}</version>
 		</dependency>
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-		</dependency>
 
 		<dependency>
 			<groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
index ac2e9f0..18fc903 100644
--- a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
+++ b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
@@ -35,7 +35,6 @@ import org.apache.cayenne.query.Ordering;
 import org.apache.cayenne.query.QueryMetadata;
 import org.apache.cayenne.query.SortOrder;
 import org.apache.cayenne.wocompat.parser.Parser;
-import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -265,7 +264,7 @@ public class EOModelProcessor {
 				if (fetchLimit instanceof Number) {
 					descriptor.setProperty(QueryMetadata.FETCH_LIMIT_PROPERTY,
 							String.valueOf(((Number) fetchLimit).intValue()));
-				} else if (StringUtils.isNumeric(fetchLimit.toString())) {
+				} else if (isNumeric(fetchLimit.toString())) {
 					descriptor.setProperty(QueryMetadata.FETCH_LIMIT_PROPERTY, fetchLimit.toString());
 				}
 			} catch (NumberFormatException nfex) {
@@ -320,7 +319,7 @@ public class EOModelProcessor {
 				if (fetchLimit instanceof Number) {
 					descriptor.setProperty(QueryMetadata.FETCH_LIMIT_PROPERTY,
 							String.valueOf(((Number) fetchLimit).intValue()));
-				} else if (StringUtils.isNumeric(fetchLimit.toString())) {
+				} else if (isNumeric(fetchLimit.toString())) {
 					descriptor.setProperty(QueryMetadata.FETCH_LIMIT_PROPERTY, fetchLimit.toString());
 				}
 			} catch (NumberFormatException nfex) {
@@ -813,6 +812,19 @@ public class EOModelProcessor {
 		return null;
 	}
 
+	static boolean isNumeric(String str) {
+		if (str == null) {
+			return false;
+		}
+
+		for(int i = 0; i < str.length(); ++i) {
+			if (!Character.isDigit(str.charAt(i))) {
+				return false;
+			}
+		}
+		return true;
+	}
+
 	// sorts ObjEntities so that subentities in inheritance hierarchy are shown
 	// last
 	final class InheritanceComparator implements Comparator {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3c215ef1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e3be55c..788e211 100644
--- a/pom.xml
+++ b/pom.xml
@@ -316,16 +316,6 @@
 				<scope>test</scope>
 			</dependency>
 			<dependency>
-				<groupId>commons-collections</groupId>
-				<artifactId>commons-collections</artifactId>
-				<version>3.2.1</version>
-			</dependency>
-			<dependency>
-				<groupId>commons-lang</groupId>
-				<artifactId>commons-lang</artifactId>
-				<version>2.4</version>
-			</dependency>
-			<dependency>
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-dbcp2</artifactId>
                 <version>2.1.1</version>


Mime
View raw message