sylvain     01/10/10 02:30:25

  Modified:    src/org/apache/cocoon/components/language/programming/java
                        Tag: cocoon_20_branch Javac.java
  Log:
  Class-level errors not ending with '^' were incorrectly parsed.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.7   +19 -15    
xml-cocoon2/src/org/apache/cocoon/components/language/programming/java/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/programming/java/Javac.java,v
  retrieving revision 1.2.2.6
  retrieving revision 1.2.2.7
  diff -u -r1.2.2.6 -r1.2.2.7
  --- Javac.java        2001/10/08 20:18:53     1.2.2.6
  +++ Javac.java        2001/10/10 09:30:24     1.2.2.7
  @@ -8,21 +8,21 @@
   
   package org.apache.cocoon.components.language.programming.java;
   
  -import org.apache.cocoon.components.language.programming.CompilerError;
  -import org.apache.cocoon.util.ClassUtils;
  -import org.apache.log.Hierarchy;
  -
  -import java.io.*;
  -import java.util.ArrayList;
  -import java.util.List;
  -import java.util.NoSuchElementException;
  +import org.apache.cocoon.components.language.programming.CompilerError;
  +import org.apache.cocoon.util.ClassUtils;
  +import org.apache.log.Hierarchy;
  +
  +import java.io.*;
  +import java.util.ArrayList;
  +import java.util.List;
  +import java.util.NoSuchElementException;
   import java.util.StringTokenizer;
   
   /**
    * This class wraps the Sun's Javac Compiler.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
  - * @version $Revision: 1.2.2.6 $ $Date: 2001/10/08 20:18:53 $
  + * @version $Revision: 1.2.2.7 $ $Date: 2001/10/10 09:30:24 $
    * @since 2.0
    */
   
  @@ -93,7 +93,7 @@
      * @exception IOException If an error occurs during message collection
      */
     protected List parseModernStream(BufferedReader input) throws IOException {
  -    List errors = null;
  +    List errors = new ArrayList();
       String line = null;
       StringBuffer buffer = null;
   
  @@ -101,15 +101,19 @@
         // cleanup the buffer
         buffer = new StringBuffer(); // this is quicker than clearing it
   
  -      // each error terminates with the '^' char
  +      // most errors terminate with the '^' char
         do {
  -        if ((line = input.readLine()) == null) return errors;
  +        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()));
  +            }
  +            return errors;
  +        }
           buffer.append(line);
           buffer.append('\n');
         } while (!line.endsWith("^"));
  -
  -      // if error is found create the vector
  -      if (errors == null) errors = new ArrayList();
   
         // add the error bean
         errors.add(parseModernError(buffer.toString()));
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to