ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Blinn <bbl...@gmail.com>
Subject [Patch] CvsTagDiff throws NullPointerException is cvsRoot is not specified
Date Thu, 27 Oct 2005 16:13:08 GMT
If cvsRoot is not specified when executing the CvsTagDiff target, a
NullPointerException is thrown:

E:\cygwin\home\matt\build\bill-build-20051022\basin\build.xml:669: The
following error occurred while executing this line:
E:\cygwin\home\matt\build\bill-build-20051022\basin\client-build2.xml:102:
java.lang.NullPointerException
        at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: E:\cygwin\home\matt\build\bill-build-20051022\basin\client-build2.xml:102:
java.lang.NullPointerException
        at org.apache.tools.ant.Task.perform(Task.java:373)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
        ... 12 more
Caused by: java.lang.NullPointerException
        at org.apache.tools.ant.util.DOMElementWriter.encode(DOMElementWriter.java:207)
        at org.apache.tools.ant.util.DOMElementWriter.openElement(DOMElementWriter.java:165)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.writeTagDiff(CvsTagDiff.java:378)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.execute(CvsTagDiff.java:237)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 18 more
--- Nested Exception ---
E:\cygwin\home\matt\build\bill-build-20051022\basin\client-build2.xml:102:
java.lang.NullPointerException
        at org.apache.tools.ant.Task.perform(Task.java:373)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NullPointerException
        at org.apache.tools.ant.util.DOMElementWriter.encode(DOMElementWriter.java:207)
        at org.apache.tools.ant.util.DOMElementWriter.openElement(DOMElementWriter.java:165)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.writeTagDiff(CvsTagDiff.java:378)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.execute(CvsTagDiff.java:237)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 18 more
--- Nested Exception ---
java.lang.NullPointerException
        at org.apache.tools.ant.util.DOMElementWriter.encode(DOMElementWriter.java:207)
        at org.apache.tools.ant.util.DOMElementWriter.openElement(DOMElementWriter.java:165)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.writeTagDiff(CvsTagDiff.java:378)
        at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.execute(CvsTagDiff.java:237)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 52 seconds


This patch should fix the problem:

--- apache-ant-1.6.5-src-orig/apache-ant-1.6.5/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
   2005-06-02 15:20:00.000000000 -0400
+++ apache-ant-1.6.5-src/apache-ant-1.6.5/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
2005-10-27 12:01:20.393375000 -0400
@@ -373,7 +373,9 @@
                 root.setAttribute("endDate", myendDate);
             }

-            root.setAttribute("cvsroot", getCvsRoot());
+            if(getCvsRoot() != null) {
+                root.setAttribute("cvsroot", getCvsRoot());
+            }
             root.setAttribute("package", mypackage);
             DOM_WRITER.openElement(root, writer, 0, "\t");
             writer.println();

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message