On 2011-11-17, Stephan Piesker wrote: > Idea for solving the issue (51 829). > Problem is that an error log is generated, although this is given by the > user as optional. The following code: > <import optional="true"> > <url file="foo.x"/> > </ import> > The import class first checks whether the file exists from url. And right > there is the problem. The method of isExists URLResource class is called, > and this in turn uses the connect method of URLResource. In this attempt > to open a file and a failure, he said brings the error log. I can believe > that you can not just call the connect method in isExists and therefore > the solution must sign a modified function. This method then returns true > or false.
> So solution: > URLResource.java file line 229: > connect away and try to open the file. For failure to return a false and a > true success. Another solution is to add a parameter to connect that specifies the log level to use if connect fails and pass in Project.MSG_VERBOSE from inside isExists(). This way you still get the error message when Ant is tun in with the -v switch in case you need to diagnose why the import fails. This is what I have done in trunk by now. > question: > Where should I send the changed file? You'd attach it to the Bugzilla issue - if you feel your solution is better than mine, let's discuss that and then you can still create one. > Should I make a JUnittest this? or AntUnit. Yes, we prefer patches that contain tests as well. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org