Review Board 1.7.22


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

Review Request #13636 - Created Aug. 18, 2013 and submitted

Erik Selin
https://issues.apache.org/jira/browse/SQOOP-1170
Reviewers
Sqoop
sqoop-trunk
Adds public to JAVA_RESERVED_WORDS. This should allow for importing tables with columns named "public".

 
src/java/com/cloudera/sqoop/orm/ClassWriter.java
Revision 61ff054 New Change
[20] 31 lines
[+20] [+] public class ClassWriter
32

    
   
32

   
33
  static {
33
  static {
34
    JAVA_RESERVED_WORDS = new HashSet<String>();
34
    JAVA_RESERVED_WORDS = new HashSet<String>();
35

    
   
35

   
36
    JAVA_RESERVED_WORDS.add("abstract");
36
    JAVA_RESERVED_WORDS.add("abstract");
37
    JAVA_RESERVED_WORDS.add("else");

   
38
    JAVA_RESERVED_WORDS.add("int");

   
39
    JAVA_RESERVED_WORDS.add("strictfp");

   
40
    JAVA_RESERVED_WORDS.add("assert");
37
    JAVA_RESERVED_WORDS.add("assert");
41
    JAVA_RESERVED_WORDS.add("enum");

   
42
    JAVA_RESERVED_WORDS.add("interface");

   
43
    JAVA_RESERVED_WORDS.add("super");

   
44
    JAVA_RESERVED_WORDS.add("boolean");
38
    JAVA_RESERVED_WORDS.add("boolean");
45
    JAVA_RESERVED_WORDS.add("extends");

   
46
    JAVA_RESERVED_WORDS.add("long");

   
47
    JAVA_RESERVED_WORDS.add("switch");

   
48
    JAVA_RESERVED_WORDS.add("break");
39
    JAVA_RESERVED_WORDS.add("break");
49
    JAVA_RESERVED_WORDS.add("false");

   
50
    JAVA_RESERVED_WORDS.add("native");

   
51
    JAVA_RESERVED_WORDS.add("synchronized");

   
52
    JAVA_RESERVED_WORDS.add("byte");
40
    JAVA_RESERVED_WORDS.add("byte");
53
    JAVA_RESERVED_WORDS.add("final");

   
54
    JAVA_RESERVED_WORDS.add("new");

   
55
    JAVA_RESERVED_WORDS.add("this");

   
56
    JAVA_RESERVED_WORDS.add("case");
41
    JAVA_RESERVED_WORDS.add("case");
57
    JAVA_RESERVED_WORDS.add("finally");

   
58
    JAVA_RESERVED_WORDS.add("null");

   
59
    JAVA_RESERVED_WORDS.add("throw");

   
60
    JAVA_RESERVED_WORDS.add("catch");
42
    JAVA_RESERVED_WORDS.add("catch");
61
    JAVA_RESERVED_WORDS.add("float");

   
62
    JAVA_RESERVED_WORDS.add("package");

   
63
    JAVA_RESERVED_WORDS.add("throws");

   
64
    JAVA_RESERVED_WORDS.add("char");
43
    JAVA_RESERVED_WORDS.add("char");
65
    JAVA_RESERVED_WORDS.add("for");

   
66
    JAVA_RESERVED_WORDS.add("private");

   
67
    JAVA_RESERVED_WORDS.add("transient");

   
68
    JAVA_RESERVED_WORDS.add("class");
44
    JAVA_RESERVED_WORDS.add("class");

    
   
45
    JAVA_RESERVED_WORDS.add("const");

    
   
46
    JAVA_RESERVED_WORDS.add("continue");

    
   
47
    JAVA_RESERVED_WORDS.add("default");

    
   
48
    JAVA_RESERVED_WORDS.add("do");

    
   
49
    JAVA_RESERVED_WORDS.add("double");

    
   
50
    JAVA_RESERVED_WORDS.add("else");

    
   
51
    JAVA_RESERVED_WORDS.add("enum");

    
   
52
    JAVA_RESERVED_WORDS.add("extends");

    
   
53
    JAVA_RESERVED_WORDS.add("false");

    
   
54
    JAVA_RESERVED_WORDS.add("final");

    
   
55
    JAVA_RESERVED_WORDS.add("finally");

    
   
56
    JAVA_RESERVED_WORDS.add("float");

    
   
57
    JAVA_RESERVED_WORDS.add("for");
69
    JAVA_RESERVED_WORDS.add("goto");
58
    JAVA_RESERVED_WORDS.add("goto");

    
   
59
    JAVA_RESERVED_WORDS.add("if");

    
   
60
    JAVA_RESERVED_WORDS.add("implements");

    
   
61
    JAVA_RESERVED_WORDS.add("import");

    
   
62
    JAVA_RESERVED_WORDS.add("instanceof");

    
   
63
    JAVA_RESERVED_WORDS.add("int");

    
   
64
    JAVA_RESERVED_WORDS.add("interface");

    
   
65
    JAVA_RESERVED_WORDS.add("long");

    
   
66
    JAVA_RESERVED_WORDS.add("native");

    
   
67
    JAVA_RESERVED_WORDS.add("new");

    
   
68
    JAVA_RESERVED_WORDS.add("null");

    
   
69
    JAVA_RESERVED_WORDS.add("package");

    
   
70
    JAVA_RESERVED_WORDS.add("private");
70
    JAVA_RESERVED_WORDS.add("protected");
71
    JAVA_RESERVED_WORDS.add("protected");

    
   
72
    JAVA_RESERVED_WORDS.add("public");

    
   
73
    JAVA_RESERVED_WORDS.add("return");

    
   
74
    JAVA_RESERVED_WORDS.add("short");

    
   
75
    JAVA_RESERVED_WORDS.add("static");

    
   
76
    JAVA_RESERVED_WORDS.add("strictfp");

    
   
77
    JAVA_RESERVED_WORDS.add("super");

    
   
78
    JAVA_RESERVED_WORDS.add("switch");

    
   
79
    JAVA_RESERVED_WORDS.add("synchronized");

    
   
80
    JAVA_RESERVED_WORDS.add("this");

    
   
81
    JAVA_RESERVED_WORDS.add("throw");

    
   
82
    JAVA_RESERVED_WORDS.add("throws");

    
   
83
    JAVA_RESERVED_WORDS.add("transient");
71
    JAVA_RESERVED_WORDS.add("true");
84
    JAVA_RESERVED_WORDS.add("true");
72
    JAVA_RESERVED_WORDS.add("const");
85
    JAVA_RESERVED_WORDS.add("try");

    
   
86
    JAVA_RESERVED_WORDS.add("void");

    
   
87
    JAVA_RESERVED_WORDS.add("volatile");

    
   
88
    JAVA_RESERVED_WORDS.add("while");
73
  }
89
  }
74

    
   
90

   
75
  public static final int CLASS_WRITER_VERSION =
91
  public static final int CLASS_WRITER_VERSION =
76
    org.apache.sqoop.orm.ClassWriter.CLASS_WRITER_VERSION;
92
    org.apache.sqoop.orm.ClassWriter.CLASS_WRITER_VERSION;
77

    
   
93

   
[+20] [20] 18 lines
src/java/org/apache/sqoop/orm/ClassWriter.java
Revision 4cb4b78 New Change
 
src/test/com/cloudera/sqoop/orm/TestClassWriter.java
Revision 358f3fc New Change
 
  1. src/java/com/cloudera/sqoop/orm/ClassWriter.java: Loading...
  2. src/java/org/apache/sqoop/orm/ClassWriter.java: Loading...
  3. src/test/com/cloudera/sqoop/orm/TestClassWriter.java: Loading...