Opened 13 years ago
Closed 13 years ago
#268 closed enhancement (fixed)
Prune unnecessary exceptions
Reported by: | Peter Powers | Owned by: | Peter Powers |
---|---|---|---|
Priority: | minor | Milestone: | OpenSHA 1.2 |
Component: | sha | Version: | |
Keywords: | Cc: |
Description
There are many custom exceptions that are un- or little used that could/should be replaced with basic java exceptions. e.g.:
- why is there a NullObjectException? when a NullPointerException? will do?
- MagFreqDistException? is used mostly where an UnsupportedOperationException? is most appropriate
- InvalidRangeException? is heavily used in place of what should be IllegalArgumentExceptions?
Swapping out the more heavily used exceptions is beyond the scope of this ticket but should be revisited along with more consistent use of preconditions.
Change History (3)
comment:1 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
- removed from Container2D(int,int) rewriting constructor using preconditions and creating jUnit base class and test; deleted in [7830]
- unused; deleted in [7831]
- replaced in various MFD implementations with UnsuppOpEx? or (in one instance) the general RuntimeEx?; created initial test classes for MFD and tests for set overrides; deleted in [7833]
- removed unnecessary refs in namedObjComparator; deleted in [7834]
- unused; deleted in [7835]
- unused; deleted in [7836]
- unnecessary; ever since rewriting region classes, only basic runtime exception are thrown; this removal touched quite a few files but mostly with removal of unnecessary throws in method signatures; where the ex was being explicitly caught (and would never actually be caught), blocks were updated to catch general Exception at the last; deleted in [7837]
- unnecessary; replaced few throw instances with IllegalArgumentExceptions?; deleted in [7838]
Note: See
TracTickets for help on using
tickets.
As a general note on exceptions, RuntimeExceptions? (NPE, IllegalArg?, UnsuppOper?) don't need to be declared in a method signature but should rather be listed in the javadocs