summaryrefslogtreecommitdiff
path: root/libre/apache-ant-libre/ant_diagnostics.patch
blob: 38148b45cb9de98601e01a7c12c72fa72e41b014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/src/main/org/apache/tools/ant/Diagnostics.java
+++ b/src/main/org/apache/tools/ant/Diagnostics.java
@@ -179,7 +179,10 @@
      * @param clazz the class to get the information from.
      * @since Ant 1.8.0
      */
-    private static URL getClassLocation(Class clazz) {
+    private static URL getClassLocation(Class clazz) {
+		if (clazz.getProtectionDomain().getCodeSource() == null) {
+			return null;
+		}
         return clazz.getProtectionDomain().getCodeSource().getLocation();
     }
 
@@ -241,7 +244,7 @@
         }
         Transformer transformer = null;
         try {
-            transformer = transformerFactory.newTransformer();
+            transformer = transformerFactory.newTransformer();
         } catch (Exception e) {
             // ignore
             ignoreThrowable(e);