Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

pop unmarshalled type on exception #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ protected Object convert(Object parent, Class type, Converter converter) {
try {
types.push(type);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best style to move this line outside the try block.

Object result = converter.unmarshal(reader, this);
types.popSilently();
return result;
} catch (ConversionException conversionException) {
addInformationTo(conversionException, type, converter, parent);
Expand All @@ -80,6 +79,9 @@ protected Object convert(Object parent, Class type, Converter converter) {
addInformationTo(conversionException, type, converter, parent);
throw conversionException;
}
finally {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should not be on a new line.

types.popSilently();
}
}

private void addInformationTo(ErrorWriter errorWriter, Class type, Converter converter, Object parent) {
Expand Down