Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 51864

Summary: Compiler incorrectly reports exception on overriding method
Product: [Eclipse Project] JDT Reporter: Peter Wall <pwall>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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 ***