Skip to content

Commit 61a1f62

Browse files
committed
SWS-749 - org.springframework.xml.sax.SaxUtils swallows exceptions
1 parent 8ac15a2 commit 61a1f62

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

xml/src/main/java/org/springframework/xml/sax/SaxUtils.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2005-2010 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
2222

2323
import org.springframework.core.io.Resource;
2424

25+
import org.apache.commons.logging.Log;
26+
import org.apache.commons.logging.LogFactory;
2527
import org.xml.sax.InputSource;
2628

2729
/**
@@ -32,6 +34,8 @@
3234
*/
3335
public abstract class SaxUtils {
3436

37+
private static final Log logger = LogFactory.getLog(SaxUtils.class);
38+
3539
/**
3640
* Creates a SAX <code>InputSource</code> from the given resource. Sets the system identifier to the resource's
3741
* <code>URL</code>, if available.
@@ -53,10 +57,12 @@ public static String getSystemId(Resource resource) {
5357
try {
5458
return new URI(resource.getURL().toExternalForm()).toString();
5559
}
56-
catch (IOException e) {
60+
catch (IOException ex) {
61+
logger.debug("Could not get System ID from [" + resource + "], ex");
5762
return null;
5863
}
5964
catch (URISyntaxException e) {
65+
logger.debug("Could not get System ID from [" + resource + "], ex");
6066
return null;
6167
}
6268
}

0 commit comments

Comments
 (0)