Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 51864 - Compiler incorrectly reports exception on overriding method
Summary: Compiler incorrectly reports exception on overriding method
Status: RESOLVED DUPLICATE of bug 51353
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-12 12:24 EST by Peter Wall CLA
Modified: 2004-02-12 18:41 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Wall CLA 2004-02-12 12:24:00 EST
In J2SDK1.5beta1, StringBuffer nows extends AbstractStringBuilder, and this
class implements Appendable.  Appendable declares append(char) to throw
IOException, but the versions of this method in AbstractStringBuilder and
StringBuffer do not throw any exceptions.  This is permitted in the language
spec. - you may narrow but not widen the range of exceptions thrown.

The JDT compiler flags all uses of StringBuffer.append(char) demanding that it
be enclosed in a try-catch block or that the enclosing method is declared to
throw IOException.  This appears to be an incorrect interpretation of the
language spec.
Comment 1 Philipe Mulet CLA 2004-02-12 18:41:37 EST

*** This bug has been marked as a duplicate of 51353 ***