Index: CHANGES.txt
===================================================================
--- CHANGES.txt	(revision 804994)
+++ CHANGES.txt	(working copy)
@@ -61,7 +61,8 @@
     Going forward Searchable will be kept for convenience only and may
     be changed between minor releases without any deprecation
     process. It is not recommended that you implement it, but rather extend
-    Searcher.  (Shai Erera, Chris Hostetter, Mark Miller via Mike McCandless)
+    Searcher.  
+    (Shai Erera, Chris Hostetter, Martin Ruckli, Mark Miller via Mike McCandless)
 
  4. LUCENE-1422, LUCENE-1693: The new TokenStream API (see below) using
     Attributes has some backwards breaks in rare cases.
@@ -320,7 +321,7 @@
     out of order when used with a Collector that can accept docs out of order.
     Finally, Weight#explain now also takes a the top-level searcher, sub-reader 
     and sub-docID.
-    (Shai Erera, Chris Hostetter, Mark Miller via Mike McCandless)
+    (Shai Erera, Chris Hostetter, Martin Ruckli, Mark Miller via Mike McCandless)
  	
 25. LUCENE-1466: Changed Tokenizer.input to be a CharStream; added
     CharFilter and MappingCharFilter, which allows chaining & mapping
Index: src/java/org/apache/lucene/search/QueryWrapperFilter.java
===================================================================
--- src/java/org/apache/lucene/search/QueryWrapperFilter.java	(revision 804994)
+++ src/java/org/apache/lucene/search/QueryWrapperFilter.java	(working copy)
@@ -48,6 +48,7 @@
    * @deprecated Use {@link #getDocIdSet(IndexReader)} instead.
    */
   public BitSet bits(IndexReader reader) throws IOException {
+    System.out.println("dep");
     final BitSet bits = new BitSet(reader.maxDoc());
 
     new IndexSearcher(reader).search(query, new Collector() {
@@ -69,7 +70,8 @@
   }
   
   public DocIdSet getDocIdSet(final IndexReader reader) throws IOException {
-    final Weight weight = query.createWeight(new IndexSearcher(reader));
+    System.out.println("doc");
+    final Weight weight = query.weight(new IndexSearcher(reader));
     return new DocIdSet() {
       public DocIdSetIterator iterator() throws IOException {
         return weight.scorer(reader, true, false);
Index: src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
===================================================================
--- src/test/org/apache/lucene/search/TestQueryWrapperFilter.java	(revision 0)
+++ src/test/org/apache/lucene/search/TestQueryWrapperFilter.java	(revision 0)
@@ -0,0 +1,53 @@
+package org.apache.lucene.search;
+
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Field.Index;
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.RAMDirectory;
+import org.apache.lucene.util.LuceneTestCase;
+
+public class TestQueryWrapperFilter extends LuceneTestCase {
+
+  public void testBasic() throws Exception {
+    Directory dir = new RAMDirectory();
+    IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(), true,
+        IndexWriter.MaxFieldLength.LIMITED);
+    Document doc = new Document();
+    doc.add(new Field("field", "value", Store.NO, Index.ANALYZED));
+    writer.addDocument(doc);
+    writer.close();
+
+    TermQuery termQuery = new TermQuery(new Term("field", "value"));
+
+    // should not throw exception with primitive query
+    QueryWrapperFilter qwf = new QueryWrapperFilter(termQuery);
+
+    IndexSearcher searcher = new IndexSearcher(dir, true);
+    TopDocs hits = searcher.search(new MatchAllDocsQuery(), qwf, 10);
+    assertEquals(1, hits.totalHits);
+
+    // should not throw exception with non primitive query
+    BooleanQuery booleanQuery = new BooleanQuery();
+    booleanQuery.add(termQuery, Occur.MUST);
+    booleanQuery.add(new TermQuery(new Term("field", "missing")),
+        Occur.MUST_NOT);
+    qwf = new QueryWrapperFilter(termQuery);
+
+    hits = searcher.search(new MatchAllDocsQuery(), qwf, 10);
+    assertEquals(1, hits.totalHits);
+
+    // should not throw exception with Query that doesn't implement
+    // Query#createWeight
+    qwf = new QueryWrapperFilter(new FuzzyQuery(new Term("field", "valu")));
+
+    hits = searcher.search(new MatchAllDocsQuery(), qwf, 10);
+    assertEquals(1, hits.totalHits);
+
+  }
+}

