NPE for Twitter Atom feed with OpenSearch module

Description

Twitter, like Google's Blog Search feeds, include a subset of OpenSearch tags in
their search based Atom feeds. However, they don't include a <startIndex> tag.
The code in
com.sun.syndication.feed.module.opensearch.impl.OpenSearchModuleParser assumes
that the tag exists and tries to parse it's value into an integer. The
<itemsPerPage> tag is handled the same way. This results in
NullPointerExceptions when parsing one of their feeds.

My reading of
http://www.opensearch.org/Specifications/OpenSearch/1.1#The_.22startIndex.22_element
leads me to believe that the parser should handle missing <startIndex> and
<itemsPerPage> without RuntimeExceptions.

The fix is simply:
80c80,81
< osm.setStartIndex(Integer.parseInt(e.getText()));

> if(e!=null)
> osm.setStartIndex(Integer.parseInt(e.getText()));

Environment

None

Activity

Show:

Martin Kurz October 8, 2013 at 7:48 PM

We recently moved to GitHub. The issue is now located here: https://github.com/rometools/rome-modules/issues/23

UNRESOLVED

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created July 16, 2009 at 3:38 PM
Updated October 8, 2013 at 7:48 PM
Resolved July 16, 2009 at 3:38 PM