Review whether or not the IllegalArgumentException should be thrown rather than caught (with a default value returned) for parsed getters

Registered by Gregory Moyer

Currently, when a parsed getter (i.e. getIntegerProperty(...) or getEnumProperty(...)) is called and the parsing throws an IllegalArgumentException (or, in the case of numbers, NumberFormatException to be more specific), this exception is caught and the appropriate default value is returned. It may make more sense to pass the exception along to the caller. This design needs to be reviewed.

Blueprint information

Status:
Complete
Approver:
Gregory Moyer
Priority:
High
Drafter:
Gregory Moyer
Direction:
Approved
Assignee:
Gregory Moyer
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon 1.1-beta1
Started by
Gregory Moyer
Completed by
Gregory Moyer

Related branches

Sprints

Whiteboard

Implementation is deferred until the direction is finalized.

One way I am contemplating is providing two of each of the affected methods - one with throws the exception and one which returns the default value.

I decided to go with the above approach and change the current methods to throw the exception immediately while new *Fallback() methods will try the default before throwing the exception.

Implemented in http://bazaar.launchpad.net/~syphr42/prom/trunk/revision/62 and http://bazaar.launchpad.net/~syphr42/prom/trunk/revision/63

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.