You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2018/11/26 14:50:42 UTC

[3/6] tomee git commit: removes String concatenation loop in SunConvertion

removes String concatenation loop in SunConvertion


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/20b08f50
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/20b08f50
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/20b08f50

Branch: refs/heads/master
Commit: 20b08f5093e2c562886d6221e5f2a6322bd158e1
Parents: afec54d
Author: Otavio Santana <ot...@gmail.com>
Authored: Thu Nov 22 13:24:17 2018 -0200
Committer: Otavio Santana <ot...@gmail.com>
Committed: Thu Nov 22 13:24:17 2018 -0200

----------------------------------------------------------------------
 .../java/org/apache/openejb/config/SunConversion.java   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/20b08f50/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java b/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java
index 5f40caa..3f987b0 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java
@@ -1170,7 +1170,7 @@ public class SunConversion implements DynamicDeployer {
         final List bits = Collections.list(new StringTokenizer(queryFilter, " \t\n\r\f()&|<>=!~+-/*", true));
 
         boolean inWitespace = false;
-        String currentSymbol = "";
+        StringBuilder currentSymbol = new StringBuilder();
         for (int i = 0; i < bits.size(); i++) {
             final TokenType tokenType;
             final String bit = (String) bits.get(i);
@@ -1190,7 +1190,7 @@ public class SunConversion implements DynamicDeployer {
                 case '<':
                 case '!':
                     // symbols are blindly coalesced so you can end up with nonsence like +-=+
-                    currentSymbol += bit.charAt(0);
+                    currentSymbol.append(bit.charAt(0));
                     tokenType = TokenType.SYMBOL;
                     break;
                 default:
@@ -1201,8 +1201,8 @@ public class SunConversion implements DynamicDeployer {
                 inWitespace = false;
             }
             if (tokenType != TokenType.SYMBOL && currentSymbol.length() > 0) {
-                tokens.add(currentSymbol);
-                currentSymbol = "";
+                tokens.add(currentSymbol.toString());
+                currentSymbol = new StringBuilder();
             }
             if (tokenType == TokenType.NORMAL) {
                 tokens.add(bit);
@@ -1210,8 +1210,8 @@ public class SunConversion implements DynamicDeployer {
         }
         // add saved symobl if we have one
         if (currentSymbol.length() > 0) {
-            tokens.add(currentSymbol);
-            currentSymbol = "";
+            tokens.add(currentSymbol.toString());
+            currentSymbol = new StringBuilder();
         }
         // strip off leading space
         if (tokens.getFirst().equals(" ")) {