Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4638015
Votes 2
Synopsis REGRESSION: javadoc terminates with StringIndexOutOfBoundsException
Category doclet:tbd
Reported Against 1.4
Release Fixed 1.4.1(hopper)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 14-FEB-2002
Description




java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OPERATING SYSTEM VERSION : Win 2k 5.00.2195, SP2

DESCRIPTION OF THE PROBLEM :

C:\temp\kkk>javadoc -d c:\temp\test org.foederal.sn -sourcepath c:\temp\kkk
Loading source files for package org.foederal.sn...
Constructing Javadoc information...
Standard Doclet version 1.4.0

Generating c:\temp\test\constant-values.html...
Building tree for all the packages and classes...
Building index for all the packages and classes...
Generating c:\temp\test\overview-tree.html...
Generating c:\temp\test\index-all.html...
javadoc: In doclet class com.sun.tools.doclets.standard.Standard,  method 
start has thrown an exception java.lang.reflec
t.InvocationTargetException
java.lang.StringIndexOutOfBoundsException: String index out of range: 105
         at java.lang.String.substring(String.java:1473)
         at 
com.sun.tools.doclets.standard.HtmlStandardWriter.commentTagsToString(HtmlStandardWriter.java:1611)
         at 
com.sun.tools.doclets.standard.HtmlStandardWriter.printCommentTags(HtmlStandardWriter.java:1555)
         at 
com.sun.tools.doclets.standard.HtmlStandardWriter.printSummaryComment(HtmlStandardWriter.java:1528)
         at 
com.sun.tools.doclets.standard.AbstractIndexWriter.printComment(AbstractIndexWriter.java:199)
         at 
com.sun.tools.doclets.standard.AbstractIndexWriter.printDescription(AbstractIndexWriter.java:172)
         at 
com.sun.tools.doclets.standard.AbstractIndexWriter.generateContents(AbstractIndexWriter.java:90)
         at 
com.sun.tools.doclets.standard.SingleIndexWriter.generateIndexFile(SingleIndexWriter.java:78)
         at 
com.sun.tools.doclets.standard.SingleIndexWriter.generate(SingleIndexWriter.java:52)
         at 
com.sun.tools.doclets.standard.Standard.startGeneration(Standard.java:120)
         at com.sun.tools.doclets.standard.Standard.start(Standard.java:44)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:196)
         at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:95)
         at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:288)
         at com.sun.tools.javadoc.Start.begin(Start.java:114)
         at com.sun.tools.javadoc.Main.execute(Main.java:44)
         at com.sun.tools.javadoc.Main.main(Main.java:34)
1 error

REGRESSION.  Last worked in version 1.3.1_02

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. starting javadoc as described above

This bug can be reproduced always.

Release Regression From : 1.3.1_02
The above release value was the last known release where this 
bug was knwon to work. Since then there has been a regression.

(Review ID: 139424) 
======================================================================
Work Around
N/A
Evaluation

We cannot reproduce this problem.
Could you please provide us with a source file or package and the
javadoc command that would reproduce this problem?

-Doug

Aha!  I see example doc comments provided on Bug Parade:

I'm getting this too, with the released 1.4. As far as I 
can tell, this became a bug between 1.4b1 and 1.4b2.
Looks like it's breaking when it's writing index-all.html. 

Haven't got a very simple test case, but I've tracked it 
down to a source file which has two links in the first 
sentence of the class description comment.

The following class doesn't cause JavaDoc to crash, but it 
*does* give a very spurious entry in the index-all.html 
page, which could be relevant:

/**
 * Here's the <a href="mailto:  xxxxx@xxxxx  ">first</a>
 * and here's the <a href="http://www.pobox.com">second</a>.
 */
public class Test
{
    public void bar()
    {
    }
}


Jon   xxxxx@xxxxx  

this source wild produce the exception as well:
---------------------------------
/**
 <a href=x>  
 <a href=x> 
 */
public class A  { }
---------------------------------

regards marco

============================

Javadoc terminates with StringIndexOutOfBoundsException when it
processes the following Doc comment:

/**
 * Here's the <a href="mailto:  xxxxx@xxxxx  ">first</a>
 * and here's the <a href="http://www.pobox.com">second</a>.
 */

While the doclet is processing the href stored in a StringBuffer, it
makes calls to String.indexOf(), where the String represents the
original href.  The doclet should be calling StringBuffer.indexOf()
instead because the href length may change as it is being processed.

A regression test has been added at:

test/com/sun/javadoc/TestTagInheritenceWrapper.sh
  xxxxx@xxxxx   2002-04-15
Comments
  
  Include a link with my name & email   

Submitted On 25-FEB-2002
jskeet
Haven't got a very simple test case, but I've tracked it 
down to a source file which has two links in the first 
sentence of the class description comment.

The following class doesn't cause JavaDoc to crash, but it 
*does* give a very spurious entry in the index-all.html 
page, which could be relevant:

/**
 * Here's the <a href="mailto:skeet@pobox.com">first</a>
 * and here's the <a href="http://www.pobox.com">second</a>.
 */
public class Test
{
    public void bar()
    {
    }
}


Jon



Submitted On 25-FEB-2002
jskeet
I'm getting this too, with the released 1.4. As far as I 
can tell, this became a bug between 1.4b1 and 1.4b2.

Looks like it's breaking when it's writing index-all.html. 
I'll see if I can come up with a very simple test case...

Jon


Submitted On 05-MAR-2002
mind8
this source wild produce the exception as well:
---------------------------------
/**
 <a href=x>  
 <a href=x> 
 */
public class A  { }
---------------------------------
regards marco


Submitted On 30-MAY-2002
jpschewe
So if this is fixed, how come I'm still seeing it with the
1.4.0 release?


Submitted On 03-SEP-2002
thorciphers
This is definitely NOT fixed yet.  I'm still seeing this error under Windows 2000, here's my version info:
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)


Submitted On 24-SEP-2002
jpschewe
This is fixed in jdk 1.4.1, thanks.



PLEASE NOTE: JDK6 is formerly known as Project Mustang