You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/01/11 14:16:51 UTC

DO NOT REPLY [Bug 15994] New: - The cvstagdiff taskdef errors when no committed files have occurred in CVS in given interval

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: ant-dev@jakarta.apache.org
        ReportedBy: tony@bci.gb.com


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:tony@xxxxx:/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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>