Index: native/Enquire.cc
===================================================================
--- native/Enquire.cc	(revision 7547)
+++ native/Enquire.cc	(working copy)
@@ -57,7 +57,7 @@
                 _deciderclass = env->GetObjectClass(obj);
                 if (!_deciderclass) goto on_error;
 
-                _acceptmethod = env->GetMethodID(_deciderclass, "accept", "(Lorg/xapian/Document;)I");
+                _acceptmethod = env->GetMethodID(_deciderclass, "accept", "(Lorg/xapian/Document;)Z");
                 if (!_acceptmethod) goto on_error;
 
 on_error:
@@ -73,13 +73,13 @@
             jclass documentclass = env->FindClass("org/xapian/Document");
             if (!documentclass) goto on_error;
 
-            ctorid = env->GetMethodID(documentclass, "<init>", "(J)");
+            ctorid = env->GetMethodID(documentclass, "<init>", "(J)V");
             if (!ctorid) goto on_error;
 
             document = env->NewObject(documentclass, ctorid, docid);
             if (!document) goto on_error;
 
-            return env->CallIntMethod(_obj, _acceptmethod, document);
+            return env->CallBooleanMethod(_obj, _acceptmethod, document);
 
 on_error:       // I can also "program" in VisualBasic
         CATCH(-1)
@@ -103,7 +103,7 @@
                 _deciderclass = env->GetObjectClass(obj);
                 if (!_deciderclass) goto on_error;
 
-                _acceptmethod = env->GetMethodID(_deciderclass, "accept", "(Ljava/lang/String;)I");
+                _acceptmethod = env->GetMethodID(_deciderclass, "accept", "(Ljava/lang/String;)Z");
                 if (!_acceptmethod) goto on_error;
 
 on_error:
@@ -112,7 +112,7 @@
 
     int operator() (const std::string &tname) const {
         TRY
-            return env->CallIntMethod(_obj, _acceptmethod, env->NewStringUTF(tname.c_str()));
+            return env->CallBooleanMethod(_obj, _acceptmethod, env->NewStringUTF(tname.c_str()));
         CATCH(-1)
     }
 };
@@ -197,7 +197,7 @@
     CATCH(-1)
 }
 
-JNIEXPORT jlong JNICALL Java_org_xapian_XapianJNI_enquire_1get_1eset__JJJIDLcom_tcdi_app_xapian_ExpandDecider_2 (JNIEnv *env, jclass clazz, jlong eid, jlong maxitems, jlong rsetid, jint flags, jdouble k, jobject ed) {
+JNIEXPORT jlong JNICALL Java_org_xapian_XapianJNI_enquire_1get_1eset__JJJIDLorg_xapian_ExpandDecider_2 (JNIEnv *env, jclass clazz, jlong eid, jlong maxitems, jlong rsetid, jint flags, jdouble k, jobject ed) {
     TRY
         Enquire *e = _enquire->get(eid);
         RSet *rset = _rset->get(rsetid);
@@ -206,7 +206,7 @@
     CATCH(-1)
 }
 
-JNIEXPORT jlong JNICALL Java_org_xapian_XapianJNI_enquire_1get_1eset__JJJLcom_tcdi_app_xapian_ExpandDecider_2 (JNIEnv *env, jclass clazz, jlong eid, jlong maxitems, jlong rsetid, jobject ed) {
+JNIEXPORT jlong JNICALL Java_org_xapian_XapianJNI_enquire_1get_1eset__JJJLorg_xapian_ExpandDecider_2 (JNIEnv *env, jclass clazz, jlong eid, jlong maxitems, jlong rsetid, jobject ed) {
     TRY
         Enquire *e = _enquire->get(eid);
         RSet *rset = _rset->get(rsetid);
Index: org/xapian/ESetIterator.java
===================================================================
--- org/xapian/ESetIterator.java	(revision 7547)
+++ org/xapian/ESetIterator.java	(working copy)
@@ -75,7 +75,7 @@
 
     public boolean hasNext() {
         try {
-            return XapianJNI.esetiterator_equals(id, _end_id);
+            return !XapianJNI.esetiterator_equals(id, _end_id);
         } catch (XapianError xe) {
             throw new XapianRuntimeError(xe);
         }
Index: org/xapian/Enquire.java
===================================================================
--- org/xapian/Enquire.java	(revision 7547)
+++ org/xapian/Enquire.java	(working copy)
@@ -111,6 +111,10 @@
         return new ESet(XapianJNI.enquire_get_eset(id, maxitems, rset.id, flags, k, ed));
     }
 
+    public ESet getESet(long maxitems, RSet rset) throws XapianError {
+        return new ESet(XapianJNI.enquire_get_eset(id, maxitems, rset.id, null));
+    }
+
     public ESet getESet(long maxitems, RSet rset, ExpandDecider ed) throws XapianError {
         return new ESet(XapianJNI.enquire_get_eset(id, maxitems, rset.id, ed));
     }
Index: org/xapian/RSet.java
===================================================================
--- org/xapian/RSet.java	(revision 7547)
+++ org/xapian/RSet.java	(working copy)
@@ -38,6 +38,10 @@
         this.id = id;
     }
 
+    public RSet() throws XapianError {
+        id = XapianJNI.rset_new();
+    }
+
     public long size() throws XapianError {
         return XapianJNI.rset_size(id);
     }
Index: SmokeTest.java
===================================================================
--- SmokeTest.java	(revision 7547)
+++ SmokeTest.java	(working copy)
@@ -20,6 +20,16 @@
 import org.xapian.*;
 import org.xapian.errors.*;
 
+class MyMatchDecider implements MatchDecider {
+    public boolean accept(Document d) {
+	return false;
+    }
+}
+
+class MyExpandDecider implements ExpandDecider {
+    public boolean accept(String s) { return s.substring(0, 1) != "a"; }
+}
+
 public class SmokeTest {
     public static void main(String[] args) throws Exception {
 	try {
@@ -95,6 +105,30 @@
 		System.err.println("OP_ELITE_SET is " + Query.OP_ELITE_SET + " not 10");
 		System.exit(1);
 	    }
+
+	    RSet rset = new RSet();
+	    rset.addDocument(1);
+	    ESet eset = enq.getESet(10, rset, new MyExpandDecider());
+	    ESetIterator eit = eset.iterator();
+	    int count = 0;
+	    while (eit.hasNext()) {
+		if (eit.getTerm().substring(0, 1) == "a") {
+		    System.err.println("MyExpandDecider wasn't used");
+		    System.exit(1);
+		}
+		++count;
+		eit.next();
+	    }
+	    if (count != eset.size()) {
+		System.err.println("ESet.size() mismatched number of terms returned by ESetIterator");
+		System.exit(1);
+	    }
+
+	    MSet mset2 = enq.getMSet(0, 10, null, new MyMatchDecider());
+	    if (mset2.size() > 0) {
+		System.err.println("MyMatchDecider wasn't used");
+		System.exit(1);
+	    }
 	} catch (Exception e) {
 	    System.err.println("Caught unexpected exception " + e.toString());
 	    System.exit(1);
