rometools / rome

Java library for RSS and Atom feeds
https://rometools.github.io/rome
Apache License 2.0
909 stars 168 forks source link

RSS item category iteration should try to reflect document order #122

Closed PatrickGotthard closed 11 years ago

PatrickGotthard commented 11 years ago
=== This issue was migrated from JIRA ===
Type: Task
Priority: Major
Status: Resolved
Resolution: Fixed
Reported by: jabley
Assigned to: ROME Jira Lead
Created: Fri Jan 23 12:18:53 CET 2009
Updated: Mon Mar 02 09:43:32 CET 2009
Resolved: Mon Mar 02 09:43:32 CET 2009
Version: current
Fix version: milestone 1
JIRA Link: https://rometools.jira.com/browse/ROME-121
=========================================

When parsing RSS feeds which contain categories, iterating the SyndEntry does
not reflect document order. Under normal conditions, this is not important, but
it's nice to have.

Index: src/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java
===================================================================
RCS file:\\ /cvs/rome/src/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java,v
retrieving revision 1.6
diff -u -r1.6 ConverterForRSS092.java
— src/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java 15 Sep
2005 16:54:45 -0000 1.6
+++ src/java/com/sun/syndication/feed/synd/impl/ConverterForRSS092.java 23 Jan
2009 13:16:21 -0000
@@ -22,9 +22,9 @@
import com.sun.syndication.feed.synd.*;

import java.util.ArrayList;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import java.util.HashSet;

/**
*/
@@ -42,7 +42,7 @@
SyndEntry syndEntry = super.createSyndEntry(item);
List cats = item.getCategories();
if (cats.size()>0) {

PatrickGotthard commented 11 years ago
=== This comment was migrated from JIRA ===
Author: nlothian
Created: Sun Mar 01 21:11:58 CET 2009
===========================================

Looks sensible

PatrickGotthard commented 11 years ago
=== This comment was migrated from JIRA ===
Author: nlothian
Created: Sun Mar 01 21:15:36 CET 2009
===========================================

Patch committed

PatrickGotthard commented 11 years ago
=== This comment was migrated from JIRA ===
Author: jabley
Created: Mon Mar 02 09:43:32 CET 2009
===========================================

Thanks for addressing this. One minor point: my bad. I really should have
included a test as well. I'll try to fix that.