United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 5073574 StringBuffer methods do not inherit @throws from AbstractStringBuilder
5073574 : StringBuffer methods do not inherit @throws from AbstractStringBuilder

Details
Type:
Bug
Submit Date:
2004-07-13
Status:
Resolved
Updated Date:
2004-07-21
Project Name:
JDK
Resolved Date:
2004-07-21
Component:
core-libs
OS:
generic
Sub-Component:
java.lang
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0

Related Reports
Relates:

Sub Tasks

Description
String{Buffer,Builder} extend the package-private class AbstractStringBuilder
which contains all of the javadoc for this method.  It appears that the Tiger introduction of AbstractSTringBuilder has inadvertently removed the @throws
for some pre-Tiger methods (e.g. charAt, subSequence, substring, insert, etc...) since they aren't inherited.

Our local standard doclet expert has determined that the standard doclet is
behaving as specified based on this statement in the javadoc reference guide:

    When a @throws tag for a particular exception is missing, the @throws
    tag is copied only if that exception is declared.

Assuming that this behaviour has existed prior to Tiger, the documentation
of StringBuffer should be updated.

I'll add the @throws explicitly to the javadoc in String{Buffer,Builder}.append(CharSequence, int, int) as part of the fix for bug 5067406.

For historical purposes, note that these exceptions were documented
(or possibly implied) in these ccc requests:

  StringBuffer:  
    4812591: StringBuffer needs append(CharSequence)
    http://ccc.sfbay/4812591

  StringBuffer:
    4261803: Need an unsynchronized StringBuffer
    http://ccc/4261803

-- iag@sfbay 2004-07-13

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-rc

FIXED IN:
tiger-rc

INTEGRATED IN:
tiger-b59
tiger-rc


                                     
2004-09-08
EVALUATION

I used the {@inheritDoc} tag since the throws tags do not act like all the other doc components.
###@###.### 2004-07-15
                                     
2004-07-15
SUGGESTED FIX

I applied this fix to StringBuffer to get the intended output.

*** /tmp/geta27817	Tue Jul 13 14:59:30 2004
--- StringBuffer.java	Tue Jul 13 14:48:29 2004
***************
*** 282,287 ****
--- 282,288 ----
      }
  
      /**
+      * @throws     IndexOutOfBoundsException {@inheritDoc}
       * @since      1.5
       */
      public synchronized StringBuffer append(CharSequence s, int start, int end) 

Similar changes should be made to other methods in StringBuffer (and possibly StringBuilder).

-- iag@sfbay 2004-07-13
                                     
2004-07-13



Hardware and Software, Engineered to Work Together