Update of /cvsroot/nice/Nice/src/nice/tools/doc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11524/src/nice/tools/doc
Modified Files:
comment.nice
Log Message:
Fixed a bug whereby an @tag alone on a line would cause an uncaught IndexArrayOutOfBounds exception.
Index: comment.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/comment.nice,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** comment.nice 4 Aug 2004 14:54:21 -0000 1.6
--- comment.nice 23 Jan 2005 15:22:36 -0000 1.7
***************
*** 107,114 ****
if(line.charAt(0) == '@') {
//find the first space - this tells us the range of the tag
int index = line.indexOf(' ');
! String tag = line.substring(1, index); //skip the '@'
! String comment = line.substring(index+1); //+1 because we need to skip the space
!
Node n = new Node(value: (tag, comment));
root.insert(n);
--- 107,123 ----
if(line.charAt(0) == '@') {
//find the first space - this tells us the range of the tag
+ //alternatively, there might be no space
int index = line.indexOf(' ');
! String tag, comment;
! if(index != -1 && index + 1 <= line.length()) {
! //skip the '@'
! tag = line.substring(1, index);
! //+1 because we need to skip the space
! comment = line.substring(index+1);
! }
! else {
! tag = line;
! comment = "";
! }
Node n = new Node(value: (tag, comment));
root.insert(n);
|