sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1170: Can't import columns with name "public"
Date Mon, 26 Aug 2013 16:01:26 GMT
Updated Branches:
  refs/heads/trunk fa40fcabe -> 1b41c9a6d


SQOOP-1170: Can't import columns with name "public"

(Erik Selin via Jarek Jarcec Cecho)


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

Branch: refs/heads/trunk
Commit: 1b41c9a6d25e8bbe2a9c35c5ed3deb4530a67f28
Parents: fa40fca
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Mon Aug 26 09:00:37 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Mon Aug 26 09:00:37 2013 -0700

----------------------------------------------------------------------
 .../com/cloudera/sqoop/orm/ClassWriter.java     | 66 ++++++++++++--------
 src/java/org/apache/sqoop/orm/ClassWriter.java  | 66 ++++++++++++--------
 .../com/cloudera/sqoop/orm/TestClassWriter.java | 54 ++++++++++++++++
 3 files changed, 136 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/1b41c9a6/src/java/com/cloudera/sqoop/orm/ClassWriter.java
----------------------------------------------------------------------
diff --git a/src/java/com/cloudera/sqoop/orm/ClassWriter.java b/src/java/com/cloudera/sqoop/orm/ClassWriter.java
index 61ff054..80141bf 100644
--- a/src/java/com/cloudera/sqoop/orm/ClassWriter.java
+++ b/src/java/com/cloudera/sqoop/orm/ClassWriter.java
@@ -34,42 +34,58 @@ public class ClassWriter
     JAVA_RESERVED_WORDS = new HashSet<String>();
 
     JAVA_RESERVED_WORDS.add("abstract");
-    JAVA_RESERVED_WORDS.add("else");
-    JAVA_RESERVED_WORDS.add("int");
-    JAVA_RESERVED_WORDS.add("strictfp");
     JAVA_RESERVED_WORDS.add("assert");
-    JAVA_RESERVED_WORDS.add("enum");
-    JAVA_RESERVED_WORDS.add("interface");
-    JAVA_RESERVED_WORDS.add("super");
     JAVA_RESERVED_WORDS.add("boolean");
-    JAVA_RESERVED_WORDS.add("extends");
-    JAVA_RESERVED_WORDS.add("long");
-    JAVA_RESERVED_WORDS.add("switch");
     JAVA_RESERVED_WORDS.add("break");
-    JAVA_RESERVED_WORDS.add("false");
-    JAVA_RESERVED_WORDS.add("native");
-    JAVA_RESERVED_WORDS.add("synchronized");
     JAVA_RESERVED_WORDS.add("byte");
-    JAVA_RESERVED_WORDS.add("final");
-    JAVA_RESERVED_WORDS.add("new");
-    JAVA_RESERVED_WORDS.add("this");
     JAVA_RESERVED_WORDS.add("case");
-    JAVA_RESERVED_WORDS.add("finally");
-    JAVA_RESERVED_WORDS.add("null");
-    JAVA_RESERVED_WORDS.add("throw");
     JAVA_RESERVED_WORDS.add("catch");
-    JAVA_RESERVED_WORDS.add("float");
-    JAVA_RESERVED_WORDS.add("package");
-    JAVA_RESERVED_WORDS.add("throws");
     JAVA_RESERVED_WORDS.add("char");
-    JAVA_RESERVED_WORDS.add("for");
-    JAVA_RESERVED_WORDS.add("private");
-    JAVA_RESERVED_WORDS.add("transient");
     JAVA_RESERVED_WORDS.add("class");
+    JAVA_RESERVED_WORDS.add("const");
+    JAVA_RESERVED_WORDS.add("continue");
+    JAVA_RESERVED_WORDS.add("default");
+    JAVA_RESERVED_WORDS.add("do");
+    JAVA_RESERVED_WORDS.add("double");
+    JAVA_RESERVED_WORDS.add("else");
+    JAVA_RESERVED_WORDS.add("enum");
+    JAVA_RESERVED_WORDS.add("extends");
+    JAVA_RESERVED_WORDS.add("false");
+    JAVA_RESERVED_WORDS.add("final");
+    JAVA_RESERVED_WORDS.add("finally");
+    JAVA_RESERVED_WORDS.add("float");
+    JAVA_RESERVED_WORDS.add("for");
     JAVA_RESERVED_WORDS.add("goto");
+    JAVA_RESERVED_WORDS.add("if");
+    JAVA_RESERVED_WORDS.add("implements");
+    JAVA_RESERVED_WORDS.add("import");
+    JAVA_RESERVED_WORDS.add("instanceof");
+    JAVA_RESERVED_WORDS.add("int");
+    JAVA_RESERVED_WORDS.add("interface");
+    JAVA_RESERVED_WORDS.add("long");
+    JAVA_RESERVED_WORDS.add("native");
+    JAVA_RESERVED_WORDS.add("new");
+    JAVA_RESERVED_WORDS.add("null");
+    JAVA_RESERVED_WORDS.add("package");
+    JAVA_RESERVED_WORDS.add("private");
     JAVA_RESERVED_WORDS.add("protected");
+    JAVA_RESERVED_WORDS.add("public");
+    JAVA_RESERVED_WORDS.add("return");
+    JAVA_RESERVED_WORDS.add("short");
+    JAVA_RESERVED_WORDS.add("static");
+    JAVA_RESERVED_WORDS.add("strictfp");
+    JAVA_RESERVED_WORDS.add("super");
+    JAVA_RESERVED_WORDS.add("switch");
+    JAVA_RESERVED_WORDS.add("synchronized");
+    JAVA_RESERVED_WORDS.add("this");
+    JAVA_RESERVED_WORDS.add("throw");
+    JAVA_RESERVED_WORDS.add("throws");
+    JAVA_RESERVED_WORDS.add("transient");
     JAVA_RESERVED_WORDS.add("true");
-    JAVA_RESERVED_WORDS.add("const");
+    JAVA_RESERVED_WORDS.add("try");
+    JAVA_RESERVED_WORDS.add("void");
+    JAVA_RESERVED_WORDS.add("volatile");
+    JAVA_RESERVED_WORDS.add("while");
   }
 
   public static final int CLASS_WRITER_VERSION =

http://git-wip-us.apache.org/repos/asf/sqoop/blob/1b41c9a6/src/java/org/apache/sqoop/orm/ClassWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/orm/ClassWriter.java b/src/java/org/apache/sqoop/orm/ClassWriter.java
index 4cb4b78..7fdf434 100644
--- a/src/java/org/apache/sqoop/orm/ClassWriter.java
+++ b/src/java/org/apache/sqoop/orm/ClassWriter.java
@@ -64,42 +64,58 @@ public class ClassWriter {
     JAVA_RESERVED_WORDS = new HashSet<String>();
 
     JAVA_RESERVED_WORDS.add("abstract");
-    JAVA_RESERVED_WORDS.add("else");
-    JAVA_RESERVED_WORDS.add("int");
-    JAVA_RESERVED_WORDS.add("strictfp");
     JAVA_RESERVED_WORDS.add("assert");
-    JAVA_RESERVED_WORDS.add("enum");
-    JAVA_RESERVED_WORDS.add("interface");
-    JAVA_RESERVED_WORDS.add("super");
     JAVA_RESERVED_WORDS.add("boolean");
-    JAVA_RESERVED_WORDS.add("extends");
-    JAVA_RESERVED_WORDS.add("long");
-    JAVA_RESERVED_WORDS.add("switch");
     JAVA_RESERVED_WORDS.add("break");
-    JAVA_RESERVED_WORDS.add("false");
-    JAVA_RESERVED_WORDS.add("native");
-    JAVA_RESERVED_WORDS.add("synchronized");
     JAVA_RESERVED_WORDS.add("byte");
-    JAVA_RESERVED_WORDS.add("final");
-    JAVA_RESERVED_WORDS.add("new");
-    JAVA_RESERVED_WORDS.add("this");
     JAVA_RESERVED_WORDS.add("case");
-    JAVA_RESERVED_WORDS.add("finally");
-    JAVA_RESERVED_WORDS.add("null");
-    JAVA_RESERVED_WORDS.add("throw");
     JAVA_RESERVED_WORDS.add("catch");
-    JAVA_RESERVED_WORDS.add("float");
-    JAVA_RESERVED_WORDS.add("package");
-    JAVA_RESERVED_WORDS.add("throws");
     JAVA_RESERVED_WORDS.add("char");
-    JAVA_RESERVED_WORDS.add("for");
-    JAVA_RESERVED_WORDS.add("private");
-    JAVA_RESERVED_WORDS.add("transient");
     JAVA_RESERVED_WORDS.add("class");
+    JAVA_RESERVED_WORDS.add("const");
+    JAVA_RESERVED_WORDS.add("continue");
+    JAVA_RESERVED_WORDS.add("default");
+    JAVA_RESERVED_WORDS.add("do");
+    JAVA_RESERVED_WORDS.add("double");
+    JAVA_RESERVED_WORDS.add("else");
+    JAVA_RESERVED_WORDS.add("enum");
+    JAVA_RESERVED_WORDS.add("extends");
+    JAVA_RESERVED_WORDS.add("false");
+    JAVA_RESERVED_WORDS.add("final");
+    JAVA_RESERVED_WORDS.add("finally");
+    JAVA_RESERVED_WORDS.add("float");
+    JAVA_RESERVED_WORDS.add("for");
     JAVA_RESERVED_WORDS.add("goto");
+    JAVA_RESERVED_WORDS.add("if");
+    JAVA_RESERVED_WORDS.add("implements");
+    JAVA_RESERVED_WORDS.add("import");
+    JAVA_RESERVED_WORDS.add("instanceof");
+    JAVA_RESERVED_WORDS.add("int");
+    JAVA_RESERVED_WORDS.add("interface");
+    JAVA_RESERVED_WORDS.add("long");
+    JAVA_RESERVED_WORDS.add("native");
+    JAVA_RESERVED_WORDS.add("new");
+    JAVA_RESERVED_WORDS.add("null");
+    JAVA_RESERVED_WORDS.add("package");
+    JAVA_RESERVED_WORDS.add("private");
     JAVA_RESERVED_WORDS.add("protected");
+    JAVA_RESERVED_WORDS.add("public");
+    JAVA_RESERVED_WORDS.add("return");
+    JAVA_RESERVED_WORDS.add("short");
+    JAVA_RESERVED_WORDS.add("static");
+    JAVA_RESERVED_WORDS.add("strictfp");
+    JAVA_RESERVED_WORDS.add("super");
+    JAVA_RESERVED_WORDS.add("switch");
+    JAVA_RESERVED_WORDS.add("synchronized");
+    JAVA_RESERVED_WORDS.add("this");
+    JAVA_RESERVED_WORDS.add("throw");
+    JAVA_RESERVED_WORDS.add("throws");
+    JAVA_RESERVED_WORDS.add("transient");
     JAVA_RESERVED_WORDS.add("true");
-    JAVA_RESERVED_WORDS.add("const");
+    JAVA_RESERVED_WORDS.add("try");
+    JAVA_RESERVED_WORDS.add("void");
+    JAVA_RESERVED_WORDS.add("volatile");
+    JAVA_RESERVED_WORDS.add("while");
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/sqoop/blob/1b41c9a6/src/test/com/cloudera/sqoop/orm/TestClassWriter.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/orm/TestClassWriter.java b/src/test/com/cloudera/sqoop/orm/TestClassWriter.java
index 358f3fc..78a250c 100644
--- a/src/test/com/cloudera/sqoop/orm/TestClassWriter.java
+++ b/src/test/com/cloudera/sqoop/orm/TestClassWriter.java
@@ -309,7 +309,61 @@ public class TestClassWriter extends TestCase {
     assertEquals("_", ClassWriter.getIdentifierStrForChar('_'));
 
     assertEquals("foo", ClassWriter.toJavaIdentifier("foo"));
+
+    assertEquals("_abstract", ClassWriter.toJavaIdentifier("abstract"));
+    assertEquals("_assert", ClassWriter.toJavaIdentifier("assert"));
+    assertEquals("_boolean", ClassWriter.toJavaIdentifier("boolean"));
+    assertEquals("_break", ClassWriter.toJavaIdentifier("break"));
+    assertEquals("_byte", ClassWriter.toJavaIdentifier("byte"));
+    assertEquals("_case", ClassWriter.toJavaIdentifier("case"));
+    assertEquals("_catch", ClassWriter.toJavaIdentifier("catch"));
+    assertEquals("_char", ClassWriter.toJavaIdentifier("char"));
     assertEquals("_class", ClassWriter.toJavaIdentifier("class"));
+    assertEquals("_const", ClassWriter.toJavaIdentifier("const"));
+    assertEquals("_continue", ClassWriter.toJavaIdentifier("continue"));
+    assertEquals("_default", ClassWriter.toJavaIdentifier("default"));
+    assertEquals("_do", ClassWriter.toJavaIdentifier("do"));
+    assertEquals("_double", ClassWriter.toJavaIdentifier("double"));
+    assertEquals("_else", ClassWriter.toJavaIdentifier("else"));
+    assertEquals("_enum", ClassWriter.toJavaIdentifier("enum"));
+    assertEquals("_extends", ClassWriter.toJavaIdentifier("extends"));
+    assertEquals("_false", ClassWriter.toJavaIdentifier("false"));
+    assertEquals("_final", ClassWriter.toJavaIdentifier("final"));
+    assertEquals("_finally", ClassWriter.toJavaIdentifier("finally"));
+    assertEquals("_float", ClassWriter.toJavaIdentifier("float"));
+    assertEquals("_for", ClassWriter.toJavaIdentifier("for"));
+    assertEquals("_goto", ClassWriter.toJavaIdentifier("goto"));
+    assertEquals("_if", ClassWriter.toJavaIdentifier("if"));
+    assertEquals("_implements", ClassWriter.toJavaIdentifier("implements"));
+    assertEquals("_import", ClassWriter.toJavaIdentifier("import"));
+    assertEquals("_instanceof", ClassWriter.toJavaIdentifier("instanceof"));
+    assertEquals("_int", ClassWriter.toJavaIdentifier("int"));
+    assertEquals("_interface", ClassWriter.toJavaIdentifier("interface"));
+    assertEquals("_long", ClassWriter.toJavaIdentifier("long"));
+    assertEquals("_native", ClassWriter.toJavaIdentifier("native"));
+    assertEquals("_new", ClassWriter.toJavaIdentifier("new"));
+    assertEquals("_null", ClassWriter.toJavaIdentifier("null"));
+    assertEquals("_package", ClassWriter.toJavaIdentifier("package"));
+    assertEquals("_private", ClassWriter.toJavaIdentifier("private"));
+    assertEquals("_protected", ClassWriter.toJavaIdentifier("protected"));
+    assertEquals("_public", ClassWriter.toJavaIdentifier("public"));
+    assertEquals("_return", ClassWriter.toJavaIdentifier("return"));
+    assertEquals("_short", ClassWriter.toJavaIdentifier("short"));
+    assertEquals("_static", ClassWriter.toJavaIdentifier("static"));
+    assertEquals("_strictfp", ClassWriter.toJavaIdentifier("strictfp"));
+    assertEquals("_super", ClassWriter.toJavaIdentifier("super"));
+    assertEquals("_switch", ClassWriter.toJavaIdentifier("switch"));
+    assertEquals("_synchronized", ClassWriter.toJavaIdentifier("synchronized"));
+    assertEquals("_this", ClassWriter.toJavaIdentifier("this"));
+    assertEquals("_throw", ClassWriter.toJavaIdentifier("throw"));
+    assertEquals("_throws", ClassWriter.toJavaIdentifier("throws"));
+    assertEquals("_transient", ClassWriter.toJavaIdentifier("transient"));
+    assertEquals("_true", ClassWriter.toJavaIdentifier("true"));
+    assertEquals("_try", ClassWriter.toJavaIdentifier("try"));
+    assertEquals("_void", ClassWriter.toJavaIdentifier("void"));
+    assertEquals("_volatile", ClassWriter.toJavaIdentifier("volatile"));
+    assertEquals("_while", ClassWriter.toJavaIdentifier("while"));
+
     assertEquals("_class", ClassWriter.toJavaIdentifier("cla ss"));
     assertEquals("_int", ClassWriter.toJavaIdentifier("int"));
     assertEquals("thisismanywords", ClassWriter.toJavaIdentifier(


Mime
View raw message