}
public Map<String, Object> readProperty(final EdmProperty edmProperty, final InputStream content,
final EntityProviderReadProperties properties) throws EntityProviderException {
XMLStreamReader reader = null;
EntityProviderException cachedException = null;
XmlPropertyConsumer xec = new XmlPropertyConsumer();
try {
reader = XmlHelper.createStreamReader(content);
return xec.readProperty(reader, edmProperty, properties.getMergeSemantic(), properties.getTypeMappings(),
properties);
} catch (EntityProviderException e) {
cachedException = e;
throw cachedException;
} finally {// NOPMD (suppress DoNotThrowExceptionInFinally)
if (reader != null) {
try {
reader.close();
} catch (XMLStreamException e) {
if (cachedException != null) {
throw cachedException;
} else {
throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
.getSimpleName()), e);
}
}
}
}