Bug 47957 - report unnecessary exceptions in private and static methods
Summary: report unnecessary exceptions in private and static methods
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-03 04:12 EST by Noel Grandin CLA
Modified: 2003-12-03 04:50 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 Noel Grandin CLA 2003-12-03 04:12:09 EST
Hi

I often seem to add exceptions to the throws clauses of methods in my classes
and then forget to remove them.
It would be nice if, in the case of private and of static methods, the compiler
could report a warning for exceptions that cannot possibly be thrown by the 
methods.
For private methods and static methods, overriding is impossible, so no intr-
class analysis is necessary - it should be 
determinable from the method body.

Thanks
Comment 1 Philipe Mulet CLA 2003-12-03 04:50:41 EST
This was added a while back in 3.0 stream.
It is optional and controlled by: 
Preferences>Java>Compiler>Unused Code>Unnecessary declaration of thrown 
exception