NPE in OpenSearchModuleParser

Description

For twitter search feeds, partial implementation of OpenSearch causes an NPE.

Sample Feed URL that demonstrates the problem:
http://search.twitter.com/search.atom?q=Streetofeames

Exception: Caused by: java.lang.NullPointerException
com.sun.syndication.feed.module.opensearch.impl.OpenSearchModuleParser.parse(OpenSearchModuleParser.java:80)

Fix: Wrap itemsPerPage and startIndex in 'if (e != null)' like is done with
totalResults already:

e = dcRoot.getChild("itemsPerPage", OS_NS);

if (e != null) {
foundSomething = true;

try{ osm.setItemsPerPage(Integer.parseInt(e.getText())); } catch(NumberFormatException ex){ // Ignore setting the field and post a warning System.err.println("Warning: The element itemsPerPage must be aninteger value: " + ex.getMessage()); }
}

e = dcRoot.getChild("startIndex", OS_NS);

if (e != null) {
foundSomething = true;

try{ osm.setStartIndex(Integer.parseInt(e.getText())); } catch(NumberFormatException ex){ // Ignore setting the field and post a warning System.err.println("Warning: The element startIndex must be an integervalue: " + ex.getMessage()); }
}

Environment

None

Status

Assignee

ROME Jira Lead

Reporter

jnadler

Labels

None

Participants

None

Affects versions

current

Priority

Major