cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r124679 - /cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java
Date Sat, 08 Jan 2005 20:22:57 GMT
Author: antonio
Date: Sat Jan  8 12:22:55 2005
New Revision: 124679

URL: http://svn.apache.org/viewcvs?view=rev&rev=124679
Log:
Use StringBuffer
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java?view=diff&rev=124679&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java&r1=124678&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java&r2=124679
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/Javac.java
Sat Jan  8 12:22:55 2005
@@ -34,7 +34,7 @@
  * This class wraps the Sun's Javac Compiler.
  *
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version CVS $Id: Javac.java,v 1.1 2004/03/10 12:58:07 stephan Exp $
+ * @version CVS $Id$
  * @since 2.0
  */
 
@@ -116,8 +116,7 @@
 
       // most errors terminate with the '^' char
       do {
-        if ((line = input.readLine()) == null)
-        {
+        if ((line = input.readLine()) == null) {
             if (buffer.length() > 0) {
                 // There's an error which doesn't end with a '^'
                 errors.add(new CompilerError("\n" + buffer.toString()));
@@ -180,13 +179,17 @@
 
       // each error has 3 lines
       for (int i = 0; i < 3 ; i++) {
-        if ((line = input.readLine()) == null) return errors;
+        if ((line = input.readLine()) == null) {
+            return errors;
+        }
         buffer.append(line);
         buffer.append('\n');
       }
 
       // if error is found create the vector
-      if (errors == null) errors = new ArrayList();
+      if (errors == null) {
+          errors = new ArrayList();
+      }
 
       // add the error bean
       errors.add(parseClassicError(buffer.toString()));
@@ -204,15 +207,17 @@
     StringTokenizer tokens = new StringTokenizer(error, ":");
     try {
       String file = tokens.nextToken();
-      if (file.length() == 1) file = new StringBuffer(file).append(":").append(tokens.nextToken()).toString();
+      if (file.length() == 1) {
+          file = new StringBuffer(file).append(":").append(tokens.nextToken()).toString();
+      }
       int line = Integer.parseInt(tokens.nextToken());
 
-      String last = tokens.nextToken();
+      StringBuffer last = new StringBuffer(tokens.nextToken());
       // In case the message contains ':', it should be reassembled
       while (tokens.hasMoreElements()) {
-        last += tokens.nextToken();
+        last.append(tokens.nextToken());
       }
-      tokens = new StringTokenizer(last.trim(), "\n");
+      tokens = new StringTokenizer(last.toString().trim(), "\n");
       String message = tokens.nextToken();
       String context = tokens.nextToken();
       String pointer = tokens.nextToken();

Mime
View raw message