Collapse identical catch branches.
Also take advantage of Java's try-with-resources feature. Resolves #1248.
This commit is contained in:
committed by
Greg L. Turnquist
parent
3c04f23ba8
commit
bde18f52af
@@ -55,10 +55,7 @@ public abstract class SaxUtils {
|
||||
public static String getSystemId(Resource resource) {
|
||||
try {
|
||||
return new URI(resource.getURL().toExternalForm()).toString();
|
||||
} catch (IOException ex) {
|
||||
logger.debug("Could not get System ID from [" + resource + "], ex");
|
||||
return null;
|
||||
} catch (URISyntaxException e) {
|
||||
} catch (IOException | URISyntaxException ex) {
|
||||
logger.debug("Could not get System ID from [" + resource + "], ex");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -98,9 +98,7 @@ public class CommonsXsdSchema implements XsdSchema {
|
||||
}
|
||||
Document[] serializedSchemas = serializer.serializeSchema(schema, false);
|
||||
return new DOMSource(serializedSchemas[0]);
|
||||
} catch (BeanInstantiationException ex) {
|
||||
// ignore
|
||||
} catch (XmlSchemaSerializer.XmlSchemaSerializerException ex) {
|
||||
} catch (BeanInstantiationException | XmlSchemaSerializer.XmlSchemaSerializerException ex) {
|
||||
// ignore
|
||||
}
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
Reference in New Issue
Block a user