Index: CHANGES.txt
===================================================================
--- CHANGES.txt	(revision 437174)
+++ CHANGES.txt	(working copy)
@@ -137,6 +137,11 @@
 Test Cases
   1. Added TestTermScorer.java (Grant Ingersoll)
 
+  2. Modified TestRangeQuery.java; Added two more tests: testInclusiveLowerNull and
+     testExclusiveLowerNull, to complement the existing testExclusive and
+     testInclusive.  This is done in preparation for fixing LUCENE-38.
+     
+
 Documentation
 
   1. Added style sheet to xdocs named lucene.css and included in the Anakia VSL descriptor.  (Grant Ingersoll)
Index: src/test/org/apache/lucene/search/TestRangeQuery.java
===================================================================
--- src/test/org/apache/lucene/search/TestRangeQuery.java	(revision 437174)
+++ src/test/org/apache/lucene/search/TestRangeQuery.java	(working copy)
@@ -45,6 +45,44 @@
     searcher.close();
   }
 
+    public void testExclusiveLowerNull() throws Exception {
+        //this test is added to cover big reported in LUCENE-38
+        //http://issues.apache.org/jira/browse/LUCENE-38
+        Query query = new RangeQuery(null,
+                                     new Term("content", "C"),
+                                     false);
+        initializeIndex(new String[] {"A", "B", "", "C", "D"});
+        IndexSearcher searcher = new IndexSearcher(dir);
+        Hits hits = searcher.search(query);
+        // When Lucene-38 is fixed, use the assert on the nexy line:
+        // assertEquals("A,B,<empty string>,C,D => A, B & <empty string> are in range", 3, hits.length());
+        // until Lucene-38 is fixed, use this assert:
+       assertEquals("A,B,<empty string>,C,D => A, B & <empty string> are in range", 2, hits.length());
+
+
+        searcher.close();
+
+        initializeIndex(new String[] {"A", "B", "", "D"});
+        searcher = new IndexSearcher(dir);
+        hits = searcher.search(query);
+        // When Lucene-38 is fixed, use the assert on the nexy line:
+        // assertEquals("A,B,<empty string>,D => A, B & <empty string> are in range", 3, hits.length());
+        // until Lucene-38 is fixed, use this assert:
+        assertEquals("A,B,<empty string>,D => A, B & <empty string> are in range", 2, hits.length());
+        searcher.close();
+
+        addDoc("C");
+        searcher = new IndexSearcher(dir);
+        hits = searcher.search(query);
+        // When Lucene-38 is fixed, use the assert on the nexy line:
+        // assertEquals("C added, still A, B & <empty string> are in range", 3, hits.length());
+        // until Lucene-38 is fixed, use this assert
+        assertEquals("C added, still A, B & <empty string> are in range", 2, hits.length());
+        searcher.close();
+      }
+
+
+
   public void testInclusive() throws Exception {
     Query query = new RangeQuery(new Term("content", "A"),
                                  new Term("content", "C"),
@@ -69,6 +107,42 @@
     searcher.close();
   }
 
+    public void testInclusiveLowerNull() throws Exception {
+       //this test is added to cover big reported in LUCENE-38
+       //http://issues.apache.org/jira/browse/LUCENE-38
+       Query query = new RangeQuery(null,
+                                    new Term("content", "C"),
+                                    true);
+
+       initializeIndex(new String[]{"A", "B", "","C", "D"});
+       IndexSearcher searcher = new IndexSearcher(dir);
+       Hits hits = searcher.search(query);
+       // When Lucene-38 is fixed, use the assert on the nexy line:
+       // assertEquals("A,B,<empty string>,C,D => A,B,<empty string>,C in range", 4, hits.length());
+       // until Lucene-38 is fixed, use this assert
+       assertEquals("A,B,<empty string>,C,D => A,B,<empty string>,C in range", 3, hits.length());
+       searcher.close();
+
+       initializeIndex(new String[]{"A", "B", "D"});
+       searcher = new IndexSearcher(dir);
+       hits = searcher.search(query);
+       // When Lucene-38 is fixed, use the assert on the nexy line:
+       // assertEquals("A,B,<empty string>,D - A, B and <empty string> in range", 3, hits.length());
+       // until Lucene-38 is fixed, use this assert
+       assertEquals("A,B,<empty string>,D => A, B and <empty string> in range", 2, hits.length());
+       searcher.close();
+
+       addDoc("C");
+       searcher = new IndexSearcher(dir);
+       hits = searcher.search(query);
+       // When Lucene-38 is fixed, use the assert on the nexy line:
+       // assertEquals("C added => A,B,<empty string>,C in range", 4, hits.length());
+       // until Lucene-38 is fixed, use this assert
+       assertEquals("C added => A,B,<empty string>,C in range", 3, hits.length());
+       searcher.close();
+     }
+
+
   public void testEqualsHashcode() {
     Query query = new RangeQuery(new Term("content", "A"),
                                  new Term("content", "C"),
