
|
If you were logged in you would be able to see more operations.
|
|
|
|
Time Tracking:
|
|
Original Estimate:
|
10 minutes
|
|
|
Remaining Estimate:
|
10 minutes
|
|
|
Time Spent:
|
Not Specified
|
|
|
|
Currently, if a custom FieldHandler throws an Exception, this exception is not being reported in the IllegalArgumentException being thrown by the framework. This should be changed
|
|
Description
|
Currently, if a custom FieldHandler throws an Exception, this exception is not being reported in the IllegalArgumentException being thrown by the framework. This should be changed |
Show » |
Sort Order:
|
Possible patch:
### Eclipse Workspace Patch 1.0 #P castorASE09 Index: xml/src/main/java/org/exolab/castor/mapping/loader/FieldHandlerImpl.java =================================================================== --- xml/src/main/java/org/exolab/castor/mapping/loader/FieldHandlerImpl.java (revision 7978) +++ xml/src/main/java/org/exolab/castor/mapping/loader/FieldHandlerImpl.java (working copy) @@ -504,22 +504,24 @@ } // If the field has no set method, ignore it. // If this is a problem, identity it someplace else. - } catch ( IllegalArgumentException except ) { + } catch (IllegalArgumentException except) { // Graceful way of dealing with unwrapping exception - if ( value == null ) - throw new IllegalArgumentException( Messages.format( "mapping.typeConversionNull", toString() ) ); - throw new IllegalArgumentException( Messages.format( "mapping.typeConversion", - toString(), value.getClass().getName() ) ); - } catch ( IllegalAccessException except ) { + if (value == null) { + String errorMessage = Messages.format("mapping.typeConversionNull", toString()); + throw new IllegalArgumentException(errorMessage); + } + String errorMessage = Messages.format("mapping.typeConversion", + toString(), value.getClass().getName()); + throw new IllegalArgumentException(errorMessage, except); + } catch (IllegalAccessException except) { // This should never happen - throw new CastorIllegalStateException( - Messages.format("mapping.schemaChangeNoAccess", toString()), - except); - } catch ( InvocationTargetException except ) { + String errorMessage = + Messages.format("mapping.schemaChangeNoAccess", toString()); + throw new CastorIllegalStateException(errorMessage, except); + } catch (InvocationTargetException except) { // This should never happen throw new MappingRuntimeException(except.getTargetException()); } - } else if ( value != null ) { Object collect; try {