commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1697040 - /commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java
Date Fri, 21 Aug 2015 18:26:01 GMT
Author: sebb
Date: Fri Aug 21 18:26:01 2015
New Revision: 1697040

URL: http://svn.apache.org/r1697040
Log:
FindBugs: String append in a loop

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java?rev=1697040&r1=1697039&r2=1697040&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java
(original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/commons/bcel6/verifier/VerifierAppFrame.java
Fri Aug 21 18:26:01 2015
@@ -331,7 +331,7 @@ public class VerifierAppFrame extends JF
             return;
         }
         Verifier v = VerifierFactory.getVerifier(current_class);
-        String all3amsg = "";
+        StringBuilder all3amsg = new StringBuilder();
         boolean all3aok = true;
         boolean rejected = false;
         for (int i = 0; i < pass3aJList.getModel().getSize(); i++) {
@@ -344,15 +344,15 @@ public class VerifierAppFrame extends JF
                 JavaClass jc = null;
                 try {
                     jc = Repository.lookupClass(v.getClassName());
-                    all3amsg += "Method '" + jc.getMethods()[i] + "': "
-                            + vr.getMessage().replace('\n', ' ') + "\n\n";
+                    all3amsg.append("Method '").append(jc.getMethods()[i]).append("': ")
+                            .append(vr.getMessage().replace('\n', ' ') ).append("\n\n");
                 } catch (ClassNotFoundException ex) {
                     // FIXME: handle the error
                     ex.printStackTrace();
                 }
             }
         }
-        pass3aTextPane.setText(all3amsg);
+        pass3aTextPane.setText(all3amsg.toString());
         pass3aTextPane.setBackground(all3aok ? Color.green : (rejected ? Color.red : Color.yellow));
     }
 



Mime
View raw message