conor       2003/07/18 05:45:58

  Modified:    src/main/org/apache/tools/ant DemuxOutputStream.java
                        DirectoryScanner.java IntrospectionHelper.java
                        Main.java PathTokenizer.java Project.java
                        ProjectHelper.java RuntimeConfigurable.java
                        Target.java Task.java TypeAdapter.java
                        UnknownElement.java XmlLogger.java
               src/main/org/apache/tools/ant/helper ProjectHelper2.java
               src/main/org/apache/tools/ant/taskdefs LogOutputStream.java
               src/main/org/apache/tools/ant/taskdefs/optional ANTLR.java
                        Cab.java EchoProperties.java IContract.java
                        Javah.java Native2Ascii.java NetRexxC.java
                        PropertyFile.java RenameExtensions.java
                        ReplaceRegExp.java Rpm.java Script.java
                        StyleBook.java TraXLiaison.java
                        XMLValidateTask.java XalanLiaison.java
               src/main/org/apache/tools/ant/types/optional
                        ScriptFilter.java
               src/main/org/apache/tools/ant/util/optional
                        WeakishReference12.java
  Log:
  Coding conventions
  
  Revision  Changes    Path
  1.19      +18 -3     ant/src/main/org/apache/tools/ant/DemuxOutputStream.java
  
  Index: DemuxOutputStream.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DemuxOutputStream.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -u -r1.18 -r1.19
  --- DemuxOutputStream.java    17 Jul 2003 15:44:36 -0000      1.18
  +++ DemuxOutputStream.java    18 Jul 2003 12:45:54 -0000      1.19
  @@ -92,6 +92,12 @@
       /** Initial buffer size. */
       private static final int INTIAL_SIZE = 132;
   
  +    /** Carriage return */
  +    private static final int CR = 0x0d;
  +
  +    /** Linefeed */
  +    private static final int LF = 0x0a;
  +
       /** Mapping from thread to buffer (Thread to BufferInfo). */
       private Hashtable buffers = new Hashtable();
   
  @@ -243,14 +249,23 @@
           }
       }
   
  -    public void write(byte b[], int off, int len) throws IOException {
  +    /**
  +     * Write a block of characters to the output stream
  +     *
  +     * @param b the array containg the data
  +     * @param off the offset into the array where data starts
  +     * @param len the length of block
  +     *
  +     * @throws IOException if the data cannot be written into the stream.
  +     */
  +    public void write(byte[] b, int off, int len) throws IOException {
           // find the line breaks and pass other chars through in blocks
           int offset = off;
           int blockStartOffset = offset;
           int remaining = len;
           BufferInfo bufferInfo = getBufferInfo();
           while (remaining > 0) {
  -            while (remaining > 0 && b[offset] != 0x0a && b[offset] != 0x0d) {
  +            while (remaining > 0 && b[offset] != LF && b[offset] != CR) {
                   offset++;
                   remaining--;
               }
  @@ -259,7 +274,7 @@
               if (blockLength > 0) {
                   bufferInfo.buffer.write(b, blockStartOffset, blockLength);
               }
  -            while (remaining > 0 && (b[offset] == 0x0a || b[offset] == 
0x0d)) {
  +            while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) {
                   write(b[offset]);
                   offset++;
                   remaining--;
  
  
  
  1.48      +7 -7      ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -w -u -r1.47 -r1.48
  
  
  
  1.60      +4 -4      
ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
  
  Index: IntrospectionHelper.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -w -u -r1.59 -r1.60
  --- IntrospectionHelper.java  17 Jul 2003 15:44:36 -0000      1.59
  +++ IntrospectionHelper.java  18 Jul 2003 12:45:54 -0000      1.60
  @@ -502,8 +502,8 @@
                   return;
               } else {
                   // Not whitespace - fail
  -                String msg = project.getElementName(element) +
  -                    " doesn't support nested text data.";
  +                String msg = project.getElementName(element)
  +                    + " doesn't support nested text data.";
                   throw new BuildException(msg);
               }
           }
  @@ -703,8 +703,8 @@
           throws BuildException {
           Class at = (Class) attributeTypes.get(attributeName);
           if (at == null) {
  -            String msg = "Class " + bean.getName() +
  -                " doesn't support the \"" + attributeName + "\" attribute.";
  +            String msg = "Class " + bean.getName()
  +                + " doesn't support the \"" + attributeName + "\" 
attribute.";
               throw new BuildException(msg);
           }
           return at;
  
  
  
  1.89      +16 -14    ant/src/main/org/apache/tools/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Main.java,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -w -u -r1.88 -r1.89
  --- Main.java 17 Jul 2003 15:44:36 -0000      1.88
  +++ Main.java 18 Jul 2003 12:45:54 -0000      1.89
  @@ -99,16 +99,16 @@
       private static PrintStream err = System.err;
   
       /** The build targets. */
  -    private Vector targets = new Vector(5);
  +    private Vector targets = new Vector();
   
       /** Set of properties that can be used by tasks. */
       private Properties definedProps = new Properties();
   
       /** Names of classes to add as listeners to project. */
  -    private Vector listeners = new Vector(5);
  +    private Vector listeners = new Vector(1);
   
       /** File names of property files to load on startup. */
  -    private Vector propertyFiles = new Vector(5);
  +    private Vector propertyFiles = new Vector(1);
   
       /** Indicates whether this build is to support interactive input */
       private boolean allowInput = true;
  @@ -334,8 +334,8 @@
                           + "permissions.";
                       throw new BuildException(msg);
                   } catch (ArrayIndexOutOfBoundsException aioobe) {
  -                    String msg = "You must specify a log file when " +
  -                        "using the -log argument";
  +                    String msg = "You must specify a log file when "
  +                        + "using the -log argument";
                       throw new BuildException(msg);
                   }
               } else if (arg.equals("-buildfile") || arg.equals("-file")
  @@ -344,8 +344,8 @@
                       buildFile = new File(args[i + 1].replace('/', 
File.separatorChar));
                       i++;
                   } catch (ArrayIndexOutOfBoundsException aioobe) {
  -                    String msg = "You must specify a buildfile when " +
  -                        "using the -buildfile argument";
  +                    String msg = "You must specify a buildfile when "
  +                        + "using the -buildfile argument";
                       throw new BuildException(msg);
                   }
               } else if (arg.equals("-listener")) {
  @@ -353,8 +353,8 @@
                       listeners.addElement(args[i + 1]);
                       i++;
                   } catch (ArrayIndexOutOfBoundsException aioobe) {
  -                    String msg = "You must specify a classname when " +
  -                        "using the -listener argument";
  +                    String msg = "You must specify a classname when "
  +                        + "using the -listener argument";
                       throw new BuildException(msg);
                   }
               } else if (arg.startsWith("-D")) {
  @@ -421,8 +421,8 @@
                       propertyFiles.addElement(args[i + 1]);
                       i++;
                   } catch (ArrayIndexOutOfBoundsException aioobe) {
  -                    String msg = "You must specify a property filename when 
" +
  -                        "using the -propertyfile argument";
  +                    String msg = "You must specify a property filename when "
  +                        + "using the -propertyfile argument";
                       throw new BuildException(msg);
                   }
               } else if (arg.equals("-k") || arg.equals("-keep-going")) {
  @@ -483,6 +483,7 @@
                       try {
                           fis.close();
                       } catch (IOException e) {
  +                        // ignore
                       }
                   }
               }
  @@ -502,7 +503,8 @@
           }
   
           if (logTo != null) {
  -            out = err = logTo;
  +            out = logTo;
  +            err = logTo;
               System.setOut(out);
               System.setErr(out);
           }
  @@ -605,8 +607,8 @@
               // use a system manager that prevents from System.exit()
               // only in JDK > 1.1
               SecurityManager oldsm = null;
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0) &&
  -                !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  +            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0)
  +                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
                   oldsm = System.getSecurityManager();
   
                   //SecurityManager can not be installed here for backwards
  
  
  
  1.19      +2 -2      ant/src/main/org/apache/tools/ant/PathTokenizer.java
  
  Index: PathTokenizer.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/PathTokenizer.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -u -r1.18 -r1.19
  
  
  
  1.147     +3 -2      ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -w -u -r1.146 -r1.147
  --- Project.java      17 Jul 2003 10:20:14 -0000      1.146
  +++ Project.java      18 Jul 2003 12:45:54 -0000      1.147
  @@ -2029,7 +2029,8 @@
       // Should move to a separate public class - and have API to add
       // listeners, etc.
       private static class AntRefTable extends Hashtable {
  -        Project project;
  +        private Project project;
  +
           public AntRefTable(Project project) {
               super();
               this.project = project;
  
  
  
  1.98      +5 -3      ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -w -u -r1.97 -r1.98
  --- ProjectHelper.java        26 Jun 2003 13:15:22 -0000      1.97
  +++ ProjectHelper.java        18 Jul 2003 12:45:54 -0000      1.98
  @@ -132,7 +132,7 @@
       // Since the tree is composed of UE and RC - it can be reused !
       // protected Hashtable processedFiles=new Hashtable();
   
  -    protected Vector importStack = new Vector();
  +    private Vector importStack = new Vector();
   
       // Temporary - until we figure a better API
       /** EXPERIMENTAL WILL_CHANGE
  @@ -146,6 +146,8 @@
        *  Import stack.
        *  Used to keep track of imported files. Error reporting should
        *  display the import path.
  +     *
  +     * @return the stack of import source objects.
        */
       public Vector getImportStack() {
           return importStack;
  @@ -229,8 +231,8 @@
                       String helperClassName = rd.readLine();
                       rd.close();
   
  -                    if (helperClassName != null &&
  -                        !"".equals(helperClassName)) {
  +                    if (helperClassName != null
  +                        && !"".equals(helperClassName)) {
   
                           helper = newHelper(helperClassName);
                       }
  
  
  
  1.40      +2 -2      
ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java
  
  Index: RuntimeConfigurable.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -w -u -r1.39 -r1.40
  --- RuntimeConfigurable.java  7 Jul 2003 08:20:52 -0000       1.39
  +++ RuntimeConfigurable.java  18 Jul 2003 12:45:55 -0000      1.40
  @@ -349,8 +349,8 @@
           }
   
           // Configure the object
  -        Object target = (wrappedObject instanceof TypeAdapter) ?
  -                ((TypeAdapter) wrappedObject).getProxy() : wrappedObject;
  +        Object target = (wrappedObject instanceof TypeAdapter)
  +            ? ((TypeAdapter) wrappedObject).getProxy() : wrappedObject;
   
           //PropertyHelper ph=PropertyHelper.getPropertyHelper(p);
           IntrospectionHelper ih =
  
  
  
  1.42      +5 -5      ant/src/main/org/apache/tools/ant/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -w -u -r1.41 -r1.42
  --- Target.java       16 Jul 2003 14:38:54 -0000      1.41
  +++ Target.java       18 Jul 2003 12:45:55 -0000      1.42
  @@ -77,9 +77,9 @@
       /** The "unless" condition to test on execution. */
       private String unlessCondition = "";
       /** List of targets this target is dependent on. */
  -    private List/*<String>*/ dependencies = null;
  +    private List dependencies = null;
       /** Children of this target (tasks and data types). */
  -    private List/*<Task|RuntimeConfigurable>*/ children = new ArrayList(5);
  +    private List children = new ArrayList();
       /** Position in task list */
       private int taskPosition = 0;
       
  
  
  
  1.46      +4 -2      ant/src/main/org/apache/tools/ant/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Task.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -w -u -r1.45 -r1.46
  --- Task.java 17 Jul 2003 10:20:14 -0000      1.45
  +++ Task.java 18 Jul 2003 12:45:55 -0000      1.46
  @@ -204,7 +204,8 @@
        *
        * @exception BuildException if someting goes wrong with the build
        */
  -    public void init() throws BuildException {}
  +    public void init() throws BuildException {
  +    }
   
       /**
        * Called by the project to let the task do its work. This method may be
  @@ -215,7 +216,8 @@
        *
        * @exception BuildException if something goes wrong with the build
        */
  -    public void execute() throws BuildException {}
  +    public void execute() throws BuildException {
  +    }
   
       /**
        * Returns the file/location where this task was defined.
  
  
  
  1.3       +14 -7     ant/src/main/org/apache/tools/ant/TypeAdapter.java
  
  Index: TypeAdapter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/TypeAdapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -u -r1.2 -r1.3
  --- TypeAdapter.java  4 Jul 2003 14:04:53 -0000       1.2
  +++ TypeAdapter.java  18 Jul 2003 12:45:55 -0000      1.3
  @@ -64,13 +64,17 @@
   
       /**
        * Sets the project
  +     *
  +     * @param p the project instance.
        */
  -    public void setProject(Project p);
  +    void setProject(Project p);
   
       /**
        * Gets the project
  +     *
  +     * @return the project instance.
        */
  -    public Project getProject();
  +    Project getProject();
   
       /**
        * Sets the proxy object, whose methods are going to be
  @@ -81,17 +85,20 @@
        *
        * @param o The target object. Must not be <code>null</code>.
        */
  -    public void setProxy(Object o);
  +    void setProxy(Object o);
   
       /**
        * Returns the proxy object.
        *
        * @return the target proxy object
        */
  -    public Object getProxy();
  +    Object getProxy();
   
       /**
  -     * Check if the proxy class matchs the criteria
  +     * Check if the proxy class is compatible with this adapter - i.e.
  +     * the adapter will be able to adapt instances of the give class.
  +     *
  +     * @patam proxyClass the class to be checked.
        */
  -    public void checkProxyClass(Class proxyClass);
  +    void checkProxyClass(Class proxyClass);
   }
  
  
  
  1.56      +4 -5      ant/src/main/org/apache/tools/ant/UnknownElement.java
  
  Index: UnknownElement.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -w -u -r1.55 -r1.56
  --- UnknownElement.java       17 Jul 2003 10:20:14 -0000      1.55
  +++ UnknownElement.java       18 Jul 2003 12:45:55 -0000      1.56
  @@ -439,8 +439,9 @@
        */
       public String getTaskName() {
           //return elementName;
  -        return realThing == null || !(realThing instanceof Task) ?
  -            super.getTaskName() : ((Task) realThing).getTaskName();
  +        return realThing == null
  +            || !(realThing instanceof Task) ? super.getTaskName()
  +                                            : ((Task) 
realThing).getTaskName();
       }
   
       /**
  @@ -481,6 +482,4 @@
           }
           return false;
       }
  -
  -
  -}// UnknownElement
  +}
  
  
  
  1.38      +2 -1      ant/src/main/org/apache/tools/ant/XmlLogger.java
  
  Index: XmlLogger.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/XmlLogger.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -w -u -r1.37 -r1.38
  --- XmlLogger.java    6 Jul 2003 09:57:34 -0000       1.37
  +++ XmlLogger.java    18 Jul 2003 12:45:55 -0000      1.38
  @@ -92,7 +92,7 @@
       private PrintStream outStream;
   
       /** DocumentBuilder to use when creating the document to start with. */
  -    private static final DocumentBuilder builder = getDocumentBuilder();
  +    private static DocumentBuilder builder = getDocumentBuilder();
   
       /**
        * Returns a default DocumentBuilder instance or throws an
  @@ -230,6 +230,7 @@
                   try {
                       out.close();
                   } catch (IOException e) {
  +                    // ignore
                   }
               }
           }
  
  
  
  1.23      +2 -2      
ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  
  Index: ProjectHelper2.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -w -u -r1.22 -r1.23
  --- ProjectHelper2.java       17 Jul 2003 15:44:37 -0000      1.22
  +++ ProjectHelper2.java       18 Jul 2003 12:45:56 -0000      1.23
  @@ -104,7 +104,7 @@
   
       public void parse(Project project, Object source)
               throws BuildException {
  -        this.getImportStack().addElement(source);
  +        getImportStack().addElement(source);
           //System.out.println("Adding " + source);
           AntXMLContext context = null;
           context = (AntXMLContext) 
project.getReference("ant.parsing.context");
  @@ -116,7 +116,7 @@
               project.addReference("ant.targets", context.getTargets());
           }
   
  -        if (this.getImportStack().size() > 1) {
  +        if (getImportStack().size() > 1) {
               // we are in an imported file.
               context.setIgnoreProjectTag(true);
               context.getCurrentTarget().startImportedTasks();
  
  
  
  1.15      +18 -3     
ant/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java
  
  Index: LogOutputStream.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/LogOutputStream.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -u -r1.14 -r1.15
  --- LogOutputStream.java      17 Jul 2003 15:44:37 -0000      1.14
  +++ LogOutputStream.java      18 Jul 2003 12:45:56 -0000      1.15
  @@ -76,6 +76,12 @@
       /** Initial buffer size. */
       private static final int INTIAL_SIZE = 132;
   
  +    /** Carriage return */
  +    private static final int CR = 0x0d;
  +
  +    /** Linefeed */
  +    private static final int LF = 0x0a;
  +
       private ByteArrayOutputStream buffer
           = new ByteArrayOutputStream(INTIAL_SIZE);
       private boolean skip = false;
  @@ -162,13 +168,22 @@
           return level;
       }
   
  -    public void write(byte b[], int off, int len) throws IOException {
  +    /**
  +     * Write a block of characters to the output stream
  +     *
  +     * @param b the array containg the data
  +     * @param off the offset into the array where data starts
  +     * @param len the length of block
  +     *
  +     * @throws IOException if the data cannot be written into the stream.
  +     */
  +    public void write(byte[] b, int off, int len) throws IOException {
           // find the line breaks and pass other chars through in blocks
           int offset = off;
           int blockStartOffset = offset;
           int remaining = len;
           while (remaining > 0) {
  -            while (remaining > 0 && b[offset] != 0x0a && b[offset] != 0x0d) {
  +            while (remaining > 0 && b[offset] != LF && b[offset] != CR) {
                   offset++;
                   remaining--;
               }
  @@ -177,7 +192,7 @@
               if (blockLength > 0) {
                   buffer.write(b, blockStartOffset, blockLength);
               }
  -            while (remaining > 0 && (b[offset] == 0x0a || b[offset] == 
0x0d)) {
  +            while (remaining > 0 && (b[offset] == LF || b[offset] == CR)) {
                   write(b[offset]);
                   offset++;
                   remaining--;
  
  
  
  1.32      +2 -0      
ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -w -u -r1.31 -r1.32
  --- ANTLR.java        17 Jul 2003 14:55:41 -0000      1.31
  +++ ANTLR.java        18 Jul 2003 12:45:57 -0000      1.32
  @@ -298,6 +298,7 @@
   
       public void execute() throws BuildException {
           validateAttributes();
  +
           //TODO: use ANTLR to parse the grammar file to do this.
           File generatedFile = getGeneratedFile();
           boolean targetIsOutOfDate =
  @@ -437,6 +438,7 @@
       /**
        * Whether the antlr version is 2.7.2 (or higher).
        *
  +     * @return true if the version of Antlr present is 2.7.2 or later.
        * @since Ant 1.6
        */
       protected boolean is272() {
  
  
  
  1.28      +2 -2      
ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -w -u -r1.27 -r1.28
  --- Cab.java  17 Jul 2003 14:55:41 -0000      1.27
  +++ Cab.java  18 Jul 2003 12:45:57 -0000      1.28
  @@ -177,8 +177,8 @@
           boolean upToDate = true;
           for (int i = 0; i < files.size() && upToDate; i++) {
               String file = files.elementAt(i).toString();
  -            if (fileUtils.resolveFile(baseDir, file).lastModified() >
  -                cabFile.lastModified()) {
  +            if (fileUtils.resolveFile(baseDir, file).lastModified()
  +                    > cabFile.lastModified()) {
                   upToDate = false;
               }
           }
  
  
  
  1.20      +5 -2      
ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java
  
  Index: EchoProperties.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -w -u -r1.19 -r1.20
  --- EchoProperties.java       17 Jul 2003 15:44:39 -0000      1.19
  +++ EchoProperties.java       18 Jul 2003 12:45:57 -0000      1.20
  @@ -296,7 +296,9 @@
                       if (null != in) {
                           in.close();
                       }
  -                } catch (IOException ioe) {}
  +                } catch (IOException ioe) {
  +                    //ignore
  +                }
               }
           }
   
  @@ -347,6 +349,7 @@
                   try {
                       os.close();
                   } catch (IOException e) {
  +                    //ignore
                   }
               }
           }
  
  
  
  1.17      +167 -87   
ant/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java
  
  Index: IContract.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -u -r1.16 -r1.17
  --- IContract.java    17 Jul 2003 14:55:41 -0000      1.16
  +++ IContract.java    18 Jul 2003 12:45:57 -0000      1.17
  @@ -53,8 +53,6 @@
    */
   package org.apache.tools.ant.taskdefs.optional;
   
  -
  -
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.FileOutputStream;
  @@ -84,7 +82,8 @@
    * iControl generates a control file that you can refer to
    * from this task using the controlfile attribute.
    * iContract is at
  - * <a 
href="http://www.reliable-systems.com/tools/";>http://www.reliable-systems.com/tools/</a>
  + * <a href="http://www.reliable-systems.com/tools/";>
  + *   http://www.reliable-systems.com/tools/</a>
    * <p/>
    * Thanks to Rainer Schmitz for enhancements and comments.
    *
  @@ -104,55 +103,63 @@
    *   </tr>
    *   <tr>
    *     <td valign="top">instrumentdir</td>
  - *     <td valign="top">Indicates where the instrumented source files should 
go.</td>
  + *     <td valign="top">Indicates where the instrumented source
  + *                      files should go.</td>
    *     <td valign="top" align="center">Yes</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">repositorydir</td>
  - *     <td valign="top">Indicates where the repository source files should 
go.</td>
  + *     <td valign="top">Indicates where the repository source
  + *                      files should go.</td>
    *     <td valign="top" align="center">Yes</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">builddir</td>
  - *     <td valign="top">Indicates where the compiled instrumented classes 
should go.
  - *       Defaults to the value of instrumentdir.
  + *     <td valign="top">Indicates where the compiled instrumented
  + *                      classes should go. Defaults to the value of
  + *                      instrumentdir.
    *       </p>
  - *       <em>NOTE:</em> Don't use the same directory for compiled 
instrumented classes
  - *       and uninstrumented classes. It will break the dependency checking. 
(Classes will
  - *       not be reinstrumented if you change them).</td>
  + *       <em>NOTE:</em> Don't use the same directory for compiled
  + *       instrumented classes and uninstrumented classes. It will break the
  + *       dependency checking. (Classes will not be reinstrumented if you
  + *       change them).</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">repbuilddir</td>
  - *     <td valign="top">Indicates where the compiled repository classes 
should go.
  - *       Defaults to the value of repositorydir.</td>
  + *     <td valign="top">Indicates where the compiled repository classes
  + *                      should go. Defaults to the value of 
repositorydir.</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">pre</td>
  - *     <td valign="top">Indicates whether or not to instrument for 
preconditions.
  - *       Defaults to <code>true</code> unless controlfile is specified, in 
which case it
  - *       defaults to <code>false</code>.</td>
  + *     <td valign="top">Indicates whether or not to instrument for
  + *                      preconditions. Defaults to <code>true</code> unless
  + *                      controlfile is specified, in which case it defaults
  + *                      to <code>false</code>.</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">post</td>
  - *     <td valign="top">Indicates whether or not to instrument for 
postconditions.
  - *       Defaults to <code>true</code> unless controlfile is specified, in 
which case it
  - *       defaults to <code>false</code>.</td>
  + *     <td valign="top">Indicates whether or not to instrument for
  + *                      postconditions. Defaults to <code>true</code> unless
  + *                      controlfile is specified, in which case it defaults
  + *                      to <code>false</code>.</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">invariant</td>
    *     <td valign="top">Indicates whether or not to instrument for 
invariants.
  - *       Defaults to <code>true</code> unless controlfile is specified, in 
which case it
  - *       defaults to <code>false</code>.</td>
  + *                      Defaults to <code>true</code> unless controlfile is
  + *                      specified, in which case it defaults to
  + *                      <code>false</code>.</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
    *     <td valign="top">failthrowable</td>
  - *     <td valign="top">The full name of the Throwable (Exception) that 
should be
  - *       thrown when an assertion is violated. Defaults to 
<code>java.lang.Error</code></td>
  + *     <td valign="top">The full name of the Throwable (Exception) that
  + *                      should be thrown when an assertion is violated.
  + *                      Defaults to <code>java.lang.Error</code></td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    *   <tr>
  @@ -180,22 +187,28 @@
    *   </tr>
    *   <tr>
    *     <td valign="top">controlfile</td>
  - *     <td valign="top">The name of the control file to pass to iContract. 
Consider using iControl to generate the file.
  + *     <td valign="top">The name of the control file to pass to iContract.
  + *                      Consider using iControl to generate the file.
    *       Default is not to pass a file. </td>
  - *     <td valign="top" align="center">Only if 
<code>updateicontrol=true</code></td>
  + *     <td valign="top" align="center">
  + *                      Only if <code>updateicontrol=true</code></td>
    *   </tr>
    *   <tr>
    *     <td valign="top">classdir</td>
  - *     <td valign="top">Indicates where compiled (unistrumented) classes are 
located.
  - *       This is required in order to properly update the 
icontrol.properties file, not
  - *       for instrumentation.</td>
  - *     <td valign="top" align="center">Only if 
<code>updateicontrol=true</code></td>
  + *     <td valign="top">Indicates where compiled (unistrumented) classes are
  + *                      located. This is required in order to properly update
  + *                      the icontrol.properties file, not for 
instrumentation.
  + *     </td>
  + *     <td valign="top" align="center">Only if
  + *                                     <code>updateicontrol=true</code></td>
    *   </tr>
    *   <tr>
    *     <td valign="top">targets</td>
  - *     <td valign="top">Name of the file that will be generated by this 
task, which lists all the
  - *        classes that iContract will instrument. If specified, the file 
will not be deleted after execution.
  - *        If not specified, a file will still be created, but it will be 
deleted after execution.</td>
  + *     <td valign="top">Name of the file that will be generated by this task,
  + *                      which lists all the classes that iContract will
  + *                      instrument. If specified, the file will not be 
deleted
  + *                      after execution. If not specified, a file will still
  + *                      be created, but it will be deleted after 
execution.</td>
    *     <td valign="top" align="center">No</td>
    *   </tr>
    * </table>
  @@ -228,8 +241,9 @@
    */
   public class IContract extends MatchingTask {
   
  -    private static final String ICONTROL_PROPERTIES_HEADER =
  -        " You might want to set classRoot to point to your normal 
compilation class root directory.";
  +    private static final String ICONTROL_PROPERTIES_HEADER
  +        = "You might want to set classRoot to point to your normal "
  +            + "compilation class root directory.";
   
       /** compiler to use for instrumenation */
       private String icCompiler = "javac";
  @@ -288,8 +302,12 @@
       private boolean invariant = true;
       private boolean invariantModified = false;
   
  -    /** Indicates whether or not to instrument all files regardless of 
timestamp */
  -    // can't be explicitly set, is set if control file exists and is newer 
than any source file
  +    /**
  +     * Indicates whether or not to instrument all files regardless of 
timestamp
  +     *
  +     * Can't be explicitly set, is set if control file exists and is newer
  +     * than any source file
  +     */
       private boolean instrumentall = false;
   
       /**
  @@ -534,13 +552,14 @@
               }
   
   
  -            // We want to be notified if iContract jar is missing. This 
makes life easier for the user
  -            // who didn't understand that iContract is a separate library 
(duh!)
  +            // We want to be notified if iContract jar is missing.
  +            // This makes life easier for the user who didn't understand
  +            // that iContract is a separate library (duh!)
               getProject().addBuildListener(new IContractPresenceDetector());
   
  -            // Prepare the directories for iContract. iContract will make 
them if they
  -            // don't exist, but for some reason I don't know, it will 
complain about the REP files
  -            // afterwards
  +            // Prepare the directories for iContract. iContract will make
  +            // them if they don't exist, but for some reason I don't know,
  +            // it will complain about the REP files afterwards
               Mkdir mkdir = (Mkdir) getProject().createTask("mkdir");
   
               mkdir.setDir(instrumentDir);
  @@ -553,42 +572,60 @@
               // Set the classpath that is needed for regular Javac compilation
               Path baseClasspath = createClasspath();
   
  -            // Might need to add the core classes if we're not using Sun's 
Javac (like Jikes)
  +            // Might need to add the core classes if we're not using
  +            // Sun's Javac (like Jikes)
               String compiler = getProject().getProperty("build.compiler");
               ClasspathHelper classpathHelper = new ClasspathHelper(compiler);
   
               classpathHelper.modify(baseClasspath);
   
  -            // Create the classpath required to compile the sourcefiles 
BEFORE instrumentation
  +            // Create the classpath required to compile the sourcefiles
  +            // BEFORE instrumentation
               Path beforeInstrumentationClasspath = ((Path) 
baseClasspath.clone());
   
               beforeInstrumentationClasspath.append(new Path(getProject(),
                   srcDir.getAbsolutePath()));
   
  -            // Create the classpath required to compile the sourcefiles 
AFTER instrumentation
  +            // Create the classpath required to compile the sourcefiles
  +            // AFTER instrumentation
               Path afterInstrumentationClasspath = ((Path) 
baseClasspath.clone());
   
  -            afterInstrumentationClasspath.append(new Path(getProject(), 
instrumentDir.getAbsolutePath()));
  -            afterInstrumentationClasspath.append(new Path(getProject(), 
repositoryDir.getAbsolutePath()));
  -            afterInstrumentationClasspath.append(new Path(getProject(), 
srcDir.getAbsolutePath()));
  -            afterInstrumentationClasspath.append(new Path(getProject(), 
buildDir.getAbsolutePath()));
  +            afterInstrumentationClasspath.append(new Path(getProject(),
  +                instrumentDir.getAbsolutePath()));
  +            afterInstrumentationClasspath.append(new Path(getProject(),
  +                repositoryDir.getAbsolutePath()));
  +            afterInstrumentationClasspath.append(new Path(getProject(),
  +                srcDir.getAbsolutePath()));
  +            afterInstrumentationClasspath.append(new Path(getProject(),
  +                buildDir.getAbsolutePath()));
   
  -            // Create the classpath required to automatically compile the 
repository files
  +            // Create the classpath required to automatically compile the
  +            // repository files
               Path repositoryClasspath = ((Path) baseClasspath.clone());
   
  -            repositoryClasspath.append(new Path(getProject(), 
instrumentDir.getAbsolutePath()));
  -            repositoryClasspath.append(new Path(getProject(), 
srcDir.getAbsolutePath()));
  -            repositoryClasspath.append(new Path(getProject(), 
repositoryDir.getAbsolutePath()));
  -            repositoryClasspath.append(new Path(getProject(), 
buildDir.getAbsolutePath()));
  +            repositoryClasspath.append(new Path(getProject(),
  +                instrumentDir.getAbsolutePath()));
  +            repositoryClasspath.append(new Path(getProject(),
  +                srcDir.getAbsolutePath()));
  +            repositoryClasspath.append(new Path(getProject(),
  +                repositoryDir.getAbsolutePath()));
  +            repositoryClasspath.append(new Path(getProject(),
  +                buildDir.getAbsolutePath()));
   
               // Create the classpath required for iContract itself
               Path iContractClasspath = ((Path) baseClasspath.clone());
   
  -            iContractClasspath.append(new Path(getProject(), 
System.getProperty("java.home") + File.separator + ".." + File.separator + 
"lib" + File.separator + "tools.jar"));
  -            iContractClasspath.append(new Path(getProject(), 
srcDir.getAbsolutePath()));
  -            iContractClasspath.append(new Path(getProject(), 
repositoryDir.getAbsolutePath()));
  -            iContractClasspath.append(new Path(getProject(), 
instrumentDir.getAbsolutePath()));
  -            iContractClasspath.append(new Path(getProject(), 
buildDir.getAbsolutePath()));
  +            iContractClasspath.append(new Path(getProject(),
  +                System.getProperty("java.home") + File.separator + ".."
  +                    + File.separator + "lib" + File.separator + 
"tools.jar"));
  +            iContractClasspath.append(new Path(getProject(),
  +                srcDir.getAbsolutePath()));
  +            iContractClasspath.append(new Path(getProject(),
  +                repositoryDir.getAbsolutePath()));
  +            iContractClasspath.append(new Path(getProject(),
  +                instrumentDir.getAbsolutePath()));
  +            iContractClasspath.append(new Path(getProject(),
  +                buildDir.getAbsolutePath()));
   
               // Create a forked java process
               Java iContract = (Java) getProject().createTask("java");
  @@ -603,18 +640,36 @@
   
               args.append(directiveString());
               args.append("-v").append(verbosity).append(" ");
  -            args.append("-b").append("\"").append(icCompiler).append(" 
-classpath ").append(beforeInstrumentationClasspath).append("\" ");
  -            args.append("-c").append("\"").append(icCompiler).append(" 
-classpath ").append(afterInstrumentationClasspath).append(" -d 
").append(buildDir).append("\" ");
  -            args.append("-n").append("\"").append(icCompiler).append(" 
-classpath ").append(repositoryClasspath).append("\" ");
  +
  +            args.append("-b").append("\"").append(icCompiler);
  +            args.append(" -classpath 
").append(beforeInstrumentationClasspath);
  +            args.append("\" ");
  +
  +            args.append("-c").append("\"").append(icCompiler);
  +            args.append(" -classpath 
").append(afterInstrumentationClasspath);
  +            args.append(" -d ").append(buildDir).append("\" ");
  +
  +            args.append("-n").append("\"").append(icCompiler);
  +            args.append(" -classpath ").append(repositoryClasspath);
  +            args.append("\" ");
  +
               args.append("-d").append(failThrowable).append(" ");
  -            
args.append("-o").append(instrumentDir).append(File.separator).append("@p").append(File.separator).append("@[EMAIL
 PROTECTED] ");
  -            
args.append("-k").append(repositoryDir).append(File.separator).append("@p ");
  +
  +            args.append("-o").append(instrumentDir).append(File.separator);
  +            args.append("@p").append(File.separator).append("@[EMAIL 
PROTECTED] ");
  +
  +            args.append("-k").append(repositoryDir).append(File.separator);
  +            args.append("@p ");
  +
               args.append(quiet ? "-q " : "");
  -            args.append(instrumentall ? "-a " : "");// reinstrument 
everything if controlFile exists and is newer than any class
  +            // reinstrument everything if controlFile exists and is newer
  +            // than any class
  +            args.append(instrumentall ? "-a " : "");
               args.append("@").append(targets.getAbsolutePath());
               iContract.createArg().setLine(args.toString());
   
  -//System.out.println( "JAVA -classpath " + iContractClasspath + " 
com.reliablesystems.iContract.Tool " + args.toString() );
  +            //System.out.println( "JAVA -classpath " + iContractClasspath
  +            //    + " com.reliablesystems.iContract.Tool " + args.toString() 
);
   
               // update iControlProperties if it's set.
               if (updateIcontrol) {
  @@ -624,17 +679,24 @@
                       // to read existing propertiesfile
                       iControlProps.load(new 
FileInputStream("icontrol.properties"));
                   } catch (IOException e) {
  -                    log("File icontrol.properties not found. That's ok. 
Writing a default one.");
  +                    log("File icontrol.properties not found. That's ok. "
  +                        + "Writing a default one.");
                   }
  -                iControlProps.setProperty("sourceRoot", 
srcDir.getAbsolutePath());
  -                iControlProps.setProperty("classRoot", 
classDir.getAbsolutePath());
  -                iControlProps.setProperty("classpath", 
afterInstrumentationClasspath.toString());
  -                iControlProps.setProperty("controlFile", 
controlFile.getAbsolutePath());
  -                iControlProps.setProperty("targetsFile", 
targets.getAbsolutePath());
  +                iControlProps.setProperty("sourceRoot",
  +                    srcDir.getAbsolutePath());
  +                iControlProps.setProperty("classRoot",
  +                    classDir.getAbsolutePath());
  +                iControlProps.setProperty("classpath",
  +                    afterInstrumentationClasspath.toString());
  +                iControlProps.setProperty("controlFile",
  +                    controlFile.getAbsolutePath());
  +                iControlProps.setProperty("targetsFile",
  +                    targets.getAbsolutePath());
   
                   try {
                       // to read existing propertiesfile
  -                    iControlProps.store(new 
FileOutputStream("icontrol.properties"), ICONTROL_PROPERTIES_HEADER);
  +                    iControlProps.store(new 
FileOutputStream("icontrol.properties"),
  +                        ICONTROL_PROPERTIES_HEADER);
                       log("Updated icontrol.properties");
                   } catch (IOException e) {
                       log("Couldn't write icontrol.properties.");
  @@ -646,11 +708,14 @@
   
               if (result != 0) {
                   if (iContractMissing) {
  -                    log("iContract can't be found on your classpath. Your 
classpath is:");
  +                    log("iContract can't be found on your classpath. "
  +                        + "Your classpath is:");
                       log(classpath.toString());
  -                    log("If you don't have the iContract jar, go get it at 
http://www.reliable-systems.com/tools/";);
  +                    log("If you don't have the iContract jar, go get it at "
  +                        + "http://www.reliable-systems.com/tools/";);
                   }
  -                throw new BuildException("iContract instrumentation failed. 
Code=" + result);
  +                throw new BuildException("iContract instrumentation failed. "
  +                    + "Code = " + result);
               }
           } else {
               // not dirty
  @@ -662,22 +727,28 @@
       /** Checks that the required attributes are set.  */
       private void preconditions() throws BuildException {
           if (srcDir == null) {
  -            throw new BuildException("srcdir attribute must be set!", 
getLocation());
  +            throw new BuildException("srcdir attribute must be set!",
  +                getLocation());
           }
           if (!srcDir.exists()) {
  -            throw new BuildException("srcdir \"" + srcDir.getPath() + "\" 
does not exist!", getLocation());
  +            throw new BuildException("srcdir \"" + srcDir.getPath()
  +                + "\" does not exist!", getLocation());
           }
           if (instrumentDir == null) {
  -            throw new BuildException("instrumentdir attribute must be set!", 
getLocation());
  +            throw new BuildException("instrumentdir attribute must be set!",
  +                getLocation());
           }
           if (repositoryDir == null) {
  -            throw new BuildException("repositorydir attribute must be set!", 
getLocation());
  +            throw new BuildException("repositorydir attribute must be set!",
  +                getLocation());
           }
           if (updateIcontrol && classDir == null) {
  -            throw new BuildException("classdir attribute must be specified 
when updateicontrol=true!", getLocation());
  +            throw new BuildException("classdir attribute must be specified "
  +                + "when updateicontrol=true!", getLocation());
           }
           if (updateIcontrol && controlFile == null) {
  -            throw new BuildException("controlfile attribute must be 
specified when updateicontrol=true!", getLocation());
  +            throw new BuildException("controlfile attribute must be 
specified "
  +                + "when updateicontrol=true!", getLocation());
           }
       }
   
  @@ -706,10 +777,12 @@
           try {
               if (targets == null) {
                   targets = new File("targets");
  -                log("Warning: targets file not specified. generating file: " 
+ targets.getName());
  +                log("Warning: targets file not specified. generating file: "
  +                    + targets.getName());
                   writeTargets = true;
               } else if (!targets.exists()) {
  -                log("Specified targets file doesn't exist. generating file: 
" + targets.getName());
  +                log("Specified targets file doesn't exist. generating file: "
  +                    + targets.getName());
                   writeTargets = true;
               }
               if (writeTargets) {
  @@ -733,7 +806,9 @@
                       }
   
                       if (!classFile.exists() || srcFile.lastModified() > 
classFile.lastModified()) {
  -                        //log( "Found a file newer than the instrumentDir 
class file: " + srcFile.getPath() + " newer than " + classFile.getPath() + ". 
Running iContract again..." );
  +                        //log( "Found a file newer than the instrumentDir 
class file: "
  +                        //    + srcFile.getPath() + " newer than " + 
classFile.getPath()
  +                        //    + ". Running iContract again..." );
                           dirty = true;
                       }
                   }
  @@ -761,7 +836,10 @@
                           if (files[i].endsWith(".class")) {
                               if (controlFileTime > srcFile.lastModified()) {
                                   if (!dirty) {
  -                                    log("Control file " + 
controlFile.getAbsolutePath() + " has been updated. Instrumenting all 
files...");
  +                                    log("Control file "
  +                                        + controlFile.getAbsolutePath()
  +                                        + " has been updated. "
  +                                        + "Instrumenting all files...");
                                   }
                                   dirty = true;
                                   instrumentall = true;
  @@ -771,7 +849,8 @@
                   }
               }
           } catch (Throwable t) {
  -            throw new BuildException("Got an interesting exception:" + 
t.getMessage());
  +            throw new BuildException("Got an interesting exception:"
  +                + t.getMessage());
           }
       }
   
  @@ -876,7 +955,8 @@
   
           // make it public
           public void modify(Path path) {
  -            // depending on what compiler to use, set the includeJavaRuntime 
flag
  +            // depending on what compiler to use, set the
  +            // includeJavaRuntime flag
               if ("jikes".equals(compiler)) {
                   icCompiler = compiler;
                   includeJavaRuntime = true;
  
  
  
  1.25      +15 -9     
ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -u -r1.24 -r1.25
  --- Javah.java        17 Jul 2003 15:44:39 -0000      1.24
  +++ Javah.java        18 Jul 2003 12:45:57 -0000      1.25
  @@ -275,25 +275,31 @@
       }
   
       /**
  -     * Executes the task.
  +     * Execute the task
  +     *
  +     * @throws BuildException is there is a problem in the task execution.
        */
       public void execute() throws BuildException {
           // first off, make sure that we've got a srcdir
   
           if ((cls == null) && (classes.size() == 0)) {
  -            throw new BuildException("class attribute must be set!", 
getLocation());
  +            throw new BuildException("class attribute must be set!",
  +                getLocation());
           }
   
           if ((cls != null) && (classes.size() > 0)) {
  -            throw new BuildException("set class attribute or class element, 
not both.", getLocation());
  +            throw new BuildException("set class attribute or class element, "
  +                + "not both.", getLocation());
           }
   
           if (destDir != null) {
               if (!destDir.isDirectory()) {
  -                throw new BuildException("destination directory \"" + 
destDir + "\" does not exist or is not a directory", getLocation());
  +                throw new BuildException("destination directory \"" + destDir
  +                    + "\" does not exist or is not a directory", 
getLocation());
               }
               if (outputFile != null) {
  -                throw new BuildException("destdir and outputFile are 
mutually exclusive", getLocation());
  +                throw new BuildException("destdir and outputFile are 
mutually "
  +                    + "exclusive", getLocation());
               }
           }
   
  @@ -305,8 +311,8 @@
   
           String compiler = getProject().getProperty("build.compiler");
           if (compiler == null) {
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) &&
  -                !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
  +            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  +                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
                   compiler = "modern";
               } else {
                   compiler = "classic";
  
  
  
  1.16      +13 -2     
ant/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
  
  Index: Native2Ascii.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  --- Native2Ascii.java 17 Jul 2003 14:55:41 -0000      1.15
  +++ Native2Ascii.java 18 Jul 2003 12:45:57 -0000      1.16
  @@ -135,6 +135,10 @@
   
       /**
        * Defines the FileNameMapper to use (nested mapper element).
  +     *
  +     * @return the mapper to use for file name translations.
  +     *
  +     * @throws BuildException if more than one mapper is defined.
        */
       public Mapper createMapper() throws BuildException {
           if (mapper != null) {
  @@ -145,6 +149,11 @@
           return mapper;
       }
   
  +    /**
  +     * Execute the task
  +     *
  +     * @throws BuildException is there is a problem in the task execution.
  +     */
       public void execute() throws BuildException {
   
           DirectoryScanner scanner = null; // Scanner to find our inputs
  @@ -252,8 +261,10 @@
   
       private class ExtMapper implements FileNameMapper {
   
  -        public void setFrom(String s) {}
  -        public void setTo(String s) {}
  +        public void setFrom(String s) {
  +        }
  +        public void setTo(String s) {
  +        }
   
           public String[] mapFileName(String fileName) {
               int lastDot = fileName.lastIndexOf('.');
  
  
  
  1.25      +35 -22    
ant/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
  
  Index: NetRexxC.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -u -r1.24 -r1.25
  --- NetRexxC.java     10 Feb 2003 14:13:45 -0000      1.24
  +++ NetRexxC.java     18 Jul 2003 12:45:57 -0000      1.25
  @@ -163,10 +163,14 @@
       private boolean suppressDeprecation = false;
   
       // constants for the messages to suppress by flags and their 
corresponding properties
  -    static final String MSG_METHOD_ARGUMENT_NOT_USED = "Warning: Method 
argument is not used";
  -    static final String MSG_PRIVATE_PROPERTY_NOT_USED = "Warning: Private 
property is defined but not used";
  -    static final String MSG_VARIABLE_NOT_USED = "Warning: Variable is set 
but not used";
  -    static final String MSG_EXCEPTION_NOT_SIGNALLED = "is in SIGNALS list 
but is not signalled within the method";
  +    static final String MSG_METHOD_ARGUMENT_NOT_USED
  +        = "Warning: Method argument is not used";
  +    static final String MSG_PRIVATE_PROPERTY_NOT_USED
  +        = "Warning: Private property is defined but not used";
  +    static final String MSG_VARIABLE_NOT_USED
  +        = "Warning: Variable is set but not used";
  +    static final String MSG_EXCEPTION_NOT_SIGNALLED
  +        = "is in SIGNALS list but is not signalled within the method";
       static final String MSG_DEPRECATION = "has been deprecated";
   
       // other implementation variables
  @@ -527,7 +531,6 @@
        * with arguments like -Dant.netrexxc.verbose=verbose5 one can easily 
take
        * control of all netrexxc-tasks.
        */
  -    // Sorry for the formatting, but that way it's easier to keep in sync 
with the private properties (line by line).
       public void init() {
           String p;
   
  @@ -736,7 +739,7 @@
               j++;
           }
           // create a single array of arguments for the compiler
  -        String compileArgs[] = new String[compileOptionsArray.length + 
fileListArray.length];
  +        String[] compileArgs = new String[compileOptionsArray.length + 
fileListArray.length];
   
           for (int i = 0; i < compileOptionsArray.length; i++) {
               compileArgs[i] = compileOptionsArray[i];
  @@ -782,38 +785,48 @@
               String l;
               BufferedReader in = new BufferedReader(new 
StringReader(out.toString()));
   
  -            log("replacing destdir '" + ddir + "' through sourcedir '" + 
sdir + "'", Project.MSG_VERBOSE);
  +            log("replacing destdir '" + ddir + "' through sourcedir '"
  +                + sdir + "'", Project.MSG_VERBOSE);
               while ((l = in.readLine()) != null) {
                   int idx;
   
  -                while (doReplace && ((idx = l.indexOf(ddir)) != -1)) {// 
path is mentioned in the message
  +                while (doReplace && ((idx = l.indexOf(ddir)) != -1)) {
  +                    // path is mentioned in the message
                       l = (new StringBuffer(l)).replace(idx, idx + dlen, 
sdir).toString();
                   }
                   // verbose level logging for suppressed messages
  -                if (suppressMethodArgumentNotUsed && 
l.indexOf(MSG_METHOD_ARGUMENT_NOT_USED) != -1) {
  +                if (suppressMethodArgumentNotUsed
  +                    && l.indexOf(MSG_METHOD_ARGUMENT_NOT_USED) != -1) {
                       log(l, Project.MSG_VERBOSE);
  -                } else if (suppressPrivatePropertyNotUsed && 
l.indexOf(MSG_PRIVATE_PROPERTY_NOT_USED) != -1) {
  +                } else if (suppressPrivatePropertyNotUsed
  +                    && l.indexOf(MSG_PRIVATE_PROPERTY_NOT_USED) != -1) {
                       log(l, Project.MSG_VERBOSE);
  -                } else if (suppressVariableNotUsed && 
l.indexOf(MSG_VARIABLE_NOT_USED) != -1) {
  +                } else if (suppressVariableNotUsed
  +                    && l.indexOf(MSG_VARIABLE_NOT_USED) != -1) {
                       log(l, Project.MSG_VERBOSE);
  -                } else if (suppressExceptionNotSignalled && 
l.indexOf(MSG_EXCEPTION_NOT_SIGNALLED) != -1) {
  +                } else if (suppressExceptionNotSignalled
  +                    && l.indexOf(MSG_EXCEPTION_NOT_SIGNALLED) != -1) {
                       log(l, Project.MSG_VERBOSE);
  -                } else if (suppressDeprecation && l.indexOf(MSG_DEPRECATION) 
!= -1) {
  +                } else if (suppressDeprecation
  +                    && l.indexOf(MSG_DEPRECATION) != -1) {
                       log(l, Project.MSG_VERBOSE);
  -                } else if (l.indexOf("Error:") != -1) {// error level 
logging for compiler errors
  +                } else if (l.indexOf("Error:") != -1) {
  +                    // error level logging for compiler errors
                       log(l, Project.MSG_ERR);
  -                } else if (l.indexOf("Warning:") != -1) {// warning for all 
warning messages
  +                } else if (l.indexOf("Warning:") != -1) {
  +                    // warning for all warning messages
                       log(l, Project.MSG_WARN);
                   } else {
                       log(l, Project.MSG_INFO);// info level for the rest.
                   }
               }
               if (rc > 1) {
  -                throw new BuildException("Compile failed, messages should 
have been provided.");
  +                throw new BuildException("Compile failed, messages should "
  +                    + "have been provided.");
               }
           } catch (IOException ioe) {
  -            throw new BuildException("Unexpected IOException while playing 
with Strings",
  -                ioe);
  +            throw new BuildException("Unexpected IOException while "
  +                + "playing with Strings", ioe);
           } finally {
               // need to reset java.class.path property
               // since the NetRexx compiler has no option for the classpath
  @@ -902,8 +915,8 @@
                   target.append(File.pathSeparator);
                   target.append(f.getAbsolutePath());
               } else {
  -                log("Dropping from classpath: " +
  -                    f.getAbsolutePath(), Project.MSG_VERBOSE);
  +                log("Dropping from classpath: "
  +                    + f.getAbsolutePath(), Project.MSG_VERBOSE);
               }
           }
   
  
  
  
  1.31      +12 -17    
ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
  
  Index: PropertyFile.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -w -u -r1.30 -r1.31
  --- PropertyFile.java 17 Jul 2003 14:55:41 -0000      1.30
  +++ PropertyFile.java 18 Jul 2003 12:45:57 -0000      1.31
  @@ -98,7 +98,8 @@
    *The &lt;propertyfile&gt; task must have:<br>
    *    <ul><li>file</li></ul>
    *Other parameters are:<br>
  - *    <ul><li>comment, key, operation, type and value (the final four being 
eliminated shortly)</li></ul>
  + *    <ul><li>comment, key, operation, type and value (the final four being
  + *            eliminated shortly)</li></ul>
    *
    *The &lt;entry&gt; task must have:<br>
    *    <ul><li>key</li></ul>
  @@ -253,7 +254,9 @@
               if (bos != null) {
                   try {
                       bos.close();
  -                } catch (IOException ioex) {}
  +                } catch (IOException ioex) {
  +                    // ignore
  +                }
               }
           }
       }
  @@ -506,8 +509,8 @@
            *      fields
            */
           private void checkParameters() throws BuildException {
  -            if (type == Type.STRING_TYPE &&
  -                operation == Operation.DECREMENT_OPER) {
  +            if (type == Type.STRING_TYPE
  +                && operation == Operation.DECREMENT_OPER) {
                   throw new BuildException("- is not suported for string "
                       + "properties (key:" + key + ")");
               }
  @@ -518,8 +521,7 @@
               if (key == null) {
                   throw new BuildException("key is mandatory");
               }
  -            if (type == Type.STRING_TYPE &&
  -                pattern != null) {
  +            if (type == Type.STRING_TYPE && pattern != null) {
                   throw new BuildException("pattern is not suported for string 
"
                       + "properties (key:" + key + ")");
               }
  @@ -631,16 +633,9 @@
           private static final String MONTH = "month";
           private static final String YEAR = "year";
   
  -        private static final String[] units = {
  -                                                MILLISECOND,
  -                                                SECOND,
  -                                                MINUTE,
  -                                                HOUR,
  -                                                DAY,
  -                                                WEEK,
  -                                                MONTH,
  -                                                YEAR
  -                                              };
  +        private static final String[] UNITS
  +            = {MILLISECOND, SECOND, MINUTE, HOUR,
  +               DAY, WEEK, MONTH, YEAR };
   
           private Hashtable calendarFields = new Hashtable();
   
  @@ -663,7 +658,7 @@
           }
   
           public String[] getValues() {
  -            return units;
  +            return UNITS;
           }
       }
   }
  
  
  
  1.23      +11 -1     
ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
  
  Index: RenameExtensions.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -w -u -r1.22 -r1.23
  --- RenameExtensions.java     17 Jul 2003 14:55:41 -0000      1.22
  +++ RenameExtensions.java     18 Jul 2003 12:45:57 -0000      1.23
  @@ -98,7 +98,9 @@
   
       /**
        * The string that files must end in to be renamed
  -     **/
  +     *
  +     * @param from the extension of files being renamed.
  +     */
       public void setFromExtension(String from) {
           fromExtension = from;
       }
  @@ -106,6 +108,8 @@
       /**
        * The string that renamed files will end with on
        * completion
  +     *
  +     * @param to the extension of the renamed files.
        */
       public void setToExtension(String to) {
           toExtension = to;
  @@ -114,6 +118,8 @@
       /**
        * store replace attribute - this determines whether the target file
        * should be overwritten if present
  +     *
  +     * @param replace if true overwrite any target files that exist.
        */
       public void setReplace(boolean replace) {
           this.replace = replace;
  @@ -121,6 +127,8 @@
   
       /**
        * Set the source dir to find the files to be renamed.
  +     *
  +     * @param srcDir the source directory.
        */
       public void setSrcDir(File srcDir) {
           this.srcDir = srcDir;
  @@ -128,6 +136,8 @@
   
       /**
        * Executes the task.
  +     *
  +     * @throws BuildException is there is a problem in the task execution.
        */
       public void execute() throws BuildException {
   
  
  
  
  1.24      +18 -12    
ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -w -u -r1.23 -r1.24
  --- ReplaceRegExp.java        17 Jul 2003 15:44:39 -0000      1.23
  +++ ReplaceRegExp.java        18 Jul 2003 12:45:57 -0000      1.24
  @@ -220,9 +220,11 @@
        *  <li>g : Global replacement.  Replace all occurences found
        *  <li>i : Case Insensitive.  Do not consider case in the match
        *  <li>m : Multiline.  Treat the string as multiple lines of input,
  -     *         using "^" and "$" as the start or end of any line, 
respectively, rather than start or end of string.
  +     *         using "^" and "$" as the start or end of any line, 
respectively,
  +     *         rather than start or end of string.
        *  <li> s : Singleline.  Treat the string as a single line of input, 
using
  -     *        "." to match any character, including a newline, which 
normally, it would not match.
  +     *        "." to match any character, including a newline, which 
normally,
  +     *        it would not match.
        *</ul>
        */
       public void setFlags(String flags) {
  @@ -334,13 +336,11 @@
   
               boolean changes = false;
   
  -            log("Replacing pattern '" + regex.getPattern(getProject()) +
  -                "' with '" + subs.getExpression(getProject()) +
  -                "' in '" + f.getPath() + "'" +
  -                (byline ? " by line" : "") +
  -                (flags.length() > 0 ? " with flags: '" + flags + "'" : "") +
  -                ".",
  -                Project.MSG_VERBOSE);
  +            log("Replacing pattern '" + regex.getPattern(getProject())
  +                + "' with '" + subs.getExpression(getProject())
  +                + "' in '" + f.getPath() + "'" + (byline ? " by line" : "")
  +                + (flags.length() > 0 ? " with flags: '" + flags + "'" : "")
  +                + ".", Project.MSG_VERBOSE);
   
               if (byline) {
                   StringBuffer linebuf = new StringBuffer();
  @@ -450,6 +450,7 @@
                       r.close();
                   }
               } catch (Exception e) {
  +                // ignore any secondary exceptions
               }
   
               try {
  @@ -457,6 +458,7 @@
                       w.close();
                   }
               } catch (Exception e) {
  +                // ignore any secondary exceptions
               }
               if (temp != null) {
                   temp.delete();
  @@ -465,8 +467,12 @@
       }
   
   
  -    public void execute()
  -         throws BuildException {
  +    /**
  +     * Execute the task
  +     *
  +     * @throws BuildException is there is a problem in the task execution.
  +     */
  +    public void execute() throws BuildException {
           if (regex == null) {
               throw new BuildException("No expression to match.");
           }
  @@ -516,7 +522,7 @@
               FileSet fs = (FileSet) (filesets.elementAt(i));
               DirectoryScanner ds = fs.getDirectoryScanner(getProject());
   
  -            String files[] = ds.getIncludedFiles();
  +            String[] files = ds.getIncludedFiles();
   
               for (int j = 0; j < files.length; j++) {
                   File f = new File(fs.getDir(getProject()), files[j]);
  
  
  
  1.16      +19 -4     
ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
  
  Index: Rpm.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  --- Rpm.java  17 Jul 2003 14:55:41 -0000      1.15
  +++ Rpm.java  18 Jul 2003 12:45:57 -0000      1.16
  @@ -126,6 +126,11 @@
        */
       private File error;
   
  +    /**
  +     * Execute the task
  +     *
  +     * @throws BuildException is there is a problem in the task execution.
  +     */
       public void execute() throws BuildException {
   
           Commandline toExecute = new Commandline();
  @@ -161,7 +166,9 @@
           } else {
               if (output != null) {
                   try {
  -                    outputstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(output)));
  +                    BufferedOutputStream bos
  +                        = new BufferedOutputStream(new 
FileOutputStream(output));
  +                    outputstream = new PrintStream(bos);
                   } catch (IOException e) {
                       throw new BuildException(e, getLocation());
                   }
  @@ -170,7 +177,9 @@
               }
               if (error != null) {
                   try {
  -                    errorstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(error)));
  +                    BufferedOutputStream bos
  +                        = new BufferedOutputStream(new 
FileOutputStream(error));
  +                    errorstream = new PrintStream(bos);
                   }  catch (IOException e) {
                       throw new BuildException(e, getLocation());
                   }
  @@ -198,12 +207,16 @@
               if (output != null) {
                   try {
                       outputstream.close();
  -                } catch (IOException e) {}
  +                } catch (IOException e) {
  +                    // ignore any secondary error
  +                }
               }
               if (error != null) {
                   try {
                       errorstream.close();
  -                } catch (IOException e) {}
  +                } catch (IOException e) {
  +                    // ignore any secondary error
  +                }
               }
           }
       }
  @@ -213,6 +226,8 @@
        * subdirectories, SPECS, SOURCES, BUILD, SRPMS ; optional.
        * If this isn't specified,
        * the <tt>baseDir</tt> value is used
  +     *
  +     * @param td the directory containing the normal RPM directories.
        */
       public void setTopDir(File td) {
           this.topDir = td;
  
  
  
  1.22      +8 -8      
ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
  
  Index: Script.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -w -u -r1.21 -r1.22
  --- Script.java       17 Jul 2003 14:55:41 -0000      1.21
  +++ Script.java       18 Jul 2003 12:45:57 -0000      1.22
  @@ -81,8 +81,8 @@
           for (Enumeration e = dictionary.keys(); e.hasMoreElements();) {
               String key = (String) e.nextElement();
   
  -            boolean isValid = key.length() > 0 &&
  -                Character.isJavaIdentifierStart(key.charAt(0));
  +            boolean isValid = key.length() > 0
  +                && Character.isJavaIdentifierStart(key.charAt(0));
   
               for (int i = 1; isValid && i < key.length(); i++) {
                   isValid = Character.isJavaIdentifierPart(key.charAt(i));
  @@ -137,7 +137,7 @@
       /**
        * Defines the language (required).
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param language the scripting language name for the script.
        */
       public void setLanguage(String language) {
           this.language = language;
  @@ -146,7 +146,7 @@
       /**
        * Load the script from an external file ; optional.
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param fileName the name of the file containing the script source.
        */
       public void setSrc(String fileName) {
           File file = new File(fileName);
  @@ -155,7 +155,7 @@
           }
   
           int count = (int) file.length();
  -        byte data[] = new byte[count];
  +        byte[] data = new byte[count];
   
           try {
               FileInputStream inStream = new FileInputStream(file);
  @@ -169,9 +169,9 @@
       }
   
       /**
  -     * The script text.
  +     * Set the script text.
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param text a component of the script text to be added.
        */
       public void addText(String text) {
           this.script += text;
  
  
  
  1.12      +1 -2      
ant/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java
  
  Index: StyleBook.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/StyleBook.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -u -r1.11 -r1.12
  --- StyleBook.java    17 Jul 2003 14:55:41 -0000      1.11
  +++ StyleBook.java    18 Jul 2003 12:45:57 -0000      1.12
  @@ -70,8 +70,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Marcus
    *      B&ouml;rger</a>
    */
  -public class StyleBook
  -     extends Java {
  +public class StyleBook extends Java {
       protected File m_targetDirectory;
       protected File m_skinDirectory;
       protected String m_loaderConfig;
  
  
  
  1.28      +4 -4      
ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
  
  Index: TraXLiaison.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -w -u -r1.27 -r1.28
  --- TraXLiaison.java  17 Jul 2003 14:55:41 -0000      1.27
  +++ TraXLiaison.java  18 Jul 2003 12:45:57 -0000      1.28
  @@ -209,8 +209,8 @@
                   reader.setEntityResolver(entityResolver);
                   src = new SAXSource(reader, new InputSource(is));
               } else {
  -                throw new IllegalStateException("xcatalog specified, but " +
  -                        "parser doesn't support SAX");
  +                throw new IllegalStateException("xcatalog specified, but "
  +                    + "parser doesn't support SAX");
               }
           } else {
               src = new StreamSource(is);
  
  
  
  1.35      +32 -27    
ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -w -u -r1.34 -r1.35
  --- XMLValidateTask.java      14 Jul 2003 13:42:33 -0000      1.34
  +++ XMLValidateTask.java      18 Jul 2003 12:45:57 -0000      1.35
  @@ -87,8 +87,10 @@
    * Checks XML files are valid (or only well formed). The
    * task uses the SAX2 parser implementation provided by JAXP by default
    * (probably the one that is used by Ant itself), but one can specify any
  - * SAX1/2 parser if needed
  - * @author Raphael Pierquin <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
  + * SAX1/2 parser if needed.
  + *
  + * @author Raphael Pierquin <a href="mailto:[EMAIL PROTECTED]">
  + *                          [EMAIL PROTECTED]</a>
    * @author Nick Pellow <a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>
    */
   public class XMLValidateTask extends Task {
  @@ -98,7 +100,7 @@
        */
       private static FileUtils fu = FileUtils.newFileUtils();
   
  -    protected static String INIT_FAILED_MSG =
  +    protected static final String INIT_FAILED_MSG =
           "Could not start xml validation: ";
   
       // ant task properties
  @@ -108,8 +110,10 @@
       protected boolean lenient = false;
       protected String  readerClassName = null;
   
  -    protected File file = null; // file to be validated
  -    protected Vector filesets = new Vector(); // sets of file to be validated
  +    /** file to be validated */
  +    protected File file = null;
  +    /** sets of file to be validated */
  +    protected Vector filesets = new Vector();
       protected Path classpath;
   
   
  @@ -137,7 +141,6 @@
        * parser yields an error.
        */
       public void setFailOnError(boolean fail) {
  -
           failOnError = fail;
       }
   
  @@ -147,35 +150,35 @@
        * If set to <code>true</true> (default), log a warn message for each 
SAX warn event.
        */
       public void setWarn(boolean bool) {
  -
           warn = bool;
       }
   
       /**
  -     * Specify whether the parser should be validating. Default is 
<code>true</code>.
  +     * Specify whether the parser should be validating. Default
  +     * is <code>true</code>.
        * <p>
  -     * If set to false, the validation will fail only if the parsed document 
is not well formed XML.
  +     * If set to false, the validation will fail only if the parsed document
  +     * is not well formed XML.
        * <p>
  -     * this option is ignored if the specified class with [EMAIL PROTECTED] 
#setClassName(String)} is not a SAX2
  -     * XMLReader.
  +     * this option is ignored if the specified class
  +     * with [EMAIL PROTECTED] #setClassName(String)} is not a SAX2 XMLReader.
        */
       public void setLenient(boolean bool) {
  -
           lenient = bool;
       }
   
       /**
        * Specify the class name of the SAX parser to be used. (optional)
  -     * @param className should be an implementation of SAX2 
<code>org.xml.sax.XMLReader</code>
  -     * or SAX2 <code>org.xml.sax.Parser</code>.
  -     * <p> if className is an implementation of 
<code>org.xml.sax.Parser</code>, [EMAIL PROTECTED] #setLenient(boolean)},
  +     * @param className should be an implementation of SAX2
  +     * <code>org.xml.sax.XMLReader</code> or SAX2 
<code>org.xml.sax.Parser</code>.
  +     * <p> if className is an implementation of
  +     * <code>org.xml.sax.Parser</code>, [EMAIL PROTECTED] 
#setLenient(boolean)},
        * will be ignored.
        * <p> if not set, the default will be used.
        * @see org.xml.sax.XMLReader
        * @see org.xml.sax.Parser
        */
       public void setClassName(String className) {
  -
           readerClassName = className;
       }
   
  @@ -184,7 +187,6 @@
        * Specify the classpath to be searched to load the parser (optional)
        */
       public void setClasspath(Path classpath) {
  -
           if (this.classpath == null) {
               this.classpath = classpath;
           } else {
  @@ -268,7 +270,8 @@
   
           int fileProcessed = 0;
           if (file == null && (filesets.size() == 0)) {
  -            throw new BuildException("Specify at least one source - a file 
or a fileset.");
  +            throw new BuildException("Specify at least one source - "
  +                + "a file or a fileset.");
           }
   
           initValidator();
  @@ -420,7 +423,8 @@
   
           if (errorHandler.getFailure()) {
               if (failOnError) {
  -                throw new BuildException(afile + " is not a valid XML 
document.");
  +                throw new BuildException(afile
  +                    + " is not a valid XML document.");
               } else {
                   log(afile + " is not a valid XML document", Project.MSG_ERR);
               }
  @@ -480,11 +484,12 @@
                   try {
                       int line = e.getLineNumber();
                       int col = e.getColumnNumber();
  -                    return new URL(sysID).getFile() +
  -                        (line == -1 ? "" : (":" + line +
  -                                            (col == -1 ? "" : (":" + col)))) 
+
  -                        ": " + e.getMessage();
  +                    return new URL(sysID).getFile()
  +                        + (line == -1 ? "" : (":" + line
  +                                        + (col == -1 ? "" : (":" + col))))
  +                        + ": " + e.getMessage();
                   } catch (MalformedURLException mfue) {
  +                    // ignore and just return exception message
                   }
               }
               return e.getMessage();
  @@ -499,7 +504,7 @@
       public class Attribute {
           /** The name of the attribute to set.
            *
  -         * Valid attributes <a 
href=http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description";>include.</a>
  +         * Valid attributes <a 
href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description";>include.</a>
            */
           private String attributeName = null;
   
  
  
  
  1.17      +9 -3      
ant/src/main/org/apache/tools/ant/taskdefs/optional/XalanLiaison.java
  
  Index: XalanLiaison.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/XalanLiaison.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -u -r1.16 -r1.17
  --- XalanLiaison.java 17 Jul 2003 14:55:41 -0000      1.16
  +++ XalanLiaison.java 18 Jul 2003 12:45:57 -0000      1.17
  @@ -108,17 +108,23 @@
                   if (xslStream != null) {
                       xslStream.close();
                   }
  -            } catch (IOException ignored) {}
  +            } catch (IOException ignored) {
  +                //ignore
  +            }
               try {
                   if (fis != null) {
                       fis.close();
                   }
  -            } catch (IOException ignored) {}
  +            } catch (IOException ignored) {
  +                //ignore
  +           }
               try {
                   if (fos != null) {
                       fos.close();
                   }
  -            } catch (IOException ignored) {}
  +            } catch (IOException ignored) {
  +                //ignore
  +            }
           }
       }
   
  
  
  
  1.5       +10 -10    
ant/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java
  
  Index: ScriptFilter.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- ScriptFilter.java 17 Jul 2003 14:55:44 -0000      1.4
  +++ ScriptFilter.java 18 Jul 2003 12:45:58 -0000      1.5
  @@ -72,6 +72,8 @@
    * to a script.
    * The script is meant to use get self.token and
    * set self.token in the reply.
  + *
  + * @author Not Specified.
    */
   public class ScriptFilter extends TokenFilter.ChainableReaderFilter {
       /** The language - attribute of element */
  @@ -90,7 +92,7 @@
       /**
        * Defines the language (required).
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param language the scripting language name for the script.
        */
       public void setLanguage(String language) {
           this.language = language;
  @@ -105,8 +107,8 @@
           for (Enumeration e = dictionary.keys(); e.hasMoreElements();) {
               String key = (String) e.nextElement();
   
  -            boolean isValid = key.length() > 0 &&
  -                Character.isJavaIdentifierStart(key.charAt(0));
  +            boolean isValid = key.length() > 0
  +                && Character.isJavaIdentifierStart(key.charAt(0));
   
               for (int i = 1; isValid && i < key.length(); i++) {
                   isValid = Character.isJavaIdentifierPart(key.charAt(i));
  @@ -116,8 +118,7 @@
                   if (isValid) {
                       beans.put(key, dictionary.get(key));
                   }
  -            }
  -            catch (Throwable t) {
  +            } catch (Throwable t) {
                   throw new BuildException(t);
                   //System.err.println("What the helll");
               }
  @@ -203,8 +204,7 @@
           try {
               manager.exec(language, "<ANT>", 0, 0, script);
               return getToken();
  -        }
  -        catch (BSFException be) {
  +        } catch (BSFException be) {
               Throwable t = be;
               Throwable te = be.getTargetException();
               if (te != null) {
  @@ -220,7 +220,7 @@
       /**
        * Load the script from an external file ; optional.
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param fileName the name of the file containing the script source.
        */
       public void setSrc(String fileName) {
           File file = new File(fileName);
  @@ -229,7 +229,7 @@
           }
   
           int count = (int) file.length();
  -        byte data[] = new byte[count];
  +        byte[] data = new byte[count];
   
           try {
               FileInputStream inStream = new FileInputStream(file);
  @@ -245,7 +245,7 @@
       /**
        * The script text.
        *
  -     * @param msg Sets the value for the script variable.
  +     * @param text a component of the script text to be added.
        */
       public void addText(String text) {
           this.script += text;
  
  
  
  1.4       +4 -0      
ant/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java
  
  Index: WeakishReference12.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- WeakishReference12.java   4 Jul 2003 14:04:56 -0000       1.3
  +++ WeakishReference12.java   18 Jul 2003 12:45:58 -0000      1.4
  @@ -61,6 +61,8 @@
   /**
    * This is a reference that really is is Weak, as it uses the
    * appropriate java.lang.ref class.
  + *
  + * @author Not Specified.
    */
   public class WeakishReference12 extends WeakishReference  {
   
  @@ -78,6 +80,8 @@
   
       /**
        * Returns this reference object's referent.
  +     *
  +     * @return referent.
        */
       public Object get() {
           return weakref.get();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to