Object mo = read(reader);
if (type.isInstance(mo)) {
return type.cast(mo);
} else {
error("UnrecognizedElementException", reader, name);
UnrecognizedElementException e = new UnrecognizedElementException(name);
throw e;
}
} catch (ContributionReadException e) {
Location location = reader.getLocation();
e.setLine(location.getLineNumber());
e.setColumn(location.getColumnNumber());
error("ContributionReadException", reader, e);
throw e;
} finally {
try {
reader.close();