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.:

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 Peter Powers

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

comment:2 Changed 13 years ago by Kevin Milner

seconded

comment:3 Changed 13 years ago by Peter Powers

Resolution: fixed
Status: newclosed

InvalidArrayShapeException?

  • removed from Container2D(int,int) rewriting constructor using preconditions and creating jUnit base class and test; deleted in [7830]

LocationException?

MagFreqDistException?

  • 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]

NamedObjectException?

  • removed unnecessary refs in namedObjComparator; deleted in [7834]

NotResizableException?

NullObjectException?

RegionConstraintException?

  • 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]

TranslateException?

Note: See TracTickets for help on using tickets.