openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r955031 - /openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java
Date Tue, 15 Jun 2010 20:07:41 GMT
Author: dwoods
Date: Tue Jun 15 20:07:41 2010
New Revision: 955031

URL: http://svn.apache.org/viewvc?rev=955031&view=rev
Log:
OPENJPA-1700 FindBugs - Method concatenates strings using + in a loop - use StringBuffer instead.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java

Modified: openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java?rev=955031&r1=955030&r2=955031&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ParseException.java
Tue Jun 15 20:07:41 2010
@@ -106,18 +106,19 @@ public class ParseException
 
         Token tok = currentToken.next;
 
-        String curtok = "";
+        StringBuffer curtokBuf = new StringBuffer();
         for (int i = 0; i < maxSize; i++) {
             if (i != 0)
-                curtok += " ";
+                curtokBuf.append(" ");
             if (tok.kind == 0) {
-                curtok += tokenImage[0];
+                curtokBuf.append(tokenImage[0]);
                 break;
             }
 
-            curtok += escape(tok.image);
+            curtokBuf.append(escape(tok.image));
             tok = tok.next;
         }
+        String curtok = curtokBuf.toString();
 
         return _loc.get("bad-parse", new Object[]{ curtok,
             new Integer(currentToken.next.beginColumn), expected });



Mime
View raw message