let SolrQuery take null start/rows to remove them (rather then throw NPE)

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@609854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2008-01-08 02:57:08 +00:00
parent b80c55ebb4
commit 2a074e6dc1
1 changed files with 12 additions and 2 deletions

View File

@ -372,8 +372,13 @@ public class SolrQuery extends ModifiableSolrParams
} }
public void setRows(Integer rows) { public void setRows(Integer rows) {
if( rows == null ) {
this.remove( CommonParams.ROWS );
}
else {
this.set(CommonParams.ROWS, rows); this.set(CommonParams.ROWS, rows);
} }
}
public Integer getRows() public Integer getRows()
{ {
@ -390,8 +395,13 @@ public class SolrQuery extends ModifiableSolrParams
// } // }
public void setStart(Integer start) { public void setStart(Integer start) {
if( start == null ) {
this.remove( CommonParams.START );
}
else {
this.set(CommonParams.START, start); this.set(CommonParams.START, start);
} }
}
public Integer getStart() public Integer getStart()
{ {