r109910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109909‎ | r109910 | r109911 >
Date:09:59, 24 January 2012
Author:oren
Status:deferred
Tags:
Comment:
replaced Raw types with Generic types for code safety
Modified paths:
  • /trunk/lucene-search-3/src/main/java/org/apache/lucene/search/MultiSearcherBase.java (modified) (history)
  • /trunk/lucene-search-3/src/main/java/org/apache/lucene/search/PositionalScorer.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-3/src/main/java/org/apache/lucene/search/PositionalScorer.java
@@ -530,14 +530,14 @@
531531 if (!checkedRepeats) {
532532 checkedRepeats = true;
533533 // check for repeats
534 - HashMap m = null;
 534+ HashMap<PhrasePositionsBoost,Object> m = null;
535535 for (PhrasePositionsBoost pp = first; pp != null; pp = pp.next) {
536536 int tpPos = pp.position + pp.offset;
537537 for (PhrasePositionsBoost pp2 = pp.next; pp2 != null; pp2 = pp2.next) {
538538 int tpPos2 = pp2.position + pp2.offset;
539539 if (tpPos2 == tpPos) {
540540 if (m == null)
541 - m = new HashMap();
 541+ m = new HashMap<PhrasePositionsBoost,Object>();
542542 pp.repeats = true;
543543 pp2.repeats = true;
544544 m.put(pp,null);
@@ -546,7 +546,7 @@
547547 }
548548 }
549549 if (m!=null)
550 - repeats = (PhrasePositionsBoost[]) m.keySet().toArray(new PhrasePositionsBoost[0]);
 550+ repeats = m.keySet().toArray(new PhrasePositionsBoost[0]);
551551 }
552552
553553 // with repeats must advance some repeating pp's so they all start with differing tp's
Index: trunk/lucene-search-3/src/main/java/org/apache/lucene/search/MultiSearcherBase.java
@@ -335,7 +335,7 @@
336336 Query rewrittenQuery = rewrite(original);
337337
338338 // step 2
339 - Set terms = new HashSet();
 339+ Set<Object> terms = new HashSet<Object>();
340340 rewrittenQuery.extractTerms(terms);
341341
342342 // step3

Status & tagging log