DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18406>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

nightly build script throws npe under some (common) conditions





------- Additional Comments From [EMAIL PROTECTED]  2003-03-27 12:58 -------
Based on the above the following patch
fixes the bug's symptom

Index: Project.java
===================================================================
RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.132
diff -u -r1.132 Project.java
--- Project.java        17 Feb 2003 14:12:10 -0000      1.132
+++ Project.java        27 Mar 2003 12:53:12 -0000
@@ -2189,12 +2189,16 @@
          * @return
          */
         public Object get(Object key) {
-            //System.out.println("AntRefTable.get " + key);
             Object o = super.get(key);
             if (o instanceof UnknownElement) {
                 // Make sure that
                 ((UnknownElement) o).maybeConfigure();
                 o = ((UnknownElement) o).getTask();
+                // if this is not a task it may be
+                // something else which placed itself in the map.
+                if (o == null) {
+                    o = super.get(key);
+                }
             }
             return o;
         }

Reply via email to