lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r827811 - in /lucene/java/trunk/src/java/org/apache/lucene: queryParser/ search/ search/spans/ store/ util/
Date Tue, 20 Oct 2009 21:43:00 GMT
Author: uschindler
Date: Tue Oct 20 21:42:59 2009
New Revision: 827811

URL: http://svn.apache.org/viewvc?rev=827811&view=rev
Log:
LUCENE-1257: Cleanup unneeded casts

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java
    lucene/java/trunk/src/java/org/apache/lucene/search/CachingWrapperFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/DefaultSimilarity.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java
    lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java
    lucene/java/trunk/src/java/org/apache/lucene/search/PhraseScorer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
    lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java
    lucene/java/trunk/src/java/org/apache/lucene/search/QueryWrapperFilter.java
    lucene/java/trunk/src/java/org/apache/lucene/search/SloppyPhraseScorer.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/store/RAMFile.java
    lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java
    lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java
    lucene/java/trunk/src/java/org/apache/lucene/util/ReaderUtil.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Tue Oct 20 21:42:59
2009
@@ -417,7 +417,7 @@
       return this.dateResolution;
     }
 
-    DateTools.Resolution resolution = (DateTools.Resolution) fieldToDateResolution.get(fieldName);
+    DateTools.Resolution resolution = fieldToDateResolution.get(fieldName);
     if (resolution == null) {
       // no date resolutions set for the given field; return default date resolution instead
       resolution = this.dateResolution;

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj Tue Oct 20 21:42:59
2009
@@ -441,7 +441,7 @@
       return this.dateResolution;
     }
 
-    DateTools.Resolution resolution = (DateTools.Resolution) fieldToDateResolution.get(fieldName);
+    DateTools.Resolution resolution = fieldToDateResolution.get(fieldName);
     if (resolution == null) {
       // no date resolutions set for the given field; return default date resolution instead
       resolution = this.dateResolution;

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java Tue Oct 20 21:42:59
2009
@@ -187,8 +187,7 @@
       this.similarity = getSimilarity(searcher);
       weights = new ArrayList<Weight>(clauses.size());
       for (int i = 0 ; i < clauses.size(); i++) {
-        BooleanClause c = (BooleanClause)clauses.get(i);
-        weights.add(c.getQuery().createWeight(searcher));
+        weights.add(clauses.get(i).getQuery().createWeight(searcher));
       }
     }
 
@@ -202,11 +201,9 @@
     public float sumOfSquaredWeights() throws IOException {
       float sum = 0.0f;
       for (int i = 0 ; i < weights.size(); i++) {
-        BooleanClause c = (BooleanClause)clauses.get(i);
-        Weight w = (Weight)weights.get(i);
         // call sumOfSquaredWeights for all clauses in case of side effects
-        float s = w.sumOfSquaredWeights();         // sum sub weights
-        if (!c.isProhibited())
+        float s = weights.get(i).sumOfSquaredWeights();         // sum sub weights
+        if (!clauses.get(i).isProhibited())
           // only add to sum for non-prohibited clauses
           sum += s;
       }
@@ -370,7 +367,7 @@
   @Override
   public Query rewrite(IndexReader reader) throws IOException {
     if (minNrShouldMatch == 0 && clauses.size() == 1) {                    // optimize
1-clause queries
-      BooleanClause c = (BooleanClause)clauses.get(0);
+      BooleanClause c = clauses.get(0);
       if (!c.isProhibited()) {			  // just return clause
 
         Query query = c.getQuery().rewrite(reader);    // rewrite first

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanScorer2.java Tue Oct 20 21:42:59
2009
@@ -212,7 +212,7 @@
     if (optionalScorers.size() > nrOptRequired)
       requiredCountingSumScorer = countingDisjunctionSumScorer(optionalScorers, nrOptRequired);
     else if (optionalScorers.size() == 1)
-      requiredCountingSumScorer = new SingleMatchScorer((Scorer) optionalScorers.get(0));
+      requiredCountingSumScorer = new SingleMatchScorer(optionalScorers.get(0));
     else
       requiredCountingSumScorer = countingConjunctionSumScorer(optionalScorers);
     return addProhibitedScorers(requiredCountingSumScorer);
@@ -226,7 +226,7 @@
     } else { // optionalScorers.size() > minNrShouldMatch, and at least one required scorer
       Scorer requiredCountingSumScorer =
             requiredScorers.size() == 1
-            ? new SingleMatchScorer((Scorer) requiredScorers.get(0))
+            ? new SingleMatchScorer(requiredScorers.get(0))
             : countingConjunctionSumScorer(requiredScorers);
       if (minNrShouldMatch > 0) { // use a required disjunction scorer over the optional
scorers
         return addProhibitedScorers( 
@@ -239,7 +239,7 @@
         return new ReqOptSumScorer(
                       addProhibitedScorers(requiredCountingSumScorer),
                       optionalScorers.size() == 1
-                        ? new SingleMatchScorer((Scorer) optionalScorers.get(0))
+                        ? new SingleMatchScorer(optionalScorers.get(0))
                         // require 1 in combined, optional scorer.
                         : countingDisjunctionSumScorer(optionalScorers, 1));
       }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/CachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/CachingWrapperFilter.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/CachingWrapperFilter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/CachingWrapperFilter.java Tue Oct
20 21:42:59 2009
@@ -72,7 +72,7 @@
     }
 
     if (cached != null) {
-      return (DocIdSet) cached;
+      return cached;
     }
 
     final DocIdSet docIdSet = docIdSetToCache(filter.getDocIdSet(reader), reader);

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DefaultSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/DefaultSimilarity.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DefaultSimilarity.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DefaultSimilarity.java Tue Oct 20
21:42:59 2009
@@ -37,7 +37,7 @@
       numTerms = state.getLength() - state.getNumOverlap();
     else
       numTerms = state.getLength();
-    return (float) (state.getBoost() * lengthNorm(field, numTerms));
+    return (state.getBoost() * lengthNorm(field, numTerms));
   }
   
   /** Implemented as <code>1/sqrt(numTerms)</code>. */

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldCacheImpl.java Tue Oct 20 21:42:59
2009
@@ -450,9 +450,8 @@
       super(wrapper);
     }
 
-    protected Object createValue(IndexReader reader, Entry entryKey)
+    protected Object createValue(IndexReader reader, Entry entry)
         throws IOException {
-      Entry entry = (Entry) entryKey;
       String field = entry.field;
       FieldCache.LongParser parser = (FieldCache.LongParser) entry.custom;
       if (parser == null) {
@@ -556,7 +555,7 @@
 
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
-      String field = StringHelper.intern((String) entryKey.field);
+      String field = StringHelper.intern(entryKey.field);
       final String[] retArray = new String[reader.maxDoc()];
       TermDocs termDocs = reader.termDocs();
       TermEnum termEnum = reader.terms (new Term (field));
@@ -591,7 +590,7 @@
 
     protected Object createValue(IndexReader reader, Entry entryKey)
         throws IOException {
-      String field = StringHelper.intern((String) entryKey.field);
+      String field = StringHelper.intern(entryKey.field);
       final int[] retArray = new int[reader.maxDoc()];
       String[] mterms = new String[reader.maxDoc()+1];
       TermDocs termDocs = reader.termDocs();

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FuzzyQuery.java Tue Oct 20 21:42:59
2009
@@ -153,7 +153,7 @@
             continue;
           }
 
-          reusableST = (ScoreTerm) stQueue.insertWithOverflow(reusableST);
+          reusableST = stQueue.insertWithOverflow(reusableST);
         }
       } while (enumerator.next());
     } finally {
@@ -163,7 +163,7 @@
     BooleanQuery query = new BooleanQuery(true);
     int size = stQueue.size();
     for(int i = 0; i < size; i++){
-      ScoreTerm st = (ScoreTerm) stQueue.pop();
+      ScoreTerm st = stQueue.pop();
       TermQuery tq = new TermQuery(st.term);      // found a match
       tq.setBoost(getBoost() * st.score); // set the boost
       query.add(tq, BooleanClause.Occur.SHOULD);          // add to query

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java Tue Oct 20 21:42:59
2009
@@ -66,7 +66,7 @@
   public void add(Term[] terms) {
     int position = 0;
     if (positions.size() > 0)
-      position = ((Integer) positions.get(positions.size()-1)).intValue() + 1;
+      position = positions.get(positions.size()-1).intValue() + 1;
 
     add(terms, position);
   }
@@ -108,7 +108,7 @@
   public int[] getPositions() {
     int[] result = new int[positions.size()];
     for (int i = 0; i < positions.size(); i++)
-      result[i] = ((Integer) positions.get(i)).intValue();
+      result[i] = positions.get(i).intValue();
     return result;
   }
 
@@ -161,7 +161,7 @@
 
       TermPositions[] tps = new TermPositions[termArrays.size()];
       for (int i=0; i<tps.length; i++) {
-        Term[] terms = (Term[])termArrays.get(i);
+        Term[] terms = termArrays.get(i);
 
         TermPositions p;
         if (terms.length > 1)
@@ -250,7 +250,7 @@
 
   public Query rewrite(IndexReader reader) {
     if (termArrays.size() == 1) {                 // optimize one-term case
-      Term[] terms = (Term[])termArrays.get(0);
+      Term[] terms = termArrays.get(0);
       BooleanQuery boq = new BooleanQuery(true);
       for (int i=0; i<terms.length; i++) {
         boq.add(new TermQuery(terms[i]), BooleanClause.Occur.SHOULD);

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiSearcher.java Tue Oct 20 21:42:59
2009
@@ -198,7 +198,7 @@
 
     ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
     for (int i = hq.size()-1; i >= 0; i--)	  // put docs in array
-      scoreDocs[i] = (ScoreDoc)hq.pop();
+      scoreDocs[i] = hq.pop();
     
     float maxScore = (totalHits==0) ? Float.NEGATIVE_INFINITY : scoreDocs[0].score;
     
@@ -241,7 +241,7 @@
 
     ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
     for (int i = hq.size() - 1; i >= 0; i--)	  // put docs in array
-      scoreDocs[i] = (ScoreDoc) hq.pop();
+      scoreDocs[i] =  hq.pop();
 
     return new TopFieldDocs (totalHits, scoreDocs, hq.getFields(), maxScore);
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ParallelMultiSearcher.java Tue Oct
20 21:42:59 2009
@@ -85,7 +85,7 @@
 
     ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
     for (int i = hq.size() - 1; i >= 0; i--) // put docs in array
-      scoreDocs[i] = (ScoreDoc) hq.pop();
+      scoreDocs[i] = hq.pop();
 
     float maxScore = (totalHits==0) ? Float.NEGATIVE_INFINITY : scoreDocs[0].score;
     
@@ -133,7 +133,7 @@
 
     ScoreDoc[] scoreDocs = new ScoreDoc[hq.size()];
     for (int i = hq.size() - 1; i >= 0; i--) // put docs in array
-      scoreDocs[i] = (ScoreDoc) hq.pop();
+      scoreDocs[i] = hq.pop();
 
     return new TopFieldDocs(totalHits, scoreDocs, hq.getFields(), maxScore);
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/PhraseScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/PhraseScorer.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/PhraseScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/PhraseScorer.java Tue Oct 20 21:42:59
2009
@@ -153,7 +153,7 @@
   protected final void pqToList() {
     last = first = null;
     while (pq.top() != null) {
-      PhrasePositions pp = (PhrasePositions) pq.pop();
+      PhrasePositions pp = pq.pop();
       if (last != null) {			  // add next to end of list
         last.next = pp;
       } else

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Query.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Query.java Tue Oct 20 21:42:59 2009
@@ -150,7 +150,7 @@
     }
     // optimization: if we have just one query, just return it
     if(uniques.size() == 1){
-        return (Query)uniques.iterator().next();
+        return uniques.iterator().next();
     }
     BooleanQuery result = new BooleanQuery(true);
     for (final Query query : uniques)

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/QueryTermVector.java Tue Oct 20 21:42:59
2009
@@ -68,7 +68,7 @@
             terms.add(termAtt.term());
             hasMoreTokens = stream.incrementToken();
           }
-          processTerms((String[])terms.toArray(new String[terms.size()]));
+          processTerms(terms.toArray(new String[terms.size()]));
         } catch (IOException e) {
         }
       }

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=827811&r1=827810&r2=827811&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 Tue Oct 20
21:42:59 2009
@@ -18,7 +18,7 @@
  */
 
 import java.io.IOException;
-import java.util.BitSet;
+
 
 import org.apache.lucene.index.IndexReader;
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/SloppyPhraseScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/SloppyPhraseScorer.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/SloppyPhraseScorer.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/SloppyPhraseScorer.java Tue Oct 20
21:42:59 2009
@@ -58,9 +58,9 @@
         float freq = 0.0f;
         boolean done = (end<0);
         while (!done) {
-            PhrasePositions pp = (PhrasePositions) pq.pop();
+            PhrasePositions pp = pq.pop();
             int start = pp.position;
-            int next = ((PhrasePositions) pq.top()).position;
+            int next = pq.top().position;
 
             boolean tpsDiffer = true;
             for (int pos = start; pos <= next || !tpsDiffer; pos = pp.position) {
@@ -96,7 +96,7 @@
       int n=0;
       PhrasePositions pp3;
       //pop until finding pp2
-      while ((pp3=(PhrasePositions)pq.pop()) != pp2) {
+      while ((pp3=pq.pop()) != pp2) {
         tmpPos[n++] = pp3;
       }
       //insert back all but pp2

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java Tue Oct 20
21:42:59 2009
@@ -939,7 +939,7 @@
       // avoid casting if unnecessary.
       FieldValueHitQueue queue = (FieldValueHitQueue) pq;
       for (int i = howMany - 1; i >= 0; i--) {
-        results[i] = queue.fillFields((Entry) queue.pop());
+        results[i] = queue.fillFields(queue.pop());
       }
     } else {
       for (int i = howMany - 1; i >= 0; i--) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/NearSpansUnordered.java Tue
Oct 20 21:42:59 2009
@@ -211,7 +211,7 @@
     return more && (atMatch() ||  next());
   }
 
-  private SpansCell min() { return (SpansCell)queue.top(); }
+  private SpansCell min() { return queue.top(); }
 
   public int doc() { return min().doc(); }
   public int start() { return min().start(); }
@@ -281,7 +281,7 @@
   private void queueToList() throws IOException {
     last = first = null;
     while (queue.top() != null) {
-      addToList((SpansCell)queue.pop());
+      addToList(queue.pop());
     }
   }
   

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java Tue Oct 20
21:42:59 2009
@@ -54,7 +54,7 @@
 
   /** Return the clauses whose spans are matched. */
   public SpanQuery[] getClauses() {
-    return (SpanQuery[])clauses.toArray(new SpanQuery[clauses.size()]);
+    return clauses.toArray(new SpanQuery[clauses.size()]);
   }
 
   public String getField() { return field; }
@@ -151,7 +151,7 @@
 
   public Spans getSpans(final IndexReader reader) throws IOException {
     if (clauses.size() == 1)                      // optimize 1-clause case
-      return ((SpanQuery)clauses.get(0)).getSpans(reader);
+      return (clauses.get(0)).getSpans(reader);
 
     return new Spans() {
         private SpanQueue queue = null;
@@ -187,7 +187,7 @@
           return queue.size() != 0;
         }
 
-        private Spans top() { return (Spans)queue.top(); }
+        private Spans top() { return queue.top(); }
 
         public boolean skipTo(int target) throws IOException {
           if (queue == null) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMFile.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMFile.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMFile.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMFile.java Tue Oct 20 21:42:59 2009
@@ -71,7 +71,7 @@
   }
 
   final synchronized byte[] getBuffer(int index) {
-    return (byte[]) buffers.get(index);
+    return buffers.get(index);
   }
 
   final synchronized int numBuffers() {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java Tue Oct 20 21:42:59
2009
@@ -92,7 +92,7 @@
         bufferPosition = BUFFER_SIZE;
       }
     } else {
-      currentBuffer = (byte[]) file.getBuffer(currentBufferIndex);
+      currentBuffer = file.getBuffer(currentBufferIndex);
       bufferPosition = 0;
       bufferStart = (long) BUFFER_SIZE * (long) currentBufferIndex;
       long buflen = length - bufferStart;

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java Tue Oct 20 21:42:59
2009
@@ -61,7 +61,7 @@
       if (nextPos > end) {                        // at the last buffer
         length = (int)(end - pos);
       }
-      out.writeBytes((byte[])file.getBuffer(buffer++), length);
+      out.writeBytes(file.getBuffer(buffer++), length);
       pos = nextPos;
     }
   }
@@ -126,7 +126,7 @@
     if (currentBufferIndex == file.numBuffers()) {
       currentBuffer = file.addBuffer(BUFFER_SIZE);
     } else {
-      currentBuffer = (byte[]) file.getBuffer(currentBufferIndex);
+      currentBuffer = file.getBuffer(currentBufferIndex);
     }
     bufferPosition = 0;
     bufferStart = (long) BUFFER_SIZE * (long) currentBufferIndex;

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/ReaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/ReaderUtil.java?rev=827811&r1=827810&r2=827811&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/ReaderUtil.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/ReaderUtil.java Tue Oct 20 21:42:59
2009
@@ -56,7 +56,7 @@
   public static IndexReader subReader(int doc, IndexReader reader) {
     List<IndexReader> subReadersList = new ArrayList<IndexReader>();
     ReaderUtil.gatherSubReaders(subReadersList, reader);
-    IndexReader[] subReaders = (IndexReader[]) subReadersList
+    IndexReader[] subReaders = subReadersList
         .toArray(new IndexReader[subReadersList.size()]);
     int[] docStarts = new int[subReaders.length];
     int maxDoc = 0;
@@ -77,7 +77,7 @@
   public static IndexReader subReader(IndexReader reader, int subIndex) {
     List<IndexReader> subReadersList = new ArrayList<IndexReader>();
     ReaderUtil.gatherSubReaders(subReadersList, reader);
-    IndexReader[] subReaders = (IndexReader[]) subReadersList
+    IndexReader[] subReaders = subReadersList
         .toArray(new IndexReader[subReadersList.size()]);
     return subReaders[subIndex];
   }



Mime
View raw message