mirror of
https://github.com/apache/sqoop.git
synced 2025-05-16 17:00:53 +08:00
SQOOP-2499: Sqoop2: Findbugs: Fix the problem of URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD for ExampleValue
(Colin Ma via Jarek Jarcec Cecho)
This commit is contained in:
parent
7ce9f67f71
commit
242146581e
@ -89,7 +89,7 @@ public String toString() {
|
||||
String [] ret = new String[values.size()];
|
||||
int i = 0;
|
||||
for(ExampleValue value : values) {
|
||||
ret[i++] = value.escapedStringValue;
|
||||
ret[i++] = value.getEscapedStringValue();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -24,21 +24,33 @@ public class ExampleValue {
|
||||
/**
|
||||
* Properly escaped value so that it can be used in INSERT statement.
|
||||
*/
|
||||
public final String insertStatement;
|
||||
private String insertStatement;
|
||||
|
||||
/**
|
||||
* Object value that should be returned from JDBC driver getObject().
|
||||
*/
|
||||
public final Object objectValue;
|
||||
private Object objectValue;
|
||||
|
||||
/**
|
||||
* Escaped string value that will be stored by HDFS connector.
|
||||
*/
|
||||
public final String escapedStringValue;
|
||||
private String escapedStringValue;
|
||||
|
||||
public ExampleValue(String insertStatement, Object objectValue, String escapedStringValue) {
|
||||
this.insertStatement = insertStatement;
|
||||
this.objectValue = objectValue;
|
||||
this.escapedStringValue = escapedStringValue;
|
||||
}
|
||||
|
||||
public String getInsertStatement() {
|
||||
return insertStatement;
|
||||
}
|
||||
|
||||
public Object getObjectValue() {
|
||||
return objectValue;
|
||||
}
|
||||
|
||||
public String getEscapedStringValue() {
|
||||
return escapedStringValue;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public void testFrom() throws Exception {
|
||||
|
||||
int i = 1;
|
||||
for(ExampleValue value: type.values) {
|
||||
insertRow(false, Integer.toString(i++), value.insertStatement);
|
||||
insertRow(false, Integer.toString(i++), value.getInsertStatement());
|
||||
}
|
||||
|
||||
// RDBMS link
|
||||
@ -152,9 +152,9 @@ public void testTo() throws Exception {
|
||||
assertEquals(type.values.size(), rowCount());
|
||||
for(ExampleValue value : type.values) {
|
||||
assertRow(
|
||||
new Object[] {"value", value.insertStatement},
|
||||
new Object[] {"value", value.getInsertStatement()},
|
||||
false,
|
||||
value.objectValue);
|
||||
value.getObjectValue());
|
||||
}
|
||||
|
||||
// Clean up testing table
|
||||
|
Loading…
Reference in New Issue
Block a user