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,7 +372,12 @@ public class SolrQuery extends ModifiableSolrParams
} }
public void setRows(Integer rows) { public void setRows(Integer rows) {
this.set(CommonParams.ROWS, rows); if( rows == null ) {
this.remove( CommonParams.ROWS );
}
else {
this.set(CommonParams.ROWS, rows);
}
} }
public Integer getRows() public Integer getRows()
@ -390,7 +395,12 @@ public class SolrQuery extends ModifiableSolrParams
// } // }
public void setStart(Integer start) { public void setStart(Integer start) {
this.set(CommonParams.START, start); if( start == null ) {
this.remove( CommonParams.START );
}
else {
this.set(CommonParams.START, start);
}
} }
public Integer getStart() public Integer getStart()