You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2015/12/01 19:33:46 UTC

incubator-groovy git commit: fix findbugs warning concerning performance of integer parsing

Repository: incubator-groovy
Updated Branches:
  refs/heads/master 9a565bd72 -> 47db5a143


fix findbugs warning concerning performance of integer parsing


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/47db5a14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/47db5a14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/47db5a14

Branch: refs/heads/master
Commit: 47db5a143456a2ab1b0518afd684fcc64ecc781b
Parents: 9a565bd
Author: pascalschumacher <pa...@gmx.net>
Authored: Tue Dec 1 19:33:24 2015 +0100
Committer: pascalschumacher <pa...@gmx.net>
Committed: Tue Dec 1 19:33:24 2015 +0100

----------------------------------------------------------------------
 .../groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/47db5a14/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
index 569d06b..ac0e3a6 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
@@ -194,7 +194,7 @@ class ExtractIndexAndSql {
             newSql.append(sql.substring(txtIndex, matcher.start())).append('?');
             String indexStr = matcher.group(1);
             if (indexStr == null) indexStr = matcher.group(3);
-            int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : new Integer(indexStr) - 1;
+            int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : Integer.parseInt(indexStr) - 1;
             String prop = matcher.group(2);
             if (prop == null) prop = matcher.group(4);
             indexPropList.add(new Tuple(new Object[]{index, prop == null || prop.length() == 0 ? "<this>" : prop}));