diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DefaultTypeList.java b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DefaultTypeList.java index 9abf243d..f92403dd 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DefaultTypeList.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DefaultTypeList.java @@ -28,11 +28,11 @@ public DefaultTypeList() { // Integer type add(DatabaseType.builder("INT") - .addExample("-32768", new Integer(-32768), "-32768") - .addExample("-1", new Integer(-1), "-1") - .addExample("0", new Integer(0), "0") - .addExample("1", new Integer(1), "1") - .addExample("32767", new Integer(32767), "32767") + .addExample("-32768", Integer.valueOf(-32768), "-32768") + .addExample("-1", Integer.valueOf(-1), "-1") + .addExample("0", Integer.valueOf(0), "0") + .addExample("1", Integer.valueOf(1), "1") + .addExample("32767", Integer.valueOf(32767), "32767") .build()); } } \ No newline at end of file diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DerbyTypeList.java b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DerbyTypeList.java index 1d4445a2..642651de 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DerbyTypeList.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/DerbyTypeList.java @@ -29,56 +29,56 @@ public DerbyTypeList() { // Numeric types add(DatabaseType.builder("SMALLINT") - .addExample("-32768", new Integer(-32768), "-32768") - .addExample( "-1", new Integer(-1), "-1") - .addExample( "0", new Integer(0), "0") - .addExample( "1", new Integer(1), "1") - .addExample( "32767", new Integer(32767), "32767") + .addExample("-32768", Integer.valueOf(-32768), "-32768") + .addExample( "-1", Integer.valueOf(-1), "-1") + .addExample( "0", Integer.valueOf(0), "0") + .addExample( "1", Integer.valueOf(1), "1") + .addExample( "32767", Integer.valueOf(32767), "32767") .build()); add(DatabaseType.builder("INT") - .addExample("-2147483648", new Integer(-2147483648), "-2147483648") - .addExample( "-1", new Integer(-1), "-1") - .addExample( "0", new Integer(0), "0") - .addExample( "1", new Integer(1), "1") - .addExample( "2147483647", new Integer(2147483647), "2147483647") + .addExample("-2147483648", Integer.valueOf(-2147483648), "-2147483648") + .addExample( "-1", Integer.valueOf(-1), "-1") + .addExample( "0", Integer.valueOf(0), "0") + .addExample( "1", Integer.valueOf(1), "1") + .addExample( "2147483647", Integer.valueOf(2147483647), "2147483647") .build()); add(DatabaseType.builder("BIGINT") - .addExample("-9223372036854775808", new Long(-9223372036854775808L), "-9223372036854775808") - .addExample( "-1", new Long(-1L), "-1") - .addExample( "0", new Long(0L), "0") - .addExample( "1", new Long(1L), "1") - .addExample( "9223372036854775807", new Long(9223372036854775807L), "9223372036854775807") + .addExample("-9223372036854775808", Long.valueOf(-9223372036854775808L), "-9223372036854775808") + .addExample( "-1", Long.valueOf(-1L), "-1") + .addExample( "0", Long.valueOf(0L), "0") + .addExample( "1", Long.valueOf(1L), "1") + .addExample( "9223372036854775807", Long.valueOf(9223372036854775807L), "9223372036854775807") .build()); // Floating points add(DatabaseType.builder("REAL") - .addExample("CAST(-3.402E+38 AS REAL)", new Float(-3.402E+38), "-3.402E38") - .addExample( "CAST(3.402E+38 AS REAL)", new Float(3.402E+38), "3.402E38") - .addExample( "0", new Float(0), "0.0") - .addExample( "CAST(1.175E-37 AS REAL)", new Float(1.175E-37), "1.175E-37") - .addExample("CAST(-1.175E-37 AS REAL)", new Float(-1.175E-37), "-1.175E-37") + .addExample("CAST(-3.402E+38 AS REAL)", Float.valueOf(-3.402E+38f), "-3.402E38") + .addExample( "CAST(3.402E+38 AS REAL)", Float.valueOf(3.402E+38f), "3.402E38") + .addExample( "0", Float.valueOf(0f), "0.0") + .addExample( "CAST(1.175E-37 AS REAL)", Float.valueOf(1.175E-37f), "1.175E-37") + .addExample("CAST(-1.175E-37 AS REAL)", Float.valueOf(-1.175E-37f), "-1.175E-37") .build()); add(DatabaseType.builder("DOUBLE") - .addExample("-1.79769E+308", new Double(-1.79769E+308), "-1.79769E308") - .addExample( "1.79769E+308", new Double(1.79769E+308), "1.79769E308") - .addExample( "0", new Double(0), "0.0") - .addExample( "2.225E-307", new Double(2.225E-307), "2.225E-307") - .addExample( "-2.225E-307", new Double(-2.225E-307), "-2.225E-307") + .addExample("-1.79769E+308", Double.valueOf(-1.79769E+308), "-1.79769E308") + .addExample( "1.79769E+308", Double.valueOf(1.79769E+308), "1.79769E308") + .addExample( "0", Double.valueOf(0), "0.0") + .addExample( "2.225E-307", Double.valueOf(2.225E-307), "2.225E-307") + .addExample( "-2.225E-307", Double.valueOf(-2.225E-307), "-2.225E-307") .build()); // Fixed point add(DatabaseType.builder("DECIMAL(5, 2)") - .addExample("-999.99", new BigDecimal(-999.99).setScale(2, RoundingMode.CEILING), "-999.99") - .addExample( "-999.9", new BigDecimal(-999.9).setScale(2, RoundingMode.FLOOR), "-999.90") - .addExample( "-99.9", new BigDecimal(-99.9).setScale(2, RoundingMode.CEILING), "-99.90") - .addExample( "-9.9", new BigDecimal(-9.9).setScale(2, RoundingMode.CEILING), "-9.90") - .addExample( "-9", new BigDecimal(-9).setScale(2, RoundingMode.CEILING), "-9.00") - .addExample( "0", new BigDecimal(0).setScale(2, RoundingMode.CEILING), "0.00") - .addExample( "9", new BigDecimal(9).setScale(2, RoundingMode.CEILING), "9.00") - .addExample( "9.9", new BigDecimal(9.9).setScale(2, RoundingMode.FLOOR), "9.90") - .addExample( "99.9", new BigDecimal(99.9).setScale(2, RoundingMode.FLOOR), "99.90") - .addExample( "999.9", new BigDecimal(999.9).setScale(2, RoundingMode.CEILING), "999.90") - .addExample( "999.99", new BigDecimal(999.99).setScale(2, RoundingMode.FLOOR), "999.99") + .addExample("-999.99", BigDecimal.valueOf(-999.99).setScale(2, RoundingMode.CEILING), "-999.99") + .addExample( "-999.9", BigDecimal.valueOf(-999.9).setScale(2, RoundingMode.FLOOR), "-999.90") + .addExample( "-99.9", BigDecimal.valueOf(-99.9).setScale(2, RoundingMode.CEILING), "-99.90") + .addExample( "-9.9", BigDecimal.valueOf(-9.9).setScale(2, RoundingMode.CEILING), "-9.90") + .addExample( "-9", BigDecimal.valueOf(-9).setScale(2, RoundingMode.CEILING), "-9.00") + .addExample( "0", BigDecimal.valueOf(0).setScale(2, RoundingMode.CEILING), "0.00") + .addExample( "9", BigDecimal.valueOf(9).setScale(2, RoundingMode.CEILING), "9.00") + .addExample( "9.9", BigDecimal.valueOf(9.9).setScale(2, RoundingMode.FLOOR), "9.90") + .addExample( "99.9", BigDecimal.valueOf(99.9).setScale(2, RoundingMode.FLOOR), "99.90") + .addExample( "999.9", BigDecimal.valueOf(999.9).setScale(2, RoundingMode.CEILING), "999.90") + .addExample( "999.99", BigDecimal.valueOf(999.99).setScale(2, RoundingMode.FLOOR), "999.99") .build()); // Boolean diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/MySQLTypeList.java b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/MySQLTypeList.java index a11872a0..a2ac97d3 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/db/types/MySQLTypeList.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/db/types/MySQLTypeList.java @@ -35,34 +35,34 @@ public MySQLTypeList() { // Numeric types add(DatabaseType.builder("SMALLINT") - .addExample("-32768", new Integer(-32768), "-32768") - .addExample("-1", new Integer(-1), "-1") - .addExample("0", new Integer(0), "0") - .addExample("1", new Integer(1), "1") - .addExample("32767", new Integer(32767), "32767") + .addExample("-32768", Integer.valueOf(-32768), "-32768") + .addExample("-1", Integer.valueOf(-1), "-1") + .addExample("0", Integer.valueOf(0), "0") + .addExample("1", Integer.valueOf(1), "1") + .addExample("32767", Integer.valueOf(32767), "32767") .build()); add(DatabaseType.builder("INT") - .addExample("-2147483648", new Integer(-2147483648), "-2147483648") - .addExample("-1", new Integer(-1), "-1") - .addExample("0", new Integer(0), "0") - .addExample("1", new Integer(1), "1") - .addExample("2147483647", new Integer(2147483647), "2147483647") + .addExample("-2147483648", Integer.valueOf(-2147483648), "-2147483648") + .addExample("-1", Integer.valueOf(-1), "-1") + .addExample("0", Integer.valueOf(0), "0") + .addExample("1", Integer.valueOf(1), "1") + .addExample("2147483647", Integer.valueOf(2147483647), "2147483647") .build()); add(DatabaseType.builder("BIGINT") - .addExample("-9223372036854775808", new Long(-9223372036854775808L), "-9223372036854775808") - .addExample("-1", new Long(-1L), "-1") - .addExample("0", new Long(0L), "0") - .addExample("1", new Long(1L), "1") - .addExample("9223372036854775807", new Long(9223372036854775807L), "9223372036854775807") + .addExample("-9223372036854775808", Long.valueOf(-9223372036854775808L), "-9223372036854775808") + .addExample("-1", Long.valueOf(-1L), "-1") + .addExample("0", Long.valueOf(0L), "0") + .addExample("1", Long.valueOf(1L), "1") + .addExample("9223372036854775807", Long.valueOf(9223372036854775807L), "9223372036854775807") .build()); // Floating points add(DatabaseType.builder("DOUBLE") - .addExample("-1.79769E+308", new Double(-1.79769E+308), "-1.79769E308") - .addExample("1.79769E+308", new Double(1.79769E+308), "1.79769E308") - .addExample("0", new Double(0), "0.0") - .addExample("2.225E-307", new Double(2.225E-307), "2.225E-307") - .addExample("-2.225E-307", new Double(-2.225E-307), "-2.225E-307") + .addExample("-1.79769E+308", Double.valueOf(-1.79769E+308), "-1.79769E308") + .addExample("1.79769E+308", Double.valueOf(1.79769E+308), "1.79769E308") + .addExample("0", Double.valueOf(0), "0.0") + .addExample("2.225E-307", Double.valueOf(2.225E-307), "2.225E-307") + .addExample("-2.225E-307", Double.valueOf(-2.225E-307), "-2.225E-307") .build()); // Boolean diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaConsumer.java b/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaConsumer.java index 78d651b3..0b4d309e 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaConsumer.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaConsumer.java @@ -69,7 +69,7 @@ public void initTopicList(List topics) { Map topicCountMap = new HashMap(); for (String topic : topics) { // we need only single threaded consumers - topicCountMap.put(topic, new Integer(1)); + topicCountMap.put(topic, Integer.valueOf(1)); } consumerMap = consumer.createMessageStreams(topicCountMap); } diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaRealRunner.java b/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaRealRunner.java index cc9c4fb3..b474ca7d 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaRealRunner.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/kafka/KafkaRealRunner.java @@ -32,8 +32,8 @@ public class KafkaRealRunner extends KafkaRunnerBase { private static final Logger logger = LoggerFactory.getLogger(KafkaLocalRunner.class); private String kafkaServerUrl; private String zkConnectionString; - private final String KAFKA_SERVER_URL_PROPERTY = "sqoop.kafka.server.url"; - private final String ZK_CONNECTION_STRING_PROPERTY = "sqoop.kafka.zookeeper.url"; + private static final String KAFKA_SERVER_URL_PROPERTY = "sqoop.kafka.server.url"; + private static final String ZK_CONNECTION_STRING_PROPERTY = "sqoop.kafka.zookeeper.url"; public KafkaRealRunner() { logger.info("Setting up kafka to point to real cluster"); diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/utils/NetworkUtils.java b/common-test/src/main/java/org/apache/sqoop/common/test/utils/NetworkUtils.java index 7f0f750d..e193e505 100644 --- a/common-test/src/main/java/org/apache/sqoop/common/test/utils/NetworkUtils.java +++ b/common-test/src/main/java/org/apache/sqoop/common/test/utils/NetworkUtils.java @@ -84,7 +84,7 @@ public static void waitForStartUp(String hostname, int port, int numberOfAttempt LOG.debug("Attempt " + (i + 1) + " to access " + hostname + ":" + port); new Socket(InetAddress.getByName(hostname), port).close(); return; - } catch (Exception e) { + } catch (RuntimeException | IOException e) { LOG.debug("Failed to connect to " + hostname + ":" + port, e); }