adding a warning into tasks' setName method is the wrong way to do this, as
it causes a failure of the reporting system. Guess that means tasks get
created before the log() system is fully up and running.

Where is a better place to put this test/warning?

ant  ","
Buildfile: build.xml

BUILD FAILED
null

Task.java
>     /**
>      * test for a name being sensible or not
>      * silly names include "", "," and " "
>      * @param proposal proposed name
>      * @return true if name is silly
>      * @todo catch names like "  " and "             " if felt important
>      */
>     private boolean sillyName(String proposal) {
>         return proposal==null || "".equals(proposal)
>             || proposal.indexOf(',')>0
>             || " ".equals(proposal);
>
>     }
>
116a131,136
>
>         if(sillyName(name)) {
>             project.log("Target name '"+name +"' is considered silly"
>                 +"and will not be supported in future versions of ant",
>                 Project.MSG_WARN);
>         }

Also, targets name "                     " are in the silly category, but I
dont have a check for them. Just think how many cpu cycles would be wasted
over time if every time a target in ant was created included a look to
verify that nobody was creating a target name containing nothing but spaces.
(yes, I know, you scan forwards till the first non space is hit, but I take
the view if you want to try that hard, we should let you)




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

Reply via email to