JDK-5073574 : StringBuffer methods do not inherit @throws from AbstractStringBuilder
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-07-13
  • Updated: 2017-05-16
  • Resolved: 2004-07-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b59Fixed
Related Reports
Relates :  
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
08-09-2004

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

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
13-07-2004