X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fyaz4j%2FResultSet.java;h=1bae33f36adfc3c68ed1f8d98e6473eeefb0a3d4;hb=a2a53e742c9f927aad2a45a19e4796ef26e8ad0b;hp=b2fd11958beb65d303f0ceef91cf1afcf7cfa3e3;hpb=098106513b8d3ae22e83c26ed6213fa3ea4c7371;p=yaz4j-moved-to-github.git diff --git a/src/main/java/org/yaz4j/ResultSet.java b/src/main/java/org/yaz4j/ResultSet.java index b2fd119..1bae33f 100644 --- a/src/main/java/org/yaz4j/ResultSet.java +++ b/src/main/java/org/yaz4j/ResultSet.java @@ -64,6 +64,8 @@ public class ResultSet implements Iterable { * @return result set (self) for chainability */ public ResultSet option(String name, String value) { + if (name == null) + throw new NullPointerException("option name cannot be null"); yaz4jlib.ZOOM_resultset_option_set(resultSet, name, value); return this; } @@ -77,7 +79,7 @@ public class ResultSet implements Iterable { } int errorCode = yaz4jlib.ZOOM_record_error(record, null, null, null); if (errorCode != 0) { - throw new ZoomException("Record excpetion, code " + errorCode); + throw new ZoomException("Record exception, code " + errorCode); } return new Record(record, this); } @@ -106,7 +108,7 @@ public class ResultSet implements Iterable { } int errorCode = yaz4jlib.ZOOM_record_error(record, null, null, null); if (errorCode != 0) { - throw new ZoomException("Record excpetion, code " + errorCode); + throw new ZoomException("Record exception, code " + errorCode); } out.add(new Record(record, this)); } @@ -146,6 +148,10 @@ public class ResultSet implements Iterable { * @throws ZoomException */ public ResultSet sort(String type, String spec) throws ZoomException { + if (type == null) + throw new NullPointerException("sort type cannot be null"); + if (spec == null) + throw new NullPointerException("sort spec cannot be null"); int ret = yaz4jlib.ZOOM_resultset_sort1(resultSet, type, spec); if (ret != 0) throw new ZoomException("Sorting resultset failed"); return this;