United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4638015 REGRESSION: javadoc terminates with StringIndexOutOfBoundsException
JDK-4638015 : REGRESSION: javadoc terminates with StringIndexOutOfBoundsException

Details
Type:
Bug
Submit Date:
2002-02-14
Status:
Resolved
Updated Date:
2002-04-25
Project Name:
JDK
Resolved Date:
2002-04-25
Component:
docs
OS:
windows_2000
Sub-Component:
doclet
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.1 (hopper)

Related Reports

Sub Tasks

Description

Name: rmT116609			Date: 02/14/2002


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) 
======================================================================

                                    

Comments
EVALUATION

to: ###@###.###
cc: ###@###.###
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:###@###.###">first</a>
 * and here's the <a href="http://www.pobox.com">second</a>.
 */
public class Test
{
    public void bar()
    {
    }
}


Jon ###@###.###

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:###@###.###">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
###@###.### 2002-04-15
                                     
2002-04-15
PUBLIC COMMENTS

This bug has been fixed.  Javadoc nolonger terminates when processing multiple hrefs in documentation.
###@###.### 2002-04-15
                                     
2002-04-15
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
hopper

FIXED IN:
hopper

INTEGRATED IN:
hopper


                                     
2004-06-14



Hardware and Software, Engineered to Work Together