Author: stevel Date: Fri Jul 14 13:13:28 2006 New Revision: 422011 URL: http://svn.apache.org/viewvc?rev=422011&view=rev Log: Bonus extra diagnostics. Handy when the uri is ${unexpanded}
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Definer.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Definer.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Definer.java?rev=422011&r1=422010&r2=422011&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Definer.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Definer.java Fri Jul 14 13:13:28 2006 @@ -201,16 +201,23 @@ //we are in an antlib, in which case the resource name is determined //automatically. //NB: URIs in the ant core package will be "" at this point. - if (getURI()!=null && getURI().startsWith(MagicNames.ANTLIB_PREFIX)) { + if (getURI() == null) { + throw new BuildException( + "name, file or resource attribute of " + + getTaskName() + " is undefined", + getLocation()); + } + + if (getURI().startsWith(MagicNames.ANTLIB_PREFIX)) { //convert the URI to a resource String uri1 = getURI(); setResource(makeResourceFromURI(uri1)); } else { - throw new BuildException( - "name, file or resource attribute of " - + getTaskName() + " is undefined", getLocation()); - } + throw new BuildException( + "Only antlib URIs can be located from the URI alone," + + "not the URI " + getURI()); } + } if (name != null) { if (classname == null) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]