CommandException: org.netbeans.lib.cvsclient.command.CommandException: String index out of range: -7
Keith <[email protected]> Wed, 10 Aug 2005 14:17:32 -0400
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Message-ID | <[email protected]> |
I wrote a test program to execute the equivalent of the cvs command
"cvs update -C -d"
When I run it I'm getting the following exception thrown:
CommandException: org.netbeans.lib.cvsclient.command.CommandException:
String index out of range: -7
I traced the problem down to an issue with a response from the server of
"Clear-static-directory ./\n" followed by "./\n" which results in a call to
ResponseServices.updateAdminData(...) in
ClearStaticDirectoryResponse.process()
The specific call is
services.updateAdminData(localPath, repositoryPath, null);
localPath and repositoryPath both have a value of "./"
The problem appears to be with the value of repositoryPath. The javadoc
comment for the repositoryPath parameter says the value should be an
absolute path and what is being passed in is a relative path. The
actual line in ResponseServices.updateAdminData() where the exception is
thrown is:
repositoryPath =
repositoryPath.substring(getRepository().length() + 1);
getRepository() returns a string of length 8 ("/opt/cvs") but
repositoryPath only has a length of 2 ("./").
So should ClearStaticDirectoryResponse.process() be converting the "./"
to an absolute path before passing it to
ResponseServices.updateAdminData(...)?
Keith