From 7cd1761fbdaabf296050e88e9124be6096ef49a3 Mon Sep 17 00:00:00 2001 From: Patrick Gotthard Date: Thu, 3 Oct 2013 14:36:21 +0200 Subject: [PATCH 1/2] Updated to latest JDOM which supports generics --- pom.xml | 2 +- .../sun/syndication/io/ModuleGenerator.java | 2 +- .../com/sun/syndication/io/ModuleParser.java | 2 +- .../syndication/io/ParsingFeedException.java | 2 +- .../com/sun/syndication/io/SAXBuilder.java | 4 ++-- .../com/sun/syndication/io/SyndFeedInput.java | 2 +- .../sun/syndication/io/SyndFeedOutput.java | 2 +- .../sun/syndication/io/WireFeedGenerator.java | 2 +- .../com/sun/syndication/io/WireFeedInput.java | 20 +++++++++---------- .../sun/syndication/io/WireFeedOutput.java | 10 +++++----- .../sun/syndication/io/WireFeedParser.java | 2 +- .../syndication/io/impl/Atom03Generator.java | 10 +++++----- .../sun/syndication/io/impl/Atom03Parser.java | 10 +++++----- .../syndication/io/impl/Atom10Generator.java | 12 +++++------ .../sun/syndication/io/impl/Atom10Parser.java | 18 ++++++++--------- .../io/impl/BaseWireFeedGenerator.java | 6 +++--- .../io/impl/BaseWireFeedParser.java | 6 +++--- .../io/impl/DCModuleGenerator.java | 6 +++--- .../syndication/io/impl/DCModuleParser.java | 6 +++--- .../sun/syndication/io/impl/FeedParsers.java | 2 +- .../syndication/io/impl/ModuleGenerators.java | 2 +- .../syndication/io/impl/ModuleParsers.java | 4 ++-- .../syndication/io/impl/RSS090Generator.java | 6 +++--- .../sun/syndication/io/impl/RSS090Parser.java | 6 +++--- .../io/impl/RSS091NetscapeGenerator.java | 6 +++--- .../io/impl/RSS091NetscapeParser.java | 2 +- .../io/impl/RSS091UserlandGenerator.java | 8 ++++---- .../io/impl/RSS091UserlandParser.java | 8 ++++---- .../syndication/io/impl/RSS092Generator.java | 4 ++-- .../sun/syndication/io/impl/RSS092Parser.java | 2 +- .../syndication/io/impl/RSS093Generator.java | 2 +- .../sun/syndication/io/impl/RSS093Parser.java | 2 +- .../syndication/io/impl/RSS094Generator.java | 4 ++-- .../sun/syndication/io/impl/RSS094Parser.java | 2 +- .../syndication/io/impl/RSS10Generator.java | 4 ++-- .../sun/syndication/io/impl/RSS10Parser.java | 6 +++--- .../syndication/io/impl/RSS20Generator.java | 2 +- .../sun/syndication/io/impl/RSS20Parser.java | 6 +++--- .../syndication/io/impl/RSS20wNSParser.java | 6 +++--- .../io/impl/SyModuleGenerator.java | 4 ++-- .../syndication/io/impl/SyModuleParser.java | 4 ++-- .../sun/syndication/unittest/FeedTest.java | 4 ++-- .../unittest/TestXmlFixerReader.java | 2 +- .../unittest/issues/Issue1Test.java | 2 +- 44 files changed, 112 insertions(+), 112 deletions(-) diff --git a/pom.xml b/pom.xml index c63a7db..984dbf3 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ org.jdom jdom - 1.1.3 + 2.0.2 junit diff --git a/src/main/java/com/sun/syndication/io/ModuleGenerator.java b/src/main/java/com/sun/syndication/io/ModuleGenerator.java index 2390d1e..a268560 100644 --- a/src/main/java/com/sun/syndication/io/ModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/ModuleGenerator.java @@ -18,7 +18,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.WireFeed; -import org.jdom.Element; +import org.jdom2.Element; import java.util.Set; diff --git a/src/main/java/com/sun/syndication/io/ModuleParser.java b/src/main/java/com/sun/syndication/io/ModuleParser.java index c083000..0f52c59 100644 --- a/src/main/java/com/sun/syndication/io/ModuleParser.java +++ b/src/main/java/com/sun/syndication/io/ModuleParser.java @@ -17,7 +17,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.module.Module; -import org.jdom.Element; +import org.jdom2.Element; /** * Parses module metadata from a XML node (JDOM element). diff --git a/src/main/java/com/sun/syndication/io/ParsingFeedException.java b/src/main/java/com/sun/syndication/io/ParsingFeedException.java index 24e6d6c..f9caf08 100644 --- a/src/main/java/com/sun/syndication/io/ParsingFeedException.java +++ b/src/main/java/com/sun/syndication/io/ParsingFeedException.java @@ -16,7 +16,7 @@ */ package com.sun.syndication.io; -import org.jdom.input.JDOMParseException; +import org.jdom2.input.JDOMParseException; /** * Exception thrown by WireFeedInput instance if it can not parse a feed. diff --git a/src/main/java/com/sun/syndication/io/SAXBuilder.java b/src/main/java/com/sun/syndication/io/SAXBuilder.java index 974c0a7..5f1194c 100644 --- a/src/main/java/com/sun/syndication/io/SAXBuilder.java +++ b/src/main/java/com/sun/syndication/io/SAXBuilder.java @@ -1,6 +1,6 @@ package com.sun.syndication.io; -import org.jdom.JDOMException; +import org.jdom2.JDOMException; import org.xml.sax.XMLReader; /* @@ -14,7 +14,7 @@ import org.xml.sax.XMLReader; * Crimson is one parser which is known not to support these features. * */ -public class SAXBuilder extends org.jdom.input.SAXBuilder { +public class SAXBuilder extends org.jdom2.input.SAXBuilder { public SAXBuilder(boolean _validate) { super(_validate); diff --git a/src/main/java/com/sun/syndication/io/SyndFeedInput.java b/src/main/java/com/sun/syndication/io/SyndFeedInput.java index 2353bb9..27c324e 100644 --- a/src/main/java/com/sun/syndication/io/SyndFeedInput.java +++ b/src/main/java/com/sun/syndication/io/SyndFeedInput.java @@ -18,7 +18,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeedImpl; -import org.jdom.Document; +import org.jdom2.Document; import org.xml.sax.InputSource; import java.io.File; diff --git a/src/main/java/com/sun/syndication/io/SyndFeedOutput.java b/src/main/java/com/sun/syndication/io/SyndFeedOutput.java index 9d3b107..27c48b8 100644 --- a/src/main/java/com/sun/syndication/io/SyndFeedOutput.java +++ b/src/main/java/com/sun/syndication/io/SyndFeedOutput.java @@ -17,7 +17,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.synd.SyndFeed; -import org.jdom.Document; +import org.jdom2.Document; import java.io.File; import java.io.IOException; diff --git a/src/main/java/com/sun/syndication/io/WireFeedGenerator.java b/src/main/java/com/sun/syndication/io/WireFeedGenerator.java index d1dabbb..960b486 100644 --- a/src/main/java/com/sun/syndication/io/WireFeedGenerator.java +++ b/src/main/java/com/sun/syndication/io/WireFeedGenerator.java @@ -18,7 +18,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.io.FeedException; -import org.jdom.Document; +import org.jdom2.Document; /** * Generates an XML document (JDOM) out of a feed for a specific real feed type. diff --git a/src/main/java/com/sun/syndication/io/WireFeedInput.java b/src/main/java/com/sun/syndication/io/WireFeedInput.java index 3d01c0b..58e6791 100644 --- a/src/main/java/com/sun/syndication/io/WireFeedInput.java +++ b/src/main/java/com/sun/syndication/io/WireFeedInput.java @@ -26,10 +26,10 @@ import java.util.List; import java.util.Map; import java.util.WeakHashMap; -import org.jdom.Document; -import org.jdom.JDOMException; -import org.jdom.input.DOMBuilder; -import org.jdom.input.JDOMParseException; +import org.jdom2.Document; +import org.jdom2.JDOMException; +import org.jdom2.input.DOMBuilder; +import org.jdom2.input.JDOMParseException; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXNotRecognizedException; @@ -153,7 +153,7 @@ public class WireFeedInput { /** * Builds an WireFeed (RSS or Atom) from a file. *

- * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'. + * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'. *

* @param file file to read to create the WireFeed. * @return the WireFeed read from the file. @@ -177,7 +177,7 @@ public class WireFeedInput { /** * Builds an WireFeed (RSS or Atom) from an Reader. *

- * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'. + * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'. *

* @param reader Reader to read to create the WireFeed. * @return the WireFeed read from the Reader. @@ -208,7 +208,7 @@ public class WireFeedInput { /** * Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource. *

- * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'. + * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'. *

* @param is W3C SAX InputSource to read to create the WireFeed. * @return the WireFeed read from the W3C SAX InputSource. @@ -236,7 +236,7 @@ public class WireFeedInput { /** * Builds an WireFeed (RSS or Atom) from an W3C DOM document. *

- * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'. + * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'. *

* @param document W3C DOM document to read to create the WireFeed. * @return the WireFeed read from the W3C DOM document. @@ -278,9 +278,9 @@ public class WireFeedInput { } /** - * Creates and sets up a org.jdom.input.SAXBuilder for parsing. + * Creates and sets up a org.jdom2.input.SAXBuilder for parsing. * - * @return a new org.jdom.input.SAXBuilder object + * @return a new org.jdom2.input.SAXBuilder object */ protected SAXBuilder createSAXBuilder() { SAXBuilder saxBuilder = new SAXBuilder(_validate); diff --git a/src/main/java/com/sun/syndication/io/WireFeedOutput.java b/src/main/java/com/sun/syndication/io/WireFeedOutput.java index e5872d9..736aa82 100644 --- a/src/main/java/com/sun/syndication/io/WireFeedOutput.java +++ b/src/main/java/com/sun/syndication/io/WireFeedOutput.java @@ -18,11 +18,11 @@ package com.sun.syndication.io; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.io.impl.FeedGenerators; -import org.jdom.Document; -import org.jdom.JDOMException; -import org.jdom.output.DOMOutputter; -import org.jdom.output.Format; -import org.jdom.output.XMLOutputter; +import org.jdom2.Document; +import org.jdom2.JDOMException; +import org.jdom2.output.DOMOutputter; +import org.jdom2.output.Format; +import org.jdom2.output.XMLOutputter; import java.io.IOException; import java.io.Writer; diff --git a/src/main/java/com/sun/syndication/io/WireFeedParser.java b/src/main/java/com/sun/syndication/io/WireFeedParser.java index e5e9af3..486ecff 100644 --- a/src/main/java/com/sun/syndication/io/WireFeedParser.java +++ b/src/main/java/com/sun/syndication/io/WireFeedParser.java @@ -18,7 +18,7 @@ package com.sun.syndication.io; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.io.FeedException; -import org.jdom.Document; +import org.jdom2.Document; /** * Parses an XML document (JDOM) into a feed bean. diff --git a/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java b/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java index 744e334..2c6a4b0 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java @@ -19,11 +19,11 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.atom.*; import com.sun.syndication.io.FeedException; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.input.SAXBuilder; +import org.jdom2.Attribute; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.jdom2.input.SAXBuilder; import java.io.StringReader; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java b/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java index 6a3770d..a6aab55 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java @@ -19,10 +19,10 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.atom.*; import com.sun.syndication.io.FeedException; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.output.XMLOutputter; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.jdom2.output.XMLOutputter; import java.util.*; @@ -242,7 +242,7 @@ public class Atom03Parser extends BaseWireFeedParser { List eContent = e.getContent(); Iterator i = eContent.iterator(); while (i.hasNext()) { - org.jdom.Content c = (org.jdom.Content) i.next(); + org.jdom2.Content c = (org.jdom2.Content) i.next(); if (c instanceof Element) { Element eC = (Element) c; if (eC.getNamespace().equals(getAtomNamespace())) { diff --git a/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java b/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java index f074f67..6228b21 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java @@ -20,11 +20,11 @@ import java.io.StringReader; import java.util.Iterator; import java.util.List; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.input.SAXBuilder; +import org.jdom2.Attribute; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.jdom2.input.SAXBuilder; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.atom.Category; @@ -39,7 +39,7 @@ import com.sun.syndication.io.WireFeedOutput; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; -import org.jdom.output.XMLOutputter; +import org.jdom2.output.XMLOutputter; /** * Feed Generator for Atom diff --git a/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java b/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java index 1468c0e..ccfc237 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java @@ -20,10 +20,10 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.output.XMLOutputter; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.jdom2.output.XMLOutputter; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.atom.Category; @@ -40,10 +40,10 @@ import java.io.IOException; import java.io.Reader; import java.net.MalformedURLException; import java.util.regex.Pattern; -import org.jdom.Attribute; -import org.jdom.JDOMException; -import org.jdom.Parent; -import org.jdom.input.SAXBuilder; +import org.jdom2.Attribute; +import org.jdom2.JDOMException; +import org.jdom2.Parent; +import org.jdom2.input.SAXBuilder; /** * Parser for Atom 1.0 @@ -323,7 +323,7 @@ public class Atom10Parser extends BaseWireFeedParser { List eContent = e.getContent(); Iterator i = eContent.iterator(); while (i.hasNext()) { - org.jdom.Content c = (org.jdom.Content) i.next(); + org.jdom2.Content c = (org.jdom2.Content) i.next(); if (c instanceof Element) { Element eC = (Element) c; if (eC.getNamespace().equals(getAtomNamespace())) { diff --git a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedGenerator.java b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedGenerator.java index ae2b96d..72a2b70 100644 --- a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedGenerator.java @@ -1,9 +1,9 @@ package com.sun.syndication.io.impl; import com.sun.syndication.io.WireFeedGenerator; -import org.jdom.Element; -import org.jdom.Namespace; -import org.jdom.Parent; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.jdom2.Parent; import java.util.HashSet; import java.util.Iterator; diff --git a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java index b9f9d86..ba48cef 100644 --- a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java +++ b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java @@ -5,11 +5,11 @@ import com.sun.syndication.feed.module.Extendable; import com.sun.syndication.io.WireFeedParser; import java.util.ArrayList; import java.util.Iterator; -import org.jdom.Element; +import org.jdom2.Element; import java.util.List; -import org.jdom.Namespace; -import org.jdom.Attribute; +import org.jdom2.Namespace; +import org.jdom2.Attribute; /** * @author Alejandro Abdelnur diff --git a/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java b/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java index 2ff8901..a7cdee3 100644 --- a/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java @@ -20,9 +20,9 @@ import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.DCModule; import com.sun.syndication.feed.module.DCSubject; import com.sun.syndication.io.ModuleGenerator; -import org.jdom.Attribute; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Attribute; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.ArrayList; import java.util.Date; diff --git a/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java b/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java index 54f16af..10173d5 100644 --- a/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java +++ b/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java @@ -23,9 +23,9 @@ import com.sun.syndication.feed.module.DCModule; import com.sun.syndication.feed.module.DCSubject; import com.sun.syndication.io.ModuleParser; import com.sun.syndication.io.WireFeedParser; -import org.jdom.Attribute; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Attribute; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/main/java/com/sun/syndication/io/impl/FeedParsers.java b/src/main/java/com/sun/syndication/io/impl/FeedParsers.java index 86351c2..2aaa1fe 100644 --- a/src/main/java/com/sun/syndication/io/impl/FeedParsers.java +++ b/src/main/java/com/sun/syndication/io/impl/FeedParsers.java @@ -17,7 +17,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.io.WireFeedParser; -import org.jdom.Document; +import org.jdom2.Document; import java.util.List; /** diff --git a/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java b/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java index 695223e..9c493f9 100644 --- a/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java +++ b/src/main/java/com/sun/syndication/io/impl/ModuleGenerators.java @@ -18,7 +18,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.module.Module; import com.sun.syndication.io.ModuleGenerator; -import org.jdom.Element; +import org.jdom2.Element; import java.util.HashSet; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java index 7534720..ac895fb 100644 --- a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java +++ b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java @@ -19,8 +19,8 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.module.Module; import com.sun.syndication.io.ModuleParser; import com.sun.syndication.io.WireFeedParser; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java index f2724b8..81c014c 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java @@ -19,9 +19,9 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.rss.*; import com.sun.syndication.io.FeedException; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java index 7b636a1..94a85f1 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java @@ -22,9 +22,9 @@ import com.sun.syndication.feed.rss.Image; import com.sun.syndication.feed.rss.Item; import com.sun.syndication.feed.rss.TextInput; import com.sun.syndication.io.FeedException; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.ArrayList; import java.util.Collection; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeGenerator.java b/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeGenerator.java index 37950f3..e86cd2c 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeGenerator.java @@ -16,9 +16,9 @@ */ package com.sun.syndication.io.impl; -import org.jdom.DocType; -import org.jdom.Document; -import org.jdom.Element; +import org.jdom2.DocType; +import org.jdom2.Document; +import org.jdom2.Element; /** * Feed Generator for RSS 0.91 diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeParser.java b/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeParser.java index aaf979b..5de4b7f 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeParser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091NetscapeParser.java @@ -16,7 +16,7 @@ */ package com.sun.syndication.io.impl; -import org.jdom.*; +import org.jdom2.*; /** */ diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java index ad7c3b1..d83cb05 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java @@ -22,10 +22,10 @@ import com.sun.syndication.feed.rss.Image; import com.sun.syndication.feed.rss.Item; import com.sun.syndication.io.FeedException; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Attribute; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.Date; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java index ab07bdb..86a0157 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java @@ -22,10 +22,10 @@ import com.sun.syndication.feed.rss.Content; import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Image; import com.sun.syndication.feed.rss.Item; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Attribute; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.*; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java index e665c88..12a03d5 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java @@ -18,8 +18,8 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.*; import com.sun.syndication.io.FeedException; -import org.jdom.Attribute; -import org.jdom.Element; +import org.jdom2.Attribute; +import org.jdom2.Element; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java index ea930cd..9eacee7 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java @@ -24,7 +24,7 @@ import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Enclosure; import com.sun.syndication.feed.rss.Item; import com.sun.syndication.feed.rss.Source; -import org.jdom.Element; +import org.jdom2.Element; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS093Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS093Generator.java index 3025c46..d0c5bee 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS093Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS093Generator.java @@ -17,7 +17,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.Item; -import org.jdom.Element; +import org.jdom2.Element; import java.util.Date; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS093Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS093Parser.java index 61f6202..f5aaaee 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS093Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS093Parser.java @@ -17,7 +17,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.Item; -import org.jdom.Element; +import org.jdom2.Element; /** */ diff --git a/src/main/java/com/sun/syndication/io/impl/RSS094Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS094Generator.java index a0b3b1b..5009beb 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS094Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS094Generator.java @@ -18,8 +18,8 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Item; -import org.jdom.Attribute; -import org.jdom.Element; +import org.jdom2.Attribute; +import org.jdom2.Element; /** * Feed Generator for RSS 0.94 diff --git a/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java index d2f84a6..61c5c86 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java @@ -21,7 +21,7 @@ import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Guid; import com.sun.syndication.feed.rss.Item; -import org.jdom.Element; +import org.jdom2.Element; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java index 5be2728..9ffdc7d 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java @@ -20,8 +20,8 @@ import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Item; import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.io.FeedException; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java index 22965d2..0547211 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java @@ -21,9 +21,9 @@ import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.feed.rss.Content; import com.sun.syndication.feed.rss.Description; import com.sun.syndication.feed.rss.Item; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java index 4df28dc..14e23ab 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java @@ -20,7 +20,7 @@ import com.sun.syndication.feed.rss.Category; import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.feed.rss.Guid; import com.sun.syndication.feed.rss.Item; -import org.jdom.Element; +import org.jdom2.Element; import java.util.List; diff --git a/src/main/java/com/sun/syndication/io/impl/RSS20Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS20Parser.java index d909fa1..e3e6e66 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS20Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS20Parser.java @@ -17,9 +17,9 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.rss.Description; -import org.jdom.Attribute; -import org.jdom.Document; -import org.jdom.Element; +import org.jdom2.Attribute; +import org.jdom2.Document; +import org.jdom2.Element; /** */ diff --git a/src/main/java/com/sun/syndication/io/impl/RSS20wNSParser.java b/src/main/java/com/sun/syndication/io/impl/RSS20wNSParser.java index 0292458..d981f0f 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS20wNSParser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS20wNSParser.java @@ -16,9 +16,9 @@ */ package com.sun.syndication.io.impl; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.Namespace; import com.sun.syndication.feed.WireFeed; diff --git a/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java b/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java index 7e717c6..e432e1a 100644 --- a/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java @@ -19,8 +19,8 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.SyModule; import com.sun.syndication.io.ModuleGenerator; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Element; +import org.jdom2.Namespace; import java.util.Set; import java.util.HashSet; diff --git a/src/main/java/com/sun/syndication/io/impl/SyModuleParser.java b/src/main/java/com/sun/syndication/io/impl/SyModuleParser.java index 3ec6adf..ac1961a 100644 --- a/src/main/java/com/sun/syndication/io/impl/SyModuleParser.java +++ b/src/main/java/com/sun/syndication/io/impl/SyModuleParser.java @@ -20,8 +20,8 @@ import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.SyModule; import com.sun.syndication.feed.module.SyModuleImpl; import com.sun.syndication.io.ModuleParser; -import org.jdom.Element; -import org.jdom.Namespace; +import org.jdom2.Element; +import org.jdom2.Namespace; /** */ diff --git a/src/test/java/com/sun/syndication/unittest/FeedTest.java b/src/test/java/com/sun/syndication/unittest/FeedTest.java index 2ce8b1b..8a4104e 100644 --- a/src/test/java/com/sun/syndication/unittest/FeedTest.java +++ b/src/test/java/com/sun/syndication/unittest/FeedTest.java @@ -11,8 +11,8 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.InputStream; -import org.jdom.Document; -import org.jdom.input.SAXBuilder; +import org.jdom2.Document; +import org.jdom2.input.SAXBuilder; /** * @author pat, tucu diff --git a/src/test/java/com/sun/syndication/unittest/TestXmlFixerReader.java b/src/test/java/com/sun/syndication/unittest/TestXmlFixerReader.java index a0b7ef7..443b520 100644 --- a/src/test/java/com/sun/syndication/unittest/TestXmlFixerReader.java +++ b/src/test/java/com/sun/syndication/unittest/TestXmlFixerReader.java @@ -19,7 +19,7 @@ package com.sun.syndication.unittest; import com.sun.syndication.io.XmlReader; import com.sun.syndication.io.impl.XmlFixerReader; import junit.framework.TestCase; -import org.jdom.input.SAXBuilder; +import org.jdom2.input.SAXBuilder; import java.io.*; diff --git a/src/test/java/com/sun/syndication/unittest/issues/Issue1Test.java b/src/test/java/com/sun/syndication/unittest/issues/Issue1Test.java index 0b65420..4868ee2 100644 --- a/src/test/java/com/sun/syndication/unittest/issues/Issue1Test.java +++ b/src/test/java/com/sun/syndication/unittest/issues/Issue1Test.java @@ -20,7 +20,7 @@ import com.sun.syndication.io.impl.XmlFixerReader; import com.sun.syndication.io.XmlReader; import com.sun.syndication.unittest.SyndFeedTest; -import org.jdom.input.SAXBuilder; +import org.jdom2.input.SAXBuilder; import java.io.BufferedReader; import java.io.ByteArrayInputStream; From 218fb2d6c98dbbc645841d6ff7b6ff5482252147 Mon Sep 17 00:00:00 2001 From: Patrick Gotthard Date: Thu, 3 Oct 2013 16:20:28 +0200 Subject: [PATCH 2/2] Updating ROME to use generics --- .../com/sun/syndication/feed/WireFeed.java | 14 +- .../com/sun/syndication/feed/atom/Entry.java | 45 +++---- .../com/sun/syndication/feed/atom/Feed.java | 8 +- .../com/sun/syndication/feed/atom/Person.java | 8 +- .../syndication/feed/module/DCModuleImpl.java | 120 +++++++++--------- .../com/sun/syndication/feed/rss/Channel.java | 4 +- .../com/sun/syndication/feed/rss/Item.java | 16 ++- .../feed/synd/SyndCategoryImpl.java | 2 +- .../sun/syndication/feed/synd/SyndEntry.java | 6 +- .../syndication/feed/synd/SyndEntryImpl.java | 34 ++--- .../sun/syndication/feed/synd/SyndFeed.java | 8 +- .../syndication/feed/synd/SyndFeedImpl.java | 63 ++++----- .../syndication/feed/synd/SyndPersonImpl.java | 8 +- .../feed/synd/impl/ConverterForAtom03.java | 88 ++++++------- .../feed/synd/impl/ConverterForAtom10.java | 108 ++++++++-------- .../feed/synd/impl/ConverterForRSS090.java | 22 ++-- .../synd/impl/ConverterForRSS091Userland.java | 8 +- .../feed/synd/impl/ConverterForRSS092.java | 28 ++-- .../feed/synd/impl/ConverterForRSS094.java | 14 +- .../feed/synd/impl/ConverterForRSS10.java | 4 +- .../sun/syndication/io/ModuleGenerator.java | 1 - .../syndication/io/impl/Atom03Generator.java | 18 +-- .../sun/syndication/io/impl/Atom03Parser.java | 34 ++--- .../syndication/io/impl/Atom10Generator.java | 28 ++-- .../sun/syndication/io/impl/Atom10Parser.java | 44 +++---- .../io/impl/BaseWireFeedParser.java | 15 ++- .../io/impl/DCModuleGenerator.java | 16 +-- .../syndication/io/impl/DCModuleParser.java | 26 ++-- .../syndication/io/impl/ModuleParsers.java | 10 +- .../syndication/io/impl/PropertiesLoader.java | 12 +- .../syndication/io/impl/RSS090Generator.java | 6 +- .../sun/syndication/io/impl/RSS090Parser.java | 25 ++-- .../io/impl/RSS091UserlandGenerator.java | 10 +- .../io/impl/RSS091UserlandParser.java | 13 +- .../syndication/io/impl/RSS092Generator.java | 6 +- .../sun/syndication/io/impl/RSS092Parser.java | 12 +- .../syndication/io/impl/RSS093Generator.java | 3 +- .../sun/syndication/io/impl/RSS094Parser.java | 2 +- .../syndication/io/impl/RSS10Generator.java | 2 +- .../sun/syndication/io/impl/RSS10Parser.java | 2 +- .../syndication/io/impl/RSS20Generator.java | 2 +- .../io/impl/SyModuleGenerator.java | 6 +- .../syndication/io/impl/XmlFixerReader.java | 2 +- .../syndication/unittest/SyndFeedTest.java | 4 +- .../unittest/TestSyndFeedAtom03.java | 2 +- .../TestSyndFeedAtom03DCSyModules.java | 2 +- .../unittest/TestSyndFeedAtom10.java | 13 +- .../unittest/TestSyndFeedAtom10Bray.java | 4 - .../unittest/TestSyndFeedAtom10b.java | 5 +- .../unittest/TestSyndFeedAtom10prefix.java | 8 -- .../unittest/TestSyndFeedRSS090.java | 2 +- .../unittest/TestSyndFeedRSS091N.java | 2 +- .../unittest/TestSyndFeedRSS092.java | 14 +- .../unittest/TestSyndFeedRSS092Alt.java | 8 +- .../unittest/TestSyndFeedRSS093.java | 2 +- .../unittest/TestSyndFeedRSS094.java | 2 +- .../unittest/TestSyndFeedRSS10.java | 2 +- .../unittest/TestSyndFeedRSS10DCMulti.java | 2 +- .../TestSyndFeedRSS10DCSyModules.java | 2 +- .../unittest/TestSyndFeedRSS20.java | 2 +- .../syndication/unittest/TestXmlReader.java | 4 +- 61 files changed, 496 insertions(+), 487 deletions(-) diff --git a/src/main/java/com/sun/syndication/feed/WireFeed.java b/src/main/java/com/sun/syndication/feed/WireFeed.java index 1799f9c..670427e 100644 --- a/src/main/java/com/sun/syndication/feed/WireFeed.java +++ b/src/main/java/com/sun/syndication/feed/WireFeed.java @@ -26,6 +26,8 @@ import java.util.List; import java.util.ArrayList; import java.io.Serializable; +import org.jdom2.Element; + /** * Parent class of the RSS (Channel) and Atom (Feed) feed beans. *

@@ -44,7 +46,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable { private String _feedType; private String _encoding; private List _modules; - private List _foreignMarkup; + private List _foreignMarkup; /** * Default constructor, for bean cloning purposes only. @@ -94,7 +96,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable { return false; } // can't use foreign markup in equals, due to JDOM equals impl - Object fm = getForeignMarkup(); + List fm = getForeignMarkup(); setForeignMarkup(((WireFeed)other).getForeignMarkup()); boolean ret = _objBean.equals(other); // restore foreign markup @@ -214,8 +216,8 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable { * @return Opaque object to discourage use * */ - public Object getForeignMarkup() { - return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; + public List getForeignMarkup() { + return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; } /** @@ -224,7 +226,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup) { - _foreignMarkup = (List)foreignMarkup; + public void setForeignMarkup(List foreignMarkup) { + _foreignMarkup = (List)foreignMarkup; } } diff --git a/src/main/java/com/sun/syndication/feed/atom/Entry.java b/src/main/java/com/sun/syndication/feed/atom/Entry.java index 848188d..e26363d 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Entry.java +++ b/src/main/java/com/sun/syndication/feed/atom/Entry.java @@ -16,18 +16,19 @@ */ package com.sun.syndication.feed.atom; -import com.sun.syndication.feed.impl.ObjectBean; -import com.sun.syndication.feed.module.Extendable; -import com.sun.syndication.feed.module.Module; -import com.sun.syndication.feed.module.impl.ModuleUtils; - import java.io.Serializable; - import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; +import org.jdom2.Element; + +import com.sun.syndication.feed.impl.ObjectBean; +import com.sun.syndication.feed.module.Extendable; +import com.sun.syndication.feed.module.Module; +import com.sun.syndication.feed.module.impl.ModuleUtils; + /** * Bean for entry elements of Atom feeds. @@ -47,7 +48,7 @@ public class Entry implements Cloneable, Serializable, Extendable { private List _categories; private List _contents; private List _contributors; - private List _foreignMarkup; + private List _foreignMarkup; private List _modules; private List _otherLinks; private ObjectBean _objBean; @@ -80,7 +81,7 @@ public class Entry implements Cloneable, Serializable, Extendable { * @return a list of Link elements with the entry alternate links, an empty list if none. */ public List getAlternateLinks() { - return (_alternateLinks == null) ? (_alternateLinks = new ArrayList()) : _alternateLinks; + return (_alternateLinks == null) ? (_alternateLinks = new ArrayList()) : _alternateLinks; } /** @@ -109,7 +110,7 @@ public class Entry implements Cloneable, Serializable, Extendable { * @param categories The categories to set. * @since Atom 1.0 */ - public void setCategories(List categories) { + public void setCategories(List categories) { _categories = categories; } @@ -119,8 +120,8 @@ public class Entry implements Cloneable, Serializable, Extendable { * @return Returns the categories. * @since Atom 1.0 */ - public List getCategories() { - return (_categories == null) ? (_categories = new ArrayList()) : _categories; + public List getCategories() { + return (_categories == null) ? (_categories = new ArrayList()) : _categories; } /** @@ -129,7 +130,7 @@ public class Entry implements Cloneable, Serializable, Extendable { * @param contents the list of Content elements with the entry contents to set, * an empty list or null if none. */ - public void setContents(List contents) { + public void setContents(List contents) { _contents = contents; } @@ -162,7 +163,7 @@ public class Entry implements Cloneable, Serializable, Extendable { * */ public List getContributors() { - return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors; + return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors; } /** @@ -189,8 +190,8 @@ public class Entry implements Cloneable, Serializable, Extendable { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup) { - _foreignMarkup = (List) foreignMarkup; + public void setForeignMarkup(List foreignMarkup) { + _foreignMarkup = (List) foreignMarkup; } /** @@ -199,8 +200,8 @@ public class Entry implements Cloneable, Serializable, Extendable { * @return list of Opaque object to discourage use * */ - public Object getForeignMarkup() { - return (_foreignMarkup == null) ? (_foreignMarkup = new ArrayList()) : _foreignMarkup; + public List getForeignMarkup() { + return (_foreignMarkup == null) ? (_foreignMarkup = new ArrayList()) : _foreignMarkup; } /** @@ -248,7 +249,7 @@ public class Entry implements Cloneable, Serializable, Extendable { */ public boolean isMediaEntry() { boolean mediaEntry = false; - List links = getOtherLinks(); + List links = getOtherLinks(); for (Iterator it = links.iterator(); it.hasNext();) { Link link = it.next(); @@ -298,7 +299,7 @@ public class Entry implements Cloneable, Serializable, Extendable { * an empty list or null if none. * */ - public void setModules(List modules) { + public void setModules(List modules) { _modules = modules; } @@ -309,8 +310,8 @@ public class Entry implements Cloneable, Serializable, Extendable { * an emtpy list if none. * */ - public List getModules() { - return (_modules == null) ? (_modules = new ArrayList()) : _modules; + public List getModules() { + return (_modules == null) ? (_modules = new ArrayList()) : _modules; } /** @@ -527,7 +528,7 @@ public class Entry implements Cloneable, Serializable, Extendable { return false; } // can't use foreign markup in equals, due to JDOM equals impl - Object fm = getForeignMarkup(); + List fm = getForeignMarkup(); setForeignMarkup(((Entry) other).getForeignMarkup()); boolean ret = _objBean.equals(other); diff --git a/src/main/java/com/sun/syndication/feed/atom/Feed.java b/src/main/java/com/sun/syndication/feed/atom/Feed.java index e79b81b..7a5677f 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Feed.java +++ b/src/main/java/com/sun/syndication/feed/atom/Feed.java @@ -161,7 +161,7 @@ public class Feed extends WireFeed { * an empty list if none. */ public List getOtherLinks() { - return (_otherLinks==null) ? (_otherLinks=new ArrayList()) : _otherLinks; + return (_otherLinks==null) ? (_otherLinks=new ArrayList()) : _otherLinks; } /** @@ -346,7 +346,7 @@ public class Feed extends WireFeed { * an empty list or null if none. * */ - public void setEntries(List entries) { + public void setEntries(List entries) { _entries = entries; } @@ -390,8 +390,8 @@ public class Feed extends WireFeed { * @return Returns the categories. * @since Atom 1.0 */ - public List getCategories() { - return (_categories==null) ? (_categories=new ArrayList()) : _categories; + public List getCategories() { + return (_categories==null) ? (_categories=new ArrayList()) : _categories; } /** diff --git a/src/main/java/com/sun/syndication/feed/atom/Person.java b/src/main/java/com/sun/syndication/feed/atom/Person.java index 29f178f..28495d9 100644 --- a/src/main/java/com/sun/syndication/feed/atom/Person.java +++ b/src/main/java/com/sun/syndication/feed/atom/Person.java @@ -40,7 +40,7 @@ public class Person implements Cloneable,Serializable, Extendable private String _uri; // since Atom 1.0 (was called url) private String _uriResolved; private String _email; - private List _modules; + private List _modules; /** * Default constructor. All properties are set to null. @@ -192,8 +192,8 @@ public class Person implements Cloneable,Serializable, Extendable * an emtpy list if none. * */ - public List getModules() { - return (_modules==null) ? (_modules=new ArrayList()) : _modules; + public List getModules() { + return (_modules==null) ? (_modules=new ArrayList()) : _modules; } /** @@ -203,7 +203,7 @@ public class Person implements Cloneable,Serializable, Extendable * an empty list or null if none. * */ - public void setModules(List modules) { + public void setModules(List modules) { _modules = modules; } diff --git a/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java b/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java index 7359efc..047666c 100644 --- a/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java +++ b/src/main/java/com/sun/syndication/feed/module/DCModuleImpl.java @@ -51,7 +51,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { /** * Properties to be ignored when cloning. */ - private static final Set IGNORE_PROPERTIES = new HashSet(); + private static final Set IGNORE_PROPERTIES = new HashSet(); /** * Unmodifiable Set containing the convenience properties of this class. @@ -60,7 +60,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * properties can be ignored as the will be copied as part of the module * cloning. */ - public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); + public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); static { IGNORE_PROPERTIES.add("title"); @@ -97,8 +97,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getTitles() { - return (_title == null) ? (_title = new ArrayList()) : _title; + public List getTitles() { + return (_title == null) ? (_title = new ArrayList()) : _title; } /** @@ -108,7 +108,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * titles to set, an empty list or null if none. * */ - public void setTitles(List titles) { + public void setTitles(List titles) { _title = titles; } @@ -130,7 +130,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setTitle(String title) { - _title = new ArrayList(); + _title = new ArrayList(); _title.add(title); } @@ -141,8 +141,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getCreators() { - return (_creator == null) ? (_creator = new ArrayList()) : _creator; + public List getCreators() { + return (_creator == null) ? (_creator = new ArrayList()) : _creator; } /** @@ -152,7 +152,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * creators to set, an empty list or null if none. * */ - public void setCreators(List creators) { + public void setCreators(List creators) { _creator = creators; } @@ -174,7 +174,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setCreator(String creator) { - _creator = new ArrayList(); + _creator = new ArrayList(); _creator.add(creator); } @@ -185,8 +185,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getSubjects() { - return (_subject == null) ? (_subject = new ArrayList()) : _subject; + public List getSubjects() { + return (_subject == null) ? (_subject = new ArrayList()) : _subject; } /** @@ -196,7 +196,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * module subjects to set, an empty list or null if none. * */ - public void setSubjects(List subjects) { + public void setSubjects(List subjects) { _subject = subjects; } @@ -219,7 +219,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setSubject(DCSubject subject) { - _subject = new ArrayList(); + _subject = new ArrayList(); _subject.add(subject); } @@ -230,8 +230,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * description, an empty list if none. * */ - public List getDescriptions() { - return (_description == null) ? (_description = new ArrayList()) : _description; + public List getDescriptions() { + return (_description == null) ? (_description = new ArrayList()) : _description; } /** @@ -241,7 +241,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * module descriptions to set, an empty list or null if none. * */ - public void setDescriptions(List descriptions) { + public void setDescriptions(List descriptions) { _description = descriptions; } @@ -264,7 +264,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setDescription(String description) { - _description = new ArrayList(); + _description = new ArrayList(); _description.add(description); } @@ -275,8 +275,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getPublishers() { - return (_publisher == null) ? (_publisher = new ArrayList()) : _publisher; + public List getPublishers() { + return (_publisher == null) ? (_publisher = new ArrayList()) : _publisher; } /** @@ -286,7 +286,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * publishers to set, an empty list or null if none. * */ - public void setPublishers(List publishers) { + public void setPublishers(List publishers) { _publisher = publishers; } @@ -309,7 +309,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setPublisher(String publisher) { - _publisher = new ArrayList(); + _publisher = new ArrayList(); _publisher.add(publisher); } @@ -320,8 +320,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getContributors() { - return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors; + public List getContributors() { + return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors; } /** @@ -331,7 +331,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * module contributors to set, an empty list or null if none. * */ - public void setContributors(List contributors) { + public void setContributors(List contributors) { _contributors = contributors; } @@ -354,7 +354,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setContributor(String contributor) { - _contributors = new ArrayList(); + _contributors = new ArrayList(); _contributors.add(contributor); } @@ -366,7 +366,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public List getDates() { - return (_date == null) ? (_date = new ArrayList()) : _date; + return (_date == null) ? (_date = new ArrayList()) : _date; } /** @@ -398,7 +398,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setDate(Date date) { - _date = new ArrayList(); + _date = new ArrayList(); _date.add(date); } @@ -409,8 +409,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getTypes() { - return (_type == null) ? (_type = new ArrayList()) : _type; + public List getTypes() { + return (_type == null) ? (_type = new ArrayList()) : _type; } /** @@ -420,7 +420,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * to set, an empty list or null if none. * */ - public void setTypes(List types) { + public void setTypes(List types) { _type = types; } @@ -443,7 +443,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setType(String type) { - _type = new ArrayList(); + _type = new ArrayList(); _type.add(type); } @@ -454,8 +454,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getFormats() { - return (_format == null) ? (_format = new ArrayList()) : _format; + public List getFormats() { + return (_format == null) ? (_format = new ArrayList()) : _format; } /** @@ -465,7 +465,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * formats to set, an empty list or null if none. * */ - public void setFormats(List formats) { + public void setFormats(List formats) { _format = formats; } @@ -488,7 +488,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setFormat(String format) { - _format = new ArrayList(); + _format = new ArrayList(); _format.add(format); } @@ -499,8 +499,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getIdentifiers() { - return (_identifier == null) ? (_identifier = new ArrayList()) : _identifier; + public List getIdentifiers() { + return (_identifier == null) ? (_identifier = new ArrayList()) : _identifier; } /** @@ -510,7 +510,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * identifiers to set, an empty list or null if none. * */ - public void setIdentifiers(List identifiers) { + public void setIdentifiers(List identifiers) { _identifier = identifiers; } @@ -533,7 +533,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setIdentifier(String identifier) { - _identifier = new ArrayList(); + _identifier = new ArrayList(); _identifier.add(identifier); } @@ -544,8 +544,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getSources() { - return (_source == null) ? (_source = new ArrayList()) : _source; + public List getSources() { + return (_source == null) ? (_source = new ArrayList()) : _source; } /** @@ -555,7 +555,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * sources to set, an empty list or null if none. * */ - public void setSources(List sources) { + public void setSources(List sources) { _source = sources; } @@ -578,7 +578,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setSource(String source) { - _source = new ArrayList(); + _source = new ArrayList(); _source.add(source); } @@ -589,8 +589,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getLanguages() { - return (_language == null) ? (_language = new ArrayList()) : _language; + public List getLanguages() { + return (_language == null) ? (_language = new ArrayList()) : _language; } /** @@ -600,7 +600,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * languages to set, an empty list or null if none. * */ - public void setLanguages(List languages) { + public void setLanguages(List languages) { _language = languages; } @@ -622,7 +622,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setLanguage(String language) { - _language = new ArrayList(); + _language = new ArrayList(); _language.add(language); } @@ -633,8 +633,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getRelations() { - return (_relation == null) ? (_relation = new ArrayList()) : _relation; + public List getRelations() { + return (_relation == null) ? (_relation = new ArrayList()) : _relation; } /** @@ -644,7 +644,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * relations to set, an empty list or null if none. * */ - public void setRelations(List relations) { + public void setRelations(List relations) { _relation = relations; } @@ -667,7 +667,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setRelation(String relation) { - _relation = new ArrayList(); + _relation = new ArrayList(); _relation.add(relation); } @@ -678,8 +678,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getCoverages() { - return (_coverage == null) ? (_coverage = new ArrayList()) : _coverage; + public List getCoverages() { + return (_coverage == null) ? (_coverage = new ArrayList()) : _coverage; } /** @@ -689,7 +689,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * coverages to set, an empty list or null if none. * */ - public void setCoverages(List coverages) { + public void setCoverages(List coverages) { _coverage = coverages; } @@ -712,7 +712,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setCoverage(String coverage) { - _coverage = new ArrayList(); + _coverage = new ArrayList(); _coverage.add(coverage); } @@ -723,8 +723,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * an empty list if none. * */ - public List getRightsList() { - return (_rights == null) ? (_rights = new ArrayList()) : _rights; + public List getRightsList() { + return (_rights == null) ? (_rights = new ArrayList()) : _rights; } /** @@ -734,7 +734,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * rights to set, an empty list or null if none. * */ - public void setRightsList(List rights) { + public void setRightsList(List rights) { _rights = rights; } @@ -757,7 +757,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule { * */ public void setRights(String rights) { - _rights = new ArrayList(); + _rights = new ArrayList(); _rights.add(rights); } diff --git a/src/main/java/com/sun/syndication/feed/rss/Channel.java b/src/main/java/com/sun/syndication/feed/rss/Channel.java index a9e6749..53273ba 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Channel.java +++ b/src/main/java/com/sun/syndication/feed/rss/Channel.java @@ -60,7 +60,7 @@ public class Channel extends WireFeed { private String _link; private String _uri; private Image _image; - private List _items; + private List _items; private TextInput _textInput; private String _language; private String _rating; @@ -403,7 +403,7 @@ public class Channel extends WireFeed { * */ public List getSkipHours() { - return (_skipHours!=null) ? _skipHours : new ArrayList(); + return (_skipHours!=null) ? _skipHours : new ArrayList(); } /** diff --git a/src/main/java/com/sun/syndication/feed/rss/Item.java b/src/main/java/com/sun/syndication/feed/rss/Item.java index 9931dd8..9063bd1 100644 --- a/src/main/java/com/sun/syndication/feed/rss/Item.java +++ b/src/main/java/com/sun/syndication/feed/rss/Item.java @@ -27,6 +27,8 @@ import java.util.Date; import java.util.List; import java.io.Serializable; +import org.jdom2.Element; + /** * Bean for items of RSS feeds. *

@@ -54,7 +56,7 @@ public class Item implements Cloneable, Serializable, Extendable { private Date _pubDate; private Date _expirationDate; private List _modules; - private List _foreignMarkup; + private List _foreignMarkup; /** * Default constructor. All properties are set to null. @@ -90,7 +92,7 @@ public class Item implements Cloneable, Serializable, Extendable { return false; } // can't use foreign markup in equals, due to JDOM equals impl - Object fm = getForeignMarkup(); + List fm = getForeignMarkup(); setForeignMarkup(((Item)other).getForeignMarkup()); boolean ret = _objBean.equals(other); // restore foreign markup @@ -269,7 +271,7 @@ public class Item implements Cloneable, Serializable, Extendable { * an empty list if none. * */ - public List getCategories() { + public List getCategories() { return (_categories==null) ? (_categories=new ArrayList()) : _categories; } @@ -423,8 +425,8 @@ public class Item implements Cloneable, Serializable, Extendable { * @return Opaque object to discourage use * */ - public Object getForeignMarkup() { - return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; + public List getForeignMarkup() { + return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; } /** @@ -433,8 +435,8 @@ public class Item implements Cloneable, Serializable, Extendable { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup) { - _foreignMarkup = (List)foreignMarkup; + public void setForeignMarkup(List foreignMarkup) { + _foreignMarkup = (List)foreignMarkup; } } diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java index eacefbb..746eeb3 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndCategoryImpl.java @@ -271,7 +271,7 @@ class SyndCategoryListFacade extends AbstractList { public static List convertElementsSyndCategoryToSubject(List cList) { List sList = null; if (cList!=null) { - sList = new ArrayList(); + sList = new ArrayList(); for (int i=0;i getForeignMarkup(); /** * Sets foreign markup found at channel level. @@ -370,7 +372,7 @@ public interface SyndEntry extends Cloneable, CopyFrom, Extendable { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup); + public void setForeignMarkup(List foreignMarkup); /** * Creates a deep clone of the object. diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java index 13119cd..1fac5e9 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndEntryImpl.java @@ -26,6 +26,8 @@ import com.sun.syndication.feed.impl.CopyFromHelper; import java.util.*; import java.io.Serializable; +import org.jdom2.Element; + /** * Bean for entries of SyndFeedImpl feeds. *

@@ -46,13 +48,13 @@ public class SyndEntryImpl implements Serializable,SyndEntry { private List _authors; private List _contributors; private SyndFeed _source; - private List _foreignMarkup; + private List _foreignMarkup; private Object wireEntry; // com.sun.syndication.feed.atom.Entry or com.sun.syndication.feed.rss.Item // ISSUE: some converters assume this is never null - private List _categories = new ArrayList(); + private List _categories = new ArrayList(); - private static final Set IGNORE_PROPERTIES = new HashSet(); + private static final Set IGNORE_PROPERTIES = new HashSet(); /** * Unmodifiable Set containing the convenience properties of this class. @@ -60,7 +62,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry { * Convenience properties are mapped to Modules, for cloning the convenience properties * can be ignored as the will be copied as part of the module cloning. */ - public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); + public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); static { IGNORE_PROPERTIES.add("publishedDate"); @@ -119,7 +121,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry { return false; } // can't use foreign markup in equals, due to JDOM equals impl - Object fm = getForeignMarkup(); + List fm = getForeignMarkup(); setForeignMarkup(((SyndEntryImpl)other).getForeignMarkup()); boolean ret = _objBean.equals(other); // restore foreign markup @@ -448,7 +450,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry { *

* @param links The links to set. */ - public void setLinks(List links) { + public void setLinks(List links) { _links = links; } @@ -470,14 +472,14 @@ public class SyndEntryImpl implements Serializable,SyndEntry { _updatedDate = new Date(updatedDate.getTime()); } - public List getAuthors() { - return (_authors==null) ? (_authors=new ArrayList()) : _authors; + public List getAuthors() { + return (_authors==null) ? (_authors=new ArrayList()) : _authors; } /* (non-Javadoc) * @see com.sun.syndication.feed.synd.SyndEntry#setAuthors(java.util.List) */ - public void setAuthors(List authors) { + public void setAuthors(List authors) { _authors = authors; } @@ -525,14 +527,14 @@ public class SyndEntryImpl implements Serializable,SyndEntry { } } - public List getContributors() { - return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors; + public List getContributors() { + return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors; } /* (non-Javadoc) * @see com.sun.syndication.feed.synd.SyndEntry#setContributors(java.util.List) */ - public void setContributors(List contributors) { + public void setContributors(List contributors) { _contributors = contributors; } @@ -551,8 +553,8 @@ public class SyndEntryImpl implements Serializable,SyndEntry { * an empty list if none. * */ - public Object getForeignMarkup() { - return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; + public List getForeignMarkup() { + return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; } /** @@ -562,8 +564,8 @@ public class SyndEntryImpl implements Serializable,SyndEntry { * an empty list if none. * */ - public void setForeignMarkup(Object foreignMarkup) { - _foreignMarkup = (List)foreignMarkup; + public void setForeignMarkup(List foreignMarkup) { + _foreignMarkup = (List)foreignMarkup; } public Object getWireEntry() { diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndFeed.java b/src/main/java/com/sun/syndication/feed/synd/SyndFeed.java index c6ba350..97e0dba 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndFeed.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndFeed.java @@ -24,6 +24,8 @@ import com.sun.syndication.feed.module.Module; import java.util.Date; import java.util.List; +import org.jdom2.Element; + /** * Bean interface for all types of feeds. *

@@ -486,7 +488,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable { * an empty list or null if none. * */ - void setModules(List modules); + void setModules(List modules); /** * Returns foreign markup found at channel level. @@ -494,7 +496,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable { * @return Opaque object to discourage use * */ - public Object getForeignMarkup(); + public List getForeignMarkup(); /** * Sets foreign markup found at channel level. @@ -502,7 +504,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup); + public void setForeignMarkup(List foreignMarkup); /** * Creates a deep clone of the object. diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java index 4e8ff37..64d8848 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndFeedImpl.java @@ -17,6 +17,7 @@ package com.sun.syndication.feed.synd; import com.sun.syndication.feed.CopyFrom; +import com.sun.syndication.feed.atom.Person; import com.sun.syndication.feed.impl.ObjectBean; import com.sun.syndication.feed.impl.CopyFromHelper; import com.sun.syndication.feed.WireFeed; @@ -28,6 +29,8 @@ import com.sun.syndication.feed.synd.impl.URINormalizer; import java.util.*; import java.io.Serializable; +import org.jdom2.Element; + /** * Bean for all types of feeds. *

@@ -46,20 +49,20 @@ public class SyndFeedImpl implements Serializable, SyndFeed { private SyndContent _description; private String _feedType; private String _link; - private List _links; + private List _links; private SyndImage _image; - private List _entries; - private List _modules; - private List _authors; - private List _contributors; - private List _foreignMarkup; + private List _entries; + private List _modules; + private List _authors; + private List _contributors; + private List _foreignMarkup; private WireFeed wireFeed = null; private boolean preserveWireFeed = false; private static final Converters CONVERTERS = new Converters(); - private static final Set IGNORE_PROPERTIES = new HashSet(); + private static final Set IGNORE_PROPERTIES = new HashSet(); /** * Unmodifiable Set containing the convenience properties of this class. @@ -68,7 +71,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * can be ignored as the will be copied as part of the module cloning. */ - public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); + public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES); static { IGNORE_PROPERTIES.add("publishedDate"); @@ -170,7 +173,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { return false; } // can't use foreign markup in equals, due to JDOM equals impl - Object fm = getForeignMarkup(); + List fm = getForeignMarkup(); setForeignMarkup(((SyndFeedImpl)other).getForeignMarkup()); boolean ret = _objBean.equals(other); // restore foreign markup @@ -543,7 +546,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list if none. * */ - public List getCategories() { + public List getCategories() { return new SyndCategoryListFacade(getDCModule().getSubjects()); } @@ -556,7 +559,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list or null if none. * */ - public void setCategories(List categories) { + public void setCategories(List categories) { getDCModule().setSubjects(SyndCategoryListFacade.convertElementsSyndCategoryToSubject(categories)); } @@ -567,8 +570,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list if none. * */ - public List getEntries() { - return (_entries==null) ? (_entries=new ArrayList()) : _entries; + public List getEntries() { + return (_entries==null) ? (_entries=new ArrayList()) : _entries; } /** @@ -578,7 +581,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list or null if none. * */ - public void setEntries(List entries) { + public void setEntries(List entries) { _entries = entries; } @@ -613,9 +616,9 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list if none. * */ - public List getModules() { + public List getModules() { if (_modules==null) { - _modules=new ArrayList(); + _modules=new ArrayList(); } if (ModuleUtils.getModule(_modules,DCModule.URI)==null) { _modules.add(new DCModuleImpl()); @@ -631,7 +634,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * an empty list or null if none. * */ - public void setModules(List modules) { + public void setModules(List modules) { _modules = modules; } @@ -693,8 +696,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed { *

* @return Returns the links. */ - public List getLinks() { - return (_links==null) ? (_links=new ArrayList()) : _links; + public List getLinks() { + return (_links==null) ? (_links=new ArrayList()) : _links; } /** @@ -702,15 +705,15 @@ public class SyndFeedImpl implements Serializable, SyndFeed { *

* @param links The links to set. */ - public void setLinks(List links) { + public void setLinks(List links) { _links = links; } - public List getAuthors() { - return (_authors==null) ? (_authors=new ArrayList()) : _authors; + public List getAuthors() { + return (_authors==null) ? (_authors=new ArrayList()) : _authors; } - public void setAuthors(List authors) { + public void setAuthors(List authors) { this._authors = authors; } @@ -738,11 +741,11 @@ public class SyndFeedImpl implements Serializable, SyndFeed { getDCModule().setCreator(author); } - public List getContributors() { - return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors; + public List getContributors() { + return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors; } - public void setContributors(List contributors) { + public void setContributors(List contributors) { this._contributors = contributors; } @@ -752,8 +755,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * @return Opaque object to discourage use * */ - public Object getForeignMarkup() { - return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; + public List getForeignMarkup() { + return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup; } /** @@ -762,8 +765,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed { * @param foreignMarkup Opaque object to discourage use * */ - public void setForeignMarkup(Object foreignMarkup) { - _foreignMarkup = (List)foreignMarkup; + public void setForeignMarkup(List foreignMarkup) { + _foreignMarkup = (List)foreignMarkup; } public boolean isPreservingWireFeed() { diff --git a/src/main/java/com/sun/syndication/feed/synd/SyndPersonImpl.java b/src/main/java/com/sun/syndication/feed/synd/SyndPersonImpl.java index c6c7989..19e20bc 100644 --- a/src/main/java/com/sun/syndication/feed/synd/SyndPersonImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/SyndPersonImpl.java @@ -36,7 +36,7 @@ public class SyndPersonImpl implements Serializable, SyndPerson { private String _name; private String _uri; private String _email; - private List _modules; + private List _modules; /** * For implementations extending SyndContentImpl to be able to use the ObjectBean functionality @@ -163,10 +163,10 @@ public class SyndPersonImpl implements Serializable, SyndPerson { * @return a list of ModuleImpl elements with the person modules, * an empty list if none. */ - public List getModules() + public List getModules() { if (_modules==null) { - _modules=new ArrayList(); + _modules=new ArrayList(); } return _modules; } @@ -178,7 +178,7 @@ public class SyndPersonImpl implements Serializable, SyndPerson { * an empty list or null if none. * */ - public void setModules(List modules) { + public void setModules(List modules) { _modules = modules; } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java index 74dd500..ff1612a 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java @@ -42,6 +42,8 @@ import java.util.List; import java.util.Date; import java.util.Iterator; +import org.jdom2.Element; + /** */ public class ConverterForAtom03 implements Converter { @@ -64,7 +66,7 @@ public class ConverterForAtom03 implements Converter { syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules())); - if (((List)feed.getForeignMarkup()).size() > 0) { + if (((List)feed.getForeignMarkup()).size() > 0) { syndFeed.setForeignMarkup(feed.getForeignMarkup()); } @@ -81,7 +83,7 @@ public class ConverterForAtom03 implements Converter { syndFeed.setLink(theLink.getHrefResolved()); } // lump alternate and other links together - List syndLinks = new ArrayList(); + List syndLinks = new ArrayList(); if (aFeed.getAlternateLinks() != null && aFeed.getAlternateLinks().size() > 0) { syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks())); @@ -98,7 +100,7 @@ public class ConverterForAtom03 implements Converter { } - List aEntries = aFeed.getEntries(); + List aEntries = aFeed.getEntries(); if (aEntries!=null) { syndFeed.setEntries(createSyndEntries(aEntries, syndFeed.isPreservingWireFeed())); } @@ -111,7 +113,7 @@ public class ConverterForAtom03 implements Converter { syndFeed.setLanguage(language); } - List authors = aFeed.getAuthors(); + List authors = aFeed.getAuthors(); if (authors!=null && authors.size() > 0) { syndFeed.setAuthors(createSyndPersons(authors)); } @@ -128,9 +130,9 @@ public class ConverterForAtom03 implements Converter { } - protected List createSyndLinks(List aLinks) { - ArrayList sLinks = new ArrayList(); - for (Iterator iter = aLinks.iterator(); iter.hasNext();) { + protected List createSyndLinks(List aLinks) { + ArrayList sLinks = new ArrayList(); + for (Iterator iter = aLinks.iterator(); iter.hasNext();) { Link link = (Link)iter.next(); if (!link.getRel().equals("enclosure")) { SyndLink sLink = createSyndLink(link); @@ -149,8 +151,8 @@ public class ConverterForAtom03 implements Converter { return syndLink; } - protected List createSyndEntries(List atomEntries, boolean preserveWireItems) { - List syndEntries = new ArrayList(); + protected List createSyndEntries(List atomEntries, boolean preserveWireItems) { + List syndEntries = new ArrayList(); for (int i=0;i 0) { - syndEntry.setForeignMarkup((List)entry.getForeignMarkup()); + if (((List)entry.getForeignMarkup()).size() > 0) { + syndEntry.setForeignMarkup((List)entry.getForeignMarkup()); } syndEntry.setTitle(entry.getTitle()); @@ -179,10 +181,10 @@ public class ConverterForAtom03 implements Converter { } // Create synd enclosures from enclosure links - List syndEnclosures = new ArrayList(); + List syndEnclosures = new ArrayList(); if (entry.getOtherLinks() != null && entry.getOtherLinks().size() > 0) { - List oLinks = entry.getOtherLinks(); - for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) { + List oLinks = entry.getOtherLinks(); + for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) { Link thisLink = (Link)iter.next(); if ("enclosure".equals(thisLink.getRel())) syndEnclosures.add(createSyndEnclosure(entry, thisLink)); @@ -191,7 +193,7 @@ public class ConverterForAtom03 implements Converter { syndEntry.setEnclosures(syndEnclosures); // lump alternate and other links together - List syndLinks = new ArrayList(); + List syndLinks = new ArrayList(); if (entry.getAlternateLinks() != null && entry.getAlternateLinks().size() > 0) { syndLinks.addAll(createSyndLinks(entry.getAlternateLinks())); @@ -213,7 +215,7 @@ public class ConverterForAtom03 implements Converter { Content content = entry.getSummary(); if (content==null) { - List contents = entry.getContents(); + List contents = entry.getContents(); if (contents!=null && contents.size()>0) { content = (Content) contents.get(0); } @@ -225,9 +227,9 @@ public class ConverterForAtom03 implements Converter { syndEntry.setDescription(sContent); } - List contents = entry.getContents(); + List contents = entry.getContents(); if (contents.size()>0) { - List sContents = new ArrayList(); + List sContents = new ArrayList(); for (int i=0;i authors = entry.getAuthors(); if (authors!=null && authors.size() > 0) { syndEntry.setAuthors(createSyndPersons(authors)); SyndPerson person0 = (SyndPerson)syndEntry.getAuthors().get(0); @@ -292,11 +294,11 @@ public class ConverterForAtom03 implements Converter { } // separate SyndEntry's links collection into alternate and other links - List alternateLinks = new ArrayList(); - List otherLinks = new ArrayList(); - List slinks = syndFeed.getLinks(); + List alternateLinks = new ArrayList(); + List otherLinks = new ArrayList(); + List slinks = syndFeed.getLinks(); if (slinks != null) { - for (Iterator iter=slinks.iterator(); iter.hasNext();) { + for (Iterator iter=slinks.iterator(); iter.hasNext();) { SyndLink syndLink = (SyndLink)iter.next(); Link link = createAtomLink(syndLink); if (link.getRel() == null || @@ -328,7 +330,7 @@ public class ConverterForAtom03 implements Converter { aFeed.setLanguage(syndFeed.getLanguage()); - List authors = syndFeed.getAuthors(); + List authors = syndFeed.getAuthors(); if (authors!=null && authors.size() > 0) { aFeed.setAuthors(createAtomPersons(authors)); } @@ -337,7 +339,7 @@ public class ConverterForAtom03 implements Converter { aFeed.setModified(syndFeed.getPublishedDate()); - List sEntries = syndFeed.getEntries(); + List sEntries = syndFeed.getEntries(); if (sEntries!=null) { aFeed.setEntries(createAtomEntries(sEntries)); } @@ -345,9 +347,9 @@ public class ConverterForAtom03 implements Converter { return aFeed; } - protected static List createAtomPersons(List sPersons) { - List persons = new ArrayList(); - for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) { + protected static List createAtomPersons(List sPersons) { + List persons = new ArrayList(); + for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) { SyndPerson sPerson = (SyndPerson)iter.next(); Person person = new Person(); person.setName(sPerson.getName()); @@ -359,9 +361,9 @@ public class ConverterForAtom03 implements Converter { return persons; } - protected static List createSyndPersons(List aPersons) { - List persons = new ArrayList(); - for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) { + protected static List createSyndPersons(List aPersons) { + List persons = new ArrayList(); + for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) { Person aPerson = (Person)iter.next(); SyndPerson person = new SyndPersonImpl(); person.setName(aPerson.getName()); @@ -373,8 +375,8 @@ public class ConverterForAtom03 implements Converter { return persons; } - protected List createAtomEntries(List syndEntries) { - List atomEntries = new ArrayList(); + protected List createAtomEntries(List syndEntries) { + List atomEntries = new ArrayList(); for (int i=0;i alternateLinks = new ArrayList(); + List otherLinks = new ArrayList(); + List slinks = sEntry.getLinks(); if (slinks != null) { - for (Iterator iter=slinks.iterator(); iter.hasNext();) { + for (Iterator iter=slinks.iterator(); iter.hasNext();) { SyndLink syndLink = (SyndLink)iter.next(); Link link = createAtomLink(syndLink); if (link.getRel() == null || @@ -427,9 +429,9 @@ public class ConverterForAtom03 implements Converter { alternateLinks.add(link); } - List sEnclosures = sEntry.getEnclosures(); + List sEnclosures = sEntry.getEnclosures(); if (sEnclosures != null) { - for (Iterator iter=sEnclosures.iterator(); iter.hasNext();) { + for (Iterator iter=sEnclosures.iterator(); iter.hasNext();) { SyndEnclosure syndEnclosure = (SyndEnclosure) iter.next(); Link link = createAtomEnclosure(syndEnclosure); otherLinks.add(link); @@ -449,9 +451,9 @@ public class ConverterForAtom03 implements Converter { aEntry.setSummary(content); } - List contents = sEntry.getContents(); + List contents = sEntry.getContents(); if (contents.size()>0) { - List aContents = new ArrayList(); + List aContents = new ArrayList(); for (int i=0;i sAuthors = sEntry.getAuthors(); if (sAuthors!=null && sAuthors.size() > 0) { aEntry.setAuthors(createAtomPersons(sAuthors)); } else if (sEntry.getAuthor() != null) { Person person = new Person(); person.setName(sEntry.getAuthor()); - List authors = new ArrayList(); + List authors = new ArrayList(); authors.add(person); aEntry.setAuthors(authors); } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java index 8f9a6b3..751ceb4 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java @@ -21,6 +21,8 @@ import java.util.Date; import java.util.Iterator; import java.util.List; +import org.jdom2.Element; + import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.atom.Category; import com.sun.syndication.feed.atom.Content; @@ -67,8 +69,8 @@ public class ConverterForAtom10 implements Converter { syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules())); - if (((List)feed.getForeignMarkup()).size() > 0) { - syndFeed.setForeignMarkup((List)feed.getForeignMarkup()); + if (((List)feed.getForeignMarkup()).size() > 0) { + syndFeed.setForeignMarkup((List)feed.getForeignMarkup()); } syndFeed.setEncoding(aFeed.getEncoding()); @@ -98,7 +100,7 @@ public class ConverterForAtom10 implements Converter { syndFeed.setLink(theLink.getHrefResolved()); } // lump alternate and other links together - List syndLinks = new ArrayList(); + List syndLinks = new ArrayList(); if (aFeed.getAlternateLinks() != null && aFeed.getAlternateLinks().size() > 0) { syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks())); @@ -109,7 +111,7 @@ public class ConverterForAtom10 implements Converter { } syndFeed.setLinks(syndLinks); - List aEntries = aFeed.getEntries(); + List aEntries = aFeed.getEntries(); if (aEntries!=null) { syndFeed.setEntries(createSyndEntries(aFeed, aEntries, syndFeed.isPreservingWireFeed())); } @@ -117,12 +119,12 @@ public class ConverterForAtom10 implements Converter { // Core Atom language/author/copyright/modified elements have precedence // over DC equivalent info. - List authors = aFeed.getAuthors(); + List authors = aFeed.getAuthors(); if (authors!=null && authors.size() > 0) { syndFeed.setAuthors(ConverterForAtom03.createSyndPersons(authors)); } - List contributors = aFeed.getContributors(); + List contributors = aFeed.getContributors(); if (contributors!=null && contributors.size() > 0) { syndFeed.setContributors(ConverterForAtom03.createSyndPersons(contributors)); } @@ -139,9 +141,9 @@ public class ConverterForAtom10 implements Converter { } - protected List createSyndLinks(List aLinks) { - ArrayList sLinks = new ArrayList(); - for (Iterator iter = aLinks.iterator(); iter.hasNext();) { + protected List createSyndLinks(List aLinks) { + ArrayList sLinks = new ArrayList(); + for (Iterator iter = aLinks.iterator(); iter.hasNext();) { Link link = (Link)iter.next(); SyndLink sLink = createSyndLink(link); sLinks.add(sLink); @@ -149,8 +151,8 @@ public class ConverterForAtom10 implements Converter { return sLinks; } - protected List createSyndEntries(Feed feed, List atomEntries, boolean preserveWireItems) { - List syndEntries = new ArrayList(); + protected List createSyndEntries(Feed feed, List atomEntries, boolean preserveWireItems) { + List syndEntries = new ArrayList(); for (int i=0;i 0) { - syndEntry.setForeignMarkup((List)entry.getForeignMarkup()); + if (((List)entry.getForeignMarkup()).size() > 0) { + syndEntry.setForeignMarkup((List)entry.getForeignMarkup()); } Content eTitle = entry.getTitleEx(); @@ -178,24 +180,24 @@ public class ConverterForAtom10 implements Converter { syndEntry.setDescription(createSyndContent(summary)); } - List contents = entry.getContents(); + List contents = entry.getContents(); if (contents != null && contents.size() > 0) { - List sContents = new ArrayList(); - for (Iterator iter=contents.iterator(); iter.hasNext();) { + List sContents = new ArrayList(); + for (Iterator iter=contents.iterator(); iter.hasNext();) { Content content = (Content)iter.next(); sContents.add(createSyndContent(content)); } syndEntry.setContents(sContents); } - List authors = entry.getAuthors(); + List authors = entry.getAuthors(); if (authors!=null && authors.size() > 0) { syndEntry.setAuthors(ConverterForAtom03.createSyndPersons(authors)); SyndPerson person0 = (SyndPerson)syndEntry.getAuthors().get(0); syndEntry.setAuthor(person0.getName()); } - List contributors = entry.getContributors(); + List contributors = entry.getContributors(); if (contributors!=null && contributors.size() > 0) { syndEntry.setContributors(ConverterForAtom03.createSyndPersons(contributors)); } @@ -210,10 +212,10 @@ public class ConverterForAtom10 implements Converter { syndEntry.setUpdatedDate(date); } - List categories = entry.getCategories(); + List categories = entry.getCategories(); if (categories!=null) { - List syndCategories = new ArrayList(); - for (Iterator iter=categories.iterator(); iter.hasNext();) { + List syndCategories = new ArrayList(); + for (Iterator iter=categories.iterator(); iter.hasNext();) { Category c = (Category)iter.next(); SyndCategory syndCategory = new SyndCategoryImpl(); syndCategory.setName(c.getTerm()); @@ -233,10 +235,10 @@ public class ConverterForAtom10 implements Converter { } // Create synd enclosures from enclosure links - List syndEnclosures = new ArrayList(); + List syndEnclosures = new ArrayList(); if (entry.getOtherLinks() != null && entry.getOtherLinks().size() > 0) { - List oLinks = entry.getOtherLinks(); - for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) { + List oLinks = entry.getOtherLinks(); + for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) { Link thisLink = (Link)iter.next(); if ("enclosure".equals(thisLink.getRel())) syndEnclosures.add( @@ -246,7 +248,7 @@ public class ConverterForAtom10 implements Converter { syndEntry.setEnclosures(syndEnclosures); // lump alternate and other links together - List syndLinks = new ArrayList(); + List syndLinks = new ArrayList(); if (entry.getAlternateLinks() != null && entry.getAlternateLinks().size() > 0) { syndLinks.addAll(createSyndLinks(entry.getAlternateLinks())); @@ -341,11 +343,11 @@ public class ConverterForAtom10 implements Converter { } // separate SyndEntry's links collection into alternate and other links - List alternateLinks = new ArrayList(); - List otherLinks = new ArrayList(); - List slinks = syndFeed.getLinks(); + List alternateLinks = new ArrayList(); + List otherLinks = new ArrayList(); + List slinks = syndFeed.getLinks(); if (slinks != null) { - for (Iterator iter=slinks.iterator(); iter.hasNext();) { + for (Iterator iter=slinks.iterator(); iter.hasNext();) { SyndLink syndLink = (SyndLink)iter.next(); Link link = createAtomLink(syndLink); if (link.getRel() == null || @@ -367,10 +369,10 @@ public class ConverterForAtom10 implements Converter { if (alternateLinks.size() > 0) aFeed.setAlternateLinks(alternateLinks); if (otherLinks.size() > 0) aFeed.setOtherLinks(otherLinks); - List sCats = syndFeed.getCategories(); - List aCats = new ArrayList(); + List sCats = syndFeed.getCategories(); + List aCats = new ArrayList(); if (sCats != null) { - for (Iterator iter=sCats.iterator(); iter.hasNext();) { + for (Iterator iter=sCats.iterator(); iter.hasNext();) { SyndCategory sCat = (SyndCategory)iter.next(); Category aCat = new Category(); aCat.setTerm(sCat.getName()); @@ -381,12 +383,12 @@ public class ConverterForAtom10 implements Converter { } if (aCats.size() > 0) aFeed.setCategories(aCats); - List authors = syndFeed.getAuthors(); + List authors = syndFeed.getAuthors(); if (authors!=null && authors.size() > 0) { aFeed.setAuthors(ConverterForAtom03.createAtomPersons(authors)); } - List contributors = syndFeed.getContributors(); + List contributors = syndFeed.getContributors(); if (contributors!=null && contributors.size() > 0) { aFeed.setContributors(ConverterForAtom03.createAtomPersons(contributors)); } @@ -395,12 +397,12 @@ public class ConverterForAtom10 implements Converter { aFeed.setUpdated(syndFeed.getPublishedDate()); - List sEntries = syndFeed.getEntries(); + List sEntries = syndFeed.getEntries(); if (sEntries!=null) { aFeed.setEntries(createAtomEntries(sEntries)); } - if (((List)syndFeed.getForeignMarkup()).size() > 0) { + if (((List)syndFeed.getForeignMarkup()).size() > 0) { aFeed.setForeignMarkup(syndFeed.getForeignMarkup()); } return aFeed; @@ -413,8 +415,8 @@ public class ConverterForAtom10 implements Converter { return sContent; } - protected List createAtomEntries(List syndEntries) { - List atomEntries = new ArrayList(); + protected List createAtomEntries(List syndEntries) { + List atomEntries = new ArrayList(); for (int i=0;i createAtomContents(List syndContents) { + List atomContents = new ArrayList(); for (int i=0;i alternateLinks = new ArrayList(); + List otherLinks = new ArrayList(); + List slinks = sEntry.getLinks(); + List enclosures = sEntry.getEnclosures(); boolean linkRelEnclosureExists = false; if (slinks != null) { - for (Iterator iter=slinks.iterator(); iter.hasNext();) { + for (Iterator iter=slinks.iterator(); iter.hasNext();) { SyndLink syndLink = (SyndLink)iter.next(); Link link = createAtomLink(syndLink); // Set this flag if there's a link of rel = enclosure so that @@ -494,7 +496,7 @@ public class ConverterForAtom10 implements Converter { // add SyndEnclosures as links with rel="enclosure" ONLY if // there are no SyndEntry.getLinks() with rel="enclosure" if (enclosures != null && linkRelEnclosureExists == false) { - for (Iterator iter=enclosures.iterator(); iter.hasNext();) { + for (Iterator iter=enclosures.iterator(); iter.hasNext();) { SyndEnclosure syndEncl = (SyndEnclosure)iter.next(); Link link = createAtomEnclosure(syndEncl); otherLinks.add(link); @@ -503,10 +505,10 @@ public class ConverterForAtom10 implements Converter { if (alternateLinks.size() > 0) aEntry.setAlternateLinks(alternateLinks); if (otherLinks.size() > 0) aEntry.setOtherLinks(otherLinks); - List sCats = sEntry.getCategories(); - List aCats = new ArrayList(); + List sCats = sEntry.getCategories(); + List aCats = new ArrayList(); if (sCats != null) { - for (Iterator iter=sCats.iterator(); iter.hasNext();) { + for (Iterator iter=sCats.iterator(); iter.hasNext();) { SyndCategory sCat = (SyndCategory)iter.next(); Category aCat = new Category(); aCat.setTerm(sCat.getName()); @@ -517,7 +519,7 @@ public class ConverterForAtom10 implements Converter { } if (aCats.size() > 0) aEntry.setCategories(aCats); - List syndContents = sEntry.getContents(); + List syndContents = sEntry.getContents(); aEntry.setContents(createAtomContents(syndContents)); List authors = sEntry.getAuthors(); @@ -531,7 +533,7 @@ public class ConverterForAtom10 implements Converter { aEntry.setAuthors(authors); } - List contributors = sEntry.getContributors(); + List contributors = sEntry.getContributors(); if (contributors!=null && contributors.size() > 0) { aEntry.setContributors(ConverterForAtom03.createAtomPersons(contributors)); } @@ -547,8 +549,8 @@ public class ConverterForAtom10 implements Converter { aEntry.setUpdated(sEntry.getPublishedDate()); } - if (((List)sEntry.getForeignMarkup()).size() > 0) { - aEntry.setForeignMarkup((List)sEntry.getForeignMarkup()); + if (((List)sEntry.getForeignMarkup()).size() > 0) { + aEntry.setForeignMarkup((List)sEntry.getForeignMarkup()); } SyndFeed sSource = sEntry.getSource(); diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS090.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS090.java index 1e4246d..1915a5f 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS090.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS090.java @@ -26,6 +26,8 @@ import com.sun.syndication.feed.synd.*; import java.util.ArrayList; import java.util.List; +import org.jdom2.Element; + /** */ public class ConverterForRSS090 implements Converter { @@ -45,7 +47,7 @@ public class ConverterForRSS090 implements Converter { public void copyInto(WireFeed feed,SyndFeed syndFeed) { syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules())); - if (((List)feed.getForeignMarkup()).size() > 0) { + if (((List)feed.getForeignMarkup()).size() > 0) { syndFeed.setForeignMarkup(feed.getForeignMarkup()); } syndFeed.setEncoding(feed.getEncoding()); @@ -59,7 +61,7 @@ public class ConverterForRSS090 implements Converter { syndFeed.setImage(createSyndImage(image)); } - List items = channel.getItems(); + List items = channel.getItems(); if (items!=null) { syndFeed.setEntries(createSyndEntries(items, syndFeed.isPreservingWireFeed())); } @@ -73,8 +75,8 @@ public class ConverterForRSS090 implements Converter { return syndImage; } - protected List createSyndEntries(List rssItems, boolean preserveWireItems) { - List syndEntries = new ArrayList(); + protected List createSyndEntries(List rssItems, boolean preserveWireItems) { + List syndEntries = new ArrayList(); for (int i=0;i 0) { + if (((List)item.getForeignMarkup()).size() > 0) { syndEntry.setForeignMarkup(item.getForeignMarkup()); } @@ -124,12 +126,12 @@ public class ConverterForRSS090 implements Converter { channel.setImage(createRSSImage(sImage)); } - List sEntries = syndFeed.getEntries(); + List sEntries = syndFeed.getEntries(); if (sEntries!=null) { channel.setItems(createRSSItems(sEntries)); } - if (((List)syndFeed.getForeignMarkup()).size() > 0) { + if (((List)syndFeed.getForeignMarkup()).size() > 0) { channel.setForeignMarkup(syndFeed.getForeignMarkup()); } return channel; @@ -143,8 +145,8 @@ public class ConverterForRSS090 implements Converter { return image; } - protected List createRSSItems(List sEntries) { - List list = new ArrayList(); + protected List createRSSItems(List sEntries) { + List list = new ArrayList(); for (int i=0;i 0) { + if (((List)sEntry.getForeignMarkup()).size() > 0) { item.setForeignMarkup(sEntry.getForeignMarkup()); } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS091Userland.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS091Userland.java index bcc035f..cd4dbe7 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS091Userland.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS091Userland.java @@ -66,10 +66,10 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 { String author = channel.getManagingEditor(); if (author != null) { - List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators(); + List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { - Set s = new HashSet(); // using a set to remove duplicates + Set s = new HashSet(); // using a set to remove duplicates s.addAll(creators); // DC creators s.add(author); // feed native author creators.clear(); @@ -107,7 +107,7 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 { item.setDescription(createItemDescription(sContent)); } - List contents = sEntry.getContents(); + List contents = sEntry.getContents(); if ((contents != null) && (contents.size() > 0)) { SyndContent syndContent = (SyndContent) contents.get(0); @@ -159,7 +159,7 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 { content.setType(cont.getType()); content.setValue(cont.getValue()); - List syndContents = new ArrayList(); + List syndContents = new ArrayList(); syndContents.add(content); syndEntry.setContents(syndContents); } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java index f47462d..f266dea 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java @@ -45,22 +45,22 @@ public class ConverterForRSS092 extends ConverterForRSS091Userland { @Override protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) { SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem); - List cats = item.getCategories(); + List cats = item.getCategories(); if (cats.size()>0) { - Set s = new LinkedHashSet(); // using a set to remove duplicates and use a LinkedHashSet to try to retain the document order + Set s = new LinkedHashSet(); // using a set to remove duplicates and use a LinkedHashSet to try to retain the document order s.addAll(createSyndCategories(cats)); // feed native categories (as syndcat) s.addAll(syndEntry.getCategories()); // DC subjects (as syndcat) - syndEntry.setCategories(new ArrayList(s)); //c + syndEntry.setCategories(new ArrayList(s)); //c } - List enclosures = item.getEnclosures(); + List enclosures = item.getEnclosures(); if (enclosures.size()>0) { syndEntry.setEnclosures(createSyndEnclosures(enclosures)); } return syndEntry; } - protected List createSyndCategories(List rssCats) { - List syndCats = new ArrayList(); + protected List createSyndCategories(List rssCats) { + List syndCats = new ArrayList(); for (int i=0;i createSyndEnclosures(List enclosures) { + List sEnclosures = new ArrayList(); for (int i=0;i sCats = sEntry.getCategories(); //c if (sCats.size()>0) { item.setCategories(createRSSCategories(sCats)); } - List sEnclosures = sEntry.getEnclosures(); + List sEnclosures = sEntry.getEnclosures(); if (sEnclosures.size()>0) { item.setEnclosures(createEnclosures(sEnclosures)); } return item; } - protected List createRSSCategories(List sCats) { - List cats = new ArrayList(); + protected List createRSSCategories(List sCats) { + List cats = new ArrayList(); for (int i=0;i createEnclosures(List sEnclosures) { + List enclosures = new ArrayList(); for (int i=0;i cats = channel.getCategories(); //c if (cats.size()>0) { - Set s = new HashSet(); // using a set to remove duplicates + Set s = new HashSet(); // using a set to remove duplicates s.addAll(createSyndCategories(cats)); // feed native categories (as syndcat) s.addAll(syndFeed.getCategories()); // DC subjects (as syndcat) - syndFeed.setCategories(new ArrayList(s)); + syndFeed.setCategories(new ArrayList(s)); } } @@ -64,9 +66,9 @@ public class ConverterForRSS094 extends ConverterForRSS093 { // adding native feed author to DC creators list String author = item.getAuthor(); if (author!=null) { - List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators(); + List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { - Set s = new HashSet(); // using a set to remove duplicates + Set s = new HashSet(); // using a set to remove duplicates s.addAll(creators); // DC creators s.add(author); // feed native author creators.clear(); @@ -97,7 +99,7 @@ public class ConverterForRSS094 extends ConverterForRSS093 { @Override protected WireFeed createRealFeed(String type,SyndFeed syndFeed) { Channel channel = (Channel) super.createRealFeed(type,syndFeed); - List cats = syndFeed.getCategories(); //c + List cats = syndFeed.getCategories(); //c if (cats.size()>0) { channel.setCategories(createRSSCategories(cats)); } diff --git a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS10.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS10.java index 1b4b704..dee3b35 100644 --- a/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS10.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForRSS10.java @@ -72,7 +72,7 @@ public class ConverterForRSS10 extends ConverterForRSS090 { SyndContent contContent = new SyndContentImpl(); contContent.setType(cont.getType()); contContent.setValue(cont.getValue()); - List contents = new ArrayList(); + List contents = new ArrayList(); contents.add(contContent); syndEntry.setContents(contents); } @@ -105,7 +105,7 @@ public class ConverterForRSS10 extends ConverterForRSS090 { if (desc!=null) { item.setDescription(createItemDescription(desc)); } - List contents = sEntry.getContents(); + List contents = sEntry.getContents(); if (contents!=null && contents.size() > 0) { item.setContent(createItemContent((SyndContent)contents.get(0))); } diff --git a/src/main/java/com/sun/syndication/io/ModuleGenerator.java b/src/main/java/com/sun/syndication/io/ModuleGenerator.java index a268560..a1c679e 100644 --- a/src/main/java/com/sun/syndication/io/ModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/ModuleGenerator.java @@ -17,7 +17,6 @@ package com.sun.syndication.io; import com.sun.syndication.feed.module.Module; -import com.sun.syndication.feed.WireFeed; import org.jdom2.Element; import java.util.Set; diff --git a/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java b/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java index 2c6a4b0..a9e6b90 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom03Generator.java @@ -90,11 +90,11 @@ public class Atom03Generator extends BaseWireFeedGenerator { populateFeedHeader(feed,eFeed); checkFeedHeaderConstraints(eFeed); generateFeedModules(feed.getModules(),eFeed); - generateForeignMarkup(eFeed, (List)feed.getForeignMarkup()); + generateForeignMarkup(eFeed, (List)feed.getForeignMarkup()); } protected void addEntries(Feed feed,Element parent) throws FeedException { - List items = feed.getEntries(); + List items = feed.getEntries(); for (int i=0;i links = feed.getAlternateLinks(); for (int i = 0; i < links.size(); i++) { eFeed.addContent(generateLinkElement((Link)links.get(i))); } @@ -131,7 +131,7 @@ public class Atom03Generator extends BaseWireFeedGenerator { eFeed.addContent(authorElement); } - List contributors = feed.getContributors(); + List contributors = feed.getContributors(); for (int i = 0; i < contributors.size(); i++) { Element contributorElement = new Element("contributor", getFeedNamespace()); fillPersonElement(contributorElement, (Person)contributors.get(i)); @@ -175,7 +175,7 @@ public class Atom03Generator extends BaseWireFeedGenerator { fillContentElement(titleElement, entry.getTitleEx()); eEntry.addContent(titleElement); } - List links = entry.getAlternateLinks(); + List links = entry.getAlternateLinks(); for (int i = 0; i < links.size(); i++) { eEntry.addContent(generateLinkElement((Link)links.get(i))); } @@ -191,7 +191,7 @@ public class Atom03Generator extends BaseWireFeedGenerator { eEntry.addContent(authorElement); } - List contributors = entry.getContributors(); + List contributors = entry.getContributors(); for (int i = 0; i < contributors.size(); i++) { Element contributorElement = new Element("contributor", getFeedNamespace()); fillPersonElement(contributorElement, (Person)contributors.get(i)); @@ -225,14 +225,14 @@ public class Atom03Generator extends BaseWireFeedGenerator { eEntry.addContent(summaryElement); } - List contents = entry.getContents(); + List contents = entry.getContents(); for (int i = 0; i < contents.size(); i++) { Element contentElement = new Element("content", getFeedNamespace()); fillContentElement(contentElement, (Content)contents.get(i)); eEntry.addContent(contentElement); } - generateForeignMarkup(eEntry, (List)entry.getForeignMarkup()); + generateForeignMarkup(eEntry, (List)entry.getForeignMarkup()); } protected void checkFeedHeaderConstraints(Element eFeed) throws FeedException { @@ -329,7 +329,7 @@ public class Atom03Generator extends BaseWireFeedGenerator { throw new FeedException("Invalid XML",ex); } - List children = tmpDoc.getRootElement().removeContent(); + List children = tmpDoc.getRootElement().removeContent(); contentElement.addContent(children); } } diff --git a/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java b/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java index a6aab55..0b002b9 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom03Parser.java @@ -76,13 +76,13 @@ public class Atom03Parser extends BaseWireFeedParser { feed.setTitleEx(parseContent(e)); } - List eList = eFeed.getChildren("link",getAtomNamespace()); + List eList = eFeed.getChildren("link",getAtomNamespace()); feed.setAlternateLinks(parseAlternateLinks(eList)); feed.setOtherLinks(parseOtherLinks(eList)); e = eFeed.getChild("author",getAtomNamespace()); if (e!=null) { - List authors = new ArrayList(); + List authors = new ArrayList(); authors.add(parsePerson(e)); feed.setAuthors(authors); } @@ -139,7 +139,7 @@ public class Atom03Parser extends BaseWireFeedParser { feed.setEntries(parseEntries(eList)); } - List foreignMarkup = + List foreignMarkup = extractForeignMarkup(eFeed, feed, getAtomNamespace()); if (foreignMarkup.size() > 0) { feed.setForeignMarkup(foreignMarkup); @@ -165,8 +165,8 @@ public class Atom03Parser extends BaseWireFeedParser { } // List(Elements) -> List(Link) - private List parseLinks(List eLinks,boolean alternate) { - List links = new ArrayList(); + private List parseLinks(List eLinks,boolean alternate) { + List links = new ArrayList(); for (int i=0;i List(Link) - private List parseAlternateLinks(List eLinks) { + private List parseAlternateLinks(List eLinks) { return parseLinks(eLinks,true); } // List(Elements) -> List(Link) - private List parseOtherLinks(List eLinks) { + private List parseOtherLinks(List eLinks) { return parseLinks(eLinks,false); } @@ -212,8 +212,8 @@ public class Atom03Parser extends BaseWireFeedParser { } // List(Elements) -> List(Persons) - private List parsePersons(List ePersons) { - List persons = new ArrayList(); + private List parsePersons(List ePersons) { + List persons = new ArrayList(); for (int i=0;i eContent = e.getContent(); + Iterator i = eContent.iterator(); while (i.hasNext()) { org.jdom2.Content c = (org.jdom2.Content) i.next(); if (c instanceof Element) { @@ -261,8 +261,8 @@ public class Atom03Parser extends BaseWireFeedParser { } // List(Elements) -> List(Entries) - private List parseEntries(List eEntries) { - List entries = new ArrayList(); + private List parseEntries(List eEntries) { + List entries = new ArrayList(); for (int i=0;i eList = eEntry.getChildren("link",getAtomNamespace()); entry.setAlternateLinks(parseAlternateLinks(eList)); entry.setOtherLinks(parseOtherLinks(eList)); e = eEntry.getChild("author",getAtomNamespace()); if (e!=null) { - List authors = new ArrayList(); + List authors = new ArrayList(); authors.add(parsePerson(e)); entry.setAuthors(authors); } @@ -320,7 +320,7 @@ public class Atom03Parser extends BaseWireFeedParser { eList = eEntry.getChildren("content",getAtomNamespace()); if (eList.size()>0) { - List content = new ArrayList(); + List content = new ArrayList(); for (int i=0;i foreignMarkup = extractForeignMarkup(eEntry, entry, getAtomNamespace()); if (foreignMarkup.size() > 0) { entry.setForeignMarkup(foreignMarkup); diff --git a/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java b/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java index 6228b21..b8ab76d 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom10Generator.java @@ -105,13 +105,13 @@ public class Atom10Generator extends BaseWireFeedGenerator { protected void addFeed(Feed feed,Element parent) throws FeedException { Element eFeed = parent; populateFeedHeader(feed,eFeed); - generateForeignMarkup(eFeed, (List)feed.getForeignMarkup()); + generateForeignMarkup(eFeed, (List)feed.getForeignMarkup()); checkFeedHeaderConstraints(eFeed); generateFeedModules(feed.getModules(),eFeed); } protected void addEntries(Feed feed,Element parent) throws FeedException { - List items = feed.getEntries(); + List items = feed.getEntries(); for (int i=0;i)entry.getForeignMarkup()); checkEntryConstraints(eEntry); generateItemModules(entry.getModules(),eEntry); parent.addContent(eEntry); @@ -137,7 +137,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { eFeed.addContent(titleElement); } - List links = feed.getAlternateLinks(); + List links = feed.getAlternateLinks(); if (links != null) for (int i = 0; i < links.size(); i++) { eFeed.addContent(generateLinkElement((Link)links.get(i))); } @@ -146,12 +146,12 @@ public class Atom10Generator extends BaseWireFeedGenerator { eFeed.addContent(generateLinkElement((Link)links.get(j))); } - List cats = feed.getCategories(); - if (cats != null) for (Iterator iter=cats.iterator(); iter.hasNext();) { + List cats = feed.getCategories(); + if (cats != null) for (Iterator iter=cats.iterator(); iter.hasNext();) { eFeed.addContent(generateCategoryElement((Category)iter.next())); } - List authors = feed.getAuthors(); + List authors = feed.getAuthors(); if (authors != null && authors.size() > 0) { for (int i = 0; i < authors.size(); i++) { Element authorElement = new Element("author", getFeedNamespace()); @@ -160,7 +160,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { } } - List contributors = feed.getContributors(); + List contributors = feed.getContributors(); if (contributors != null && contributors.size() > 0) { for (int i = 0; i < contributors.size(); i++) { Element contributorElement = new Element("contributor", getFeedNamespace()); @@ -208,7 +208,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { fillContentElement(titleElement, entry.getTitleEx()); eEntry.addContent(titleElement); } - List links = entry.getAlternateLinks(); + List links = entry.getAlternateLinks(); if (links != null) { for (int i = 0; i < links.size(); i++) { eEntry.addContent(generateLinkElement((Link)links.get(i))); @@ -221,14 +221,14 @@ public class Atom10Generator extends BaseWireFeedGenerator { } } - List cats = entry.getCategories(); + List cats = entry.getCategories(); if (cats != null) { for (int i = 0; i < cats.size(); i++) { eEntry.addContent(generateCategoryElement((Category)cats.get(i))); } } - List authors = entry.getAuthors(); + List authors = entry.getAuthors(); if (authors != null && authors.size() > 0) { for (int i = 0; i < authors.size(); i++) { Element authorElement = new Element("author", getFeedNamespace()); @@ -237,7 +237,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { } } - List contributors = entry.getContributors(); + List contributors = entry.getContributors(); if (contributors != null && contributors.size() > 0) { for (int i = 0; i < contributors.size(); i++) { Element contributorElement = new Element("contributor", getFeedNamespace()); @@ -409,7 +409,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { catch (Exception ex) { throw new FeedException("Invalid XML",ex); } - List children = tmpDoc.getRootElement().removeContent(); + List children = tmpDoc.getRootElement().removeContent(); contentElement.addContent(children); } else { // must be type html, text or some other non-XML format @@ -453,7 +453,7 @@ public class Atom10Generator extends BaseWireFeedGenerator { throws IllegalArgumentException, FeedException, IOException { // Build a feed containing only the entry - List entries = new ArrayList(); + List entries = new ArrayList(); entries.add(entry); Feed feed1 = new Feed(); feed1.setFeedType("atom_1.0"); diff --git a/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java b/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java index ccfc237..32b685c 100644 --- a/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/Atom10Parser.java @@ -117,12 +117,12 @@ public class Atom10Parser extends BaseWireFeedParser { feed.setModules(parseFeedModules(eFeed)); - List eList = eFeed.getChildren("entry",getAtomNamespace()); + List eList = eFeed.getChildren("entry",getAtomNamespace()); if (eList.size()>0) { feed.setEntries(parseEntries(feed, baseURI, eList)); } - List foreignMarkup = + List foreignMarkup = extractForeignMarkup(eFeed, feed, getAtomNamespace()); if (foreignMarkup.size() > 0) { feed.setForeignMarkup(foreignMarkup); @@ -142,11 +142,11 @@ public class Atom10Parser extends BaseWireFeedParser { feed.setTitleEx(c); } - List eList = eFeed.getChildren("link",getAtomNamespace()); + List eList = eFeed.getChildren("link",getAtomNamespace()); feed.setAlternateLinks(parseAlternateLinks(feed, null, baseURI, eList)); feed.setOtherLinks(parseOtherLinks(feed, null, baseURI, eList)); - List cList = eFeed.getChildren("category",getAtomNamespace()); + List cList = eFeed.getChildren("category",getAtomNamespace()); feed.setCategories(parseCategories(baseURI, cList)); eList = eFeed.getChildren("author", getAtomNamespace()); @@ -246,8 +246,8 @@ public class Atom10Parser extends BaseWireFeedParser { } // List(Elements) -> List(Link) - private List parseAlternateLinks(Feed feed, Entry entry, String baseURI, List eLinks) { - List links = new ArrayList(); + private List parseAlternateLinks(Feed feed, Entry entry, String baseURI, List eLinks) { + List links = new ArrayList(); for (int i=0;i0) ? links : null; } - private List parseOtherLinks(Feed feed, Entry entry, String baseURI, List eLinks) { - List links = new ArrayList(); + private List parseOtherLinks(Feed feed, Entry entry, String baseURI, List eLinks) { + List links = new ArrayList(); for (int i=0;i List(Persons) - private List parsePersons(String baseURI, List ePersons) { - List persons = new ArrayList(); + private List parsePersons(String baseURI, List ePersons) { + List persons = new ArrayList(); for (int i=0;i eContent = e.getContent(); + Iterator i = eContent.iterator(); while (i.hasNext()) { org.jdom2.Content c = (org.jdom2.Content) i.next(); if (c instanceof Element) { @@ -340,8 +340,8 @@ public class Atom10Parser extends BaseWireFeedParser { } // List(Elements) -> List(Entries) - protected List parseEntries(Feed feed, String baseURI, List eEntries) { - List entries = new ArrayList(); + protected List parseEntries(Feed feed, String baseURI, List eEntries) { + List entries = new ArrayList(); for (int i=0;i eList = eEntry.getChildren("link",getAtomNamespace()); entry.setAlternateLinks(parseAlternateLinks(feed, entry, baseURI, eList)); entry.setOtherLinks(parseOtherLinks(feed, entry, baseURI, eList)); @@ -400,7 +400,7 @@ public class Atom10Parser extends BaseWireFeedParser { e = eEntry.getChild("content",getAtomNamespace()); if (e!=null) { - List contents = new ArrayList(); + List contents = new ArrayList(); contents.add(parseContent(e)); entry.setContents(contents); } @@ -410,7 +410,7 @@ public class Atom10Parser extends BaseWireFeedParser { entry.setRights(e.getText()); } - List cList = eEntry.getChildren("category",getAtomNamespace()); + List cList = eEntry.getChildren("category",getAtomNamespace()); entry.setCategories(parseCategories(baseURI, cList)); // TODO: SHOULD handle Atom entry source element @@ -421,7 +421,7 @@ public class Atom10Parser extends BaseWireFeedParser { entry.setModules(parseItemModules(eEntry)); - List foreignMarkup = + List foreignMarkup = extractForeignMarkup(eEntry, entry, getAtomNamespace()); if (foreignMarkup.size() > 0) { entry.setForeignMarkup(foreignMarkup); @@ -429,8 +429,8 @@ public class Atom10Parser extends BaseWireFeedParser { return entry; } - private List parseCategories(String baseURI, List eCategories) { - List cats = new ArrayList(); + private List parseCategories(String baseURI, List eCategories) { + List cats = new ArrayList(); for (int i=0;i linksList = parent.getChildren("link", ATOM_10_NS); if (linksList != null) { - for (Iterator links = linksList.iterator(); links.hasNext(); ) { + for (Iterator links = linksList.iterator(); links.hasNext(); ) { Element link = (Element)links.next(); Attribute relAtt = getAttribute(link, "rel"); Attribute hrefAtt = getAttribute(link, "href"); diff --git a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java index ba48cef..fc90a07 100644 --- a/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java +++ b/src/main/java/com/sun/syndication/io/impl/BaseWireFeedParser.java @@ -2,6 +2,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.module.Extendable; +import com.sun.syndication.feed.module.Module; import com.sun.syndication.io.WireFeedParser; import java.util.ArrayList; import java.util.Iterator; @@ -60,21 +61,21 @@ public abstract class BaseWireFeedParser implements WireFeedParser { return _type; } - protected List parseFeedModules(Element feedElement) { + protected List parseFeedModules(Element feedElement) { return _feedModuleParsers.parseModules(feedElement); } - protected List parseItemModules(Element itemElement) { + protected List parseItemModules(Element itemElement) { return _itemModuleParsers.parseModules(itemElement); } - protected List parsePersonModules(Element itemElement) { + protected List parsePersonModules(Element itemElement) { return _personModuleParsers.parseModules(itemElement); } - protected List extractForeignMarkup(Element e, Extendable ext, Namespace basens) { - ArrayList foreignMarkup = new ArrayList(); - Iterator children = e.getChildren().iterator(); + protected List extractForeignMarkup(Element e, Extendable ext, Namespace basens) { + ArrayList foreignMarkup = new ArrayList(); + Iterator children = e.getChildren().iterator(); while (children.hasNext()) { Element elem = (Element)children.next(); if ( @@ -89,7 +90,7 @@ public abstract class BaseWireFeedParser implements WireFeedParser { } } // Now we can detach the foreign markup elements - Iterator fm = foreignMarkup.iterator(); + Iterator fm = foreignMarkup.iterator(); while (fm.hasNext()) { Element elem = (Element)fm.next(); elem.detach(); diff --git a/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java b/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java index a7cdee3..12a3edc 100644 --- a/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/DCModuleGenerator.java @@ -50,10 +50,10 @@ public class DCModuleGenerator implements ModuleGenerator { private static final Namespace TAXO_NS = Namespace.getNamespace("taxo", TAXO_URI); private static final Namespace RDF_NS = Namespace.getNamespace("rdf", RDF_URI); - private static final Set NAMESPACES; + private static final Set NAMESPACES; static { - Set nss = new HashSet(); + Set nss = new HashSet(); nss.add(DC_NS); nss.add(TAXO_NS); nss.add(RDF_NS); @@ -87,7 +87,7 @@ public class DCModuleGenerator implements ModuleGenerator { * * @return a set with all the URIs this module generator uses. */ - public final Set getNamespaces() { + public final Set getNamespaces() { return NAMESPACES; } @@ -106,7 +106,7 @@ public class DCModuleGenerator implements ModuleGenerator { if (dcModule.getCreator() != null) { element.addContent(generateSimpleElementList("creator", dcModule.getCreators())); } - List subjects = dcModule.getSubjects(); + List subjects = dcModule.getSubjects(); for (int i = 0; i < subjects.size(); i++) { element.addContent(generateSubjectElement((DCSubject) subjects.get(i))); } @@ -120,7 +120,7 @@ public class DCModuleGenerator implements ModuleGenerator { element.addContent(generateSimpleElementList("contributor", dcModule.getContributors())); } if (dcModule.getDate() != null) { - for (Iterator i = dcModule.getDates().iterator(); i.hasNext();) { + for (Iterator i = dcModule.getDates().iterator(); i.hasNext();) { element.addContent(generateSimpleElement("date", DateParser.formatW3CDateTime((Date) i.next()))); } @@ -201,9 +201,9 @@ public class DCModuleGenerator implements ModuleGenerator { * @param value the list of values for the elements. * @return a list of Elements created. */ - protected final List generateSimpleElementList(String name, List value) { - List elements = new ArrayList(); - for (Iterator i = value.iterator(); i.hasNext();) { + protected final List generateSimpleElementList(String name, List value) { + List elements = new ArrayList(); + for (Iterator i = value.iterator(); i.hasNext();) { elements.add(generateSimpleElement(name, (String) i.next())); } diff --git a/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java b/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java index 10173d5..aecaf41 100644 --- a/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java +++ b/src/main/java/com/sun/syndication/io/impl/DCModuleParser.java @@ -22,12 +22,12 @@ import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.DCModule; import com.sun.syndication.feed.module.DCSubject; import com.sun.syndication.io.ModuleParser; -import com.sun.syndication.io.WireFeedParser; import org.jdom2.Attribute; import org.jdom2.Element; import org.jdom2.Namespace; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.List; @@ -69,7 +69,7 @@ public class DCModuleParser implements ModuleParser { boolean foundSomething = false; DCModule dcm = new DCModuleImpl(); - List eList = dcRoot.getChildren("title", getDCNamespace()); + List eList = dcRoot.getChildren("title", getDCNamespace()); if (eList.size() > 0) { foundSomething = true; dcm.setTitles(parseElementList(eList)); @@ -172,15 +172,15 @@ public class DCModuleParser implements ModuleParser { * @param eList the element list to parse. * @return a list of subjects parsed from the elements. */ - protected final List parseSubjects(List eList) { - List subjects = new ArrayList(); - for (Iterator i = eList.iterator(); i.hasNext();) { + protected final List parseSubjects(List eList) { + List subjects = new ArrayList(); + for (Iterator i = eList.iterator(); i.hasNext();) { Element eSubject = (Element) i.next(); Element eDesc = eSubject.getChild("Description", getRDFNamespace()); if (eDesc != null) { String taxonomy = getTaxonomy(eDesc); - List eValues = eDesc.getChildren("value", getRDFNamespace()); - for (Iterator v = eValues.iterator(); v.hasNext();) { + List eValues = eDesc.getChildren("value", getRDFNamespace()); + for (Iterator v = eValues.iterator(); v.hasNext();) { Element eValue = (Element) v.next(); DCSubject subject = new DCSubjectImpl(); subject.setTaxonomyUri(taxonomy); @@ -203,9 +203,9 @@ public class DCModuleParser implements ModuleParser { * @param eList the list of elements to parse. * @return the list of strings */ - protected final List parseElementList(List eList) { - List values= new ArrayList(); - for (Iterator i = eList.iterator(); i.hasNext();) { + protected final List parseElementList(List eList) { + List values= new ArrayList(); + for (Iterator i = eList.iterator(); i.hasNext();) { Element e = (Element) i.next(); values.add(e.getText()); } @@ -219,9 +219,9 @@ public class DCModuleParser implements ModuleParser { * @param eList the list of elements to parse. * @return the list of dates. */ - protected final List parseElementListDate(List eList) { - List values = new ArrayList(); - for (Iterator i = eList.iterator(); i.hasNext();) { + protected final List parseElementListDate(List eList) { + List values = new ArrayList(); + for (Iterator i = eList.iterator(); i.hasNext();) { Element e = (Element) i.next(); values.add(DateParser.parseDate(e.getText())); } diff --git a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java index ac895fb..23cb263 100644 --- a/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java +++ b/src/main/java/com/sun/syndication/io/impl/ModuleParsers.java @@ -40,9 +40,9 @@ public class ModuleParsers extends PluginManager { return getKeys(); } - public List parseModules(Element root) { - List parsers = getPlugins(); - List modules = null; + public List parseModules(Element root) { + List parsers = getPlugins(); + List modules = null; for (int i=0;i(); } modules.add(module); } @@ -65,7 +65,7 @@ public class ModuleParsers extends PluginManager { // boolean hasElements = namespace.equals(root.getNamespace()); if (!hasElements) { - List children = root.getChildren(); + List children = root.getChildren(); for (int i=0;!hasElements && i < children.size();i++) { Element child = (Element) children.get(i); hasElements = namespace.equals(child.getNamespace()); diff --git a/src/main/java/com/sun/syndication/io/impl/PropertiesLoader.java b/src/main/java/com/sun/syndication/io/impl/PropertiesLoader.java index 2954bed..7c7c6b3 100644 --- a/src/main/java/com/sun/syndication/io/impl/PropertiesLoader.java +++ b/src/main/java/com/sun/syndication/io/impl/PropertiesLoader.java @@ -27,8 +27,8 @@ public class PropertiesLoader { private static final String EXTRA_PLUGIN_FILE = "rome.properties"; - private static Map clMap = - new WeakHashMap(); + private static Map clMap = + new WeakHashMap(); /** @@ -65,7 +65,7 @@ public class PropertiesLoader { * */ private PropertiesLoader(String masterFileLocation,String extraFileLocation) throws IOException { - List propertiesList = new ArrayList(); + List propertiesList = new ArrayList(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { @@ -82,7 +82,7 @@ public class PropertiesLoader { throw ex; } - Enumeration urls = classLoader.getResources(extraFileLocation); + Enumeration urls = classLoader.getResources(extraFileLocation); while (urls.hasMoreElements()) { URL url = (URL) urls.nextElement(); Properties p = new Properties(); @@ -115,7 +115,7 @@ public class PropertiesLoader { * */ public String[] getTokenizedProperty(String key,String separator) { - List entriesList = new ArrayList(); + List entriesList = new ArrayList(); for (int i=0;i<_properties.length;i++) { String values = _properties[i].getProperty(key); if (values!=null) { @@ -140,7 +140,7 @@ public class PropertiesLoader { * */ public String[] getProperty(String key) { - List entriesList = new ArrayList(); + List entriesList = new ArrayList(); for (int i=0;i<_properties.length;i++) { String values = _properties[i].getProperty(key); if (values!=null) { diff --git a/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java index 81c014c..848c5bd 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS090Generator.java @@ -88,7 +88,7 @@ public class RSS090Generator extends BaseWireFeedGenerator { addImage(channel,parent); addTextInput(channel,parent); addItems(channel,parent); - generateForeignMarkup(parent, (List)channel.getForeignMarkup()); + generateForeignMarkup(parent, (List)channel.getForeignMarkup()); } protected void addChannel(Channel channel,Element parent) throws FeedException { @@ -204,7 +204,7 @@ public class RSS090Generator extends BaseWireFeedGenerator { } protected void addItems(Channel channel,Element parent) throws FeedException { - List items = channel.getItems(); + List items = channel.getItems(); for (int i=0;i)item.getForeignMarkup()); } protected Element generateSimpleElement(String name, String value) { diff --git a/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java index 94a85f1..d3ef333 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS090Parser.java @@ -17,6 +17,7 @@ package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; +import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.feed.rss.Image; import com.sun.syndication.feed.rss.Item; @@ -57,7 +58,7 @@ public class RSS090Parser extends BaseWireFeedParser { Element rssRoot = document.getRootElement(); Namespace defaultNS = rssRoot.getNamespace(); - List additionalNSs = rssRoot.getAdditionalNamespaces(); + List additionalNSs = rssRoot.getAdditionalNamespaces(); ok = defaultNS!=null && defaultNS.equals(getRDFNamespace()); if (ok) { @@ -165,9 +166,9 @@ public class RSS090Parser extends BaseWireFeedParser { // effectively putting the sharing channel module inside the RSS tag // and not inside the channel itself. So we also need to look for // channel modules from the root RSS element. - List allFeedModules = new ArrayList(); - List rootModules = parseFeedModules(rssRoot); - List channelModules = parseFeedModules(eChannel); + List allFeedModules = new ArrayList(); + List rootModules = parseFeedModules(rssRoot); + List channelModules = parseFeedModules(eChannel); if (rootModules != null) { allFeedModules.addAll(rootModules); } @@ -177,7 +178,7 @@ public class RSS090Parser extends BaseWireFeedParser { channel.setModules(allFeedModules); channel.setItems(parseItems(rssRoot)); - List foreignMarkup = + List foreignMarkup = extractForeignMarkup(eChannel, channel, getRSSNamespace()); if (foreignMarkup.size() > 0) { channel.setForeignMarkup(foreignMarkup); @@ -191,7 +192,7 @@ public class RSS090Parser extends BaseWireFeedParser { * And RSS0.91, RSS0.02, RSS0.93, RSS0.94 and RSS2.0 have the item elements under the 'channel' element. *

*/ - protected List getItems(Element rssRoot) { + protected List getItems(Element rssRoot) { return rssRoot.getChildren("item",getRSSNamespace()); } @@ -254,11 +255,11 @@ public class RSS090Parser extends BaseWireFeedParser { * @param rssRoot the root element of the RSS document to parse for all items information. * @return a list with all the parsed RSSItem beans. */ - protected List parseItems(Element rssRoot) { - Collection eItems = getItems(rssRoot); + protected List parseItems(Element rssRoot) { + Collection eItems = getItems(rssRoot); - List items = new ArrayList(); - for (Iterator i=eItems.iterator();i.hasNext();) { + List items = new ArrayList(); + for (Iterator i=eItems.iterator();i.hasNext();) { Element eItem = (Element) i.next(); items.add(parseItem(rssRoot,eItem)); } @@ -289,12 +290,12 @@ public class RSS090Parser extends BaseWireFeedParser { item.setModules(parseItemModules(eItem)); - List foreignMarkup = + List foreignMarkup = extractForeignMarkup(eItem, item, getRSSNamespace()); //content:encoded elements are treated special, without a module, they have to be removed from the foreign //markup to avoid duplication in case of read/write. Note that this fix will break if a content module is //used - Iterator iterator = foreignMarkup.iterator(); + Iterator iterator = foreignMarkup.iterator(); while (iterator.hasNext()) { Element ie = (Element)iterator.next(); if (getContentNamespace().equals(ie.getNamespace()) && ie.getName().equals("encoded")) { diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java index d83cb05..3924152 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandGenerator.java @@ -94,7 +94,7 @@ public class RSS091UserlandGenerator extends RSS090Generator { Element skipHours = eChannel.getChild("skipHours"); if (skipHours != null) { - List hours = skipHours.getChildren(); + List hours = skipHours.getChildren(); for (int i = 0; i < hours.size(); i++) { Element hour = (Element) hours.get(i); @@ -154,7 +154,7 @@ public class RSS091UserlandGenerator extends RSS090Generator { return root; } - protected Element generateSkipDaysElement(List days) { + protected Element generateSkipDaysElement(List days) { Element skipDaysElement = new Element("skipDays"); for (int i = 0; i < days.size(); i++) { @@ -164,7 +164,7 @@ public class RSS091UserlandGenerator extends RSS090Generator { return skipDaysElement; } - protected Element generateSkipHoursElement(List hours) { + protected Element generateSkipHoursElement(List hours) { Element skipHoursElement = new Element("skipHours", getFeedNamespace()); for (int i = 0; i < hours.size(); i++) { @@ -225,13 +225,13 @@ public class RSS091UserlandGenerator extends RSS090Generator { eChannel.addContent(generateSimpleElement("webMaster", webMaster)); } - List skipHours = channel.getSkipHours(); + List skipHours = channel.getSkipHours(); if ((skipHours != null) && (skipHours.size() > 0)) { eChannel.addContent(generateSkipHoursElement(skipHours)); } - List skipDays = channel.getSkipDays(); + List skipDays = channel.getSkipDays(); if ((skipDays != null) && (skipDays.size() > 0)) { eChannel.addContent(generateSkipDaysElement(skipDays)); diff --git a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java index 86a0157..8077cb7 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS091UserlandParser.java @@ -123,8 +123,8 @@ public class RSS091UserlandParser extends RSS090Parser { } e = eChannel.getChild("skipHours"); if (e!=null) { - List skipHours = new ArrayList(); - List eHours = e.getChildren("hour",getRSSNamespace()); + List skipHours = new ArrayList(); + List eHours = e.getChildren("hour",getRSSNamespace()); for (int i=0;i skipDays = new ArrayList(); + List eDays = e.getChildren("day",getRSSNamespace()); for (int i=0;i getItems(Element rssRoot) { Element eChannel = rssRoot.getChild("channel",getRSSNamespace()); - return (eChannel!=null) ? eChannel.getChildren("item",getRSSNamespace()) : Collections.EMPTY_LIST; + List emptyList = Collections.emptyList(); + return (eChannel!=null) ? eChannel.getChildren("item",getRSSNamespace()) : emptyList; } /** diff --git a/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java index 12a03d5..9e1e1a3 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS092Generator.java @@ -77,7 +77,7 @@ public class RSS092Generator extends RSS091UserlandGenerator { } // Another one to thanks DW for - protected int getNumberOfEnclosures(List enclosures) { + protected int getNumberOfEnclosures(List enclosures) { return (enclosures.size()>0) ? 1 : 0; } @@ -89,12 +89,12 @@ public class RSS092Generator extends RSS091UserlandGenerator { eItem.addContent(generateSourceElement(source)); } - List enclosures = item.getEnclosures(); + List enclosures = item.getEnclosures(); for(int i = 0; i < getNumberOfEnclosures(enclosures); i++) { eItem.addContent(generateEnclosure((Enclosure)enclosures.get(i))); } - List categories = item.getCategories(); + List categories = item.getCategories(); for(int i = 0; i < categories.size(); i++) { eItem.addContent(generateCategoryElement((Category)categories.get(i))); } diff --git a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java index 9eacee7..50eb04c 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS092Parser.java @@ -91,9 +91,9 @@ public class RSS092Parser extends RSS091UserlandParser { // 0.92 allows one enclosure occurrence, 0.93 multiple // just saving to write some code. - List eEnclosures = eItem.getChildren("enclosure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK + List eEnclosures = eItem.getChildren("enclosure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (eEnclosures.size()>0) { - List enclosures = new ArrayList(); + List enclosures = new ArrayList(); for (int i=0;i eCats = eItem.getChildren("category");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK item.setCategories(parseCategories(eCats)); return item; } - protected List parseCategories(List eCats) { - List cats = null; + protected List parseCategories(List eCats) { + List cats = null; if (eCats.size()>0) { - cats = new ArrayList(); + cats = new ArrayList(); for (int i=0;i enclosures) { return enclosures.size(); } diff --git a/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java index 61c5c86..7479e36 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS094Parser.java @@ -45,7 +45,7 @@ public class RSS094Parser extends RSS093Parser { Channel channel = (Channel) super.parseChannel(rssRoot); Element eChannel = rssRoot.getChild("channel",getRSSNamespace()); - List eCats = eChannel.getChildren("category",getRSSNamespace()); + List eCats = eChannel.getChildren("category",getRSSNamespace()); channel.setCategories(parseCategories(eCats)); Element eTtl = eChannel.getChild("ttl",getRSSNamespace()); diff --git a/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java index 9ffdc7d..0532f7e 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS10Generator.java @@ -55,7 +55,7 @@ public class RSS10Generator extends RSS090Generator { if (channel.getUri() != null) { eChannel.setAttribute("about", channel.getUri(), getRDFNamespace()); } - List items = channel.getItems(); + List items = channel.getItems(); if (items.size()>0) { Element eItems = new Element("items",getFeedNamespace()); Element eSeq = new Element("Seq",getRDFNamespace()); diff --git a/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java b/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java index 0547211..e992a0a 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS10Parser.java @@ -56,7 +56,7 @@ public class RSS10Parser extends RSS090Parser { Element rssRoot = document.getRootElement(); Namespace defaultNS = rssRoot.getNamespace(); - List additionalNSs = rssRoot.getAdditionalNamespaces(); + List additionalNSs = rssRoot.getAdditionalNamespaces(); ok = defaultNS!=null && defaultNS.equals(getRDFNamespace()); if (ok) { diff --git a/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java b/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java index 14e23ab..5d48fbd 100644 --- a/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/RSS20Generator.java @@ -56,7 +56,7 @@ public class RSS20Generator extends RSS094Generator { eChannel.addContent(generateSimpleElement("ttl", String.valueOf(ttl))); } - List categories = channel.getCategories(); + List categories = channel.getCategories(); for(int i = 0; i < categories.size(); i++) { eChannel.addContent(generateCategoryElement((Category)categories.get(i))); } diff --git a/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java b/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java index e432e1a..42abeee 100644 --- a/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java +++ b/src/main/java/com/sun/syndication/io/impl/SyModuleGenerator.java @@ -39,10 +39,10 @@ public class SyModuleGenerator implements ModuleGenerator { private static final String SY_URI = "http://purl.org/rss/1.0/modules/syndication/"; private static final Namespace SY_NS = Namespace.getNamespace("sy", SY_URI); - private static final Set NAMESPACES; + private static final Set NAMESPACES; static { - Set nss = new HashSet(); + Set nss = new HashSet(); nss.add(SY_NS); NAMESPACES = Collections.unmodifiableSet(nss); } @@ -60,7 +60,7 @@ public class SyModuleGenerator implements ModuleGenerator { * * @return a set with all the URIs (JDOM Namespace elements) this module generator uses. */ - public Set getNamespaces() { + public Set getNamespaces() { return NAMESPACES; } diff --git a/src/main/java/com/sun/syndication/io/impl/XmlFixerReader.java b/src/main/java/com/sun/syndication/io/impl/XmlFixerReader.java index 88a98b2..b5a2d12 100644 --- a/src/main/java/com/sun/syndication/io/impl/XmlFixerReader.java +++ b/src/main/java/com/sun/syndication/io/impl/XmlFixerReader.java @@ -339,7 +339,7 @@ public class XmlFixerReader extends Reader { in.close(); } - private static Map CODED_ENTITIES = new HashMap(); + private static Map CODED_ENTITIES = new HashMap(); static { // note: refer to Character entity references in HTML 4 diff --git a/src/test/java/com/sun/syndication/unittest/SyndFeedTest.java b/src/test/java/com/sun/syndication/unittest/SyndFeedTest.java index b7694fe..4130521 100644 --- a/src/test/java/com/sun/syndication/unittest/SyndFeedTest.java +++ b/src/test/java/com/sun/syndication/unittest/SyndFeedTest.java @@ -95,7 +95,7 @@ public abstract class SyndFeedTest extends FeedTest { } public void testEntries() throws Exception { - List entrylist = getCachedSyndFeed().getEntries(); + List entrylist = getCachedSyndFeed().getEntries(); assertEquals(2, entrylist.size()); } @@ -228,7 +228,7 @@ public abstract class SyndFeedTest extends FeedTest { http://blogs.law.harvard.edu/tech/rss 60 - (PICS-1.1 Òhttp://www.classify.org/safesurf/Ó l r (SS~~000 1)) + (PICS-1.1 �http://www.classify.org/safesurf/� l r (SS~~000 1)) 0 diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03.java index 2d51454..70ae98e 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03.java @@ -52,7 +52,7 @@ public class TestSyndFeedAtom03 extends SyndFeedTest { protected void _testEntry(int i) throws Exception { - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getTitle(),"feed.entry["+i+"].title"); assertProperty(entry.getLink(),"feed.entry["+i+"].link^href"); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03DCSyModules.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03DCSyModules.java index f71f59e..a37f447 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03DCSyModules.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom03DCSyModules.java @@ -101,7 +101,7 @@ public class TestSyndFeedAtom03DCSyModules extends TestSyndFeedAtom03 { } protected void _testEntryDCModule(int i) throws Exception { - List entries = getCachedSyndFeed().getEntries(); + List entries = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) entries.get(i); DCModule dc = (DCModule) entry.getModule(DCModule.URI); _testDCModule(dc,"feed.entry["+i+"].",true,i); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10.java index af731c4..a553cc0 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10.java @@ -7,8 +7,9 @@ package com.sun.syndication.unittest; import java.util.Date; import java.util.List; +import org.jdom2.Element; + import com.sun.syndication.feed.atom.Entry; -import com.sun.syndication.feed.rss.Item; import com.sun.syndication.feed.synd.SyndContent; import com.sun.syndication.feed.synd.SyndEnclosure; import com.sun.syndication.feed.synd.SyndEntry; @@ -39,7 +40,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 { assertProperty(getCachedSyndFeed().getTitleEx().getValue(),"feed.title"); assertEquals("html", getCachedSyndFeed().getTitleEx().getType()); - List altLinks = getCachedSyndFeed().getLinks(); + List altLinks = getCachedSyndFeed().getLinks(); assertEquals(3, altLinks.size()); assertEquals("http://example.com/blog", ((SyndLink)altLinks.get(0)).getHref()); @@ -62,7 +63,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 { } public void testForeignMarkup() throws Exception { - assertEquals(1, ((List)getCachedSyndFeed().getForeignMarkup()).size()); + assertEquals(1, ((List)getCachedSyndFeed().getForeignMarkup()).size()); } public void testPublishedDate() throws Exception { @@ -72,7 +73,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 { protected void _testEntry(int i) throws Exception { - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getTitle(),"feed.entry["+i+"].title"); @@ -86,10 +87,10 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 { assertEquals(entry.getPublishedDate(),d); assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary"); assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]"); - assertEquals(1, ((List)entry.getForeignMarkup()).size()); + assertEquals(1, ((List)entry.getForeignMarkup()).size()); if (i == 0) { - List links = entry.getLinks(); + List links = entry.getLinks(); assertEquals(4, links.size()); assertEquals("http://example.com/blog/entry1", ((SyndLink)links.get(0)).getHref()); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10Bray.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10Bray.java index 1896905..7852259 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10Bray.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10Bray.java @@ -4,10 +4,6 @@ import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.impl.Atom10Parser; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - public class TestSyndFeedAtom10Bray extends FeedTest { protected void setUp() throws Exception { diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10b.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10b.java index 0850c87..fbff42f 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10b.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10b.java @@ -4,8 +4,6 @@ import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.impl.Atom10Parser; -import java.util.ArrayList; -import java.util.Iterator; import java.util.List; public class TestSyndFeedAtom10b extends FeedTest { @@ -26,9 +24,8 @@ public class TestSyndFeedAtom10b extends FeedTest { } public void testXmlBaseConformance() throws Exception { - List errors = new ArrayList(); SyndFeed feed = getSyndFeed(false); - List entries = feed.getEntries(); + List entries = feed.getEntries(); for (int index = 0; index < entries.size(); index++) { SyndEntry entry = (SyndEntry) entries.get(index); assertEquals( diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10prefix.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10prefix.java index f5962f7..01c2b0b 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10prefix.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedAtom10prefix.java @@ -1,15 +1,7 @@ package com.sun.syndication.unittest; -import com.sun.syndication.feed.synd.SyndLink; -import com.sun.syndication.feed.synd.SyndEntry; -import com.sun.syndication.feed.synd.SyndEnclosure; -import com.sun.syndication.feed.synd.SyndContent; import com.sun.syndication.feed.atom.Feed; import com.sun.syndication.feed.atom.Link; -import com.sun.syndication.io.impl.DateParser; - -import java.util.List; -import java.util.Date; public class TestSyndFeedAtom10prefix extends FeedTest { diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS090.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS090.java index ea865dc..f1a1806 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS090.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS090.java @@ -51,7 +51,7 @@ public class TestSyndFeedRSS090 extends SyndFeedTest { } protected void _testItem(int i) throws Exception { - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getTitle(),"item["+i+"].title"); assertProperty(entry.getLink(),"item["+i+"].link"); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS091N.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS091N.java index 302093a..a8e9b40 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS091N.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS091N.java @@ -62,7 +62,7 @@ public class TestSyndFeedRSS091N extends SyndFeedTest { } protected void _testItem(int i) throws Exception { - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getTitle(),"channel.item["+i+"].title"); assertProperty(entry.getLink(),"channel.item["+i+"].link"); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS092.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS092.java index c77808a..8c89b27 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS092.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS092.java @@ -32,7 +32,7 @@ public class TestSyndFeedRSS092 extends TestSyndFeedRSS091N { protected void _testItem(int i) throws Exception { super._testItem(i); - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getTitle(),"channel.item["+i+"].title"); @@ -42,9 +42,9 @@ public class TestSyndFeedRSS092 extends TestSyndFeedRSS091N { _testEnclosures(entry.getEnclosures(),"channel.item["+i+"]"); } - protected void _testCategories(List cats,String prefix) throws Exception { - Set s1 = new HashSet(); - Set s2 = new HashSet(); + protected void _testCategories(List cats,String prefix) throws Exception { + Set s1 = new HashSet(); + Set s2 = new HashSet(); for (int i=0;i encs,String prefix) throws Exception { + Set s1 = new HashSet(); + Set s2 = new HashSet(); for (int i=0;i encs,String prefix) throws Exception { + Set s1 = new HashSet(); + Set s2 = new HashSet(); for (int i=0;i items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); Date d = DateParser.parseRFC822("Mon, 0"+(i+1)+" Jan 2001 00:00:00 GMT"); assertEquals(entry.getPublishedDate(),d); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS094.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS094.java index f33b983..9ada491 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS094.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS094.java @@ -41,7 +41,7 @@ public class TestSyndFeedRSS094 extends TestSyndFeedRSS093 { protected void _testItem(int i) throws Exception { super._testItem(i); - List items = getCachedSyndFeed() + List items = getCachedSyndFeed() .getEntries(); SyndEntry entry = (SyndEntry) items.get(i); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10.java index 18bcb36..fbb9113 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10.java @@ -34,7 +34,7 @@ public class TestSyndFeedRSS10 extends TestSyndFeedRSS090 { protected void _testItem(int i) throws Exception { super._testItem(i); - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(entry.getDescription().getValue(),"item["+i+"].description"); assertProperty(((SyndContent)entry.getContents().get(0)).getValue(), "item["+i+"].content"); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCMulti.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCMulti.java index 6c2dc2f..1af2f00 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCMulti.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCMulti.java @@ -96,7 +96,7 @@ public class TestSyndFeedRSS10DCMulti extends TestSyndFeedRSS10 { } protected void _testItemDCModule(int i) throws Exception { - List entries = getCachedSyndFeed().getEntries(); + List entries = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) entries.get(i); DCModule dc = (DCModule) entry.getModule(DCModule.URI); _testDCModule(dc, "item[" + i + "]."); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCSyModules.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCSyModules.java index 7bd8375..8f141d4 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCSyModules.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS10DCSyModules.java @@ -86,7 +86,7 @@ public class TestSyndFeedRSS10DCSyModules extends TestSyndFeedRSS10 { } protected void _testItemDCModule(int i) throws Exception { - List entries = getCachedSyndFeed().getEntries(); + List entries = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) entries.get(i); DCModule dc = (DCModule) entry.getModule(DCModule.URI); _testDCModule(dc,"item["+i+"]."); diff --git a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS20.java b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS20.java index 9e07eb1..1f7338c 100644 --- a/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS20.java +++ b/src/test/java/com/sun/syndication/unittest/TestSyndFeedRSS20.java @@ -32,7 +32,7 @@ public class TestSyndFeedRSS20 extends TestSyndFeedRSS094 { protected void _testItem(int i) throws Exception { super._testItem(i); - List items = getCachedSyndFeed().getEntries(); + List items = getCachedSyndFeed().getEntries(); SyndEntry entry = (SyndEntry) items.get(i); assertProperty(((SyndContent)entry.getContents().get(0)).getValue(), "channel.item["+i+"].content"); } diff --git a/src/test/java/com/sun/syndication/unittest/TestXmlReader.java b/src/test/java/com/sun/syndication/unittest/TestXmlReader.java index 859dbfb..63c68d6 100644 --- a/src/test/java/com/sun/syndication/unittest/TestXmlReader.java +++ b/src/test/java/com/sun/syndication/unittest/TestXmlReader.java @@ -247,7 +247,7 @@ public class TestXmlReader extends TestCase { private static final int[] UTF_16LE_BOM_BYTES = {0xFF,0XFE}; private static final int[] UTF_8_BOM_BYTES = {0xEF,0xBB,0xBF}; - private static final Map BOMs = new HashMap(); + private static final Map BOMs = new HashMap(); static { BOMs.put("no-bom",NO_BOM_BYTES); @@ -271,7 +271,7 @@ public class TestXmlReader extends TestCase { private static final MessageFormat INFO = new MessageFormat( "\nBOM : {0}\nDoc : {1}\nStream Enc : {2}\nProlog Enc : {3}\n"); - private static final Map XMLs = new HashMap(); + private static final Map XMLs = new HashMap(); static { XMLs.put(XML1, XML);