ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [DO NOT REPLY: Bug 3457] New: Task Depend throws NullPointerException
Date Thu, 06 Sep 2001 12:17:53 GMT
PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3457

*** shadow/3457	Thu Sep  6 05:17:52 2001
--- shadow/3457.tmp.21331	Thu Sep  6 05:17:52 2001
***************
*** 0 ****
--- 1,80 ----
+ +============================================================================+
+ | Task Depend throws NullPointerException                                    |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 3457                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.4                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Critical                 OS/Version: Windows NT/2K           |
+ |     Priority: Other                     Component: Optional Tasks          |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: chs@logas.de                                                 |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ The call of "<depend srcdir="${src}" destdir="${build}" closure="yes"/>"
+ (variables are correctly filled) results in the following exception:
+ 
+ Build.xml:128: java.lang.NullPointerException
+ 	at org.apache.tools.ant.taskdefs.optional.depend.Depend.execute
+ (Depend.java:534)
+ 	at org.apache.tools.ant.Task.perform(Task.java:217)
+ 	at org.apache.tools.ant.Target.execute(Target.java:164)
+ 	at org.apache.tools.ant.Target.performTasks(Target.java:182)
+ 	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
+ 	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:256)
+ 	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120)
+ 	at org.apache.tools.ant.Task.perform(Task.java:217)
+ 	at org.apache.tools.ant.Target.execute(Target.java:164)
+ 	at org.apache.tools.ant.Target.performTasks(Target.java:182)
+ 	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
+ 	at org.apache.tools.ant.Project.executeTargets(Project.java:560)
+ 	at org.apache.tools.ant.Main.runBuild(Main.java:454)
+ 	at org.apache.tools.ant.Main.start(Main.java:153)
+ 	at org.apache.tools.ant.Main.main(Main.java:176)
+ --- Nested Exception ---
+ java.lang.NullPointerException
+ 	at 
+ org.apache.tools.ant.taskdefs.optional.depend.Depend.determineDependencies
+ (Depend.java:299)
+ 	at org.apache.tools.ant.taskdefs.optional.depend.Depend.execute
+ (Depend.java:464)
+ 	at org.apache.tools.ant.Task.perform(Task.java:217)
+ 	at org.apache.tools.ant.Target.execute(Target.java:164)
+ 	at org.apache.tools.ant.Target.performTasks(Target.java:182)
+ 	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
+ 	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:256)
+ 	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120)
+ 	at org.apache.tools.ant.Task.perform(Task.java:217)
+ 	at org.apache.tools.ant.Target.execute(Target.java:164)
+ 	at org.apache.tools.ant.Target.performTasks(Target.java:182)
+ 	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
+ 	at org.apache.tools.ant.Project.executeTargets(Project.java:560)
+ 	at org.apache.tools.ant.Main.runBuild(Main.java:454)
+ 	at org.apache.tools.ant.Main.start(Main.java:153)
+ 	at org.apache.tools.ant.Main.main(Main.java:176)
+ 
+ I solved the problem the following way, maybe there is a better one:
+ 
+ (from row 288)
+             if (dependencyList == null) {
+                 /***************INSERTED***********************/
+                 dependencyMap = new Hashtable();
+                 /***************END****************************/
+ 
+                 // not cached - so need to read directly from the class file
+                 FileInputStream inFileStream = null;
+                 try {
+                     inFileStream = new FileInputStream(info.absoluteFile);
+                     ClassFile classFile = new ClassFile();
+                     classFile.read(inFileStream);
+                     
+                     dependencyList = classFile.getClassRefs();
+                     if (dependencyList != null) {
+                         cacheDirty = true;
+                         dependencyMap.put(info.className, dependencyList);
+                     }
+                     
+                 }

Mime
View raw message