Bug 65647

Summary: Attribute "quiet" of task "LoadResource" not working as described
Product: Ant Reporter: michael.luber
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 1.10.12   
Target Milestone: 1.10.13   
Hardware: PC   
OS: All   

Description michael.luber 2021-10-22 12:14:53 UTC
https://ant.apache.org/manual/Tasks/loadresource.html
says about the attribute "quiet":

Do not display a diagnostic message (unless Ant has been invoked with the -verbose or -debug switches)

Using the task "LoadFile" which is derived from "LoadResource", I
found that this does not work. I tried this ANT-script:

<project name="MyProject" default="all">
  <target name="all" >
      <loadfile property="filecontent" srcFile="noSuchFile" quiet="true"/>
  </target>
</project>

which produces:

all:
 [loadfile] D:\git\brake\s7p.build\ant\noSuchFile doesn't exist


The reason for that is that in apache-ant-1.10.12\src\main\org\apache\tools\ant\taskdefs\LoadResource.java, in method execute(), if the file does not exist, we issue

log(message, quiet ? Project.MSG_WARN : Project.MSG_ERR);

which should be

log(message, quiet ? Project.MSG_VERBOSE: Project.MSG_ERR);
Comment 1 Stefan Bodewig 2022-11-19 12:26:43 UTC
yes, you are correct, thank you