ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21373] - Multiple packages in CvsTagDiff causes StringIndexOutOfBounds
Date Thu, 10 Jul 2003 16:03:17 GMT
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=21373>.
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=21373

Multiple packages in CvsTagDiff causes StringIndexOutOfBounds





------- Additional Comments From rory@mungler.com  2003-07-10 16:03 -------
Well, the line returned by CVS actually has the top level (ie CVS) module in 
it, but CvsTagDiff.java removes it.  The line reads:

File Module/Package/Blah/Something.java changed from revision 1.2 to 1.2.1

and CvsTagDiff.java removes the 'File Module/' part.  In the existing code, it 
uses the string length of the module name plus 5 plus 1 [ie "File 
Module/".length()], and my patch just removed everything up to and including 
the first '/' so that it would do so for any module name length.

The code could be changed to only remove the module name if there is only one 
package specified.  ie if multiple packages are specified, the results could 
span multiple CVS modules, hence they should be returned.  This could cause 
problems if any package names have spaces in them (ie how else are you going to 
tell multiple packages have been specified, if not by checking for spaces?).

Alternatively, the code could be changed to always return the module name, but 
this would probably break a few existing systems.  

Therefore I propose a compromise - how about adding a boolean attribute to the 
<cvstagdiff> task to specify whether or not to return the module?  eg:

<cvstagdiff package="Version2.0/Some/Directory Version3.0/Some/Other/Stuff" 
returnmodulenames="true" .... />

Default it to false, hence existing code doesn't break.  Nice.

What do you think?

Cheers

Rory

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


Mime
View raw message