sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject git commit: SQOOP-1105. Sqoop2: Remove our implementation of StringUtils
Date Fri, 12 Jul 2013 23:30:28 GMT
Updated Branches:
  refs/heads/sqoop2 4997f97bc -> 20bbef04c


SQOOP-1105. Sqoop2: Remove our implementation of StringUtils

(Raghav Kumar Gautam via Hari Shreedharan)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/20bbef04
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/20bbef04
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/20bbef04

Branch: refs/heads/sqoop2
Commit: 20bbef04c4344b6e53645ad934db20888b98bccf
Parents: 4997f97
Author: Hari Shreedharan <hshreedharan@apache.org>
Authored: Fri Jul 12 16:29:52 2013 -0700
Committer: Hari Shreedharan <hshreedharan@apache.org>
Committed: Fri Jul 12 16:29:52 2013 -0700

----------------------------------------------------------------------
 .../sqoop/client/utils/FormDisplayer.java       |  2 +-
 .../sqoop/json/util/FormSerialization.java      |  2 +-
 .../java/org/apache/sqoop/model/MEnumInput.java |  2 +-
 .../org/apache/sqoop/utils/StringUtils.java     | 51 --------------------
 .../org/apache/sqoop/utils/TestStringUtils.java | 35 --------------
 repository/repository-derby/pom.xml             |  5 ++
 .../derby/DerbyRepositoryHandler.java           |  2 +-
 7 files changed, 9 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java b/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
index 0a0f319..b044e22 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
+++ b/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.client.utils;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.model.MAccountableEntity;
 import org.apache.sqoop.model.MBooleanInput;
@@ -31,7 +32,6 @@ import org.apache.sqoop.model.MJob;
 import org.apache.sqoop.model.MJobForms;
 import org.apache.sqoop.model.MMapInput;
 import org.apache.sqoop.model.MStringInput;
-import org.apache.sqoop.utils.StringUtils;
 import org.apache.sqoop.validation.Status;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java b/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
index 05a0878..98768d6 100644
--- a/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
+++ b/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.json.util;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MEnumInput;
 import org.apache.sqoop.model.MForm;
@@ -26,7 +27,6 @@ import org.apache.sqoop.model.MInputType;
 import org.apache.sqoop.model.MIntegerInput;
 import org.apache.sqoop.model.MMapInput;
 import org.apache.sqoop.model.MStringInput;
-import org.apache.sqoop.utils.StringUtils;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/common/src/main/java/org/apache/sqoop/model/MEnumInput.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/MEnumInput.java b/common/src/main/java/org/apache/sqoop/model/MEnumInput.java
index 620c840..28830f4 100644
--- a/common/src/main/java/org/apache/sqoop/model/MEnumInput.java
+++ b/common/src/main/java/org/apache/sqoop/model/MEnumInput.java
@@ -17,8 +17,8 @@
  */
 package org.apache.sqoop.model;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.utils.StringUtils;
 
 import java.util.Arrays;
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/common/src/main/java/org/apache/sqoop/utils/StringUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/utils/StringUtils.java b/common/src/main/java/org/apache/sqoop/utils/StringUtils.java
deleted file mode 100644
index 97d356a..0000000
--- a/common/src/main/java/org/apache/sqoop/utils/StringUtils.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.utils;
-
-/**
- * Convenience String methods.
- *
- * We might consider replacing this with commons-lang library at some point.
- */
-public final class StringUtils {
-
-  public static String join(String []array, String separator) {
-    if(array == null) {
-      return null;
-    }
-
-    StringBuilder sb = new StringBuilder();
-    boolean first = true;
-
-    for(String item : array) {
-      if(first) {
-        first = false;
-      } else {
-        sb.append(separator);
-      }
-
-      sb.append(item);
-    }
-
-    return sb.toString();
-  }
-
-  private StringUtils() {
-    // Instantiation is prohibited
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java b/common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java
deleted file mode 100644
index e0ca2ec..0000000
--- a/common/src/test/java/org/apache/sqoop/utils/TestStringUtils.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.utils;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TestStringUtils extends TestCase {
-
-  public void testJoin() {
-    assertNull(StringUtils.join(null, "a"));
-
-    String []a = new String[] {"a", "b", "c"};
-
-    assertEquals("a,b,c", StringUtils.join(a, ","));
-    assertEquals("abc", StringUtils.join(a, ""));
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/repository/repository-derby/pom.xml
----------------------------------------------------------------------
diff --git a/repository/repository-derby/pom.xml b/repository/repository-derby/pom.xml
index f6cf60d..6ad6d64 100644
--- a/repository/repository-derby/pom.xml
+++ b/repository/repository-derby/pom.xml
@@ -43,6 +43,11 @@ limitations under the License.
     </dependency>
 
     <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/sqoop/blob/20bbef04/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
index 72c72bb..f717abf 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
@@ -39,6 +39,7 @@ import java.util.Set;
 import javax.sql.DataSource;
 
 import org.apache.log4j.Logger;
+import org.apache.commons.lang.StringUtils;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConnection;
@@ -63,7 +64,6 @@ import org.apache.sqoop.submission.SubmissionStatus;
 import org.apache.sqoop.submission.counter.Counter;
 import org.apache.sqoop.submission.counter.CounterGroup;
 import org.apache.sqoop.submission.counter.Counters;
-import org.apache.sqoop.utils.StringUtils;
 
 /**
  * JDBC based repository handler for Derby database.


Mime
View raw message