From 58878dd20ed2a83a83ff2236634f2fdc51eb4934 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 16 Oct 2009 18:54:01 +0000 Subject: [PATCH] Further unneeded casts, thanks Kay Kay git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@826035 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/search/DisjunctionMaxQuery.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java index fb749bfb569..ad372021d27 100644 --- a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java +++ b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java @@ -159,7 +159,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable { /* Explain the score we computed for doc */ @Override public Explanation explain(IndexReader reader, int doc) throws IOException { - if (disjuncts.size() == 1) return ((Weight) weights.get(0)).explain(reader,doc); + if (disjuncts.size() == 1) return weights.get(0).explain(reader,doc); ComplexExplanation result = new ComplexExplanation(); float max = 0.0f, sum = 0.0f; result.setDescription(tieBreakerMultiplier == 0.0f ? "max of:" : "max plus " + tieBreakerMultiplier + " times others of:"); @@ -191,7 +191,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable { public Query rewrite(IndexReader reader) throws IOException { int numDisjunctions = disjuncts.size(); if (numDisjunctions == 1) { - Query singleton = (Query) disjuncts.get(0); + Query singleton = disjuncts.get(0); Query result = singleton.rewrite(reader); if (getBoost() != 1.0f) { if (result == singleton) result = (Query)result.clone(); @@ -201,7 +201,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable { } DisjunctionMaxQuery clone = null; for (int i = 0 ; i < numDisjunctions; i++) { - Query clause = (Query) disjuncts.get(i); + Query clause = disjuncts.get(i); Query rewrite = clause.rewrite(reader); if (rewrite != clause) { if (clone == null) clone = (DisjunctionMaxQuery)this.clone(); @@ -239,7 +239,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable { buffer.append("("); int numDisjunctions = disjuncts.size(); for (int i = 0 ; i < numDisjunctions; i++) { - Query subquery = (Query) disjuncts.get(i); + Query subquery = disjuncts.get(i); if (subquery instanceof BooleanQuery) { // wrap sub-bools in parens buffer.append("("); buffer.append(subquery.toString(field));