cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/components/language/programming/java Jikes.java
Date Fri, 24 Nov 2000 14:40:47 GMT
dims        00/11/24 06:40:45

  Modified:    src/org/apache/cocoon/components/language/programming/java
                        Tag: xml-cocoon2 Jikes.java
  Log:
  Patch from "Schmitt, Christian" <Christian.Schmitt@Dresdner-Bank.com>
  for Jikes.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +35 -3     xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/Jikes.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- Jikes.java	2000/09/27 16:15:14	1.1.2.5
  +++ Jikes.java	2000/11/24 14:40:42	1.1.2.6
  @@ -16,7 +16,7 @@
    * This class wraps IBM's <i>Jikes</i> Java compiler
    * NOTE: inspired by the Apache Jasper implementation.
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1.2.5 $ $Date: 2000/09/27 16:15:14 $
  + * @version $Revision: 1.1.2.6 $ $Date: 2000/11/24 14:40:42 $
    * @since 2.0
    */
   
  @@ -63,6 +63,35 @@
       }
   
       /**
  +     * Copy arguments to a string array
  +     *
  +     * @param arguments The compiler arguments
  +     * @return A string array containing compilation arguments
  +     */
  +    protected String[] toStringArray(List arguments) {
  +      int i;
  +    
  +      for (i = 0; i < arguments.size(); i++) {
  +        String arg = (String) arguments.get(i);
  +        if (arg.equals("-sourcepath")) {
  +          // Remove -sourcepath option. Jikes does not understand that.
  +          arguments.remove(i);
  +          arguments.remove(i);
  +          break;
  +        }
  +      }
  +      
  +      String[] args = new String[arguments.size() + 1];
  +      for (i = 0; i < arguments.size(); i++) {
  +        args[i] = (String) arguments.get(i);
  +      } 
  +
  +      args[i] = file;
  +
  +      return args;
  +    } 
  +
  +    /**
        * Execute the compiler
        */
       public boolean compile() throws IOException {
  @@ -73,7 +102,8 @@
           // indicate Emacs output mode must be used
           args.add("+E");
           // avoid warnings
  -        args.add("--nowarn");
  +        // Option nowarn with one hyphen only
  +        args.add("-nowarn");
   
           int exitValue;
           ByteArrayOutputStream tmpErr = new ByteArrayOutputStream(OUTPUT_BUFFER_SIZE);
  @@ -105,7 +135,9 @@
   
           // Jikes returns 0 even when there are some types of errors.
           // Check if any error output as well
  -        return ((exitValue == 0) && (tmpErr.size() > 0));
  +        // Return should be OK when both exitValue and
  +        // tmpErr.size() are 0 ?!
  +        return ((exitValue == 0) && (tmpErr.size() == 0));    
       }
   
       /**
  
  
  

Mime
View raw message