You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2018/02/01 17:28:09 UTC

[Bug 62071] New: Calling FileSet.setFile twice fails with misleading message

https://bz.apache.org/bugzilla/show_bug.cgi?id=62071

            Bug ID: 62071
           Summary: Calling FileSet.setFile twice fails with misleading
                    message
           Product: Ant
           Version: 1.9.9
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: sterling@gradle.com
  Target Milestone: ---

This was originally raised against Gradle
(https://github.com/gradle/gradle/issues/4212), but we traced the failure back
to a change in behavior in Ant 1.9.8 to fix bug 59402.

A third party Ant task, Installer, creates a FileSet and then calls setFile
twice to create a collection of two files:
https://github.com/tikalk/tikal-ant-installer/blob/master/src_ext/org/tp23/antinstaller/taskdefs/Installer.java#L195-L196

I believe this only worked because both files are in the same directory.

Now the method throws an exception with the message:
> you can only specify one of the dir and file attributes

This is a little confusing because the user never set 'dir' directly (calling
setFile does it under the covers).

The original reporter was able to workaround this and I think the Installer
task isn't following the spirit of the API, so I think the only problem here is
the wonkiness of the error message.  It would be better if it said "you can
only specify the file attribute once" or something like that in this particular
case.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62071] Calling FileSet.setFile twice fails with misleading message

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62071

--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
I don't think the initial intention has ever been to prohibit calling setFile
twice, after all you can still call setDir twice. After some pondering I've
decided it would be easier to fix the error message. If you call setFile twice
with two different arguments the surely something must be wrong.

Currently running tests, will be fixed in 1.9.10 and 1.10.2.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62071] Calling FileSet.setFile twice fails with misleading message

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62071

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |1.9.10

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
fixed in both branches with commit a390fd6 -
https://github.com/apache/ant/commit/a390fd653ca45cb32cee7b25050ae70a4f1b55c9

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 62071] Calling FileSet.setFile twice fails with misleading message

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62071

--- Comment #3 from Sterling Greene <st...@gradle.com> ---
Thanks Stefan.

-- 
You are receiving this mail because:
You are the assignee for the bug.