Bug 30471 - ChangeLogTask filterEntrySet throws NullPointerException
Summary: ChangeLogTask filterEntrySet throws NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 1.7.0
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-04 17:43 UTC by Sean Erickson
Modified: 2008-07-16 07:32 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Erickson 2004-08-04 17:43:00 UTC
When running the cvschangelog task like so:

<target name="cvs_changelog_today">
  <cvschangelog destfile="changelog.xml" dir="../src/" daysinpast="1" />
</target>

I get the output from ant, in verbose mode, with the exception:

ant -buildfile buildExt.xml cvs_changelog_today -verbose -debug
Apache Ant version 1.6.2 compiled on July 16 2004
Apache Ant version 1.6.2 compiled on July 16 2004
Buildfile: buildExt.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: /usr/local/j2sdk1.4.2_03/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.2 compiled on
July 16 2004
Setting ro project property: ant.file -> /home/share/cvs/augur40x/build/buildExt.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /home/share/cvs/augur40x/build/buildExt.xml with URI =
file:///home/share/cvs/augur40x/build/buildExt.xml
Setting ro project property: ant.project.name -> SeanBuild
Adding reference: SeanBuild
Setting ro project property: ant.file.SeanBuild ->
/home/share/cvs/augur40x/build/buildExt.xml
Project base dir set to: /home/share/cvs/augur40x
 +Target: cvs_changelog_today
 +Target: clean_run_javadoc
 +Target: javadoc
Setting project property: reportJar -> www/webapps/augur/Report.jar
Setting project property: src -> ../src
Setting project property: handlersSrc -> api/iai
Setting project property: pkg -> pkg
Setting project property: tar -> augur.tar
Setting project property: pat -> ../lib/patbin132.zip
Setting project property: tools -> ../lib/tools12.jar
Setting project property: comm -> ../lib/comm203.jar
Setting project property: suiterunner -> ../lib/suiterunner-1.0beta6.jar
Setting project property: jws -> ../lib/jws/1.2
Setting project property: jws-shared -> ../lib/jws/1.2/jwsdp-shared/lib
Setting project property: jaxb -> ../lib/jws/1.2/jaxb/lib
Setting project property: jaxb-api -> ../lib/jws/1.2/jaxb/lib/jaxb-api.jar
Setting project property: jaxb-libs -> ../lib/jws/1.2/jaxb/lib/jaxb-libs.jar
Setting project property: jaxb-impl -> ../lib/jws/1.2/jaxb/lib/jaxb-impl.jar
Setting project property: jaxb-xjc -> ../lib/jws/1.2/jaxb/lib/jaxb-xjc.jar
Setting project property: jaxp -> ../lib/jws/1.2/jaxp/lib
Setting project property: jaxp-endorsed -> ../lib/jws/1.2/jaxp/lib/endorsed
Setting project property: jaxp-api -> ../lib/jws/1.2/jaxp/lib/jaxp-api.jar
Setting project property: crimson -> ../lib/jws/1.2/jaxp/lib/crimson.jar
Setting project property: xalan -> ../lib/jws/1.2/jaxp/lib/xalan.jar
Setting project property: mail -> ../lib/jws/1.2/jwsdp-shared/lib/mail.jar
Setting project property: tomcat -> ../lib/tomcat/4.1.27
Setting project property: catalina -> ../lib/tomcat/4.1.27/server/catalina.jar
Setting project property: servlet -> ../lib/tomcat/4.1.27/common/servlet.jar
Setting project property: serverJar -> lib/augur.jar
Override ignored for property reportJar
Setting project property: srcBackup -> build/src-bak.zip
Setting project property: company -> Industrious Activities, Inc.
Setting project property: name -> value
Build sequence for target `cvs_changelog_today' is [cvs_changelog_today]
cvs_changelog_today:
[cvschangelog] log
[cvschangelog] Using cvs passfile: /home/erickson/.cvspass
[cvschangelog] Executing 'cvs' with arguments:
[cvschangelog] 'log'
[cvschangelog] '-d'
[cvschangelog] '>=2004-08-03'
[cvschangelog] 
[cvschangelog] The ' characters around the executable and arguments are
[cvschangelog] not part of the command.
[cvschangelog] 
[cvschangelog] 
[cvschangelog] environment:
[cvschangelog] 
[cvschangelog]  SSH_AGENT_PID=1049
[cvschangelog]  SHELL=/bin/bash
[cvschangelog]  TERM=rxvt
[cvschangelog]  CVSROOT=:ext:erickson@ia-inc.com:/home/cvs
[cvschangelog]  WINDOWID=37748738
[cvschangelog]  USER=erickson
[cvschangelog] 
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:
[cvschangelog]  NB_JDK_HOME=/usr/local/java/
[cvschangelog]  SSH_AUTH_SOCK=/tmp/ssh-DEZQDkQ989/agent.989
[cvschangelog]  USERNAME=erickson
[cvschangelog]  XPSERVERLIST=:64 
[cvschangelog]  DESKTOP_SESSION=fluxbox
[cvschangelog] 
PATH=/usr/local/java/jre/javaws/:/usr/local/java/bin/:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/sbin:/usr/sbin:/usr/local/sbin:/opt/java/WTK104/bin
[cvschangelog]  PWD=/home/erickson/cvs/augur40x/build
[cvschangelog]  JAVA_HOME=/usr/local/java/
[cvschangelog]  GDMSESSION=fluxbox
[cvschangelog]  HOME=/home/erickson
[cvschangelog]  SHLVL=2
[cvschangelog]  COLORFGBG=0;15
[cvschangelog]  JDK_HOME=/usr/local/java/
[cvschangelog]  LOGNAME=erickson
[cvschangelog]  CVS_RSH=ssh
[cvschangelog]  LESSOPEN=|lesspipe %s
[cvschangelog]  DISPLAY=:0.0
[cvschangelog]  XAUTHORITY=/home/erickson/.Xauthority
[cvschangelog]  COLORTERM=rxvt-xpm
[cvschangelog] 
LD_LIBRARY_PATH=/usr/local/j2sdk1.4.2_03/jre/lib/i386/client:/usr/local/j2sdk1.4.2_03/jre/lib/i386:/usr/local/j2sdk1.4.2_03/jre/../lib/i386
[cvschangelog]  NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
[cvschangelog]  XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
[cvschangelog]  CVS_PASSFILE=/home/erickson/.cvspass
Execute:Java13CommandLauncher: Executing 'cvs' with arguments:
'log'
'-d'
'>=2004-08-03'

The ' characters around the executable and arguments are
not part of the command.
[cvschangelog] retCode=0
[cvschangelog] cvs log: Logging .
[cvschangelog] cvs log: Logging com/many_directories_in_our_codebase

BUILD FAILED
/home/share/cvs/augur40x/build/buildExt.xml:237: 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.executeTarget(Project.java:1214)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
        at org.apache.tools.ant.Main.runBuild(Main.java:673)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: java.lang.NullPointerException
        at java.util.Date.after(Date.java:871)
        at
org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask.filterEntrySet(ChangeLogTask.java:333)
        at
org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask.execute(ChangeLogTask.java:262)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 8 more
--- Nested Exception ---
java.lang.NullPointerException
        at java.util.Date.after(Date.java:871)
        at
org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask.filterEntrySet(ChangeLogTask.java:333)
        at
org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask.execute(ChangeLogTask.java:262)
        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.executeTarget(Project.java:1214)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
        at org.apache.tools.ant.Main.runBuild(Main.java:673)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Total time: 17 seconds


background:

This task worked in the past but no longer works.  I am not sure if it quit
working with a java upgrade or an ant upgrade. 

I have verified this problem with Ant 1.5.3-1, 1.6.1, and 1.6.2

Here is my current Java version:
java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
Comment 1 Stefan Bodewig 2004-09-21 11:31:35 UTC
Which version of CVS are you using?  It may be related to Bug 30962 and Bug 30576
Comment 2 Sean Erickson 2004-09-22 20:41:03 UTC
My cvs version is  1.12.9, so it appears it could be the date format as
described in <a
href=http://issues.apache.org/bugzilla/show_bug.cgi?id=30576>30576</a>

Question: is there a workaround?
Comment 3 Kev Jackson 2006-03-08 04:01:26 UTC
I've just checked the Java API docs.  

Prior to Java 1.5.0, the API states that Date.after(d) doesn't throw
NullPointerException when d == null

in Java 1.5.0, the API states that Date.after(d) does throw a
NullPointerException when d == null

My guess is that this actually changed in Java 1.4, but the docs are incorrect.
 I've added a simple check + comments to the code in SVN trunk.  I don't think
that this is related to the CVS version at all - it seems to be simply a change
in the underlying API which hasn't been caught until now.
Comment 4 Stefan Bodewig 2008-07-16 07:32:47 UTC
Kev's change is part of the 1.7 branch, so this should be fixed.