lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r831094 [4/8] - in /lucene/java/branches/flex_1458: ./ contrib/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/br/ contrib/analyzers/common/src/java/org/apache/lucene/analysis/cz/ contrib/analyzers/common/src/java/org/apache/l...
Date Thu, 29 Oct 2009 21:29:56 GMT
Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsReader.java Thu Oct 29 21:29:47 2009
@@ -19,6 +19,7 @@
 
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.document.AbstractField;
+import org.apache.lucene.document.CompressionTools;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldSelector;
@@ -32,6 +33,7 @@
 
 import java.io.IOException;
 import java.io.Reader;
+import java.util.zip.DataFormatException;
 
 /**
  * Class responsible for access to stored document fields.
@@ -68,6 +70,7 @@
    *  job not to close the original FieldsReader until all
    *  clones are called (eg, currently SegmentReader manages
    *  this logic). */
+  @Override
   public Object clone() {
     ensureOpen();
     return new FieldsReader(fieldInfos, numTotalDocs, size, format, formatSize, docStoreOffset, cloneableFieldsStream, cloneableIndexStream);
@@ -203,7 +206,11 @@
   }
 
   boolean canReadRawDocs() {
-    return format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES;
+    // Disable reading raw docs in 2.x format, because of the removal of compressed
+    // fields in 3.0. We don't want rawDocs() to decode field bits to figure out
+    // if a field was compressed, hence we enforce ordinary (non-raw) stored field merges
+    // for <3.0 indexes.
+    return format >= FieldsWriter.FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS;
   }
 
   final Document doc(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
@@ -219,31 +226,34 @@
       FieldSelectorResult acceptField = fieldSelector == null ? FieldSelectorResult.LOAD : fieldSelector.accept(fi.name);
       
       byte bits = fieldsStream.readByte();
-      assert bits <= FieldsWriter.FIELD_IS_TOKENIZED + FieldsWriter.FIELD_IS_BINARY;
+      assert bits <= FieldsWriter.FIELD_IS_COMPRESSED + FieldsWriter.FIELD_IS_TOKENIZED + FieldsWriter.FIELD_IS_BINARY;
 
+      boolean compressed = (bits & FieldsWriter.FIELD_IS_COMPRESSED) != 0;
+      assert (compressed ? (format < FieldsWriter.FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS) : true)
+        : "compressed fields are only allowed in indexes of version <= 2.9";
       boolean tokenize = (bits & FieldsWriter.FIELD_IS_TOKENIZED) != 0;
       boolean binary = (bits & FieldsWriter.FIELD_IS_BINARY) != 0;
       //TODO: Find an alternative approach here if this list continues to grow beyond the
       //list of 5 or 6 currently here.  See Lucene 762 for discussion
       if (acceptField.equals(FieldSelectorResult.LOAD)) {
-        addField(doc, fi, binary, tokenize);
+        addField(doc, fi, binary, compressed, tokenize);
       }
       else if (acceptField.equals(FieldSelectorResult.LOAD_AND_BREAK)){
-        addField(doc, fi, binary, tokenize);
+        addField(doc, fi, binary, compressed, tokenize);
         break;//Get out of this loop
       }
       else if (acceptField.equals(FieldSelectorResult.LAZY_LOAD)) {
-        addFieldLazy(doc, fi, binary, tokenize);
+        addFieldLazy(doc, fi, binary, compressed, tokenize);
       }
       else if (acceptField.equals(FieldSelectorResult.SIZE)){
-        skipField(binary, addFieldSize(doc, fi, binary));
+        skipField(binary, compressed, addFieldSize(doc, fi, binary, compressed));
       }
       else if (acceptField.equals(FieldSelectorResult.SIZE_AND_BREAK)){
-        addFieldSize(doc, fi, binary);
+        addFieldSize(doc, fi, binary, compressed);
         break;
       }
       else {
-        skipField(binary);
+        skipField(binary, compressed);
       }
     }
 
@@ -280,12 +290,12 @@
    * Skip the field.  We still have to read some of the information about the field, but can skip past the actual content.
    * This will have the most payoff on large fields.
    */
-  private void skipField(boolean binary) throws IOException {
-    skipField(binary, fieldsStream.readVInt());
+  private void skipField(boolean binary, boolean compressed) throws IOException {
+    skipField(binary, compressed, fieldsStream.readVInt());
   }
   
-  private void skipField(boolean binary, int toRead) throws IOException {
-   if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES || binary) {
+  private void skipField(boolean binary, boolean compressed, int toRead) throws IOException {
+   if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES || binary || compressed) {
      fieldsStream.seek(fieldsStream.getFilePointer() + toRead);
    } else {
      // We need to skip chars.  This will slow us down, but still better
@@ -293,12 +303,12 @@
    }
   }
 
-  private void addFieldLazy(Document doc, FieldInfo fi, boolean binary, boolean tokenize) throws IOException {
+  private void addFieldLazy(Document doc, FieldInfo fi, boolean binary, boolean compressed, boolean tokenize) throws IOException {
     if (binary) {
       int toRead = fieldsStream.readVInt();
       long pointer = fieldsStream.getFilePointer();
       //was: doc.add(new Fieldable(fi.name, b, Fieldable.Store.YES));
-      doc.add(new LazyField(fi.name, Field.Store.YES, toRead, pointer, binary));
+      doc.add(new LazyField(fi.name, Field.Store.YES, toRead, pointer, binary, compressed));
       //Need to move the pointer ahead by toRead positions
       fieldsStream.seek(pointer + toRead);
     } else {
@@ -307,43 +317,75 @@
       Field.TermVector termVector = Field.TermVector.toTermVector(fi.storeTermVector, fi.storeOffsetWithTermVector, fi.storePositionWithTermVector);
 
       AbstractField f;
-      int length = fieldsStream.readVInt();
-      long pointer = fieldsStream.getFilePointer();
-      //Skip ahead of where we are by the length of what is stored
-      if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES)
-        fieldsStream.seek(pointer+length);
-      else
-        fieldsStream.skipChars(length);
-      f = new LazyField(fi.name, store, index, termVector, length, pointer, binary);
-      f.setOmitNorms(fi.omitNorms);
-      f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
+      if (compressed) {
+        int toRead = fieldsStream.readVInt();
+        long pointer = fieldsStream.getFilePointer();
+        f = new LazyField(fi.name, store, toRead, pointer, binary, compressed);
+        //skip over the part that we aren't loading
+        fieldsStream.seek(pointer + toRead);
+        f.setOmitNorms(fi.omitNorms);
+        f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
+      } else {
+        int length = fieldsStream.readVInt();
+        long pointer = fieldsStream.getFilePointer();
+        //Skip ahead of where we are by the length of what is stored
+        if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES) {
+          fieldsStream.seek(pointer+length);
+        } else {
+          fieldsStream.skipChars(length);
+        }
+        f = new LazyField(fi.name, store, index, termVector, length, pointer, binary, compressed);
+        f.setOmitNorms(fi.omitNorms);
+        f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
+      }
+      
       doc.add(f);
     }
 
   }
 
-  private void addField(Document doc, FieldInfo fi, boolean binary, boolean tokenize) throws CorruptIndexException, IOException {
+  private void addField(Document doc, FieldInfo fi, boolean binary, boolean compressed, boolean tokenize) throws CorruptIndexException, IOException {
 
     //we have a binary stored field, and it may be compressed
     if (binary) {
       int toRead = fieldsStream.readVInt();
       final byte[] b = new byte[toRead];
       fieldsStream.readBytes(b, 0, b.length);
-      doc.add(new Field(fi.name, b, Field.Store.YES));
+      if (compressed) {
+        doc.add(new Field(fi.name, uncompress(b), Field.Store.YES));
+      } else {
+        doc.add(new Field(fi.name, b, Field.Store.YES));
+      }
     } else {
       Field.Store store = Field.Store.YES;
       Field.Index index = Field.Index.toIndex(fi.isIndexed, tokenize);
       Field.TermVector termVector = Field.TermVector.toTermVector(fi.storeTermVector, fi.storeOffsetWithTermVector, fi.storePositionWithTermVector);
 
       AbstractField f;
-      f = new Field(fi.name,     // name
-    		false,
-              fieldsStream.readString(), // read value
-              store,
-              index,
-              termVector);
-      f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
-      f.setOmitNorms(fi.omitNorms);
+      if (compressed) {
+        int toRead = fieldsStream.readVInt();
+
+        final byte[] b = new byte[toRead];
+        fieldsStream.readBytes(b, 0, b.length);
+        f = new Field(fi.name,      // field name
+                false,
+                new String(uncompress(b), "UTF-8"), // uncompress the value and add as string
+                store,
+                index,
+                termVector);
+        f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
+        f.setOmitNorms(fi.omitNorms);
+      } else {
+        f = new Field(fi.name,     // name
+         false,
+                fieldsStream.readString(), // read value
+                store,
+                index,
+                termVector);
+        f.setOmitTermFreqAndPositions(fi.omitTermFreqAndPositions);
+        f.setOmitNorms(fi.omitNorms);
+      }
+      
       doc.add(f);
     }
   }
@@ -351,8 +393,8 @@
   // Add the size of field as a byte[] containing the 4 bytes of the integer byte size (high order byte first; char = 2 bytes)
   // Read just the size -- caller must skip the field content to continue reading fields
   // Return the size in bytes or chars, depending on field type
-  private int addFieldSize(Document doc, FieldInfo fi, boolean binary) throws IOException {
-    int size = fieldsStream.readVInt(), bytesize = binary ? size : 2*size;
+  private int addFieldSize(Document doc, FieldInfo fi, boolean binary, boolean compressed) throws IOException {
+    int size = fieldsStream.readVInt(), bytesize = binary || compressed ? size : 2*size;
     byte[] sizebytes = new byte[4];
     sizebytes[0] = (byte) (bytesize>>>24);
     sizebytes[1] = (byte) (bytesize>>>16);
@@ -369,8 +411,10 @@
   private class LazyField extends AbstractField implements Fieldable {
     private int toRead;
     private long pointer;
+    /** @deprecated Only kept for backward-compatbility with <3.0 indexes. Will be removed in 4.0. */
+    private boolean isCompressed;
 
-    public LazyField(String name, Field.Store store, int toRead, long pointer, boolean isBinary) {
+    public LazyField(String name, Field.Store store, int toRead, long pointer, boolean isBinary, boolean isCompressed) {
       super(name, store, Field.Index.NO, Field.TermVector.NO);
       this.toRead = toRead;
       this.pointer = pointer;
@@ -378,9 +422,10 @@
       if (isBinary)
         binaryLength = toRead;
       lazy = true;
+      this.isCompressed = isCompressed;
     }
 
-    public LazyField(String name, Field.Store store, Field.Index index, Field.TermVector termVector, int toRead, long pointer, boolean isBinary) {
+    public LazyField(String name, Field.Store store, Field.Index index, Field.TermVector termVector, int toRead, long pointer, boolean isBinary, boolean isCompressed) {
       super(name, store, index, termVector);
       this.toRead = toRead;
       this.pointer = pointer;
@@ -388,6 +433,7 @@
       if (isBinary)
         binaryLength = toRead;
       lazy = true;
+      this.isCompressed = isCompressed;
     }
 
     private IndexInput getFieldStream() {
@@ -427,15 +473,21 @@
           IndexInput localFieldsStream = getFieldStream();
           try {
             localFieldsStream.seek(pointer);
-            if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES) {
-              byte[] bytes = new byte[toRead];
-              localFieldsStream.readBytes(bytes, 0, toRead);
-              fieldsData = new String(bytes, "UTF-8");
+            if (isCompressed) {
+              final byte[] b = new byte[toRead];
+              localFieldsStream.readBytes(b, 0, b.length);
+              fieldsData = new String(uncompress(b), "UTF-8");
             } else {
-              //read in chars b/c we already know the length we need to read
-              char[] chars = new char[toRead];
-              localFieldsStream.readChars(chars, 0, toRead);
-              fieldsData = new String(chars);
+              if (format >= FieldsWriter.FORMAT_VERSION_UTF8_LENGTH_IN_BYTES) {
+                byte[] bytes = new byte[toRead];
+                localFieldsStream.readBytes(bytes, 0, toRead);
+                fieldsData = new String(bytes, "UTF-8");
+              } else {
+                //read in chars b/c we already know the length we need to read
+                char[] chars = new char[toRead];
+                localFieldsStream.readChars(chars, 0, toRead);
+                fieldsData = new String(chars);
+              }
             }
           } catch (IOException e) {
             throw new FieldReaderException(e);
@@ -465,6 +517,7 @@
       this.toRead = toRead;
     }
 
+    @Override
     public byte[] getBinaryValue(byte[] result) {
       ensureOpen();
 
@@ -484,7 +537,11 @@
           try {
             localFieldsStream.seek(pointer);
             localFieldsStream.readBytes(b, 0, toRead);
-            fieldsData = b;
+            if (isCompressed == true) {
+              fieldsData = uncompress(b);
+            } else {
+              fieldsData = b;
+            }
           } catch (IOException e) {
             throw new FieldReaderException(e);
           }
@@ -498,4 +555,16 @@
         return null;     
     }
   }
+
+  private byte[] uncompress(byte[] b)
+          throws CorruptIndexException {
+    try {
+      return CompressionTools.decompress(b);
+    } catch (DataFormatException e) {
+      // this will happen if the field is not compressed
+      CorruptIndexException newException = new CorruptIndexException("field data are in wrong format: " + e.toString());
+      newException.initCause(e);
+      throw newException;
+    }
+  }
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsWriter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FieldsWriter.java Thu Oct 29 21:29:47 2009
@@ -30,17 +30,23 @@
 {
   static final byte FIELD_IS_TOKENIZED = 0x1;
   static final byte FIELD_IS_BINARY = 0x2;
+  
+  /** @deprecated Kept for backwards-compatibility with <3.0 indexes; will be removed in 4.0 */
+  static final byte FIELD_IS_COMPRESSED = 0x4;
 
   // Original format
   static final int FORMAT = 0;
 
   // Changed strings to UTF8
   static final int FORMAT_VERSION_UTF8_LENGTH_IN_BYTES = 1;
+  
+  // Lucene 3.0: Removal of compressed fields
+  static final int FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS = 2;
 
   // NOTE: if you introduce a new format, make it 1 higher
   // than the current one, and always change this if you
   // switch to a new format!
-  static final int FORMAT_CURRENT = FORMAT_VERSION_UTF8_LENGTH_IN_BYTES;
+  static final int FORMAT_CURRENT = FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS;
   
     private FieldInfos fieldInfos;
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FilterIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FilterIndexReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FilterIndexReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FilterIndexReader.java Thu Oct 29 21:29:47 2009
@@ -86,9 +86,13 @@
 
     public FilterTermEnum(TermEnum in) { this.in = in; }
 
+    @Override
     public boolean next() throws IOException { return in.next(); }
+    @Override
     public Term term() { return in.term(); }
+    @Override
     public int docFreq() { return in.docFreq(); }
+    @Override
     public void close() throws IOException { in.close(); }
   }
 
@@ -106,20 +110,24 @@
     this.in = in;
   }
 
+  @Override
   public Directory directory() {
     return in.directory();
   }
   
+  @Override
   public Bits getDeletedDocs() throws IOException {
     return in.getDeletedDocs();
   }
   
+  @Override
   public TermFreqVector[] getTermFreqVectors(int docNumber)
           throws IOException {
     ensureOpen();
     return in.getTermFreqVectors(docNumber);
   }
 
+  @Override
   public TermFreqVector getTermFreqVector(int docNumber, String field)
           throws IOException {
     ensureOpen();
@@ -127,125 +135,152 @@
   }
 
 
+  @Override
   public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     in.getTermFreqVector(docNumber, field, mapper);
 
   }
 
+  @Override
   public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     in.getTermFreqVector(docNumber, mapper);
   }
 
+  @Override
   public int numDocs() {
     // Don't call ensureOpen() here (it could affect performance)
     return in.numDocs();
   }
 
+  @Override
   public int maxDoc() {
     // Don't call ensureOpen() here (it could affect performance)
     return in.maxDoc();
   }
 
+  @Override
   public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
     ensureOpen();
     return in.document(n, fieldSelector);
   }
 
+  @Override
   public boolean isDeleted(int n) {
     // Don't call ensureOpen() here (it could affect performance)
     return in.isDeleted(n);
   }
 
+  @Override
   public boolean hasDeletions() {
     // Don't call ensureOpen() here (it could affect performance)
     return in.hasDeletions();
   }
 
+  @Override
   protected void doUndeleteAll() throws CorruptIndexException, IOException {in.undeleteAll();}
 
+  @Override
   public boolean hasNorms(String field) throws IOException {
     ensureOpen();
     return in.hasNorms(field);
   }
 
+  @Override
   public byte[] norms(String f) throws IOException {
     ensureOpen();
     return in.norms(f);
   }
 
+  @Override
   public void norms(String f, byte[] bytes, int offset) throws IOException {
     ensureOpen();
     in.norms(f, bytes, offset);
   }
 
+  @Override
   protected void doSetNorm(int d, String f, byte b) throws CorruptIndexException, IOException {
     in.setNorm(d, f, b);
   }
 
+  @Override
   public TermEnum terms() throws IOException {
     ensureOpen();
     return in.terms();
   }
 
+  @Override
   public TermEnum terms(Term t) throws IOException {
     ensureOpen();
     return in.terms(t);
   }
 
+  @Override
   public int docFreq(Term t) throws IOException {
     ensureOpen();
     return in.docFreq(t);
   }
 
+  @Override
   public int docFreq(String field, TermRef t) throws IOException {
     ensureOpen();
     return in.docFreq(field, t);
   }
-
+  
+  @Override
   public TermDocs termDocs() throws IOException {
     ensureOpen();
     return in.termDocs();
   }
 
+  @Override
   public TermDocs termDocs(Term term) throws IOException {
     ensureOpen();
     return in.termDocs(term);
   }
 
+  @Override
   public TermPositions termPositions() throws IOException {
     ensureOpen();
     return in.termPositions();
   }
 
+  @Override
   protected void doDelete(int n) throws  CorruptIndexException, IOException { in.deleteDocument(n); }
   
+  @Override
   protected void doCommit(Map<String,String> commitUserData) throws IOException { in.commit(commitUserData); }
   
+  @Override
   protected void doClose() throws IOException { in.close(); }
 
 
+  @Override
   public Collection<String> getFieldNames(IndexReader.FieldOption fieldNames) {
     ensureOpen();
     return in.getFieldNames(fieldNames);
   }
 
+  @Override
   public long getVersion() {
     ensureOpen();
     return in.getVersion();
   }
 
+  @Override
   public boolean isCurrent() throws CorruptIndexException, IOException {
     ensureOpen();
     return in.isCurrent();
   }
   
+  @Override
   public boolean isOptimized() {
     ensureOpen();
     return in.isOptimized();
   }
   
+  @Override
   public IndexReader[] getSequentialSubReaders() {
     return in.getSequentialSubReaders();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriter.java Thu Oct 29 21:29:47 2009
@@ -35,10 +35,12 @@
 @SuppressWarnings("unchecked")
 final class FreqProxTermsWriter extends TermsHashConsumer {
 
+  @Override
   public TermsHashConsumerPerThread addThread(TermsHashPerThread perThread) {
     return new FreqProxTermsWriterPerThread(perThread);
   }
 
+  @Override
   void createPostings(RawPostingList[] postings, int start, int count) {
     final int end = start + count;
     for(int i=start;i<end;i++)
@@ -61,7 +63,9 @@
     }
   }
 
+  @Override
   void closeDocStore(SegmentWriteState state) {}
+  @Override
   void abort() {}
 
   private int flushedDocCount;
@@ -71,6 +75,7 @@
   // under the same FieldInfo together, up into TermsHash*.
   // Other writers would presumably share alot of this...
 
+  @Override
   public void flush(Map<TermsHashConsumerPerThread,Collection<TermsHashConsumerPerField>> threadsAndFields, final SegmentWriteState state) throws IOException {
 
     // Gather all FieldData's that have postings, across all
@@ -306,6 +311,7 @@
     int lastPosition;                               // Last position where this term occurred
   }
 
+  @Override
   int bytesPerPosting() {
     return RawPostingList.BYTES_SIZE + 4 * DocumentsWriter.INT_NUM_BYTE;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java Thu Oct 29 21:29:47 2009
@@ -43,6 +43,7 @@
     omitTermFreqAndPositions = fieldInfo.omitTermFreqAndPositions;
   }
 
+  @Override
   int getStreamCount() {
     if (fieldInfo.omitTermFreqAndPositions)
       return 1;
@@ -50,10 +51,12 @@
       return 2;
   }
 
+  @Override
   void finish() {}
 
   boolean hasPayloads;
 
+  @Override
   void skippingLongTerm() throws IOException {}
 
   public int compareTo(Object other0) {
@@ -68,6 +71,7 @@
     payloadAttribute = null;
   }
 
+  @Override
   boolean start(Fieldable[] fields, int count) {
     for(int i=0;i<count;i++)
       if (fields[i].isIndexed())
@@ -75,6 +79,7 @@
     return false;
   }     
   
+  @Override
   void start(Fieldable f) {
     if (fieldState.attributeSource.hasAttribute(PayloadAttribute.class)) {
       payloadAttribute = fieldState.attributeSource.getAttribute(PayloadAttribute.class);
@@ -101,6 +106,7 @@
     p.lastPosition = fieldState.position;
   }
 
+  @Override
   final void newTerm(RawPostingList p0) {
     // First time we're seeing this term since the last
     // flush
@@ -116,6 +122,7 @@
     }
   }
 
+  @Override
   final void addTerm(RawPostingList p0) {
 
     assert docState.testPoint("FreqProxTermsWriterPerField.addTerm start");

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerThread.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerThread.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerThread.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/FreqProxTermsWriterPerThread.java Thu Oct 29 21:29:47 2009
@@ -26,16 +26,20 @@
     termsHashPerThread = perThread;
   }
   
+  @Override
   public TermsHashConsumerPerField addField(TermsHashPerField termsHashPerField, FieldInfo fieldInfo) {
     return new FreqProxTermsWriterPerField(termsHashPerField, this, fieldInfo);
   }
 
+  @Override
   void startDocument() {
   }
 
+  @Override
   DocumentsWriter.DocWriter finishDocument() {
     return null;
   }
 
+  @Override
   public void abort() {}
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexCommit.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexCommit.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexCommit.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexCommit.java Thu Oct 29 21:29:47 2009
@@ -89,6 +89,7 @@
   /**
    * Two IndexCommits are equal if both their Directory and versions are equal.
    */
+  @Override
   public boolean equals(Object other) {
     if (other instanceof IndexCommit) {
       IndexCommit otherCommit = (IndexCommit) other;
@@ -97,6 +98,7 @@
       return false;
   }
 
+  @Override
   public int hashCode() {
     return getDirectory().hashCode() + getSegmentsFileName().hashCode();
   }

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=831094&r1=831093&r2=831094&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 Thu Oct 29 21:29:47 2009
@@ -610,30 +610,37 @@
       assert !segmentInfos.hasExternalSegments(directory);
     }
 
+    @Override
     public boolean isOptimized() {
       return isOptimized;
     }
 
+    @Override
     public String getSegmentsFileName() {
       return segmentsFileName;
     }
 
+    @Override
     public Collection<String> getFileNames() throws IOException {
       return files;
     }
 
+    @Override
     public Directory getDirectory() {
       return directory;
     }
 
+    @Override
     public long getVersion() {
       return version;
     }
 
+    @Override
     public long getGeneration() {
       return generation;
     }
 
+    @Override
     public Map<String,String> getUserData() {
       return userData;
     }
@@ -642,6 +649,7 @@
      * Called only be the deletion policy, to remove this
      * commit point from the index.
      */
+    @Override
     public void delete() {
       if (!deleted) {
         deleted = true;
@@ -649,6 +657,7 @@
       }
     }
 
+    @Override
     public boolean isDeleted() {
       return deleted;
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexReader.java Thu Oct 29 21:29:47 2009
@@ -91,6 +91,7 @@
     private FieldOption(String option) {
       this.option = option;
     }
+    @Override
     public String toString() {
       return this.option;
     }
@@ -437,6 +438,7 @@
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error
    */
+  @Override
   public synchronized Object clone() {
     throw new UnsupportedOperationException("This reader does not implement clone()");
   }
@@ -504,6 +506,7 @@
    */
   public static long lastModified(final Directory directory2) throws CorruptIndexException, IOException {
     return ((Long) new SegmentInfos.FindSegmentsFile(directory2) {
+        @Override
         public Object doBody(String segmentFileName) throws IOException {
           return Long.valueOf(directory2.fileModified(segmentFileName));
         }

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=831094&r1=831093&r2=831094&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 Thu Oct 29 21:29:47 2009
@@ -469,8 +469,7 @@
         // not pooling readers, we release it:
         readerMap.remove(sr.getSegmentInfo());
 
-        // TODO: java 5
-        // assert !sr.hasChanges || Thread.holdsLock(IndexWriter.this);
+        assert !sr.hasChanges || Thread.holdsLock(IndexWriter.this);
 
         // Drop our ref -- this will commit any pending
         // changes to the dir
@@ -4797,6 +4796,7 @@
       return limit;
     }
     
+    @Override
     public String toString()
     {
       return name + ":" + limit;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogByteSizeMergePolicy.java Thu Oct 29 21:29:47 2009
@@ -35,6 +35,7 @@
     minMergeSize = (long) (DEFAULT_MIN_MERGE_MB*1024*1024);
     maxMergeSize = (long) (DEFAULT_MAX_MERGE_MB*1024*1024);
   }
+  @Override
   protected long size(SegmentInfo info) throws IOException {
     return sizeBytes(info);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogDocMergePolicy.java Thu Oct 29 21:29:47 2009
@@ -36,6 +36,7 @@
     // it to Long.MAX_VALUE to disable it
     maxMergeSize = Long.MAX_VALUE;
   }
+  @Override
   protected long size(SegmentInfo info) throws IOException {
     return sizeDocs(info);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/LogMergePolicy.java Thu Oct 29 21:29:47 2009
@@ -102,6 +102,7 @@
   }
 
   // Javadoc inherited
+  @Override
   public boolean useCompoundFile(SegmentInfos infos, SegmentInfo info) {
     return useCompoundFile;
   }
@@ -120,6 +121,7 @@
   }
 
   // Javadoc inherited
+  @Override
   public boolean useCompoundDocStore(SegmentInfos infos) {
     return useCompoundDocStore;
   }
@@ -151,6 +153,7 @@
     return calibrateSizeByDeletes;
   }
 
+  @Override
   public void close() {}
 
   abstract protected long size(SegmentInfo info) throws IOException;
@@ -211,6 +214,7 @@
    *  setting is true.  This method returns multiple merges
    *  (mergeFactor at a time) so the {@link MergeScheduler}
    *  in use may make use of concurrency. */
+  @Override
   public MergeSpecification findMergesForOptimize(SegmentInfos infos,
       int maxNumSegments, Set<SegmentInfo> segmentsToOptimize) throws IOException {
     MergeSpecification spec;
@@ -295,6 +299,7 @@
    * index.  We simply merge adjacent segments that have
    * deletes, up to mergeFactor at a time.
    */ 
+  @Override
   public MergeSpecification findMergesToExpungeDeletes(SegmentInfos segmentInfos)
       throws CorruptIndexException, IOException {
     final int numSegments = segmentInfos.size();
@@ -347,6 +352,7 @@
    *  multiple levels have too many segments, this method
    *  will return multiple merges, allowing the {@link
    *  MergeScheduler} to use concurrency. */
+  @Override
   public MergeSpecification findMerges(SegmentInfos infos) throws IOException {
 
     final int numSegments = infos.size();

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiLevelSkipListReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiLevelSkipListReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiLevelSkipListReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiLevelSkipListReader.java Thu Oct 29 21:29:47 2009
@@ -244,27 +244,33 @@
       input.readBytes(data, 0, length);
     }
     
+    @Override
     public void close() throws IOException {
       data = null;
     }
 
+    @Override
     public long getFilePointer() {
       return pointer + pos;
     }
 
+    @Override
     public long length() {
       return data.length;
     }
 
+    @Override
     public byte readByte() throws IOException {
       return data[pos++];
     }
 
+    @Override
     public void readBytes(byte[] b, int offset, int len) throws IOException {
       System.arraycopy(data, pos, b, offset, len);
       pos += len;
     }
 
+    @Override
     public void seek(long pos) throws IOException {
       this.pos =  (int) (pos - pointer);
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultiReader.java Thu Oct 29 21:29:47 2009
@@ -125,6 +125,7 @@
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error 
    */
+  @Override
   public synchronized IndexReader reopen() throws CorruptIndexException, IOException {
     return doReopen(false);
   }
@@ -138,6 +139,7 @@
    * readers is increased to ensure that the subreaders remain open
    * until the last referring reader is closed.
    */
+  @Override
   public synchronized Object clone() {
     try {
       return doReopen(true);
@@ -208,12 +210,14 @@
     }
   }
 
+  @Override
   public TermFreqVector[] getTermFreqVectors(int n) throws IOException {
     ensureOpen();
     int i = readerIndex(n);        // find segment num
     return subReaders[i].getTermFreqVectors(n - starts[i]); // dispatch to segment
   }
 
+  @Override
   public TermFreqVector getTermFreqVector(int n, String field)
       throws IOException {
     ensureOpen();
@@ -222,22 +226,26 @@
   }
 
 
+  @Override
   public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     int i = readerIndex(docNumber);        // find segment num
     subReaders[i].getTermFreqVector(docNumber - starts[i], field, mapper);
   }
 
+  @Override
   public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     int i = readerIndex(docNumber);        // find segment num
     subReaders[i].getTermFreqVector(docNumber - starts[i], mapper);
   }
 
+  @Override
   public boolean isOptimized() {
     return false;
   }
   
+  @Override
   public synchronized int numDocs() {
     // Don't call ensureOpen() here (it could affect performance)
     if (numDocs == -1) {        // check cache
@@ -249,29 +257,34 @@
     return numDocs;
   }
 
+  @Override
   public int maxDoc() {
     // Don't call ensureOpen() here (it could affect performance)
     return maxDoc;
   }
 
   // inherit javadoc
+  @Override
   public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
     ensureOpen();
     int i = readerIndex(n);                          // find segment num
     return subReaders[i].document(n - starts[i], fieldSelector);    // dispatch to segment reader
   }
 
+  @Override
   public boolean isDeleted(int n) {
     // Don't call ensureOpen() here (it could affect performance)
     int i = readerIndex(n);                           // find segment num
     return subReaders[i].isDeleted(n - starts[i]);    // dispatch to segment reader
   }
 
+  @Override
   public boolean hasDeletions() {
     // Don't call ensureOpen() here (it could affect performance)
     return hasDeletions;
   }
 
+  @Override
   protected void doDelete(int n) throws CorruptIndexException, IOException {
     numDocs = -1;                             // invalidate cache
     int i = readerIndex(n);                   // find segment num
@@ -279,6 +292,7 @@
     hasDeletions = true;
   }
 
+  @Override
   protected void doUndeleteAll() throws CorruptIndexException, IOException {
     for (int i = 0; i < subReaders.length; i++)
       subReaders[i].undeleteAll();
@@ -291,6 +305,7 @@
     return DirectoryReader.readerIndex(n, this.starts, this.subReaders.length);
   }
   
+  @Override
   public boolean hasNorms(String field) throws IOException {
     ensureOpen();
     for (int i = 0; i < subReaders.length; i++) {
@@ -305,6 +320,7 @@
     return ones;
   }
   
+  @Override
   public synchronized byte[] norms(String field) throws IOException {
     ensureOpen();
     byte[] bytes = normsCache.get(field);
@@ -320,6 +336,7 @@
     return bytes;
   }
 
+  @Override
   public synchronized void norms(String field, byte[] result, int offset)
     throws IOException {
     ensureOpen();
@@ -338,6 +355,7 @@
     }
   }
 
+  @Override
   protected void doSetNorm(int n, String field, byte value)
     throws CorruptIndexException, IOException {
     synchronized (normsCache) {
@@ -347,16 +365,19 @@
     subReaders[i].setNorm(n-starts[i], field, value); // dispatch
   }
 
+  @Override
   public TermEnum terms() throws IOException {
     ensureOpen();
     return new MultiTermEnum(this, subReaders, starts, null);
   }
 
+  @Override
   public TermEnum terms(Term term) throws IOException {
     ensureOpen();
     return new MultiTermEnum(this, subReaders, starts, term);
   }
 
+  @Override
   public int docFreq(Term t) throws IOException {
     ensureOpen();
     int total = 0;          // sum freqs in segments
@@ -364,7 +385,8 @@
       total += subReaders[i].docFreq(t);
     return total;
   }
-
+  
+  @Override
   public int docFreq(String field, TermRef t) throws IOException {
     ensureOpen();
     int total = 0;          // sum freqs in segments
@@ -373,12 +395,14 @@
     }
     return total;
   }
-
+  
+  @Override
   public TermDocs termDocs() throws IOException {
     ensureOpen();
     return new MultiTermDocs(this, subReaders, starts);
   }
 
+  @Override
   public TermPositions termPositions() throws IOException {
     ensureOpen();
     return new MultiTermPositions(this, subReaders, starts);
@@ -394,6 +418,7 @@
       subReaders[i].commit(commitUserData);
   }
 
+  @Override
   protected synchronized void doClose() throws IOException {
     for (int i = 0; i < subReaders.length; i++) {
       if (decrefOnClose[i]) {
@@ -404,6 +429,7 @@
     }
   }
   
+  @Override
   public Collection<String> getFieldNames (IndexReader.FieldOption fieldNames) {
     ensureOpen();
     return DirectoryReader.getFieldNames(fieldNames, this.subReaders);
@@ -412,6 +438,7 @@
   /**
    * Checks recursively if all subreaders are up to date. 
    */
+  @Override
   public boolean isCurrent() throws CorruptIndexException, IOException {
     for (int i = 0; i < subReaders.length; i++) {
       if (!subReaders[i].isCurrent()) {
@@ -426,10 +453,12 @@
   /** Not implemented.
    * @throws UnsupportedOperationException
    */
+  @Override
   public long getVersion() {
     throw new UnsupportedOperationException("MultiReader does not support this method.");
   }
   
+  @Override
   public IndexReader[] getSequentialSubReaders() {
     return subReaders;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultipleTermPositions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultipleTermPositions.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultipleTermPositions.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/MultipleTermPositions.java Thu Oct 29 21:29:47 2009
@@ -47,6 +47,7 @@
       return top();
     }
 
+    @Override
     public final boolean lessThan(TermPositions a, TermPositions b) {
       return a.doc() < b.doc();
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriter.java Thu Oct 29 21:29:47 2009
@@ -41,21 +41,25 @@
 
   private static final byte defaultNorm = Similarity.encodeNorm(1.0f);
   private FieldInfos fieldInfos;
+  @Override
   public InvertedDocEndConsumerPerThread addThread(DocInverterPerThread docInverterPerThread) {
     return new NormsWriterPerThread(docInverterPerThread, this);
   }
 
+  @Override
   public void abort() {}
 
   // We only write the _X.nrm file at flush
   void files(Collection<String> files) {}
 
+  @Override
   void setFieldInfos(FieldInfos fieldInfos) {
     this.fieldInfos = fieldInfos;
   }
 
   /** Produce _X.nrm if any document had a field with norms
    *  not disabled */
+  @Override
   public void flush(Map<InvertedDocEndConsumerPerThread,Collection<InvertedDocEndConsumerPerField>> threadsAndFields, SegmentWriteState state) throws IOException {
 
     final Map byField = new HashMap();
@@ -173,5 +177,6 @@
     }
   }
 
+  @Override
   void closeDocStore(SegmentWriteState state) {}
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerField.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerField.java Thu Oct 29 21:29:47 2009
@@ -52,6 +52,7 @@
     fieldState = docInverterPerField.fieldState;
   }
 
+  @Override
   void abort() {
     upto = 0;
   }
@@ -60,6 +61,7 @@
     return fieldInfo.name.compareTo(((NormsWriterPerField) other).fieldInfo.name);
   }
   
+  @Override
   void finish() {
     assert docIDs.length == norms.length;
     if (fieldInfo.isIndexed && !fieldInfo.omitNorms) {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerThread.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerThread.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerThread.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/NormsWriterPerThread.java Thu Oct 29 21:29:47 2009
@@ -26,13 +26,17 @@
     docState = docInverterPerThread.docState;
   }
 
+  @Override
   InvertedDocEndConsumerPerField addField(DocInverterPerField docInverterPerField, final FieldInfo fieldInfo) {
     return new NormsWriterPerField(docInverterPerField, this, fieldInfo);
   }
 
+  @Override
   void abort() {}
 
+  @Override
   void startDocument() {}
+  @Override
   void finishDocument() {}
 
   boolean freeRAM() {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ParallelReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ParallelReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ParallelReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ParallelReader.java Thu Oct 29 21:29:47 2009
@@ -177,6 +177,7 @@
     return fields;
   }
   
+  @Override
   public synchronized Object clone() {
     try {
       return doReopen(true);
@@ -204,6 +205,7 @@
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error 
    */
+  @Override
   public synchronized IndexReader reopen() throws CorruptIndexException, IOException {
     return doReopen(false);
   }
@@ -273,22 +275,26 @@
   }
 
 
+  @Override
   public int numDocs() {
     // Don't call ensureOpen() here (it could affect performance)
     return numDocs;
   }
 
+  @Override
   public int maxDoc() {
     // Don't call ensureOpen() here (it could affect performance)
     return maxDoc;
   }
 
+  @Override
   public boolean hasDeletions() {
     // Don't call ensureOpen() here (it could affect performance)
     return hasDeletions;
   }
 
   // check first reader
+  @Override
   public boolean isDeleted(int n) {
     // Don't call ensureOpen() here (it could affect performance)
     if (readers.size() > 0)
@@ -297,6 +303,7 @@
   }
 
   // delete in all readers
+  @Override
   protected void doDelete(int n) throws CorruptIndexException, IOException {
     for (final IndexReader reader : readers) {
       reader.deleteDocument(n);
@@ -305,6 +312,7 @@
   }
 
   // undeleteAll in all readers
+  @Override
   protected void doUndeleteAll() throws CorruptIndexException, IOException {
     for (final IndexReader reader : readers) {
       reader.undeleteAll();
@@ -313,6 +321,7 @@
   }
 
   // append fields from storedFieldReaders
+  @Override
   public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
     ensureOpen();
     Document result = new Document();
@@ -338,6 +347,7 @@
   }
 
   // get all vectors
+  @Override
   public TermFreqVector[] getTermFreqVectors(int n) throws IOException {
     ensureOpen();
     ArrayList<TermFreqVector> results = new ArrayList<TermFreqVector>();
@@ -352,6 +362,7 @@
     return results.toArray(new TermFreqVector[results.size()]);
   }
 
+  @Override
   public TermFreqVector getTermFreqVector(int n, String field)
     throws IOException {
     ensureOpen();
@@ -360,6 +371,7 @@
   }
 
 
+  @Override
   public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     IndexReader reader = fieldToReader.get(field);
@@ -368,6 +380,7 @@
     }
   }
 
+  @Override
   public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException {
     ensureOpen();
 
@@ -380,18 +393,21 @@
 
   }
 
+  @Override
   public boolean hasNorms(String field) throws IOException {
     ensureOpen();
     IndexReader reader = fieldToReader.get(field);
     return reader==null ? false : reader.hasNorms(field);
   }
 
+  @Override
   public byte[] norms(String field) throws IOException {
     ensureOpen();
     IndexReader reader = fieldToReader.get(field);
     return reader==null ? null : reader.norms(field);
   }
 
+  @Override
   public void norms(String field, byte[] result, int offset)
     throws IOException {
     ensureOpen();
@@ -400,6 +416,7 @@
       reader.norms(field, result, offset);
   }
 
+  @Override
   protected void doSetNorm(int n, String field, byte value)
     throws CorruptIndexException, IOException {
     IndexReader reader = fieldToReader.get(field);
@@ -407,43 +424,51 @@
       reader.doSetNorm(n, field, value);
   }
 
+  @Override
   public TermEnum terms() throws IOException {
     ensureOpen();
     return new ParallelTermEnum();
   }
 
+  @Override
   public TermEnum terms(Term term) throws IOException {
     ensureOpen();
     return new ParallelTermEnum(term);
   }
 
+  @Override
   public int docFreq(Term term) throws IOException {
     ensureOpen();
     IndexReader reader = fieldToReader.get(term.field());
     return reader==null ? 0 : reader.docFreq(term);
   }
 
+  @Override
   public int docFreq(String field, TermRef term) throws IOException {
     ensureOpen();
     IndexReader reader = ((IndexReader)fieldToReader.get(field));
     return reader == null? 0 : reader.docFreq(field, term);
   }
 
+  @Override
   public TermDocs termDocs(Term term) throws IOException {
     ensureOpen();
     return new ParallelTermDocs(term);
   }
 
+  @Override
   public TermDocs termDocs() throws IOException {
     ensureOpen();
     return new ParallelTermDocs();
   }
 
+  @Override
   public TermPositions termPositions(Term term) throws IOException {
     ensureOpen();
     return new ParallelTermPositions(term);
   }
 
+  @Override
   public TermPositions termPositions() throws IOException {
     ensureOpen();
     return new ParallelTermPositions();
@@ -452,6 +477,7 @@
   /**
    * Checks recursively if all subreaders are up to date. 
    */
+  @Override
   public boolean isCurrent() throws CorruptIndexException, IOException {
     for (final IndexReader reader : readers) {
       if (!reader.isCurrent()) {
@@ -466,6 +492,7 @@
   /**
    * Checks recursively if all subindexes are optimized 
    */
+  @Override
   public boolean isOptimized() {
     for (final IndexReader reader : readers) {
       if (!reader.isOptimized()) {
@@ -481,6 +508,7 @@
   /** Not implemented.
    * @throws UnsupportedOperationException
    */
+  @Override
   public long getVersion() {
     throw new UnsupportedOperationException("ParallelReader does not support this method.");
   }
@@ -490,11 +518,13 @@
     return readers.toArray(new IndexReader[readers.size()]);
   }
 
+  @Override
   protected void doCommit(Map<String,String> commitUserData) throws IOException {
     for (final IndexReader reader : readers)
       reader.commit(commitUserData);
   }
 
+  @Override
   protected synchronized void doClose() throws IOException {
     for (int i = 0; i < readers.size(); i++) {
       if (decrefOnClose.get(i).booleanValue()) {
@@ -505,6 +535,7 @@
     }
   }
 
+  @Override
   public Collection<String> getFieldNames (IndexReader.FieldOption fieldNames) {
     ensureOpen();
     Set<String> fieldSet = new HashSet<String>();
@@ -538,6 +569,7 @@
         termEnum = reader.terms(term);
     }
 
+    @Override
     public boolean next() throws IOException {
       if (termEnum==null)
         return false;
@@ -566,6 +598,7 @@
       return false;                               // no more fields
     }
 
+    @Override
     public Term term() {
       if (termEnum==null)
         return null;
@@ -573,6 +606,7 @@
       return termEnum.term();
     }
 
+    @Override
     public int docFreq() {
       if (termEnum==null)
         return 0;
@@ -580,6 +614,7 @@
       return termEnum.docFreq();
     }
 
+    @Override
     public void close() throws IOException {
       if (termEnum!=null)
         termEnum.close();
@@ -645,6 +680,7 @@
     public ParallelTermPositions() {}
     public ParallelTermPositions(Term term) throws IOException { seek(term); }
 
+    @Override
     public void seek(Term term) throws IOException {
       IndexReader reader = fieldToReader.get(term.field());
       termDocs = reader!=null ? reader.termPositions(term) : null;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Payload.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Payload.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Payload.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/Payload.java Thu Oct 29 21:29:47 2009
@@ -156,6 +156,7 @@
    * Clones this payload by creating a copy of the underlying
    * byte array.
    */
+  @Override
   public Object clone() {
     try {
       // Start with a shallow copy of data
@@ -176,6 +177,7 @@
     }
   }
 
+  @Override
   public boolean equals(Object obj) {
     if (obj == this)
       return true;
@@ -192,6 +194,7 @@
       return false;
   }
 
+  @Override
   public int hashCode() {
     return ArrayUtil.hashCode(data, offset, offset+length);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/PositionBasedTermVectorMapper.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/PositionBasedTermVectorMapper.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/PositionBasedTermVectorMapper.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/PositionBasedTermVectorMapper.java Thu Oct 29 21:29:47 2009
@@ -56,6 +56,7 @@
    * Never ignores positions.  This mapper doesn't make much sense unless there are positions
    * @return false
    */
+  @Override
   public boolean isIgnoringPositions() {
     return false;
   }
@@ -67,6 +68,7 @@
    * @param offsets
    * @param positions
    */
+  @Override
   public void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions) {
     for (int i = 0; i < positions.length; i++) {
       Integer posVal = Integer.valueOf(positions[i]);
@@ -86,6 +88,7 @@
    * @param storeOffsets Whether offsets are available
    * @param storePositions Whether positions are available
    */
+  @Override
   public void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions) {
     if (storePositions == false)
     {

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlyDirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlyDirectoryReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlyDirectoryReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlyDirectoryReader.java Thu Oct 29 21:29:47 2009
@@ -37,6 +37,7 @@
     super(writer, infos, termInfosIndexDivisor, codecs);
   }
   
+  @Override
   protected void acquireWriteLock() {
     ReadOnlySegmentReader.noWrite();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlySegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlySegmentReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlySegmentReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReadOnlySegmentReader.java Thu Oct 29 21:29:47 2009
@@ -23,11 +23,13 @@
     throw new UnsupportedOperationException("This IndexReader cannot make any changes to the index (it was opened with readOnly = true)");
   }
   
+  @Override
   protected void acquireWriteLock() {
     noWrite();
   }
 
   // Not synchronized
+  @Override
   public boolean isDeleted(int n) {
     return deletedDocs != null && deletedDocs.get(n);
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReusableStringReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReusableStringReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReusableStringReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ReusableStringReader.java Thu Oct 29 21:29:47 2009
@@ -31,9 +31,11 @@
     left = s.length();
     this.upto = 0;
   }
+  @Override
   public int read(char[] c) {
     return read(c, 0, c.length);
   }
+  @Override
   public int read(char[] c, int off, int len) {
     if (left > len) {
       s.getChars(upto, upto+len, c, off);
@@ -50,6 +52,7 @@
       return r;
     }
   }
+  @Override
   public void close() {};
 }
 

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=831094&r1=831093&r2=831094&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 Thu Oct 29 21:29:47 2009
@@ -98,6 +98,7 @@
 
   private Map<String,String> diagnostics;
 
+  @Override
   public String toString() {
     return "si: "+dir.toString()+" "+name+" docCount: "+docCount+" delCount: "+delCount+" delFileName: "+getDelFileName();
   }
@@ -339,6 +340,7 @@
     clearFiles();
   }
 
+  @Override
   public Object clone () {
     SegmentInfo si = new SegmentInfo(name, docCount, dir, codec);
     si.isCompoundFile = isCompoundFile;
@@ -756,6 +758,7 @@
 
   /** We consider another SegmentInfo instance equal if it
    *  has the same dir and same name. */
+  @Override
   public boolean equals(Object obj) {
     SegmentInfo other;
     try {
@@ -766,6 +769,7 @@
     return other.dir == dir && other.name.equals(name);
   }
 
+  @Override
   public int hashCode() {
     return dir.hashCode() + name.hashCode();
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfos.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentInfos.java Thu Oct 29 21:29:47 2009
@@ -314,6 +314,7 @@
 
     new FindSegmentsFile(directory) {
 
+      @Override
       protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
         read(directory, segmentFileName, codecs);
         return null;
@@ -378,6 +379,7 @@
    * SegmentInfo.
    */
   
+  @Override
   public Object clone() {
     SegmentInfos sis = (SegmentInfos) super.clone();
     for(int i=0;i<sis.size();i++) {
@@ -411,6 +413,7 @@
     throws CorruptIndexException, IOException {
 
     return ((Long) new FindSegmentsFile(directory) {
+        @Override
         protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
 
           IndexInput input = directory.openInput(segmentFileName);

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMergeQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMergeQueue.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMergeQueue.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentMergeQueue.java Thu Oct 29 21:29:47 2009
@@ -24,6 +24,7 @@
     initialize(size);
   }
 
+  @Override
   protected final boolean lessThan(SegmentMergeInfo stiA, SegmentMergeInfo stiB) {
     int comparison = stiA.term.compareTerm(stiB.term);
     if (comparison == 0)

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=831094&r1=831093&r2=831094&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 Thu Oct 29 21:29:47 2009
@@ -87,6 +87,7 @@
     segment = name;
     codecs = Codecs.getDefault();
     checkAbort = new CheckAbort(null, null) {
+      @Override
       public void work(double units) throws MergeAbortedException {
         // do nothing
       }
@@ -101,6 +102,7 @@
       checkAbort = new CheckAbort(merge, directory);
     } else {
       checkAbort = new CheckAbort(null, null) {
+        @Override
         public void work(double units) throws MergeAbortedException {
           // do nothing
         }

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=831094&r1=831093&r2=831094&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 Thu Oct 29 21:29:47 2009
@@ -255,6 +255,7 @@
    * Sets the initial value 
    */
   private class FieldsReaderLocal extends CloseableThreadLocal<FieldsReader> {
+    @Override
     protected FieldsReader initialValue() {
       return (FieldsReader) core.getFieldsReaderOrig().clone();
     }
@@ -263,6 +264,7 @@
   static class Ref {
     private int refCount = 1;
     
+    @Override
     public String toString() {
       return "refcount: "+refCount;
     }
@@ -453,6 +455,7 @@
     
     // Returns a copy of this Norm instance that shares
     // IndexInput & bytes with the original one
+    @Override
     public synchronized Object clone() {
       assert refCount > 0 && (origNorm == null || origNorm.refCount > 0);
         
@@ -504,54 +507,6 @@
   }
 
   Map<String,Norm> norms = new HashMap<String,Norm>();
-  
-  /** The class which implements SegmentReader. */
-  // @deprecated (LUCENE-1677)
-  private static Class IMPL;
-  static {
-    try {
-      String name =
-        System.getProperty("org.apache.lucene.SegmentReader.class",
-                           SegmentReader.class.getName());
-      IMPL = Class.forName(name);
-    } catch (ClassNotFoundException e) {
-      throw new RuntimeException("cannot load SegmentReader class: " + e, e);
-    } catch (SecurityException se) {
-      try {
-        IMPL = Class.forName(SegmentReader.class.getName());
-      } catch (ClassNotFoundException e) {
-        throw new RuntimeException("cannot load default SegmentReader class: " + e, e);
-      }
-    }
-  }
-
-  // @deprecated (LUCENE-1677)
-  private static Class READONLY_IMPL;
-  static {
-    try {
-      String name =
-        System.getProperty("org.apache.lucene.ReadOnlySegmentReader.class",
-                           ReadOnlySegmentReader.class.getName());
-      READONLY_IMPL = Class.forName(name);
-    } catch (ClassNotFoundException e) {
-      throw new RuntimeException("cannot load ReadOnlySegmentReader class: " + e, e);
-    } catch (SecurityException se) {
-      try {
-        READONLY_IMPL = Class.forName(ReadOnlySegmentReader.class.getName());
-      } catch (ClassNotFoundException e) {
-        throw new RuntimeException("cannot load default ReadOnlySegmentReader class: " + e, e);
-      }
-    }
-  }
-
-  /**
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
-   * @deprecated
-   */
-  public static SegmentReader get(SegmentInfo si) throws CorruptIndexException, IOException {
-    return get(false, si.dir, si, BufferedIndexInput.BUFFER_SIZE, true, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR, null);
-  }
 
   /**
    * @throws CorruptIndexException if the index is corrupt
@@ -564,15 +519,6 @@
   /**
    * @throws CorruptIndexException if the index is corrupt
    * @throws IOException if there is a low-level IO error
-   * @deprecated
-   */
-  static SegmentReader get(SegmentInfo si, int readBufferSize, boolean doOpenStores, int termInfosIndexDivisor) throws CorruptIndexException, IOException {
-    return get(false, si.dir, si, readBufferSize, doOpenStores, termInfosIndexDivisor, null);
-  }
-
-  /**
-   * @throws CorruptIndexException if the index is corrupt
-   * @throws IOException if there is a low-level IO error
    */
   public static SegmentReader get(boolean readOnly,
                                   Directory dir,
@@ -586,15 +532,7 @@
       codecs = Codecs.getDefault();
     }
     
-    SegmentReader instance;
-    try {
-      if (readOnly)
-        instance = (SegmentReader)READONLY_IMPL.newInstance();
-      else
-        instance = (SegmentReader)IMPL.newInstance();
-    } catch (Exception e) {
-      throw new RuntimeException("cannot load SegmentReader class: " + e, e);
-    }
+    SegmentReader instance = readOnly ? new ReadOnlySegmentReader() : new SegmentReader();
     instance.readOnly = readOnly;
     instance.si = si;
     instance.readBufferSize = readBufferSize;
@@ -669,6 +607,7 @@
     return (BitVector)bv.clone();
   }
 
+  @Override
   public final synchronized Object clone() {
     try {
       return clone(readOnly); // Preserve current readOnly
@@ -677,6 +616,7 @@
     }
   }
 
+  @Override
   public final synchronized IndexReader clone(boolean openReadOnly) throws CorruptIndexException, IOException {
     return reopenSegment(si, true, openReadOnly);
   }
@@ -706,15 +646,7 @@
     assert !doClone || (normsUpToDate && deletionsUpToDate);
 
     // clone reader
-    SegmentReader clone;
-    try {
-      if (openReadOnly)
-        clone = (SegmentReader) READONLY_IMPL.newInstance();
-      else
-        clone = (SegmentReader) IMPL.newInstance();
-    } catch (Exception e) {
-      throw new RuntimeException("cannot load SegmentReader class: " + e, e);
-    }
+    SegmentReader clone = openReadOnly ? new ReadOnlySegmentReader() : new SegmentReader();
 
     boolean success = false;
     try {
@@ -781,6 +713,7 @@
     return clone;
   }
 
+  @Override
   protected void doCommit(Map<String,String> commitUserData) throws IOException {
     if (hasChanges) {
       if (deletedDocsDirty) {               // re-write deleted
@@ -816,6 +749,7 @@
     return fieldsReaderLocal.get();
   }
 
+  @Override
   protected void doClose() throws IOException {
     termVectorsLocal.close();
     fieldsReaderLocal.close();
@@ -839,6 +773,7 @@
     return si.hasDeletions();
   }
 
+  @Override
   public boolean hasDeletions() {
     // Don't call ensureOpen() here (it could affect performance)
     return deletedDocs != null;
@@ -852,6 +787,7 @@
     return si.hasSeparateNorms();
   }
 
+  @Override
   protected void doDelete(int docNum) {
     if (deletedDocs == null) {
       deletedDocs = new BitVector(maxDoc());
@@ -871,6 +807,7 @@
       pendingDeleteCount++;
   }
 
+  @Override
   protected void doUndeleteAll() {
     deletedDocsDirty = false;
     if (deletedDocs != null) {
@@ -890,7 +827,8 @@
   List<String> files() throws IOException {
     return new ArrayList<String>(si.files());
   }
-
+  
+  @Override
   public TermEnum terms() throws IOException {
     ensureOpen();
     if (isPreFlex) {
@@ -906,6 +844,7 @@
 
   /** @deprecated Please switch to the flex API ({@link
    * #fields}) instead. */
+  @Override
   public TermEnum terms(Term t) throws IOException {
     ensureOpen();
     if (isPreFlex) {
@@ -923,17 +862,20 @@
     return core.fieldInfos;
   }
 
+  @Override
   public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
     ensureOpen();
     return getFieldsReader().doc(n, fieldSelector);
   }
 
+  @Override
   public synchronized boolean isDeleted(int n) {
     return (deletedDocs != null && deletedDocs.get(n));
   }
 
   /** @deprecated Switch to the flex API ({@link
    * IndexReader#termDocsEnum}) instead. */
+  @Override
   public TermDocs termDocs(Term term) throws IOException {
     if (term == null) {
       return new AllTermDocs(this);
@@ -948,6 +890,7 @@
 
   /** @deprecated Switch to the flex API {@link
    *  IndexReader#termDocsEnum} instead. */
+  @Override
   public TermDocs termDocs() throws IOException {
     ensureOpen();
     if (isPreFlex) {
@@ -964,6 +907,7 @@
 
   /** @deprecated Switch to the flex API {@link
    *  IndexReader#termDocsEnum} instead */
+  @Override
   public TermPositions termPositions() throws IOException {
     ensureOpen();
     if (isPreFlex) {
@@ -1023,6 +967,7 @@
     }
   }
 
+  @Override
   public int numDocs() {
     // Don't call ensureOpen() here (it could affect performance)
     int n = maxDoc();
@@ -1031,6 +976,7 @@
     return n;
   }
 
+  @Override
   public int maxDoc() {
     // Don't call ensureOpen() here (it could affect performance)
     return si.docCount;
@@ -1039,6 +985,7 @@
   /**
    * @see IndexReader#getFieldNames(IndexReader.FieldOption fldOption)
    */
+  @Override
   public Collection<String> getFieldNames(IndexReader.FieldOption fieldOption) {
     ensureOpen();
 
@@ -1087,6 +1034,7 @@
   }
 
 
+  @Override
   public synchronized boolean hasNorms(String field) {
     ensureOpen();
     return norms.containsKey(field);
@@ -1108,12 +1056,14 @@
   }
 
   // returns fake norms if norms aren't available
+  @Override
   public synchronized byte[] norms(String field) throws IOException {
     ensureOpen();
     byte[] bytes = getNorms(field);
     return bytes;
   }
 
+  @Override
   protected void doSetNorm(int doc, String field, byte value)
           throws IOException {
     Norm norm = norms.get(field);
@@ -1125,6 +1075,7 @@
   }
 
   /** Read norms into a pre-allocated array. */
+  @Override
   public synchronized void norms(String field, byte[] bytes, int offset)
     throws IOException {
 
@@ -1243,6 +1194,7 @@
    *  flag set.  If the flag was not set, the method returns null.
    * @throws IOException
    */
+  @Override
   public TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException {
     // Check if this field is invalid or has no stored term vector
     ensureOpen();
@@ -1258,6 +1210,7 @@
   }
 
 
+  @Override
   public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws IOException {
     ensureOpen();
     FieldInfo fi = core.fieldInfos.fieldInfo(field);
@@ -1274,6 +1227,7 @@
   }
 
 
+  @Override
   public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException {
     ensureOpen();
 
@@ -1291,6 +1245,7 @@
    *  If no such fields existed, the method returns null.
    * @throws IOException
    */
+  @Override
   public TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException {
     ensureOpen();
     
@@ -1340,6 +1295,7 @@
   }
 
   /** Returns the directory this index resides in. */
+  @Override
   public Directory directory() {
     // Don't ensureOpen here -- in certain cases, when a
     // cloned/reopened reader needs to commit, it may call
@@ -1351,9 +1307,17 @@
   // share the underlying postings data) will map to the
   // same entry in the FieldCache.  See LUCENE-1579.
   // nocommit - what to return here?
+  @Override
   public final Object getFieldCacheKey() {
     return core;
   }
+  
+  // nocommit: missing?
+  //@Override
+  //public long getUniqueTermCount() {
+  //  return core.getTermsReader().size();
+  //}
+
 
   /**
    * Lotsa tests did hacks like:<br/>

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentTermVector.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentTermVector.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SegmentTermVector.java Thu Oct 29 21:29:47 2009
@@ -39,6 +39,7 @@
     return field;
   }
 
+  @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
     sb.append('{');

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SerialMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SerialMergeScheduler.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SerialMergeScheduler.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SerialMergeScheduler.java Thu Oct 29 21:29:47 2009
@@ -26,6 +26,7 @@
   /** Just do the merges in sequence. We do this
    * "synchronized" so that even if the application is using
    * multiple threads, only one merge may run at a time. */
+  @Override
   synchronized public void merge(IndexWriter writer)
     throws CorruptIndexException, IOException {
 
@@ -37,5 +38,6 @@
     }
   }
 
+  @Override
   public void close() {}
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java Thu Oct 29 21:29:47 2009
@@ -92,15 +92,19 @@
     MyCommitPoint(IndexCommit cp) {
       this.cp = cp;
     }
+    @Override
     public String getSegmentsFileName() {
       return cp.getSegmentsFileName();
     }
+    @Override
     public Collection<String> getFileNames() throws IOException {
       return cp.getFileNames();
     }
+    @Override
     public Directory getDirectory() {
       return cp.getDirectory();
     }
+    @Override
     public void delete() {
       synchronized(SnapshotDeletionPolicy.this) {
         // Suppress the delete request if this commit point is
@@ -109,15 +113,19 @@
           cp.delete();
       }
     }
+    @Override
     public boolean isDeleted() {
       return cp.isDeleted();
     }
+    @Override
     public long getVersion() {
       return cp.getVersion();
     }
+    @Override
     public long getGeneration() {
       return cp.getGeneration();
     }
+    @Override
     public Map<String,String> getUserData() throws IOException {
       return cp.getUserData();
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SortedTermVectorMapper.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SortedTermVectorMapper.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SortedTermVectorMapper.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/SortedTermVectorMapper.java Thu Oct 29 21:29:47 2009
@@ -60,6 +60,7 @@
    * @param positions Position information, may be null
    */
   //We need to combine any previous mentions of the term
+  @Override
   public void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions) {
     TermVectorEntry entry =  termToTVE.get(term);
     if (entry == null) {
@@ -108,6 +109,7 @@
 
   }
 
+  @Override
   public void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions) {
 
     this.storeOffsets = storeOffsets;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/StoredFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/StoredFieldsWriter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/StoredFieldsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/StoredFieldsWriter.java Thu Oct 29 21:29:47 2009
@@ -177,15 +177,18 @@
       numStoredFields = 0;
     }
 
+    @Override
     void abort() {
       reset();
       free(this);
     }
 
+    @Override
     public long sizeInBytes() {
       return fdt.sizeInBytes();
     }
 
+    @Override
     public void finish() throws IOException {
       finishDocument(this);
     }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorEntry.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorEntry.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorEntry.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorEntry.java Thu Oct 29 21:29:47 2009
@@ -73,6 +73,7 @@
   }
 
 
+  @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (o == null || getClass() != o.getClass()) return false;
@@ -84,10 +85,12 @@
     return true;
   }
 
+  @Override
   public int hashCode() {
     return (term != null ? term.hashCode() : 0);
   }
 
+  @Override
   public String toString() {
     return "TermVectorEntry{" +
             "field='" + field + '\'' +

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java Thu Oct 29 21:29:47 2009
@@ -70,6 +70,7 @@
    * @param o The comparison Object
    * @return true if both {@link #getStartOffset()} and {@link #getEndOffset()} are the same for both objects.
    */
+  @Override
   public boolean equals(Object o) {
     if (this == o) return true;
     if (!(o instanceof TermVectorOffsetInfo)) return false;
@@ -82,6 +83,7 @@
     return true;
   }
 
+  @Override
   public int hashCode() {
     int result;
     result = startOffset;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsReader.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsReader.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsReader.java Thu Oct 29 21:29:47 2009
@@ -520,6 +520,7 @@
     }
   }
 
+  @Override
   protected Object clone() throws CloneNotSupportedException {
     
     final TermVectorsReader clone = (TermVectorsReader) super.clone();
@@ -552,6 +553,7 @@
   private boolean storingPositions;
   private String field;
 
+  @Override
   public void setExpectations(String field, int numTerms, boolean storeOffsets, boolean storePositions) {
     this.field = field;
     terms = new String[numTerms];
@@ -564,6 +566,7 @@
       this.offsets = new TermVectorOffsetInfo[numTerms][];
   }
 
+  @Override
   public void map(String term, int frequency, TermVectorOffsetInfo[] offsets, int[] positions) {
     terms[currentPosition] = term;
     termFreqs[currentPosition] = frequency;

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriter.java Thu Oct 29 21:29:47 2009
@@ -41,16 +41,19 @@
     this.docWriter = docWriter;
   }
 
+  @Override
   public TermsHashConsumerPerThread addThread(TermsHashPerThread termsHashPerThread) {
     return new TermVectorsTermsWriterPerThread(termsHashPerThread, this);
   }
 
+  @Override
   void createPostings(RawPostingList[] postings, int start, int count) {
     final int end = start + count;
     for(int i=start;i<end;i++)
       postings[i] = new PostingList();
   }
 
+  @Override
   synchronized void flush(Map<TermsHashConsumerPerThread,Collection<TermsHashConsumerPerField>> threadsAndFields, final SegmentWriteState state) throws IOException {
 
     if (tvx != null) {
@@ -77,6 +80,7 @@
     }
   }
 
+  @Override
   synchronized void closeDocStore(final SegmentWriteState state) throws IOException {
     if (tvx != null) {
       // At least one doc in this run had term vectors
@@ -207,6 +211,7 @@
     return false;
   }
 
+  @Override
   public void abort() {
     if (tvx != null) {
       try {
@@ -252,6 +257,7 @@
       numVectorFields = 0;
     }
 
+    @Override
     void abort() {
       reset();
       free(this);
@@ -267,10 +273,12 @@
       numVectorFields++;
     }
 
+    @Override
     public long sizeInBytes() {
       return tvf.sizeInBytes();
     }
 
+    @Override
     public void finish() throws IOException {
       finishDocument(this);
     }
@@ -282,6 +290,7 @@
     int lastPosition;                               // Last position where this term occurred
   }
 
+  @Override
   int bytesPerPosting() {
     return RawPostingList.BYTES_SIZE + 3 * DocumentsWriter.INT_NUM_BYTE;
   }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerField.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerField.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerField.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerField.java Thu Oct 29 21:29:47 2009
@@ -49,10 +49,12 @@
     fieldState = termsHashPerField.fieldState;
   }
 
+  @Override
   int getStreamCount() {
     return 2;
   }
 
+  @Override
   boolean start(Fieldable[] fields, int count) {
     doVectors = false;
     doVectorPositions = false;
@@ -97,6 +99,7 @@
    *  are enabled, to write the vectors to
    *  RAMOutputStream, which is then quickly flushed to
    *  * the real term vectors files in the Directory. */
+  @Override
   void finish() throws IOException {
 
     assert docState.testPoint("TermVectorsTermsWriterPerField.finish start");
@@ -194,6 +197,7 @@
     maxNumPostings = 0;
   }
   
+  @Override
   void start(Fieldable f) {
     if (doVectorOffsets) {
       offsetAttribute = fieldState.attributeSource.addAttribute(OffsetAttribute.class);
@@ -202,6 +206,7 @@
     }
   }
 
+  @Override
   void newTerm(RawPostingList p0) {
 
     assert docState.testPoint("TermVectorsTermsWriterPerField.newTerm start");
@@ -225,6 +230,7 @@
     }
   }
 
+  @Override
   void addTerm(RawPostingList p0) {
 
     assert docState.testPoint("TermVectorsTermsWriterPerField.addTerm start");
@@ -247,5 +253,6 @@
     }
   }
 
+  @Override
   void skippingLongTerm() {}
 }

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerThread.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerThread.java?rev=831094&r1=831093&r2=831094&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerThread.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/TermVectorsTermsWriterPerThread.java Thu Oct 29 21:29:47 2009
@@ -39,6 +39,7 @@
   final UnicodeUtil.UTF8Result utf8Results[] = {new UnicodeUtil.UTF8Result(),
                                                 new UnicodeUtil.UTF8Result()};
 
+  @Override
   public void startDocument() {
     assert clearLastVectorFieldName();
     if (doc != null) {
@@ -47,6 +48,7 @@
     }
   }
 
+  @Override
   public DocumentsWriter.DocWriter finishDocument() {
     try {
       return doc;
@@ -55,10 +57,12 @@
     }
   }
 
+  @Override
   public TermsHashConsumerPerField addField(TermsHashPerField termsHashPerField, FieldInfo fieldInfo) {
     return new TermVectorsTermsWriterPerField(termsHashPerField, this, fieldInfo);
   }
 
+  @Override
   public void abort() {
     if (doc != null) {
       doc.abort();



Mime
View raw message