cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-05-23 Thread mbenson
mbenson 2005/05/23 12:46:14

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  use DataType's convenience method
  
  Revision  ChangesPath
  1.51  +1 -32 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- AbstractFileSet.java  21 Apr 2005 13:33:13 -  1.50
  +++ AbstractFileSet.java  23 May 2005 19:46:14 -  1.51
  @@ -393,27 +393,6 @@
   }
   
   /**
  - * Gets as descriptive as possible a name used for this datatype 
instance.
  - * @return codeString/code name.
  - */
  -protected String getDataTypeName() {
  -// look up the types in project and see if they match this class
  -Project p = getProject();
  -if (p != null) {
  -Hashtable typedefs = p.getDataTypeDefinitions();
  -for (Enumeration e = typedefs.keys(); e.hasMoreElements();) {
  -String typeName = (String) e.nextElement();
  -Class typeClass = (Class) typedefs.get(typeName);
  -if (typeClass == getClass()) {
  -return typeName;
  -}
  -}
  -}
  -String classname = getClass().getName();
  -return classname.substring(classname.lastIndexOf('.') + 1);
  -}
  -
  -/**
* Returns the directory scanner needed to access the files to process.
* @return a codeDirectoryScanner/code instance.
*/
  @@ -504,17 +483,7 @@
* @return the referenced FileSet
*/
   protected AbstractFileSet getRef(Project p) {
  -if (!isChecked()) {
  -Stack stk = new Stack();
  -stk.push(this);
  -dieOnCircularReference(stk, p);
  -}
  -Object o = getRefid().getReferencedObject(p);
  -if (!getClass().isAssignableFrom(o.getClass())) {
  -throw new BuildException(getRefid().getRefId()
  -+  doesn\'t denote a  + getDataTypeName());
  -}
  -return (AbstractFileSet) o;
  +return (AbstractFileSet) getCheckedRef(p);
   }
   
   // SelectorContainer methods
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-03-09 Thread mbenson
mbenson 2005/03/09 14:00:41

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Switch to = Java 1.2 method, a little clearer hopefully.
  
  Revision  ChangesPath
  1.48  +1 -1  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- AbstractFileSet.java  18 Feb 2005 16:57:23 -  1.47
  +++ AbstractFileSet.java  9 Mar 2005 22:00:41 -   1.48
  @@ -784,7 +784,7 @@
   fs.additionalPatterns
   .addElement(((PatternSet) e.nextElement()).clone());
   }
  -fs.selectors = (Vector) fs.selectors.clone();
  +fs.selectors = new Vector(selectors);
   return fs;
   } catch (CloneNotSupportedException e) {
   throw new BuildException(e);
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-18 Thread peterreilly
peterreilly2005/02/18 02:49:27

  Modified:.build.xml
   src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  clear the cached directory scanner when cloning an abstractfileset
  
  Revision  ChangesPath
  1.455 +0 -1  ant/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/ant/build.xml,v
  retrieving revision 1.454
  retrieving revision 1.455
  diff -u -r1.454 -r1.455
  --- build.xml 16 Feb 2005 17:40:07 -  1.454
  +++ build.xml 18 Feb 2005 10:49:27 -  1.455
  @@ -333,7 +333,6 @@
   exclude unless=run.failing.tests 
name=${optional.package}/jdepend/JDependTest.java/
   exclude unless=run.failing.tests 
name=${optional.package}/DotnetTest.java/
   exclude unless=run.failing.tests 
name=${optional.package}/WsdlToDotnetTest.java/
  -exclude unless=run.failing.tests 
name=${ant.package}/taskdefs/CloneTest.java/
 /patternset
   
 !--
  
  
  
  1.45  +1 -0  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- AbstractFileSet.java  11 Feb 2005 18:05:07 -  1.44
  +++ AbstractFileSet.java  18 Feb 2005 10:49:27 -  1.45
  @@ -784,6 +784,7 @@
   .addElement(((PatternSet) e.nextElement()).clone());
   }
   fs.selectors = (Vector) fs.selectors.clone();
  +fs.directoryScanner = null; // Clear the cached directory 
scanner
   return fs;
   } catch (CloneNotSupportedException e) {
   throw new BuildException(e);
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-18 Thread bodewig
bodewig 2005/02/18 04:29:51

  Modified:.Tag: ANT_16_BRANCH WHATSNEW
   src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
Zip.java
   src/main/org/apache/tools/ant/types Tag: ANT_16_BRANCH
AbstractFileSet.java
  Log:
  merge
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.503.2.178 +3 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.177
  retrieving revision 1.503.2.178
  diff -u -r1.503.2.177 -r1.503.2.178
  --- WHATSNEW  18 Feb 2005 11:04:28 -  1.503.2.177
  +++ WHATSNEW  18 Feb 2005 12:29:50 -  1.503.2.178
  @@ -204,6 +204,9 @@
 connetced to, potentially leading to exceptions in commons-net.
 Bugzilla Report 33618.
   
  +* zip's defaultexcludes attribute was ignored when an archive was
  +  updated.  Bugzilla Report 33412.
  +
   Changes from Ant 1.6.1 to Ant 1.6.2
   ===
   
  
  
  
  No   revision
  No   revision
  1.116.2.13 +2 -0  ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.116.2.12
  retrieving revision 1.116.2.13
  diff -u -r1.116.2.12 -r1.116.2.13
  --- Zip.java  18 Jan 2005 12:40:01 -  1.116.2.12
  +++ Zip.java  18 Feb 2005 12:29:51 -  1.116.2.13
  @@ -482,6 +482,8 @@
   ZipFileSet oldFiles = new ZipFileSet();
   oldFiles.setProject(getProject());
   oldFiles.setSrc(renamedFile);
  +oldFiles.setDefaultexcludes(getImplicitFileSet()
  +.getDefaultexcludes());
   
   for (int i = 0; i  addedFiles.size(); i++) {
   PatternSet.NameEntry ne = oldFiles.createExclude();
  
  
  
  No   revision
  No   revision
  1.29.2.6  +9 -0  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.29.2.5
  retrieving revision 1.29.2.6
  diff -u -r1.29.2.5 -r1.29.2.6
  --- AbstractFileSet.java  10 Dec 2004 21:52:32 -  1.29.2.5
  +++ AbstractFileSet.java  18 Feb 2005 12:29:51 -  1.29.2.6
  @@ -267,6 +267,15 @@
   }
   
   /**
  + * Whether default exclusions should be used or not.
  + * @since Ant 1.6.3
  + */
  +public boolean getDefaultexcludes() {
  +return (isReference())
  +? getRef(getProject()).getDefaultexcludes() : useDefaultExcludes;
  +}
  +
  +/**
* Sets case sensitivity of the file system.
*
* @param isCaseSensitive codeboolean/code.
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-18 Thread bodewig
bodewig 2005/02/18 04:30:31

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Needed getDefaulexcludes in 1.6.3 for PR 33412
  
  Revision  ChangesPath
  1.46  +1 -1  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- AbstractFileSet.java  18 Feb 2005 10:49:27 -  1.45
  +++ AbstractFileSet.java  18 Feb 2005 12:30:31 -  1.46
  @@ -329,7 +329,7 @@
   
   /**
* Whether default exclusions should be used or not.
  - * @since Ant 1.7
  + * @since Ant 1.6.3
*/
   public synchronized boolean getDefaultexcludes() {
   return (isReference())
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-18 Thread peterreilly
peterreilly2005/02/18 08:57:23

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  adding a selector to abstractfileset did not null the cached directory scanner
  now there is no need to null the directory scanner when cloning
  
  Revision  ChangesPath
  1.47  +1 -1  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- AbstractFileSet.java  18 Feb 2005 12:30:31 -  1.46
  +++ AbstractFileSet.java  18 Feb 2005 16:57:23 -  1.47
  @@ -586,6 +586,7 @@
   throw noChildrenAllowed();
   }
   selectors.addElement(selector);
  +directoryScanner = null;
   }
   
   /* Methods below all add specific selectors */
  @@ -784,7 +785,6 @@
   .addElement(((PatternSet) e.nextElement()).clone());
   }
   fs.selectors = (Vector) fs.selectors.clone();
  -fs.directoryScanner = null; // Clear the cached directory 
scanner
   return fs;
   } catch (CloneNotSupportedException e) {
   throw new BuildException(e);
  
  
  

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



Re: cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-14 Thread Stefan Bodewig
On 11 Feb 2005, [EMAIL PROTECTED] wrote:

   Modified to return a cached DirectoryScanner instance until
   changes are made to the AbstractFileSet.

What if the filesystem changes between invocations?

delete
  fileset dir=foo include=bar id=use-later/
/delete
copy todir=baz
  fileset refid=use-later/
/copy

I admit this one is silly, but there will be real-world examples.

Stefan

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



Re: cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-14 Thread Matt Benson
--- Stefan Bodewig [EMAIL PROTECTED] wrote:

 On 11 Feb 2005, [EMAIL PROTECTED] wrote:
 
Modified to return a cached DirectoryScanner
 instance until
changes are made to the AbstractFileSet.
 
 What if the filesystem changes between invocations?

Unless I have done something other than I intended,
scan() should still be invoked against the DS before
it is returned.

-Matt




__ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

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



Re: cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-14 Thread Stefan Bodewig
On Mon, 14 Feb 2005, Matt Benson [EMAIL PROTECTED] wrote:
 --- Stefan Bodewig [EMAIL PROTECTED] wrote:
 
 On 11 Feb 2005, [EMAIL PROTECTED] wrote:
 
Modified to return a cached DirectoryScanner
 instance until
changes are made to the AbstractFileSet.
 
 What if the filesystem changes between invocations?
 
 Unless I have done something other than I intended,
 scan() should still be invoked against the DS before
 it is returned.

Uhm, yes.  You are right, sorry.

Stefan

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-11 Thread mbenson
mbenson 2005/02/11 08:27:28

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Modified to return a cached DirectoryScanner instance until
  changes are made to the AbstractFileSet.
  
  Revision  ChangesPath
  1.40  +79 -52
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- AbstractFileSet.java  4 Feb 2005 23:37:33 -   1.39
  +++ AbstractFileSet.java  11 Feb 2005 16:27:28 -  1.40
  @@ -66,6 +66,9 @@
   private boolean caseSensitive = true;
   private boolean followSymlinks = true;
   
  +/* cached DirectoryScanner instance for our own Project only */
  +private DirectoryScanner directoryScanner = null;
  +
   /**
* Construct a new codeAbstractFileSet/code.
*/
  @@ -113,11 +116,12 @@
* Sets the base-directory for this instance.
* @param dir the directory's codeFile/code instance.
*/
  -public void setDir(File dir) throws BuildException {
  +public synchronized void setDir(File dir) throws BuildException {
   if (isReference()) {
   throw tooManyAttributes();
   }
   this.dir = dir;
  +directoryScanner = null;
   }
   
   /**
  @@ -134,7 +138,7 @@
*  reference is resolved, if set.
* @return codeFile/code.
*/
  -public File getDir(Project p) {
  +public synchronized File getDir(Project p) {
   return (isReference()) ? getRef(p).getDir(p) : dir;
   }
   
  @@ -142,12 +146,13 @@
* Creates a nested patternset.
* @return codePatternSet/code.
*/
  -public PatternSet createPatternSet() {
  +public synchronized PatternSet createPatternSet() {
   if (isReference()) {
   throw noChildrenAllowed();
   }
   PatternSet patterns = new PatternSet();
   additionalPatterns.addElement(patterns);
  +directoryScanner = null;
   return patterns;
   }
   
  @@ -155,10 +160,11 @@
* Add a name entry to the include list.
* @return codePatternSet.NameEntry/code.
*/
  -public PatternSet.NameEntry createInclude() {
  +public synchronized PatternSet.NameEntry createInclude() {
   if (isReference()) {
   throw noChildrenAllowed();
   }
  +directoryScanner = null;
   return defaultPatterns.createInclude();
   }
   
  @@ -166,10 +172,11 @@
* Add a name entry to the include files list.
* @return codePatternSet.NameEntry/code.
*/
  -public PatternSet.NameEntry createIncludesFile() {
  +public synchronized PatternSet.NameEntry createIncludesFile() {
   if (isReference()) {
   throw noChildrenAllowed();
   }
  +directoryScanner = null;
   return defaultPatterns.createIncludesFile();
   }
   
  @@ -177,10 +184,11 @@
* Add a name entry to the exclude list.
* @return codePatternSet.NameEntry/code.
*/
  -public PatternSet.NameEntry createExclude() {
  +public synchronized PatternSet.NameEntry createExclude() {
   if (isReference()) {
   throw noChildrenAllowed();
   }
  +directoryScanner = null;
   return defaultPatterns.createExclude();
   }
   
  @@ -188,10 +196,11 @@
* Add a name entry to the excludes files list.
* @return codePatternSet.NameEntry/code.
*/
  -public PatternSet.NameEntry createExcludesFile() {
  +public synchronized PatternSet.NameEntry createExcludesFile() {
   if (isReference()) {
   throw noChildrenAllowed();
   }
  +directoryScanner = null;
   return defaultPatterns.createExcludesFile();
   }
   
  @@ -216,11 +225,12 @@
*
* @param includes the codeString/code containing the include 
patterns.
*/
  -public void setIncludes(String includes) {
  +public synchronized void setIncludes(String includes) {
   if (isReference()) {
   throw tooManyAttributes();
   }
   defaultPatterns.setIncludes(includes);
  +directoryScanner = null;
   }
   
   /**
  @@ -230,7 +240,7 @@
* @param includes array containing the include patterns.
* @since Ant 1.7
*/
  -public void appendIncludes(String[] includes) {
  +public synchronized void appendIncludes(String[] includes) {
   if (isReference()) {
   throw tooManyAttributes();
   }
  @@ -238,6 +248,7 @@
   for (int i = 0; i  includes.length; i++) {
   defaultPatterns.createInclude().setName(includes[i]);

cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-11 Thread mbenson
mbenson 2005/02/11 09:44:13

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Javadoc
  
  Revision  ChangesPath
  1.42  +3 -0  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- AbstractFileSet.java  11 Feb 2005 17:32:19 -  1.41
  +++ AbstractFileSet.java  11 Feb 2005 17:44:13 -  1.42
  @@ -792,6 +792,7 @@
   }
   
   /**
  + * Get the merged include patterns for this AbstractFileSet.
* @return the include patterns of the default pattern set and all
* nested patternsets.
*
  @@ -802,6 +803,7 @@
   }
   
   /**
  + * Get the merged exclude patterns for this AbstractFileSet.
* @return the exclude patterns of the default pattern set and all
* nested patternsets.
*
  @@ -812,6 +814,7 @@
   }
   
   /**
  + * Get the merged patterns for this AbstractFileSet.
* @return the default patternset merged with the additional sets
* in a new PatternSet instance.
*
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-11 Thread mbenson
mbenson 2005/02/11 09:46:31

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Keep setFile atomic.
  
  Revision  ChangesPath
  1.43  +1 -1  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- AbstractFileSet.java  11 Feb 2005 17:44:13 -  1.42
  +++ AbstractFileSet.java  11 Feb 2005 17:46:31 -  1.43
  @@ -210,7 +210,7 @@
* @param file the single codeFile/code included in this
* codeAbstractFileSet/code.
*/
  -public void setFile(File file) {
  +public synchronized void setFile(File file) {
   if (isReference()) {
   throw tooManyAttributes();
   }
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-11 Thread mbenson
mbenson 2005/02/11 10:05:07

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Javadoc
  
  Revision  ChangesPath
  1.44  +1 -1  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- AbstractFileSet.java  11 Feb 2005 17:46:31 -  1.43
  +++ AbstractFileSet.java  11 Feb 2005 18:05:07 -  1.44
  @@ -339,7 +339,7 @@
   /**
* Sets case sensitivity of the file system.
*
  - * @param isCaseSensitive codeboolean/code.
  + * @param caseSensitive codeboolean/code.
*/
   public synchronized void setCaseSensitive(boolean caseSensitive) {
   if (isReference()) {
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-04 Thread mbenson
mbenson 2005/02/04 15:22:16

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  +2 convenience methods
  
  Revision  ChangesPath
  1.38  +17 -0 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- AbstractFileSet.java  4 Feb 2005 08:08:59 -   1.37
  +++ AbstractFileSet.java  4 Feb 2005 23:22:16 -   1.38
  @@ -122,6 +122,14 @@
   
   /**
* Retrieves the base-directory for this instance.
  + * @return codeFile/code.
  + */
  +public synchronized File getDir() {
  +return getDir(getProject());
  +}
  +
  +/**
  + * Retrieves the base-directory for this instance.
* @param p the codeProject/code against which the
*  reference is resolved, if set.
* @return codeFile/code.
  @@ -386,6 +394,15 @@
* Returns the directory scanner needed to access the files to process.
* @return a codeDirectoryScanner/code instance.
*/
  +public DirectoryScanner getDirectoryScanner() {
  +return getDirectoryScanner(getProject());
  +}
  +
  +/**
  + * Returns the directory scanner needed to access the files to process.
  + * @param p the Project against which the DirectoryScanner should be 
configured.
  + * @return a codeDirectoryScanner/code instance.
  + */
   public DirectoryScanner getDirectoryScanner(Project p) {
   if (isReference()) {
   return getRef(p).getDirectoryScanner(p);
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2005-02-04 Thread mbenson
mbenson 2005/02/04 15:37:33

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  another convenience method
  
  Revision  ChangesPath
  1.39  +10 -1 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- AbstractFileSet.java  4 Feb 2005 23:22:16 -   1.38
  +++ AbstractFileSet.java  4 Feb 2005 23:37:33 -   1.39
  @@ -124,7 +124,7 @@
* Retrieves the base-directory for this instance.
* @return codeFile/code.
*/
  -public synchronized File getDir() {
  +public File getDir() {
   return getDir(getProject());
   }
   
  @@ -426,6 +426,15 @@
   }
   
   /**
  + * Set up the specified directory scanner against this
  + * AbstractFileSet's Project.
  + * @param ds a codeFileScanner/code instance.
  + */
  +public void setupDirectoryScanner(FileScanner ds) {
  +setupDirectoryScanner(ds, getProject());
  +}
  +
  +/**
* Set up the specified directory scanner against the specified project.
* @param ds a codeFileScanner/code instance.
* @param p an Ant codeProject/code instance.
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2004-12-10 Thread mbenson
mbenson 2004/12/10 10:28:45

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  Javadoc and LOC bumming
  
  Revision  ChangesPath
  1.35  +99 -104   
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- AbstractFileSet.java  12 Nov 2004 15:15:22 -  1.34
  +++ AbstractFileSet.java  10 Dec 2004 18:28:45 -  1.35
  @@ -66,10 +66,18 @@
   private boolean isCaseSensitive = true;
   private boolean followSymlinks = true;
   
  +/**
  + * Construct a new codeAbstractFileSet/code.
  + */
   public AbstractFileSet() {
   super();
   }
   
  +/**
  + * Construct a new codeAbstractFileSet/code, shallowly cloned
  + * from the specified codeAbstractFileSet/code.
  + * @param fileset the codeAbstractFileSet/code to use as a template.
  + */
   protected AbstractFileSet(AbstractFileSet fileset) {
   this.dir = fileset.dir;
   this.defaultPatterns = fileset.defaultPatterns;
  @@ -86,6 +94,7 @@
*
* pYou must not set another attribute or nest elements inside
* this element if you make it a reference./p
  + * @param r the codeReference/code to use.
*/
   public void setRefid(Reference r) throws BuildException {
   if (dir != null || defaultPatterns.hasPatterns(getProject())) {
  @@ -102,17 +111,20 @@
   
   /**
* Sets the base-directory for this instance.
  + * @param dir the directory's codeFile/code instance.
*/
   public void setDir(File dir) throws BuildException {
   if (isReference()) {
   throw tooManyAttributes();
   }
  -
   this.dir = dir;
   }
   
   /**
* Retrieves the base-directory for this instance.
  + * @param p the codeProject/code against which the
  + *  reference is resolved, if set.
  + * @return codeFile/code.
*/
   public File getDir(Project p) {
   if (isReference()) {
  @@ -123,6 +135,7 @@
   
   /**
* Creates a nested patternset.
  + * @return codePatternSet/code.
*/
   public PatternSet createPatternSet() {
   if (isReference()) {
  @@ -134,7 +147,8 @@
   }
   
   /**
  - * add a name entry on the include list
  + * Add a name entry to the include list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createInclude() {
   if (isReference()) {
  @@ -144,7 +158,8 @@
   }
   
   /**
  - * add a name entry on the include files list
  + * Add a name entry to the include files list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createIncludesFile() {
   if (isReference()) {
  @@ -154,7 +169,8 @@
   }
   
   /**
  - * add a name entry on the exclude list
  + * Add a name entry to the exclude list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createExclude() {
   if (isReference()) {
  @@ -164,7 +180,8 @@
   }
   
   /**
  - * add a name entry on the excludes files list
  + * Add a name entry to the excludes files list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createExcludesFile() {
   if (isReference()) {
  @@ -175,15 +192,15 @@
   
   /**
* Creates a single file fileset.
  + * @param file the single codeFile/code included in this
  + * codeAbstractFileSet/code.
*/
   public void setFile(File file) {
   if (isReference()) {
   throw tooManyAttributes();
   }
   setDir(file.getParentFile());
  -
  -PatternSet.NameEntry include = createInclude();
  -include.setName(file.getName());
  +createInclude().setName(file.getName());
   }
   
   /**
  @@ -192,13 +209,12 @@
*
* pPatterns may be separated by a comma or a space./p
*
  - * @param includes the string containing the include patterns
  + * @param includes the codeString/code containing the include 
patterns.
*/
   public void setIncludes(String includes) {
   if (isReference()) {
   throw tooManyAttributes();
   }
  -
   defaultPatterns.setIncludes(includes);
   }
   
  @@ -208,62 +224,55 @@
*
* pPatterns may be separated by a comma or a space./p
*
  - * @param excludes the string containing the exclude patterns
  + * @param excludes the codeString/code containing the exclude 
patterns.
*/
   public void 

cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2004-12-10 Thread mbenson
mbenson 2004/12/10 13:49:32

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  More LOC bumming
  
  Revision  ChangesPath
  1.36  +14 -27
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AbstractFileSet.java  10 Dec 2004 18:28:45 -  1.35
  +++ AbstractFileSet.java  10 Dec 2004 21:49:32 -  1.36
  @@ -54,8 +54,8 @@
* pCommon base class for DirSet and FileSet./p
*
*/
  -public abstract class AbstractFileSet extends DataType implements Cloneable,
  -SelectorContainer {
  +public abstract class AbstractFileSet extends DataType
  +implements Cloneable, SelectorContainer {
   
   private PatternSet defaultPatterns = new PatternSet();
   private Vector additionalPatterns = new Vector();
  @@ -127,10 +127,7 @@
* @return codeFile/code.
*/
   public File getDir(Project p) {
  -if (isReference()) {
  -return getRef(p).getDir(p);
  -}
  -return dir;
  +return (isReference()) ? getRef(p).getDir(p) : dir;
   }
   
   /**
  @@ -400,12 +397,10 @@
   }
   Object o = getRefid().getReferencedObject(p);
   if (!getClass().isAssignableFrom(o.getClass())) {
  -String msg = getRefid().getRefId() +  doesn\'t denote a 
  -+ getDataTypeName();
  -throw new BuildException(msg);
  -} else {
  -return (AbstractFileSet) o;
  +throw new BuildException(getRefid().getRefId()
  ++  doesn\'t denote a  + getDataTypeName());
   }
  +return (AbstractFileSet) o;
   }
   
   // SelectorContainer methods
  @@ -416,10 +411,8 @@
* @return whether any selectors are in this container.
*/
   public boolean hasSelectors() {
  -if (isReference()  getProject() != null) {
  -return getRef(getProject()).hasSelectors();
  -}
  -return !(selectors.isEmpty());
  +return (isReference()  getProject() != null)
  +? getRef(getProject()).hasSelectors() : !(selectors.isEmpty());
   }
   
   /**
  @@ -450,10 +443,8 @@
* @return the number of selectors in this container as an 
codeint/code.
*/
   public int selectorCount() {
  -if (isReference()  getProject() != null) {
  -return getRef(getProject()).selectorCount();
  -}
  -return selectors.size();
  +return (isReference()  getProject() != null)
  +? getRef(getProject()).selectorCount() : selectors.size();
   }
   
   /**
  @@ -462,10 +453,8 @@
* @return a codeFileSelector[]/code of the selectors in this 
container.
*/
   public FileSelector[] getSelectors(Project p) {
  -if (isReference()) {
  -return getRef(p).getSelectors(p);
  -}
  -return (FileSelector[])(selectors.toArray(
  +return (isReference())
  +? getRef(p).getSelectors(p) : (FileSelector[])(selectors.toArray(
   new FileSelector[selectors.size()]));
   }
   
  @@ -475,10 +464,8 @@
* @return an codeEnumeration/code of selectors.
*/
   public Enumeration selectorElements() {
  -if (isReference()  getProject() != null) {
  -return getRef(getProject()).selectorElements();
  -}
  -return selectors.elements();
  +return (isReference()  getProject() != null)
  +? getRef(getProject()).selectorElements() : selectors.elements();
   }
   
   /**
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2004-12-10 Thread mbenson
mbenson 2004/12/10 13:52:32

  Modified:src/main/org/apache/tools/ant/types Tag: ANT_16_BRANCH
AbstractFileSet.java
  Log:
  Sync
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.29.2.5  +115 -133  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.29.2.4
  retrieving revision 1.29.2.5
  diff -u -r1.29.2.4 -r1.29.2.5
  --- AbstractFileSet.java  9 Mar 2004 17:01:54 -   1.29.2.4
  +++ AbstractFileSet.java  10 Dec 2004 21:52:32 -  1.29.2.5
  @@ -54,8 +54,8 @@
* pCommon base class for DirSet and FileSet./p
*
*/
  -public abstract class AbstractFileSet extends DataType implements Cloneable,
  -SelectorContainer {
  +public abstract class AbstractFileSet extends DataType
  +implements Cloneable, SelectorContainer {
   
   private PatternSet defaultPatterns = new PatternSet();
   private Vector additionalPatterns = new Vector();
  @@ -66,10 +66,18 @@
   private boolean isCaseSensitive = true;
   private boolean followSymlinks = true;
   
  +/**
  + * Construct a new codeAbstractFileSet/code.
  + */
   public AbstractFileSet() {
   super();
   }
   
  +/**
  + * Construct a new codeAbstractFileSet/code, shallowly cloned
  + * from the specified codeAbstractFileSet/code.
  + * @param fileset the codeAbstractFileSet/code to use as a template.
  + */
   protected AbstractFileSet(AbstractFileSet fileset) {
   this.dir = fileset.dir;
   this.defaultPatterns = fileset.defaultPatterns;
  @@ -86,6 +94,7 @@
*
* pYou must not set another attribute or nest elements inside
* this element if you make it a reference./p
  + * @param r the codeReference/code to use.
*/
   public void setRefid(Reference r) throws BuildException {
   if (dir != null || defaultPatterns.hasPatterns(getProject())) {
  @@ -102,27 +111,28 @@
   
   /**
* Sets the base-directory for this instance.
  + * @param dir the directory's codeFile/code instance.
*/
   public void setDir(File dir) throws BuildException {
   if (isReference()) {
   throw tooManyAttributes();
   }
  -
   this.dir = dir;
   }
   
   /**
* Retrieves the base-directory for this instance.
  + * @param p the codeProject/code against which the
  + *  reference is resolved, if set.
  + * @return codeFile/code.
*/
   public File getDir(Project p) {
  -if (isReference()) {
  -return getRef(p).getDir(p);
  -}
  -return dir;
  +return (isReference()) ? getRef(p).getDir(p) : dir;
   }
   
   /**
* Creates a nested patternset.
  + * @return codePatternSet/code.
*/
   public PatternSet createPatternSet() {
   if (isReference()) {
  @@ -134,7 +144,8 @@
   }
   
   /**
  - * add a name entry on the include list
  + * Add a name entry to the include list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createInclude() {
   if (isReference()) {
  @@ -144,7 +155,8 @@
   }
   
   /**
  - * add a name entry on the include files list
  + * Add a name entry to the include files list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createIncludesFile() {
   if (isReference()) {
  @@ -154,7 +166,8 @@
   }
   
   /**
  - * add a name entry on the exclude list
  + * Add a name entry to the exclude list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createExclude() {
   if (isReference()) {
  @@ -164,7 +177,8 @@
   }
   
   /**
  - * add a name entry on the excludes files list
  + * Add a name entry to the excludes files list.
  + * @return codePatternSet.NameEntry/code.
*/
   public PatternSet.NameEntry createExcludesFile() {
   if (isReference()) {
  @@ -175,15 +189,15 @@
   
   /**
* Creates a single file fileset.
  + * @param file the single codeFile/code included in this
  + * codeAbstractFileSet/code.
*/
   public void setFile(File file) {
   if (isReference()) {
   throw tooManyAttributes();
   }
   setDir(file.getParentFile());
  -
  -PatternSet.NameEntry include = createInclude();
  -include.setName(file.getName());
  +createInclude().setName(file.getName());
   }
   
   /**
  @@ -192,13 +206,12 @@
*
* pPatterns may be separated by a comma or a space./p
   

cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java PatternSet.java

2003-09-17 Thread bodewig
bodewig 2003/09/17 02:20:38

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
PatternSet.java
  Log:
  Create a deep (well, deeper) clone in AbstractFileSet#clone
  
  PR: 23090
  
  Make PatternSet Clonable.
  
  Revision  ChangesPath
  1.29  +22 -7 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- AbstractFileSet.java  13 Sep 2003 16:35:52 -  1.28
  +++ AbstractFileSet.java  17 Sep 2003 09:20:38 -  1.29
  @@ -719,16 +719,31 @@
   }
   
   /**
  + * Creates a deep clone of this instance, except for the nested
  + * selectors (the list of selectors is a shallow clone of this
  + * instance's list).
  + *
* @since Ant 1.6
*/
   public Object clone() {
  -try {
  -AbstractFileSet fs = (AbstractFileSet) super.clone();
  -fs.setProject(getProject());
  -return fs;
  -} catch (CloneNotSupportedException e) {
  -throw new BuildException(e);
  +if (isReference()) {
  +return (getRef(getProject())).clone();
  +} else {
  +try {
  +AbstractFileSet fs = (AbstractFileSet) super.clone();
  +fs.defaultPatterns = (PatternSet) defaultPatterns.clone();
  +fs.additionalPatterns = new 
Vector(additionalPatterns.size());
  +Enumeration e = additionalPatterns.elements();
  +while (e.hasMoreElements()) {
  +fs.additionalPatterns
  +.addElement(((PatternSet) e.nextElement()).clone());
  +}
  +fs.selectors = (Vector) fs.selectors.clone();
  +return fs;
  +} catch (CloneNotSupportedException e) {
  +throw new BuildException(e);
  +}
   }
   }
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.31  +22 -2 ant/src/main/org/apache/tools/ant/types/PatternSet.java
  
  Index: PatternSet.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/PatternSet.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- PatternSet.java   18 Jul 2003 14:21:24 -  1.30
  +++ PatternSet.java   17 Sep 2003 09:20:38 -  1.31
  @@ -1,7 +1,7 @@
   /*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -77,7 +77,7 @@
* @author Jon S. Stevens a href=mailto:[EMAIL PROTECTED][EMAIL 
PROTECTED]/a
* @author Stefan Bodewig
*/
  -public class PatternSet extends DataType {
  +public class PatternSet extends DataType implements Cloneable {
   private Vector includeList = new Vector();
   private Vector excludeList = new Vector();
   private Vector includesFileList = new Vector();
  @@ -475,6 +475,26 @@
   public String toString() {
   return patternSet{ includes:  + includeList
   +  excludes:  + excludeList +  };
  +}
  +
  +/**
  + * @since Ant 1.6
  + */
  +public Object clone() {
  +if (isReference()) {
  +return getRef(getProject()).clone();
  +} else {
  +try {
  +PatternSet ps = (PatternSet) super.clone();
  +ps.includeList = (Vector) includeList.clone();
  +ps.excludeList = (Vector) excludeList.clone();
  +ps.includesFileList = (Vector) includesFileList.clone();
  +ps.excludesFileList = (Vector) excludesFileList.clone();
  +return ps;
  +} catch (CloneNotSupportedException e) {
  +throw new BuildException(e);
  +}
  +}
   }
   
   }
  
  
  

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



cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java CommandlineJava.java

2003-08-13 Thread peterreilly
peterreilly2003/08/13 07:06:20

  Modified:src/main/org/apache/tools/ant ComponentHelper.java
   src/main/org/apache/tools/ant/helper ProjectHelper2.java
   src/main/org/apache/tools/ant/types AbstractFileSet.java
CommandlineJava.java
  Log:
  remove some deprecated methods and 1.1 holdovers
  Bugzilla: 22326
  
  Revision  ChangesPath
  1.22  +5 -5  ant/src/main/org/apache/tools/ant/ComponentHelper.java
  
  Index: ComponentHelper.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ComponentHelper.java  13 Aug 2003 13:18:54 -  1.21
  +++ ComponentHelper.java  13 Aug 2003 14:06:19 -  1.22
  @@ -54,8 +54,6 @@
   
   package org.apache.tools.ant;
   
  -import org.apache.tools.ant.util.WeakishReference;
  -
   import java.util.Enumeration;
   import java.util.Hashtable;
   import java.util.HashSet;
  @@ -67,6 +65,7 @@
   import java.util.Vector;
   import java.io.InputStream;
   import java.io.IOException;
  +import java.lang.ref.WeakReference;
   import java.lang.reflect.Modifier;
   
   import org.apache.tools.ant.taskdefs.Typedef;
  @@ -87,6 +86,7 @@
*
* @author Costin Manolache
* @author Peter Reilly
  + * @author a href=mailto:[EMAIL PROTECTED]Martijn Kruithof/a
* @since Ant1.6
*/
   public class ComponentHelper  {
  @@ -551,7 +551,7 @@
   v = new Vector();
   createdTasks.put(type, v);
   }
  -v.addElement(WeakishReference.createReference(task));
  +v.addElement(new WeakReference(task));
   }
   }
   
  @@ -568,8 +568,8 @@
   if (v != null) {
   Enumeration taskEnum = v.elements();
   while (taskEnum.hasMoreElements()) {
  -WeakishReference ref =
  -(WeakishReference) taskEnum.nextElement();
  +WeakReference ref =
  +(WeakReference) taskEnum.nextElement();
   Task t = (Task) ref.get();
   //being a weak ref, it may be null by this point
   if (t != null) {
  
  
  
  1.30  +3 -3  
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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ProjectHelper2.java   13 Aug 2003 13:18:54 -  1.29
  +++ ProjectHelper2.java   13 Aug 2003 14:06:19 -  1.30
  @@ -641,7 +641,7 @@
   if (key.equals(default)) {
   if (value != null  !value.equals()) {
   if (!context.isIgnoringProjectTag()) {
  -project.setDefaultTarget(value);
  +project.setDefault(value);
   }
   }
   } else if (key.equals(name)) {
  @@ -707,8 +707,8 @@
   if ((new File(baseDir)).isAbsolute()) {
   project.setBasedir(baseDir);
   } else {
  -project.setBaseDir(project.resolveFile(baseDir,
  -   
context.getBuildFileParent()));
  +project.setBaseDir(fu.resolveFile(
  +   context.getBuildFileParent(), 
baseDir));
   }
   }
   }
  
  
  
  1.24  +4 -4  
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- AbstractFileSet.java  29 Jul 2003 08:43:49 -  1.23
  +++ AbstractFileSet.java  13 Aug 2003 14:06:19 -  1.24
  @@ -97,6 +97,7 @@
* @author Stefan Bodewig
* @author Magesh Umasankar
* @author a href=mailto:[EMAIL PROTECTED]Bruce Atherton/a
  + * @author a href=mailto:[EMAIL PROTECTED]Martijn Kruithof/a
*/
   public abstract class AbstractFileSet extends DataType implements Cloneable,
   SelectorContainer {
  @@ -208,7 +209,7 @@
   }
   
   /**
  - * add a name entry on the include files list
  + * add a name entry on the excludes files list
*/
   public PatternSet.NameEntry createExcludesFile() {
   if (isReference()) {
  @@ -224,8 +225,7 @@
   if (isReference()) {
   

cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java Commandline.java CommandlineJava.java DirSet.java FileSet.java FilterSet.java Path.java ZipFileSet.java

2003-05-27 Thread bodewig
bodewig 2003/05/27 02:30:17

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
Commandline.java CommandlineJava.java DirSet.java
FileSet.java FilterSet.java Path.java
ZipFileSet.java
  Log:
  fix the completely broken clone() implementations.
  
  Revision  ChangesPath
  1.20  +13 -0 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AbstractFileSet.java  25 May 2003 11:40:54 -  1.19
  +++ AbstractFileSet.java  27 May 2003 09:30:17 -  1.20
  @@ -668,4 +668,17 @@
   return sb.toString();
   }
   
  +/**
  + * @since Ant 1.6
  + */
  +public Object clone() {
  +try {
  +AbstractFileSet fs = (AbstractFileSet) super.clone();
  +fs.setProject(getProject());
  +return fs;
  +} catch (CloneNotSupportedException e) {
  +throw new BuildException(e);
  +}
  +}
  +
   }
  
  
  
  1.29  +7 -4  ant/src/main/org/apache/tools/ant/types/Commandline.java
  
  Index: Commandline.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Commandline.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Commandline.java  4 Apr 2003 13:51:12 -   1.28
  +++ Commandline.java  27 May 2003 09:30:17 -  1.29
  @@ -427,10 +427,13 @@
   }
   
   public Object clone() {
  -Commandline c = new Commandline();
  -c.setExecutable(executable);
  -c.addArguments(getArguments());
  -return c;
  +try {
  +Commandline c = (Commandline) super.clone();
  +c.arguments = (Vector) arguments.clone();
  +return c;
  +} catch (CloneNotSupportedException e) {
  +throw new BuildException(e);
  +}
   }
   
   /**
  
  
  
  1.40  +14 -13
ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- CommandlineJava.java  27 May 2003 08:49:42 -  1.39
  +++ CommandlineJava.java  27 May 2003 09:30:17 -  1.40
  @@ -440,20 +440,21 @@
* @return a CommandlineJava object
*/
   public Object clone() {
  -CommandlineJava c = new CommandlineJava();
  -c.vmCommand = (Commandline) vmCommand.clone();
  -c.javaCommand = (Commandline) javaCommand.clone();
  -c.sysProperties = (SysProperties) sysProperties.clone();
  -c.maxMemory = maxMemory;
  -if (classpath != null) {
  -c.classpath = (Path) classpath.clone();
  +try {
  +CommandlineJava c = (CommandlineJava) super.clone();
  +c.vmCommand = (Commandline) vmCommand.clone();
  +c.javaCommand = (Commandline) javaCommand.clone();
  +c.sysProperties = (SysProperties) sysProperties.clone();
  +if (classpath != null) {
  +c.classpath = (Path) classpath.clone();
  +}
  +if (bootclasspath != null) {
  +c.bootclasspath = (Path) bootclasspath.clone();
  +}
  +return c;
  +} catch (CloneNotSupportedException e) {
  +throw new BuildException(e);
   }
  -if (bootclasspath != null) {
  -c.bootclasspath = (Path) bootclasspath.clone();
  -}
  -c.vmVersion = vmVersion;
  -c.executeJar = executeJar;
  -return c;
   }
   
   /**
  
  
  
  1.9   +3 -3  ant/src/main/org/apache/tools/ant/types/DirSet.java
  
  Index: DirSet.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/DirSet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DirSet.java   10 Feb 2003 14:14:30 -  1.8
  +++ DirSet.java   27 May 2003 09:30:17 -  1.9
  @@ -1,7 +1,7 @@
   /*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -76,9 +76,9 @@
*/
   public Object clone() {
   if 

cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java

2003-03-10 Thread stevel
stevel  2003/03/09 23:36:46

  Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java
  Log:
  implementing bug 12060: provide a toString operator
  so that turning into a property is mildly meaningful.
  
  We dont include base dir info, so you get a list of
  files relative to the basem, all with a ; separator.
  
  Revision  ChangesPath
  1.16  +20 -1 
ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java
  
  Index: AbstractFileSet.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AbstractFileSet.java  7 Mar 2003 11:23:07 -   1.15
  +++ AbstractFileSet.java  10 Mar 2003 07:36:45 -  1.16
  @@ -1,7 +1,7 @@
   /*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -623,6 +623,25 @@
*/
   public void addDepend(DependSelector selector) {
   appendSelector(selector);
  +}
  +
  +/**
  + * Returns included files as a list of semicolon-separated filenames
  + *
  + * @return String object with included filenames
  + */
  +public String toString() {
  +DirectoryScanner ds = getDirectoryScanner(getProject());
  +String[] files = ds.getIncludedFiles();
  +StringBuffer sb = new StringBuffer();
  +
  +for (int i = 0; i  files.length; i++) {
  +if (i0) {
  +sb.append(';');
  +}
  +sb.append(files[i]);
  +}
  +return sb.toString();
   }
   
   }