You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/10/04 23:27:15 UTC

svn commit: r453035 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/types/ArchiveFileSet.java src/main/org/apache/tools/ant/types/ZipFileSet.java

Author: peterreilly
Date: Wed Oct  4 14:27:14 2006
New Revision: 453035

URL: http://svn.apache.org/viewvc?view=rev&rev=453035
Log:
Bugzilla 30498: no check on refid for setting some attributes in zipfileset

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=453035&r1=453034&r2=453035
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Oct  4 14:27:14 2006
@@ -32,6 +32,9 @@
 * UnknownElement.maybeConfigure always configured.
   Bugzilla report 40641.
 
+* no check for refid when prefix attribute is set in zipfileset.
+  Bugzilla report 30498.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java?view=diff&rev=453035&r1=453034&r2=453035
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/ArchiveFileSet.java Wed Oct  4 14:27:14 2006
@@ -130,6 +130,7 @@
      * @param srcFile The archive from which to extract entries.
      */
     public void setSrc(File srcFile) {
+        checkAttributesAllowed();
         setSrcResource(new FileResource(srcFile));
     }
 
@@ -177,6 +178,7 @@
      * @param prefix The prefix to prepend to entries in the archive file.
      */
     public void setPrefix(String prefix) {
+        checkAttributesAllowed();
         if (!prefix.equals("") && !fullpath.equals("")) {
             throw new BuildException("Cannot set both fullpath and prefix attributes");
         }
@@ -202,6 +204,7 @@
      * @param fullpath the full pathname of the single entry in this fileset.
      */
     public void setFullpath(String fullpath) {
+        checkAttributesAllowed();
         if (!prefix.equals("") && !fullpath.equals("")) {
             throw new BuildException("Cannot set both fullpath and prefix attributes");
         }
@@ -304,6 +307,7 @@
      * @param octalString a <code>String</code> value
      */
     public void setFileMode(String octalString) {
+        checkAttributesAllowed();
         integerSetFileMode(Integer.parseInt(octalString, BASE_OCTAL));
     }
 
@@ -352,6 +356,7 @@
      * @param octalString a <code>String</code> value
      */
     public void setDirMode(String octalString) {
+        checkAttributesAllowed();
         integerSetDirMode(Integer.parseInt(octalString, BASE_OCTAL));
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java?view=diff&rev=453035&r1=453034&r2=453035
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/ZipFileSet.java Wed Oct  4 14:27:14 2006
@@ -63,6 +63,7 @@
      * @since Ant 1.7
      */
     public void setEncoding(String enc) {
+        checkAttributesAllowed();
         this.encoding = enc;
     }
 
@@ -72,6 +73,14 @@
      * @since Ant 1.7
      */
     public String getEncoding() {
+        if (isReference()) {
+            AbstractFileSet ref = getRef(getProject());
+            if (ref instanceof ZipFileSet) {
+                return ((ZipFileSet) ref).getEncoding();
+            } else {
+                return null;
+            }
+        }
         return encoding;
     }
 



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