[ https://issues.apache.org/jira/browse/KYLIN-3586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16641077#comment-16641077 ]
ASF GitHub Bot commented on KYLIN-3586: --------------------------------------- shaofengshi closed pull request #280: KYLIN-3586 Fix remaining boxing/unboxing problem URL: https://github.com/apache/kylin/pull/280 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java b/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java index efc5030fa9..405d36143e 100644 --- a/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java +++ b/core-common/src/main/java/org/apache/kylin/common/debug/BackdoorToggles.java @@ -114,7 +114,7 @@ public static int getQueryTimeout() { if (v == null) return -1; else - return Integer.valueOf(v); + return Integer.parseInt(v); } public static Pair<Short, Short> getShardAssignment() { diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/tuple/Tuple.java b/core-metadata/src/main/java/org/apache/kylin/metadata/tuple/Tuple.java index cd2cfe316c..86db79b0f2 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/tuple/Tuple.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/tuple/Tuple.java @@ -176,7 +176,7 @@ public String toString() { public static long getTs(ITuple row, TblColRef partitionCol) { //ts column type differentiate if (partitionCol.getDatatype().equals("date")) { - return epicDaysToMillis(Integer.valueOf(row.getValue(partitionCol).toString())); + return epicDaysToMillis(Integer.parseInt(row.getValue(partitionCol).toString())); } else { return Long.parseLong(row.getValue(partitionCol).toString()); } diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java index 6814f2d8bc..9826de5827 100644 --- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java +++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java @@ -176,20 +176,20 @@ public static Object wrapObject(String value, int sqlType) { return new BigDecimal(value); case Types.BIT: case Types.BOOLEAN: - return Boolean.parseBoolean(value); + return Boolean.valueOf(value); case Types.TINYINT: return Byte.valueOf(value); case Types.SMALLINT: return Short.valueOf(value); case Types.INTEGER: - return Integer.parseInt(value); + return Integer.valueOf(value); case Types.BIGINT: - return Long.parseLong(value); + return Long.valueOf(value); case Types.FLOAT: - return Float.parseFloat(value); + return Float.valueOf(value); case Types.REAL: case Types.DOUBLE: - return Double.parseDouble(value); + return Double.valueOf(value); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Boxing/unboxing to parse a primitive is suboptimal > -------------------------------------------------- > > Key: KYLIN-3586 > URL: https://issues.apache.org/jira/browse/KYLIN-3586 > Project: Kylin > Issue Type: Bug > Reporter: Ted Yu > Assignee: Lijun Cao > Priority: Major > Fix For: v2.6.0 > > > An example is from HBaseLookupRowEncoder: > {code} > int valIdx = Integer.valueOf(Bytes.toString(qualifier)); > {code} > valueOf returns an Integer object which would be unboxed and assigned to > valIdx. > Integer.parseInt() should be used instead. -- This message was sent by Atlassian JIRA (v7.6.3#76005)