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=15994>.
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=15994

The cvstagdiff taskdef errors when no committed files have occurred in CVS in 
given interval

           Summary: The cvstagdiff taskdef errors when no committed files
                    have occurred in CVS in given interval
           Product: Ant
           Version: 1.5.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When I use the <cvstagdiff> taskdef and supply a startdate and enddate interval 
in which no commits have occurred in CVS, the cvstagdiff taskdef stack dumps 
and quits the build. See the ant log excerpt below.

I have writen a small fix for this and rebuilt Ant 1.5.1 locally and the fix 
cures the problem. The problem is that the method 'parseRDiff' (in 
CvsTagDiff.java line 354) assumes the CVS supplied rdiff file contains at least 
one line when it may contain none. I have changed line 354 from:

  int headerLength = getHeaderLength(line);

to:

  int headerLength = (line == null) ? 0 : getHeaderLength(line);


------------------------ Ant's log.xml ----------------
<task location="file:C:/CruiseControl/bcitoolkitbuild/build.xml:126: " 
name="cvstagdiff" time="2 seconds">
 <message priority="debug"><![CDATA[Cvs command is rdiff -s -D '2003-01-10 
12:15:19' -D '2003-01-10 14:50:31' bt_toolkit]]></message>
 <message priority="debug"><![CDATA[Execute:Java13CommandLauncher: 
Executing 'cvs' with arguments:
'-d:ext:[EMAIL PROTECTED]:/cvs/bcisource'
'rdiff'
'-s'
'-D'
'2003-01-10 12:15:19'
'-D'
'2003-01-10 14:50:31'
'bt_toolkit'

The ' characters around the executable and arguments are
not part of the command.
]]></message>
 <message priority="debug"><![CDATA[retCode=0]]></message>
 </task>
</target>
<stacktrace><![CDATA[java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.getHeaderLength
(CvsTagDiff.java:428)
at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.parseRDiff
(CvsTagDiff.java:354)
at org.apache.tools.ant.taskdefs.cvslib.CvsTagDiff.execute(CvsTagDiff.java:326)
at org.apache.tools.ant.Task.perform(Task.java:319)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
]]></stacktrace>
-----------------------

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to