lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r825891 - in /lucene/java/trunk/src: java/org/apache/lucene/index/ java/org/apache/lucene/search/ java/org/apache/lucene/search/payloads/ java/org/apache/lucene/util/ test/org/apache/lucene/search/ test/org/apache/lucene/util/
Date Fri, 16 Oct 2009 13:42:41 GMT
Author: uschindler
Date: Fri Oct 16 13:42:41 2009
New Revision: 825891

URL: http://svn.apache.org/viewvc?rev=825891&view=rev
Log:
put more out-commented @Overrides back in. Add more.

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/Term.java
    lucene/java/trunk/src/java/org/apache/lucene/search/DocIdSet.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FilteredDocIdSet.java
    lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java
    lucene/java/trunk/src/java/org/apache/lucene/util/SimpleStringInterner.java
    lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java
    lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java
    lucene/java/trunk/src/test/org/apache/lucene/util/LocalizedTestCase.java
    lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java
    lucene/java/trunk/src/test/org/apache/lucene/util/TestNumericUtils.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/Term.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/Term.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/Term.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/Term.java Fri Oct 16 13:42:41 2009
@@ -27,7 +27,7 @@
   Note that terms may represent more than words from text fields, but also
   things like dates, email addresses, urls, etc.  */
 
-public final class Term implements Comparable, java.io.Serializable {
+public final class Term implements Comparable<Term>, java.io.Serializable {
   String field;
   String text;
 
@@ -74,7 +74,7 @@
       return new Term(field,text,false);
   }
 
-  //@Override
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;
@@ -96,7 +96,7 @@
     return true;
   }
 
-  //@Override
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = 1;
@@ -105,10 +105,6 @@
     return result;
   }
 
-  public int compareTo(Object other) {
-    return compareTo((Term)other);
-  }
-
   /** Compares two terms, returning a negative integer if this
     term belongs before the argument, zero if this term is equal to the
     argument, and a positive integer if this term belongs after the argument.
@@ -127,6 +123,7 @@
     text = txt;
   }
 
+  @Override
   public final String toString() { return field + ":" + text; }
 
   private void readObject(java.io.ObjectInputStream in)

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/DocIdSet.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DocIdSet.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DocIdSet.java Fri Oct 16 13:42:41
2009
@@ -34,10 +34,12 @@
       public int nextDoc() throws IOException { return NO_MORE_DOCS; }
     };
     
+    @Override
     public DocIdSetIterator iterator() {
       return iterator;
     }
     
+    @Override
     public boolean isCacheable() {
       return true;
     }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java Fri Oct
16 13:42:41 2009
@@ -478,10 +478,12 @@
     abstract boolean matchDoc(int doc) throws ArrayIndexOutOfBoundsException;
     
     /** this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs */
+    @Override
     public boolean isCacheable() {
       return !(mayUseTermDocs && reader.hasDeletions());
     }
 
+    @Override
     public DocIdSetIterator iterator() throws IOException {
       // Synchronization needed because deleted docs BitVector
       // can change after call to hasDeletions until TermDocs creation.

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java Fri Oct
16 13:42:41 2009
@@ -126,11 +126,13 @@
       }
     }
 
+    @Override
     public DocIdSetIterator iterator() {
       return new FieldCacheTermsFilterDocIdSetIterator();
     }
 
     /** This DocIdSet implementation is cacheable. */
+    @Override
     public boolean isCacheable() {
       return true;
     }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FilteredDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FilteredDocIdSet.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FilteredDocIdSet.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FilteredDocIdSet.java Fri Oct 16 13:42:41
2009
@@ -50,6 +50,7 @@
   }
   
   /** This DocIdSet implementation is cacheable if the inner set is cacheable. */
+  @Override
   public boolean isCacheable() {
     return _innerSet.isCacheable();
   }
@@ -66,7 +67,7 @@
    * @see DocIdSetIterator
    * @see FilteredDocIdSetIterator
    */
-  // @Override
+  @Override
   public DocIdSetIterator iterator() throws IOException {
     return new FilteredDocIdSetIterator(_innerSet.iterator()) {
       protected boolean match(int docid) throws IOException {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java Fri Oct 16
13:42:41 2009
@@ -44,26 +44,32 @@
     this.query = query;
   }
 
+  @Override
   public DocIdSet getDocIdSet(final IndexReader reader) throws IOException {
     final Weight weight = query.weight(new IndexSearcher(reader));
     return new DocIdSet() {
+      @Override
       public DocIdSetIterator iterator() throws IOException {
         return weight.scorer(reader, true, false);
       }
+      @Override
       public boolean isCacheable() { return false; }
     };
   }
 
+  @Override
   public String toString() {
     return "QueryWrapperFilter(" + query + ")";
   }
 
+  @Override
   public boolean equals(Object o) {
     if (!(o instanceof QueryWrapperFilter))
       return false;
     return this.query.equals(((QueryWrapperFilter)o).query);
   }
 
+  @Override
   public int hashCode() {
     return query.hashCode() ^ 0x923F64B9;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Similarity.java Fri Oct 16 13:42:41
2009
@@ -752,11 +752,11 @@
     if(supportedMethods.overridesTermIDF) {
       final float idf = idf(term, searcher);
       return new IDFExplanation() {
-        //@Override
+        @Override
         public float getIdf() {
           return idf;
         }
-        //@Override
+        @Override
         public String explain() {
           return "Inexplicable";
         }
@@ -766,12 +766,12 @@
     final int max = searcher.maxDoc();
     final float idf = idf(df, max);
     return new IDFExplanation() {
-        //@Override
+        @Override
         public String explain() {
           return "idf(docFreq=" + df +
           ", maxDocs=" + max + ")";
         }
-        //@Override
+        @Override
         public float getIdf() {
           return idf;
         }};
@@ -814,11 +814,11 @@
     if(supportedMethods.overridesCollectionIDF) {
       final float idf = idf(terms, searcher);
       return new IDFExplanation() {
-        //@Override
+        @Override
         public float getIdf() {
           return idf;
         }
-        //@Override
+        @Override
         public String explain() {
           return "Inexplicable";
         }
@@ -839,11 +839,11 @@
     }
     final float fIdf = idf;
     return new IDFExplanation() {
-      //@Override
+      @Override
       public float getIdf() {
         return fIdf;
       }
-      //@Override
+      @Override
       public String explain() {
         return exp.toString();
       }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermRangeQuery.java Fri Oct 16 13:42:41
2009
@@ -130,12 +130,14 @@
   /** Returns the collator used to determine range inclusion, if any. */
   public Collator getCollator() { return collator; }
   
+  @Override
   protected FilteredTermEnum getEnum(IndexReader reader) throws IOException {
     return new TermRangeTermEnum(reader, field, lowerTerm,
         upperTerm, includeLower, includeUpper, collator);
   }
 
   /** Prints a user-readable version of this query. */
+  @Override
   public String toString(String field) {
       StringBuilder buffer = new StringBuilder();
       if (!getField().equals(field)) {
@@ -151,7 +153,7 @@
       return buffer.toString();
   }
 
-  //@Override
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = super.hashCode();
@@ -164,7 +166,7 @@
     return result;
   }
 
-  //@Override
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java Fri
Oct 16 13:42:41 2009
@@ -66,10 +66,12 @@
     this.function = function;
   }
 
+  @Override
   public Weight createWeight(Searcher searcher) throws IOException {
     return new PayloadNearSpanWeight(this, searcher);
   }
 
+  @Override
   public Object clone() {
     int sz = clauses.size();
     SpanQuery[] newClauses = new SpanQuery[sz];
@@ -84,6 +86,7 @@
     return boostingNearQuery;
   }
 
+  @Override
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();
     buffer.append("payloadNear([");
@@ -104,7 +107,7 @@
     return buffer.toString();
   }
 
-  // @Override
+  @Override
   public int hashCode() {
     final int prime = 31;
     int result = super.hashCode();
@@ -113,7 +116,7 @@
     return result;
   }
 
-  // @Override
+  @Override
   public boolean equals(Object obj) {
     if (this == obj)
       return true;
@@ -146,6 +149,7 @@
           similarity, reader.norms(query.getField()));
     }
 
+    @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
         boolean topScorer) throws IOException {
       return new PayloadNearSpanScorer(query.getSpans(reader), this,
@@ -215,12 +219,14 @@
       return super.setFreqCurrentDoc();
     }
 
+    @Override
     public float score() throws IOException {
 
       return super.score()
           * function.docScore(doc, fieldName, payloadsSeen, payloadScore);
     }
 
+    @Override
     public Explanation explain(int doc) throws IOException {
       Explanation result = new Explanation();
       Explanation nonPayloadExpl = super.explain(doc);

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/OpenBitSet.java Fri Oct 16 13:42:41
2009
@@ -112,11 +112,13 @@
     this.wlen = numWords;
   }
   
+  @Override
   public DocIdSetIterator iterator() {
     return new OpenBitSetIterator(bits, wlen);
   }
 
   /** This DocIdSet implementation is cacheable. */
+  @Override
   public boolean isCacheable() {
     return true;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/SimpleStringInterner.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/SimpleStringInterner.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/SimpleStringInterner.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/SimpleStringInterner.java Fri Oct 16
13:42:41 2009
@@ -46,7 +46,7 @@
     this.maxChainLength = Math.max(2,maxChainLength);
   }
 
-  // @Override
+  @Override
   public String intern(String s) {
     int h = s.hashCode();
     // In the future, it may be worth augmenting the string hash

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java Fri Oct 16 13:42:41
2009
@@ -181,6 +181,7 @@
   }
 
   /** This DocIdSet implementation is cacheable. */
+  @Override
   public boolean isCacheable() {
     return true;
   }
@@ -188,6 +189,7 @@
   /**
    * @return    An iterator over the sorted integers.
    */
+  @Override
   public DocIdSetIterator iterator() {
     return new DocIdSetIterator() {
       int bytePos = 0;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java Fri Oct 16 13:42:41
2009
@@ -42,7 +42,7 @@
     final int maxdoc=10;
     final DocIdSet innerSet = new DocIdSet() {
 
-        // @Override
+        @Override
         public DocIdSetIterator iterator() {
           return new DocIdSetIterator() {
 
@@ -52,13 +52,13 @@
               return docid;
             }
             
-            //@Override
+            @Override
             public int nextDoc() throws IOException {
               docid++;
               return docid < maxdoc ? docid : (docid = NO_MORE_DOCS);
             }
 
-            //@Override
+            @Override
             public int advance(int target) throws IOException {
               while (nextDoc() < target) {}
               return docid;
@@ -69,7 +69,7 @@
 	  
 		
     DocIdSet filteredSet = new FilteredDocIdSet(innerSet){
-        // @Override
+        @Override
         protected boolean match(int docid) {
           return docid%2 == 0;  //validate only even docids
         }	

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/LocalizedTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/LocalizedTestCase.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/LocalizedTestCase.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/LocalizedTestCase.java Fri Oct 16 13:42:41
2009
@@ -65,19 +65,19 @@
     this.testWithDifferentLocales = testWithDifferentLocales;
   }
 
-  // @Override
+  @Override
   protected void setUp() throws Exception {
     super.setUp();
     Locale.setDefault(locale);
   }
 
-  // @Override
+  @Override
   protected void tearDown() throws Exception {
     Locale.setDefault(defaultLocale);
     super.tearDown();
   }
   
-  // @Override
+  @Override
   public void runBare() throws Throwable {
     // Do the test with the default Locale (default)
     try {

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/LuceneTestCase.java Fri Oct 16 13:42:41
2009
@@ -199,7 +199,7 @@
     return new Random(seed);
   }
   
-  // @Override
+  @Override
   public void runBare() throws Throwable {
     try {
       seed = null;

Modified: lucene/java/trunk/src/test/org/apache/lucene/util/TestNumericUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/util/TestNumericUtils.java?rev=825891&r1=825890&r2=825891&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/util/TestNumericUtils.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/util/TestNumericUtils.java Fri Oct 16 13:42:41
2009
@@ -179,7 +179,7 @@
     final OpenBitSet bits=useBitSet ? new OpenBitSet(upper-lower+1) : null;
     
     NumericUtils.splitLongRange(new NumericUtils.LongRangeBuilder() {
-      //@Override
+      @Override
       public void addRange(long min, long max, int shift) {
         assertTrue("min, max should be inside bounds", min>=lower && min<=upper
&& max>=lower && max<=upper);
         if (useBitSet) for (long l=min; l<=max; l++) {
@@ -261,7 +261,7 @@
     final OpenBitSet bits=useBitSet ? new OpenBitSet(upper-lower+1) : null;
     
     NumericUtils.splitIntRange(new NumericUtils.IntRangeBuilder() {
-      //@Override
+      @Override
       public void addRange(int min, int max, int shift) {
         assertTrue("min, max should be inside bounds", min>=lower && min<=upper
&& max>=lower && max<=upper);
         if (useBitSet) for (int i=min; i<=max; i++) {



Mime
View raw message