From f84f0ae10e2b562beaa11e86b81efec5bbda0190 Mon Sep 17 00:00:00 2001 From: Farrukh Najmi Date: Thu, 3 Oct 2013 15:51:30 -0400 Subject: [PATCH] Added -Xlint option on javac. Fixed deprecation warning. All tests pass --- pom.xml | 1 + .../java/com/sun/syndication/io/SAXBuilder.java | 14 ++++++++++++-- .../java/com/sun/syndication/io/WireFeedInput.java | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 185ca00..0b9ba97 100644 --- a/pom.xml +++ b/pom.xml @@ -129,6 +129,7 @@ 1.6 1.6 + -Xlint diff --git a/src/main/java/com/sun/syndication/io/SAXBuilder.java b/src/main/java/com/sun/syndication/io/SAXBuilder.java index 5f1194c..2a77c56 100644 --- a/src/main/java/com/sun/syndication/io/SAXBuilder.java +++ b/src/main/java/com/sun/syndication/io/SAXBuilder.java @@ -1,6 +1,8 @@ package com.sun.syndication.io; import org.jdom2.JDOMException; +import org.jdom2.input.sax.XMLReaderJDOMFactory; +import org.jdom2.input.sax.XMLReaders; import org.xml.sax.XMLReader; /* @@ -15,9 +17,17 @@ import org.xml.sax.XMLReader; * */ public class SAXBuilder extends org.jdom2.input.SAXBuilder { - + public SAXBuilder(XMLReaderJDOMFactory factory) { + super(factory); + } + + /** + * + * @deprecated use SAXBuilder(XMLReaderJDOMFactory) with either XMLReaders.DTDVALIDATING or XMLReaders.NONVALIDATING + * @param _validate + */ public SAXBuilder(boolean _validate) { - super(_validate); + super(_validate ? XMLReaders.DTDVALIDATING : XMLReaders.NONVALIDATING); } public XMLReader createParser() throws JDOMException { diff --git a/src/main/java/com/sun/syndication/io/WireFeedInput.java b/src/main/java/com/sun/syndication/io/WireFeedInput.java index 58e6791..2a311e9 100644 --- a/src/main/java/com/sun/syndication/io/WireFeedInput.java +++ b/src/main/java/com/sun/syndication/io/WireFeedInput.java @@ -39,6 +39,7 @@ import org.xml.sax.XMLReader; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.io.impl.FeedParsers; import com.sun.syndication.io.impl.XmlFixerReader; +import org.jdom2.input.sax.XMLReaders; /** * Parses an XML document (File, InputStream, Reader, W3C SAX InputSource, W3C DOM Document or JDom DOcument) @@ -283,7 +284,7 @@ public class WireFeedInput { * @return a new org.jdom2.input.SAXBuilder object */ protected SAXBuilder createSAXBuilder() { - SAXBuilder saxBuilder = new SAXBuilder(_validate); + SAXBuilder saxBuilder = new SAXBuilder(_validate ? XMLReaders.DTDVALIDATING : XMLReaders.NONVALIDATING); saxBuilder.setEntityResolver(RESOLVER); //