ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types/optional/depend DependScanner.java
Date Wed, 26 Jan 2005 19:22:29 GMT
mbenson     2005/01/26 11:22:29

  Modified:    src/main/org/apache/tools/ant/types/optional/depend
                        DependScanner.java
  Log:
  Thread-safe(r)ty, javadoc, code simplification
  
  Revision  Changes    Path
  1.23      +8 -7      ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java
  
  Index: DependScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DependScanner.java	26 Jan 2005 18:06:51 -0000	1.22
  +++ DependScanner.java	26 Jan 2005 19:22:29 -0000	1.23
  @@ -69,7 +69,7 @@
        *
        * @param rootClasses the rootClasses to be used for this scan.
        */
  -    public void setRootClasses(Vector rootClasses) {
  +    public synchronized void setRootClasses(Vector rootClasses) {
           this.rootClasses = rootClasses;
       }
   
  @@ -79,16 +79,17 @@
        * @return the names of the files.
        */
       public String[] getIncludedFiles() {
  -        int count = included.size();
  -        String[] files = new String[count];
  -        for (int i = 0; i < count; i++) {
  +        String[] files = new String[getIncludedFilesCount()];
  +        for (int i = 0; i < files.length; i++) {
               files[i] = (String) included.elementAt(i);
           }
           return files;
       }
   
  -    //inherit doc
  -    public int getIncludedFilesCount() {
  +    /**
  +     * @see DirectoryScanner#getIncludedFilesCount
  +     */
  +    public synchronized int getIncludedFilesCount() {
           if (included == null) {
               throw new IllegalStateException();
           }
  @@ -100,7 +101,7 @@
        *
        * @exception IllegalStateException when basedir was set incorrectly.
        */
  -    public void scan() throws IllegalStateException {
  +    public synchronized void scan() throws IllegalStateException {
           included = new Vector();
           String analyzerClassName = DEFAULT_ANALYZER_CLASS;
           DependencyAnalyzer analyzer = null;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message