diff --git a/rome/src/main/java/com/rometools/rome/io/WireFeedInput.java b/rome/src/main/java/com/rometools/rome/io/WireFeedInput.java index e5f9b6f..c67680d 100644 --- a/rome/src/main/java/com/rometools/rome/io/WireFeedInput.java +++ b/rome/src/main/java/com/rometools/rome/io/WireFeedInput.java @@ -359,23 +359,29 @@ public class WireFeedInput { } } catch (final JDOMException e) { - throw new IllegalStateException("JDOM could not create a SAX parser"); + throw new IllegalStateException("JDOM could not create a SAX parser", e); } saxBuilder.setExpandEntities(false); - + return saxBuilder; - + } private void setFeature(SAXBuilder saxBuilder, XMLReader parser, String feature, boolean value) { - try { + if (isFeatureSupported(parser, feature, value)) { saxBuilder.setFeature(feature, value); + } + } + + private boolean isFeatureSupported(XMLReader parser, String feature, boolean value) { + try { parser.setFeature(feature, value); + return true; } catch (final SAXNotRecognizedException e) { - // ignore + return false; } catch (final SAXNotSupportedException e) { - // ignore + return false; } }