mirror of
https://github.com/apache/sqoop.git
synced 2025-05-17 01:11:07 +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()];
|
String [] ret = new String[values.size()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(ExampleValue value : values) {
|
for(ExampleValue value : values) {
|
||||||
ret[i++] = value.escapedStringValue;
|
ret[i++] = value.getEscapedStringValue();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -24,21 +24,33 @@ public class ExampleValue {
|
|||||||
/**
|
/**
|
||||||
* Properly escaped value so that it can be used in INSERT statement.
|
* 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().
|
* 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.
|
* 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) {
|
public ExampleValue(String insertStatement, Object objectValue, String escapedStringValue) {
|
||||||
this.insertStatement = insertStatement;
|
this.insertStatement = insertStatement;
|
||||||
this.objectValue = objectValue;
|
this.objectValue = objectValue;
|
||||||
this.escapedStringValue = escapedStringValue;
|
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;
|
int i = 1;
|
||||||
for(ExampleValue value: type.values) {
|
for(ExampleValue value: type.values) {
|
||||||
insertRow(false, Integer.toString(i++), value.insertStatement);
|
insertRow(false, Integer.toString(i++), value.getInsertStatement());
|
||||||
}
|
}
|
||||||
|
|
||||||
// RDBMS link
|
// RDBMS link
|
||||||
@ -152,9 +152,9 @@ public void testTo() throws Exception {
|
|||||||
assertEquals(type.values.size(), rowCount());
|
assertEquals(type.values.size(), rowCount());
|
||||||
for(ExampleValue value : type.values) {
|
for(ExampleValue value : type.values) {
|
||||||
assertRow(
|
assertRow(
|
||||||
new Object[] {"value", value.insertStatement},
|
new Object[] {"value", value.getInsertStatement()},
|
||||||
false,
|
false,
|
||||||
value.objectValue);
|
value.getObjectValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up testing table
|
// Clean up testing table
|
||||||
|
Loading…
Reference in New Issue
Block a user