Bug 54662

Summary: Bug in Unused Code > ... checked exception > Check overriding
Product: [Eclipse Project] JDT Reporter: Nobody - feel free to take it <nobody>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M8   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nobody - feel free to take it CLA 2004-03-12 11:22:05 EST
Java Compiler > Unused Code > Unnecessary declaration of thrown checked 
exception > Check overriding

The checkbox seems to behave just the wrong way
Comment 1 Philipe Mulet CLA 2004-03-25 06:10:42 EST
Works for me. If the check option is enabled, then overriding/implementing 
methods are checked as well, if not, they are ignored.

Comment 2 Nobody - feel free to take it CLA 2004-03-25 13:07:19 EST
I think, I got the option's sense wrong. But now, another option is missing to 
me. I thought that the 'Check overriding' option would be what I am missing 
now.

Please look at the following two classes ClassA and ClassB:

public class ClassA {
    protected void foo() throws IOException {}
}

public class ClassB extends ClassA {
    protected void foo() throws IOException {
        throw new IOException();
    }
}

foo() in ClassA needs to have the 'throws' clause because foo() in ClassB has 
a 'throws' clause and ClassB extends ClassA.

Thus, the 'throws' clause in ClassA is NOT unnecessary and no warning or error 
should be shown. There could be an option for this - the one I said I was 
missing.
Comment 3 Philipe Mulet CLA 2004-03-26 05:24:05 EST
See bug 44876#c2 for explanation of current behavior.