Author: antoine
Date: Sat Feb 20 23:57:59 2010
New Revision: 912258
URL: http://svn.apache.org/viewvc?rev=912258&view=rev
Log:
fix getClassLocation method in Diagnostics class. Bug 48782. Reported by
Torsten Werner. Patch by Ludovic Claude.
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=912258&r1=912257&r2=912258&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Feb 20 23:57:59 2010
@@ -29,6 +29,9 @@
* VectorSet#remove(Object) would fail if the size of the vector
equaled its capacity.
+
+ * Regression : ant -diagnostics was returning with exit code 1
+ Bugzilla Report 48782
Other changes:
--------------
Modified: ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java?rev=912258&r1=912257&r2=912258&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java Sat Feb 20
23:57:59 2010
@@ -180,6 +180,9 @@
* @since Ant 1.8.0
*/
private static URL getClassLocation(Class clazz) {
+ if (clazz.getProtectionDomain().getCodeSource() == null) {
+ return null;
+ }
return clazz.getProtectionDomain().getCodeSource().getLocation();
}