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 2009/06/03 02:19:52 UTC

DO NOT REPLY [Bug 47303] New: Copy failonerror is internally inconsistent with Warning message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47303

           Summary: Copy failonerror is internally inconsistent with
                    Warning message
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: dsuits@lombardi.com


org.apache.tools.ant.taskdefs.Copy.copySingleFile()

If the source file does not exist, the following log is executed:

                String message = "Warning: Could not find file "
                    + file.getAbsolutePath() + " to copy.";
                if (!failonerror) {
                    log(message, Project.MSG_ERR);
                } else {
                    throw new BuildException(message);
                }

This is inconsistent and misleading.  If it is an error for the file to be
missing, then the message is incorrect "Warning:" should be spelled "Error:". 
If instead the intent of failonerror is to convert errors to warnings, then the
message priority should be Project.MSG_WARN.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 47303] Copy failonerror is internally inconsistent with Warning message

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





--- Comment #2 from dsuits@lombardi.com  2009-06-03 11:06:29 PST ---
The documentation available here:
apache-ant-1.7.1-src.zip/apache-ant-1.7.1/docs/manual/CoreTasks/copy.html


"If false, log a warning message, but do not stop the build, when the file to
copy does not exist or one of the nested filesets points to a directory that
doesn't exist or an error occurs while copying."

So build script developers are being told to expect a warning, but BuildEvent
consumers (custom BuildListeners) are receiving an error to process.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 47303] Copy failonerror is internally inconsistent with Warning message

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |trivial




--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2009-06-03 08:23:19 PST ---
There are other places where the code says "Warning" and logs it as ERR in
Copy (lines 441, 504 and 519 in trunk).

While I agree this looks confusing I don't really think we should change it at
all.
The change is really more of a cosmetic one and there might be code out there
scanning for the word "Warning".

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.