lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r915850 - in /lucene/java/branches/flex_1458: ./ contrib/queries/src/java/org/apache/lucene/search/ contrib/regex/src/java/org/apache/lucene/search/regex/ contrib/spellchecker/src/java/org/apache/lucene/search/spell/ contrib/surround/src/ja...
Date Wed, 24 Feb 2010 16:19:40 GMT
Author: mikemccand
Date: Wed Feb 24 16:19:39 2010
New Revision: 915850

URL: http://svn.apache.org/viewvc?rev=915850&view=rev
Log:
LUCENE-2111 (flex): remove some more nocommits; enable forkmode=batch; change BytesRef.toString
-> utf8ToString

Added:
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java
  (with props)
Modified:
    lucene/java/branches/flex_1458/CHANGES.txt
    lucene/java/branches/flex_1458/common-build.xml
    lucene/java/branches/flex_1458/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java
    lucene/java/branches/flex_1458/contrib/regex/src/java/org/apache/lucene/search/regex/RegexTermsEnum.java
    lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
    lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
    lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileDeleter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNames.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LegacyFieldsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMerger.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/BytesRef.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/FlexTestUtil.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestCodecs.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDoc.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestSegmentMerger.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java

Modified: lucene/java/branches/flex_1458/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/CHANGES.txt?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/CHANGES.txt Wed Feb 24 16:19:39 2010
@@ -30,6 +30,11 @@
   advanced APIs and subject to change suddenly.
   (Robert Muir, Mike McCandless)
 
+* LUCENE-1458: Flex API changes:
+  - Directory.copy now copies all files (not just index files), since
+    what is and isn't and index file is now dependent on the codec
+    used.
+
 Changes in runtime behavior
 
 * LUCENE-1923: Made IndexReader.toString() produce something

Modified: lucene/java/branches/flex_1458/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/common-build.xml?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/common-build.xml (original)
+++ lucene/java/branches/flex_1458/common-build.xml Wed Feb 24 16:19:39 2010
@@ -43,7 +43,7 @@
   <property name="dev.version" value="3.1-dev"/>
   <property name="version" value="${dev.version}"/>
   <property name="backwards.branch" value="flex_1458_3_0_back_compat_tests"/>
-  <property name="backwards.rev" value="915514"/>
+  <property name="backwards.rev" value="915849"/>
   <property name="spec.version" value="${version}"/>	
   <property name="year" value="2000-${current.year}"/>
   <property name="final.name" value="lucene-${name}-${version}"/>
@@ -398,7 +398,7 @@
 	    </condition>
 	  	<mkdir dir="@{junit.output.dir}"/>
 	    <junit printsummary="off" haltonfailure="no" maxmemory="512M"
-	      errorProperty="tests.failed" failureProperty="tests.failed">
+	      errorProperty="tests.failed" failureProperty="tests.failed" forkmode="perBatch">
 	      <classpath refid="@{junit.classpath}"/>
 	      <assertions>
 	        <enable package="org.apache.lucene"/>

Modified: lucene/java/branches/flex_1458/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/queries/src/java/org/apache/lucene/search/FuzzyLikeThisQuery.java
Wed Feb 24 16:19:39 2010
@@ -213,7 +213,7 @@
                         totalVariantDocFreqs+=fe.docFreq();
                         float score=boostAtt.getBoost();
                         if (variantsQ.size() < MAX_VARIANTS_PER_TERM || score > minScore){
-                          ScoreTerm st=new ScoreTerm(new Term(startTerm.field(), possibleMatch.toString()),score,startTerm);
                   
+                          ScoreTerm st=new ScoreTerm(new Term(startTerm.field(), possibleMatch.utf8ToString()),score,startTerm);
                   
                           variantsQ.insertWithOverflow(st);
                           minScore = variantsQ.top().score; // maintain minScore
                         }

Modified: lucene/java/branches/flex_1458/contrib/regex/src/java/org/apache/lucene/search/regex/RegexTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/regex/src/java/org/apache/lucene/search/regex/RegexTermsEnum.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/regex/src/java/org/apache/lucene/search/regex/RegexTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/contrib/regex/src/java/org/apache/lucene/search/regex/RegexTermsEnum.java
Wed Feb 24 16:19:39 2010
@@ -56,7 +56,7 @@
   @Override
   protected final AcceptStatus accept(BytesRef term) {
     if (term.startsWith(prefixRef)) {
-      return regexImpl.match(term.toString()) ? AcceptStatus.YES : AcceptStatus.NO;
+      return regexImpl.match(term.utf8ToString()) ? AcceptStatus.YES : AcceptStatus.NO;
     } else {
       return AcceptStatus.END;
     }

Modified: lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LuceneDictionary.java
Wed Feb 24 16:19:39 2010
@@ -74,7 +74,7 @@
         return null;
       }
 
-      String result = pendingTerm.toString();
+      String result = pendingTerm.utf8ToString();
 
       try {
         pendingTerm = termsEnum.next();

Modified: lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndPrefixQuery.java
Wed Feb 24 16:19:39 2010
@@ -70,7 +70,7 @@
         expanded = true;
       } else if (status == TermsEnum.SeekStatus.NOT_FOUND) {
         if (termsEnum.term().startsWith(prefixRef)) {
-          mtv.visitMatchingTerm(new Term(fieldName, termsEnum.term().toString()));
+          mtv.visitMatchingTerm(new Term(fieldName, termsEnum.term().utf8ToString()));
           expanded = true;
         } else {
           skip = true;
@@ -84,7 +84,7 @@
         while(true) {
           BytesRef text = termsEnum.next();
           if (text != null && text.startsWith(prefixRef)) {
-            mtv.visitMatchingTerm(new Term(fieldName, text.toString()));
+            mtv.visitMatchingTerm(new Term(fieldName, text.utf8ToString()));
             expanded = true;
           } else {
             break;

Modified: lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
(original)
+++ lucene/java/branches/flex_1458/contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SrndTruncQuery.java
Wed Feb 24 16:19:39 2010
@@ -108,7 +108,7 @@
 
         while(text != null) {
           if (text != null && text.startsWith(prefixRef)) {
-            String textString = text.toString();
+            String textString = text.utf8ToString();
             matcher.reset(textString.substring(prefixLength));
             if (matcher.matches()) {
               mtv.visitMatchingTerm(new Term(fieldName, textString));

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileDeleter.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileDeleter.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileDeleter.java
Wed Feb 24 16:19:39 2010
@@ -143,27 +143,7 @@
     // First pass: walk the files and initialize our ref
     // counts:
     long currentGen = segmentInfos.getGeneration();
-    final Collection<String> codecsExtensions = codecs.getAllExtensions();
-    final FilenameFilter mainFilter = IndexFileNameFilter.getFilter();
-
-    indexFilenameFilter = new FilenameFilter() {
-        public boolean accept(File dir, String name) {
-          if (mainFilter.accept(dir, name)) {
-            return true;
-          } else {
-            // See if any of the codecs claim this
-            // extension:
-            int i = name.lastIndexOf('.');
-            if (i != -1) {
-              String extension = name.substring(1+i);
-              if (codecsExtensions.contains(extension)) {
-                return true;
-              }
-            }
-            return false;
-        }
-      }
-      };
+    indexFilenameFilter = new IndexFileNameFilter(codecs);
     
     String[] files = directory.listAll();
 

Added: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java?rev=915850&view=auto
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java
(added)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java
Wed Feb 24 16:19:39 2010
@@ -0,0 +1,70 @@
+package org.apache.lucene.index;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.HashSet;
+import org.apache.lucene.index.codecs.Codecs;
+
+/**
+ * Filename filter that accept filenames and extensions only
+ * created by Lucene.
+ *
+ * @lucene.internal
+ */
+
+public class IndexFileNameFilter implements FilenameFilter {
+
+  private final HashSet<String> extensions;
+
+  public IndexFileNameFilter(Codecs codecs) {
+    extensions = new HashSet<String>();
+    for (int i = 0; i < IndexFileNames.INDEX_EXTENSIONS.length; i++) {
+      extensions.add(IndexFileNames.INDEX_EXTENSIONS[i]);
+    }
+    if (codecs != null) {
+      for(String ext : codecs.getAllExtensions()) {
+        extensions.add(ext);
+      }
+    }
+  }
+
+  /* (non-Javadoc)
+   * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
+   */
+  public boolean accept(File dir, String name) {
+    int i = name.lastIndexOf('.');
+    if (i != -1) {
+      String extension = name.substring(1+i);
+      if (extensions.contains(extension)) {
+        return true;
+      } else if (extension.startsWith("f") &&
+                 extension.matches("f\\d+")) {
+        return true;
+      } else if (extension.startsWith("s") &&
+                 extension.matches("s\\d+")) {
+        return true;
+      }
+    } else {
+      if (name.equals(IndexFileNames.DELETABLE)) return true;
+      else if (name.startsWith(IndexFileNames.SEGMENTS)) return true;
+    }
+    return false;
+  }
+}

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNameFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNames.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNames.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNames.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexFileNames.java Wed
Feb 24 16:19:39 2010
@@ -17,10 +17,19 @@
  * limitations under the License.
  */
 
+import org.apache.lucene.index.codecs.Codec;
+
 /**
- * Useful constants representing filenames and extensions used by lucene
+ * Useful constants representing filenames and extensions
+ * used by lucene.
+ *
+ * <p><b>NOTE</b>: extensions used by codecs are not
+ * listed here.  You must interact with the {@link Codec}
+ * directly.
+ *
+ * @lucene.internal
  */
-// nocommit -- made public
+
 public final class IndexFileNames {
 
   /** Name of the index segment file */
@@ -36,18 +45,6 @@
   /** Extension of norms file */
   static final String NORMS_EXTENSION = "nrm";
 
-  /** Extension of freq postings file */
-  //static final String FREQ_EXTENSION = "frq";
-
-  /** Extension of prox postings file */
-  //static final String PROX_EXTENSION = "prx";
-
-  /** Extension of terms file */
-  //static final String TERMS_EXTENSION = "tis";
-
-  /** Extension of terms index file */
-  //static final String TERMS_INDEX_EXTENSION = "tii";
-
   /** Extension of stored fields index file */
   static final String FIELDS_INDEX_EXTENSION = "fdx";
 
@@ -64,7 +61,6 @@
   static final String VECTORS_INDEX_EXTENSION = "tvx";
 
   /** Extension of compound file */
-  // nocommit made public
   public static final String COMPOUND_FILE_EXTENSION = "cfs";
 
   /** Extension of compound file for doc store files*/
@@ -85,6 +81,9 @@
   /** Extension of gen file */
   static final String GEN_EXTENSION = "gen";
 
+  // nocommit -- more cleanup needed -- do we really use all
+  // these arrays below?
+
   /**
    * This array contains all filename extensions used by
    * Lucene's index files, with two exceptions, namely the
@@ -98,10 +97,6 @@
     FIELD_INFOS_EXTENSION,
     FIELDS_INDEX_EXTENSION,
     FIELDS_EXTENSION,
-    //TERMS_INDEX_EXTENSION,
-    //TERMS_EXTENSION,
-    //FREQ_EXTENSION,
-    //PROX_EXTENSION,
     DELETES_EXTENSION,
     VECTORS_INDEX_EXTENSION,
     VECTORS_DOCUMENTS_EXTENSION,
@@ -109,11 +104,6 @@
     GEN_EXTENSION,
     NORMS_EXTENSION,
     COMPOUND_FILE_STORE_EXTENSION,
-    // nocommit -- need cleaner way!
-    "doc",
-    "pos",
-    "pyl",
-    "skp"
   };
 
   /** File extensions that are added to a compound file
@@ -122,10 +112,6 @@
     FIELD_INFOS_EXTENSION,
     FIELDS_INDEX_EXTENSION,
     FIELDS_EXTENSION,
-    //TERMS_INDEX_EXTENSION,
-    //TERMS_EXTENSION,
-    //FREQ_EXTENSION,
-    //PROX_EXTENSION,
     VECTORS_INDEX_EXTENSION,
     VECTORS_DOCUMENTS_EXTENSION,
     VECTORS_FIELDS_EXTENSION,
@@ -142,22 +128,14 @@
 
   static final String[] NON_STORE_INDEX_EXTENSIONS = new String[] {
     FIELD_INFOS_EXTENSION,
-    //FREQ_EXTENSION,
-    //PROX_EXTENSION,
-    //TERMS_EXTENSION,
-    //TERMS_INDEX_EXTENSION,
     NORMS_EXTENSION
   };
   
   /** File extensions of old-style index files */
   static final String COMPOUND_EXTENSIONS[] = new String[] {
     FIELD_INFOS_EXTENSION,
-    //FREQ_EXTENSION,
-    //PROX_EXTENSION,
     FIELDS_INDEX_EXTENSION,
     FIELDS_EXTENSION,
-    //TERMS_INDEX_EXTENSION,
-    //TERMS_EXTENSION
   };
 
   static final String COMPOUND_EXTENSIONS_NOT_CODEC[] = new String[] {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java Wed Feb
24 16:19:39 2010
@@ -3226,7 +3226,7 @@
 
       try {
         mergedName = newSegmentName();
-        merger = new SegmentMerger(this, mergedName, null, codecs);
+        merger = new SegmentMerger(directory, termIndexInterval, mergedName, null, codecs);
 
         SegmentReader sReader = null;
         synchronized(this) {
@@ -4241,7 +4241,7 @@
     if (infoStream != null)
       message("merging " + merge.segString(directory));
 
-    merger = new SegmentMerger(this, mergedName, merge, codecs);
+    merger = new SegmentMerger(directory, termIndexInterval, mergedName, merge, codecs);
 
     merge.readers = new SegmentReader[numSegments];
     merge.readersClone = new SegmentReader[numSegments];

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LegacyFieldsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LegacyFieldsEnum.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LegacyFieldsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LegacyFieldsEnum.java
Wed Feb 24 16:19:39 2010
@@ -92,7 +92,7 @@
       if (terms != null) {
         terms.close();
       }
-      terms = r.terms(new Term(field, text.toString()));
+      terms = r.terms(new Term(field, text.utf8ToString()));
 
       final Term t = terms.term();
       if (t == null) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfo.java Wed Feb
24 16:19:39 2010
@@ -400,14 +400,12 @@
         if (result == null)
           throw new IOException("cannot read directory " + dir + ": listAll() returned null");
 
-        final IndexFileNameFilter filter = IndexFileNameFilter.getFilter();
-        String pattern;
-        pattern = name + ".s";
-        int patternLength = pattern.length();
+        final String pattern = name + ".s\\d+";
         for(int i = 0; i < result.length; i++){
           String fileName = result[i];
-          if (filter.accept(null, fileName) && fileName.startsWith(pattern) &&
Character.isDigit(fileName.charAt(patternLength)))
-              return true;
+          if (fileName.matches(pattern)) {
+            return true;
+          }
         }
         return false;
       }
@@ -701,16 +699,17 @@
       // Pre-2.1: we have to scan the dir to find all
       // matching _X.sN/_X.fN files for our segment:
       String prefix;
-      if (useCompoundFile)
+      if (useCompoundFile) {
         prefix = name + "." + IndexFileNames.SEPARATE_NORMS_EXTENSION;
-      else
+      } else {
         prefix = name + "." + IndexFileNames.PLAIN_NORMS_EXTENSION;
-      int prefixLength = prefix.length();
+      }
+      final String pattern = prefix + "\\d+";
+
       String[] allFiles = dir.listAll();
-      final IndexFileNameFilter filter = IndexFileNameFilter.getFilter();
       for(int i=0;i<allFiles.length;i++) {
         String fileName = allFiles[i];
-        if (filter.accept(null, fileName) && fileName.length() > prefixLength
&& Character.isDigit(fileName.charAt(prefixLength)) && fileName.startsWith(prefix))
{
+        if (fileName.matches(pattern)) {
           files.add(fileName);
         }
       }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMerger.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMerger.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMerger.java Wed
Feb 24 16:19:39 2010
@@ -76,26 +76,10 @@
   
   private final Codecs codecs;
   private Codec codec;
+  private SegmentWriteState segmentWriteState;
 
-  /** This ctor used only by test code.
-   * 
-   * @param dir The Directory to merge the other segments into
-   * @param name The name of the new segment
-   */
-  SegmentMerger(Directory dir, String name) {
+  SegmentMerger(Directory dir, int termIndexInterval, String name, MergePolicy.OneMerge merge,
Codecs codecs) {
     directory = dir;
-    segment = name;
-    codecs = Codecs.getDefault();
-    checkAbort = new CheckAbort(null, null) {
-      @Override
-      public void work(double units) throws MergeAbortedException {
-        // do nothing
-      }
-    };
-  }
-
-  SegmentMerger(IndexWriter writer, String name, MergePolicy.OneMerge merge, Codecs codecs)
{
-    directory = writer.getDirectory();
     this.codecs = codecs;
     segment = name;
     if (merge != null) {
@@ -108,7 +92,7 @@
         }
       };
     }
-    termIndexInterval = writer.getTermIndexInterval();
+    this.termIndexInterval = termIndexInterval;
   }
   
   boolean hasProx() {
@@ -183,13 +167,6 @@
     }
   }
 
-  final List<String> createCompoundFile(String fileName) throws IOException {
-    // nocommit -- messy!
-    final SegmentWriteState state = new SegmentWriteState(null, directory, segment, fieldInfos,
null, mergedDocs, 0, 0, Codecs.getDefault());
-    return createCompoundFile(fileName, new SegmentInfo(segment, mergedDocs, directory,
-                                                        Codecs.getDefault().getWriter(state)));
-  }
-
   final List<String> createCompoundFile(String fileName, final SegmentInfo info)
           throws IOException {
     CompoundFileWriter cfsWriter = new CompoundFileWriter(directory, fileName, checkAbort);
@@ -375,13 +352,16 @@
         // details.
         throw new RuntimeException("mergeFields produced an invalid result: docCount is "
+ docCount + " but fdx file size is " + fdxFileLength + " file=" + fileName + " file exists?="
+ directory.fileExists(fileName) + "; now aborting this merge to prevent index corruption");
 
-    } else
+    } else {
       // If we are skipping the doc stores, that means there
       // are no deletions in any of these segments, so we
       // just sum numDocs() of each segment to get total docCount
       for (final IndexReader reader : readers) {
         docCount += reader.numDocs();
       }
+    }
+
+    segmentWriteState = new SegmentWriteState(null, directory, segment, fieldInfos, null,
docCount, 0, termIndexInterval, codecs);
 
     return docCount;
   }
@@ -582,11 +562,9 @@
 
   private final void mergeTerms() throws CorruptIndexException, IOException {
 
-    SegmentWriteState state = new SegmentWriteState(null, directory, segment, fieldInfos,
null, mergedDocs, 0, termIndexInterval, codecs);
-
     // Let Codecs decide which codec will be used to write
     // the new segment:
-    codec = codecs.getWriter(state);
+    codec = codecs.getWriter(segmentWriteState);
     
     int docBase = 0;
 
@@ -647,7 +625,7 @@
     }
     starts[mergeState.readerCount] = inputDocBase;
 
-    final FieldsConsumer consumer = codec.fieldsConsumer(state);
+    final FieldsConsumer consumer = codec.fieldsConsumer(segmentWriteState);
 
     mergeState.multiDeletedDocs = new MultiBits(subBits, starts);
     

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentReader.java Wed
Feb 24 16:19:39 2010
@@ -1453,7 +1453,7 @@
     @Override
     public Term term() {
       if (!done && terms != null && currentTerm != null) {
-        return new Term(currentField, currentTerm.toString());
+        return new Term(currentField, currentTerm.utf8ToString());
       }
       return null;
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/codecs/preflex/PreFlexFields.java
Wed Feb 24 16:19:39 2010
@@ -277,7 +277,7 @@
         System.out.println("pff.seek term=" + term);
       }
       skipNext = false;
-      termEnum = getTermsDict().terms(new Term(fieldInfo.name, term.toString()));
+      termEnum = getTermsDict().terms(new Term(fieldInfo.name, term.utf8ToString()));
       final Term t = termEnum.term();
 
       final BytesRef tr;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCache.java Wed Feb
24 16:19:39 2010
@@ -209,7 +209,7 @@
     public float parseFloat(BytesRef term) {
       // TODO: would be far better to directly parse
       // the UTF-8 bytes into float, but that's tricky?
-      return Float.parseFloat(term.toString());
+      return Float.parseFloat(term.utf8ToString());
     }
     protected Object readResolve() {
       return DEFAULT_FLOAT_PARSER;
@@ -239,7 +239,7 @@
     public double parseDouble(BytesRef term) {
       // TODO: would be far better to directly parse
       // the UTF-8 bytes into float, but that's tricky?
-      return Double.parseDouble(term.toString());
+      return Double.parseDouble(term.utf8ToString());
     }
     protected Object readResolve() {
       return DEFAULT_DOUBLE_PARSER;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/FieldCacheImpl.java Wed
Feb 24 16:19:39 2010
@@ -667,7 +667,7 @@
             break;
           }
           docs = termsEnum.docs(delDocs, docs);
-          final String termval = term.toString();
+          final String termval = term.utf8ToString();
           while (true) {
             final int docID = docs.nextDoc();
             if (docID == DocsEnum.NO_MORE_DOCS) {
@@ -721,7 +721,7 @@
           }
 
           // store term text
-          mterms[t] = term.toString();
+          mterms[t] = term.utf8ToString();
           //System.out.println("FC:  ord=" + t + " term=" + term.toBytesString());
 
           docs = termsEnum.docs(delDocs, docs);
@@ -783,7 +783,7 @@
       if (b >= '0' && b <= '9') {
         number = 10*number + (int) (b-'0');
       } else {
-        throw new NumberFormatException("could not parse \"" + term + "\" to a number");
+        throw new NumberFormatException("could not parse \"" + term.utf8ToString() + "\"
to a number");
       }
     }
     return negMul * number;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQuery.java Wed
Feb 24 16:19:39 2010
@@ -187,7 +187,7 @@
         BytesRef term;
         final Term placeholderTerm = new Term(query.field);
         while ((term = termsEnum.next()) != null) {
-          if (collector.collect(placeholderTerm.createTerm(term.toString()), boostAtt.getBoost()))
{
+          if (collector.collect(placeholderTerm.createTerm(term.utf8ToString()), boostAtt.getBoost()))
{
             count++;
           } else {
             break;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/PhraseQuery.java Wed
Feb 24 16:19:39 2010
@@ -170,7 +170,7 @@
                                           t.field(),
                                           text) != null) {
             // term does exist, but has no positions
-            throw new IllegalStateException("field \"" + t.field() + "\" was indexed with
Field.omitTermFreqAndPositions=true; cannot run PhraseQuery (term=" + text + ")");
+            throw new IllegalStateException("field \"" + t.field() + "\" was indexed with
Field.omitTermFreqAndPositions=true; cannot run PhraseQuery (term=" + t.text() + ")");
           } else {
             // term does not exist
             return null;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
(original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermRangeTermsEnum.java
Wed Feb 24 16:19:39 2010
@@ -117,12 +117,12 @@
       return AcceptStatus.YES;
     } else {
       if ((includeLower
-           ? collator.compare(term.toString(), lowerTermText) >= 0
-           : collator.compare(term.toString(), lowerTermText) > 0)
+           ? collator.compare(term.utf8ToString(), lowerTermText) >= 0
+           : collator.compare(term.utf8ToString(), lowerTermText) > 0)
           && (upperTermText == null
               || (includeUpper
-                  ? collator.compare(term.toString(), upperTermText) <= 0
-                  : collator.compare(term.toString(), upperTermText) < 0))) {
+                  ? collator.compare(term.utf8ToString(), upperTermText) <= 0
+                  : collator.compare(term.utf8ToString(), upperTermText) < 0))) {
         return AcceptStatus.YES;
       }
       return AcceptStatus.NO;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/TermScorer.java Wed Feb
24 16:19:39 2010
@@ -24,6 +24,7 @@
 /** Expert: A <code>Scorer</code> for documents matching a <code>Term</code>.
  */
 final class TermScorer extends Scorer {
+  private Weight weight;
   private DocsEnum docsEnum;
   private byte[] norms;
   private float weightValue;
@@ -53,6 +54,7 @@
   TermScorer(Weight weight, DocsEnum td, Similarity similarity, byte[] norms) {
     super(similarity);
     
+    this.weight = weight;
     this.docsEnum = td;
     this.norms = norms;
     this.weightValue = weight.getValue();
@@ -157,7 +159,6 @@
   }
 
   /** Returns a string representation of this <code>TermScorer</code>. */
-  // nocommit
-  //@Override
-  //public String toString() { return "scorer(" + weight + ")"; }
+  @Override
+  public String toString() { return "scorer(" + weight + ")"; }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/store/Directory.java Wed Feb
24 16:19:39 2010
@@ -20,8 +20,6 @@
 import java.io.IOException;
 import java.io.Closeable;
 
-import org.apache.lucene.index.IndexFileNameFilter;
-
 /** A Directory is a flat list of files.  Files may be written once, when they
  * are created.  Once a file is created it may only be opened for read, or
  * deleted.  Random access is permitted both when reading and writing.
@@ -180,16 +178,9 @@
   public static void copy(Directory src, Directory dest, boolean closeDirSrc) throws IOException
{
     final String[] files = src.listAll();
 
-    IndexFileNameFilter filter = IndexFileNameFilter.getFilter();
-
     byte[] buf = new byte[BufferedIndexOutput.BUFFER_SIZE];
     for (int i = 0; i < files.length; i++) {
 
-      if (false && !filter.accept(null, files[i])) {
-        System.out.println("  filter rejects " + files[i]);
-        continue;
-      }
-
       IndexOutput os = null;
       IndexInput is = null;
       try {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/BytesRef.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/BytesRef.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/BytesRef.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/util/BytesRef.java Wed Feb 24
16:19:39 2010
@@ -136,11 +136,13 @@
     return this.bytesEquals((BytesRef) other);
   }
 
+  // nocommit -- catch statically all places where this is
+  // being incorrectly called & switch to utf8ToString
   public String toString() {
     // nocommit -- do this, to fix all places using
     // toString, to use utf8ToString instead:
-    //throw new RuntimeException();
-    return utf8ToString();
+    throw new RuntimeException();
+    //return utf8ToString();
   }
 
   /** Interprets stored bytes as UTF8 bytes, returning the
@@ -149,7 +151,8 @@
     try {
       return new String(bytes, offset, length, "UTF-8");
     } catch (UnsupportedEncodingException uee) {
-      // should not happen
+      // should not happen -- UTF8 is presumably supported
+      // by all JREs
       throw new RuntimeException(uee);
     }
   }

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/TestExternalCodecs.java Wed
Feb 24 16:19:39 2010
@@ -167,7 +167,7 @@
       
       @Override
       public PostingsConsumer startTerm(BytesRef text) {
-        final String term = text.toString();
+        final String term = text.utf8ToString();
         current = new RAMTerm(term);
         postingsWriter.reset(current);
         return postingsWriter;
@@ -284,7 +284,7 @@
 
       @Override
       public SeekStatus seek(BytesRef term) {
-        current = term.toString();
+        current = term.utf8ToString();
         if (ramField.termToDocs.containsKey(current)) {
           return SeekStatus.FOUND;
         } else {
@@ -857,7 +857,7 @@
       if (lastBytesRef == null) {
         lastBytesRef = new BytesRef(t);
       } else {
-        assertTrue("terms in wrong order last=" + lastBytesRef + " current=" + t, reverseUnicodeComparator.compare(lastBytesRef,
t) < 0);
+        assertTrue("terms in wrong order last=" + lastBytesRef.utf8ToString() + " current="
+ t.utf8ToString(), reverseUnicodeComparator.compare(lastBytesRef, t) < 0);
         lastBytesRef.copy(t);
       }
     }

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/FlexTestUtil.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/FlexTestUtil.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/FlexTestUtil.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/FlexTestUtil.java Wed
Feb 24 16:19:39 2010
@@ -142,7 +142,7 @@
           assertTrue(termEnum.next());
           Term t = termEnum.term();
           assertEquals(t.field(), field);
-          assertEquals(t.text(), termRef.toString());
+          assertEquals(t.text(), termRef.utf8ToString());
           assertEquals(termEnum.docFreq(), terms.docFreq());
           //allTerms.add(t);
 
@@ -236,7 +236,7 @@
             }
             Term t = termEnum.term();
             assertEquals(t.field(), field);
-            assertEquals(t.text(), termRef.toString());
+            assertEquals(t.text(), termRef.utf8ToString());
             assertEquals(termEnum.docFreq(), terms.docFreq());
             //allTerms.add(t);
 
@@ -426,7 +426,7 @@
         assertEquals(t, termEnum.term());
       } else {
         //System.out.println("found other");
-        assertEquals(termsEnum.term().toString(), termEnum.term().text());
+        assertEquals(termsEnum.term().utf8ToString(), termEnum.term().text());
       }
 
       assertEquals(termsEnum.docFreq(), termEnum.docFreq());

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
Wed Feb 24 16:19:39 2010
@@ -675,7 +675,7 @@
       assertNotNull(t);
 
       // content field only has term aaa:
-      assertEquals("aaa", t.toString());
+      assertEquals("aaa", t.utf8ToString());
       assertNull(terms.next());
 
       BytesRef aaaTerm = new BytesRef("aaa");

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestCodecs.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestCodecs.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestCodecs.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestCodecs.java Wed Feb
24 16:19:39 2010
@@ -274,7 +274,7 @@
     for(int i=0;i<NUM_TERMS;i++) {
       BytesRef term = termsEnum.next();
       assertNotNull(term);
-      assertEquals(terms[i].text2, term.toString());
+      assertEquals(terms[i].text2, term.utf8ToString());
     }
     assertNull(termsEnum.next());
 

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDoc.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDoc.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestDoc.java Wed Feb 24
16:19:39 2010
@@ -35,6 +35,7 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.index.codecs.Codecs;
 
 
 /** JUnit adaptation of an older test case DocTest. */
@@ -180,7 +181,7 @@
       SegmentReader r1 = SegmentReader.get(true, si1, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
       SegmentReader r2 = SegmentReader.get(true, si2, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
 
-      SegmentMerger merger = new SegmentMerger(si1.dir, merged);
+      SegmentMerger merger = new SegmentMerger(si1.dir, IndexWriter.DEFAULT_TERM_INDEX_INTERVAL,
merged, null, Codecs.getDefault());
 
       merger.add(r1);
       merger.add(r2);

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestIndexWriter.java Wed
Feb 24 16:19:39 2010
@@ -4729,7 +4729,7 @@
     Iterator<String> it = seenTerms.iterator();
     while(it.hasNext()) {
       BytesRef tr = new BytesRef(it.next());
-      assertEquals("seek failed for term=" + termDesc(tr.toString()), 
+      assertEquals("seek failed for term=" + termDesc(tr.utf8ToString()),
                    TermsEnum.SeekStatus.FOUND,
                    terms.seek(tr));
     }

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestSegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestSegmentMerger.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestSegmentMerger.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestSegmentMerger.java
Wed Feb 24 16:19:39 2010
@@ -22,6 +22,7 @@
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.index.codecs.Codecs;
 
 import java.io.IOException;
 import java.util.Collection;
@@ -64,7 +65,7 @@
   }
   
   public void testMerge() throws IOException {                             
-    SegmentMerger merger = new SegmentMerger(mergedDir, mergedSegment);
+    SegmentMerger merger = new SegmentMerger(mergedDir, IndexWriter.DEFAULT_TERM_INDEX_INTERVAL,
mergedSegment, null, Codecs.getDefault());
     merger.add(reader1);
     merger.add(reader2);
     int docsMerged = merger.merge();

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java?rev=915850&r1=915849&r2=915850&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
(original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
Wed Feb 24 16:19:39 2010
@@ -447,7 +447,7 @@
     while (termEnum.next() != null) {
       final BytesRef t = termEnum.term();
       if (t != null) {
-        final int val = NumericUtils.prefixCodedToInt(t.toString());
+        final int val = NumericUtils.prefixCodedToInt(t.utf8ToString());
         assertTrue("value not in bounds " + val + " >= " + lower + " && "
             + val + " <= " + upper, val >= lower && val <= upper);
         count++;



Mime
View raw message