Index: contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java =================================================================== --- contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java (revision 821119) +++ contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java (working copy) @@ -129,7 +129,7 @@ * @return true if a token pair exists */ public boolean isToExist(int to) { - return tokenPairListTable.get(new Integer(to)) != null; + return tokenPairListTable.get(Integer.valueOf(to)) != null; } /** @@ -139,7 +139,7 @@ * @return {@link List} of token pairs. */ public List getToList(int to) { - return (List) tokenPairListTable.get(new Integer(to)); + return (List) tokenPairListTable.get(Integer.valueOf(to)); } /** @@ -152,9 +152,9 @@ if (!isToExist(to)) { ArrayList newlist = new ArrayList(); newlist.add(tokenPair); - tokenPairListTable.put(new Integer(to), newlist); + tokenPairListTable.put(Integer.valueOf(to), newlist); } else { - List tokenPairList = (List) tokenPairListTable.get(new Integer(to)); + List tokenPairList = (List) tokenPairListTable.get(Integer.valueOf(to)); tokenPairList.add(tokenPair); } } @@ -207,11 +207,11 @@ List rpath = new ArrayList(); List resultPath = new ArrayList(); - rpath.add(new Integer(current)); + rpath.add(Integer.valueOf(current)); while (current != 0) { PathNode currentPathNode = (PathNode) path.get(current); preNode = currentPathNode.preNode; - rpath.add(new Integer(preNode)); + rpath.add(Integer.valueOf(preNode)); current = preNode; } for (int j = rpath.size() - 1; j >= 0; j--) { Index: contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java =================================================================== --- contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java (revision 821119) +++ contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java (working copy) @@ -50,7 +50,7 @@ * @return true if there are tokens for the startOffset */ public boolean isStartExist(int s) { - return tokenListTable.get(new Integer(s)) != null; + return tokenListTable.get(Integer.valueOf(s)) != null; } /** @@ -60,7 +60,7 @@ * @return List of tokens at the specified start offset. */ public List getStartList(int s) { - return (List) tokenListTable.get(new Integer(s)); + return (List) tokenListTable.get(Integer.valueOf(s)); } /** @@ -83,7 +83,7 @@ short index = 0; while (count < size) { if (isStartExist(s)) { - tokenList = (List) tokenListTable.get(new Integer(s)); + tokenList = (List) tokenListTable.get(Integer.valueOf(s)); for (Iterator iter = tokenList.iterator(); iter.hasNext();) { SegToken st = (SegToken) iter.next(); st.index = index; @@ -106,9 +106,9 @@ if (!isStartExist(s)) { ArrayList newlist = new ArrayList(); newlist.add(token); - tokenListTable.put((Object) (new Integer(s)), newlist); + tokenListTable.put((Object) (Integer.valueOf(s)), newlist); } else { - List tokenList = (List) tokenListTable.get((Object) (new Integer(s))); + List tokenList = (List) tokenListTable.get((Object) (Integer.valueOf(s))); tokenList.add(token); } if (s > maxStart) @@ -127,7 +127,7 @@ while (count < size) { if (isStartExist(s)) { - tokenList = (List) tokenListTable.get(new Integer(s)); + tokenList = (List) tokenListTable.get(Integer.valueOf(s)); for (Iterator iter = tokenList.iterator(); iter.hasNext();) { SegToken st = (SegToken) iter.next(); result.add(st); Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentSource.java =================================================================== --- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentSource.java (revision 821119) +++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/ContentSource.java (working copy) @@ -59,8 +59,8 @@ private static final int OTHER = 1; private static final Map extensionToType = new HashMap(); static { - extensionToType.put(".bz2", new Integer(BZIP)); - extensionToType.put(".bzip", new Integer(BZIP)); + extensionToType.put(".bz2", Integer.valueOf(BZIP)); + extensionToType.put(".bzip", Integer.valueOf(BZIP)); } protected static final int BUFFER_SIZE = 1 << 16; // 64K Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java =================================================================== --- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java (revision 821119) +++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java (working copy) @@ -235,11 +235,11 @@ "SEP", "OCT", "NOV", "DEC"}; static { - ELEMENTS.put("page", new Integer(PAGE)); - ELEMENTS.put("text", new Integer(BODY)); - ELEMENTS.put("timestamp", new Integer(DATE)); - ELEMENTS.put("title", new Integer(TITLE)); - ELEMENTS.put("id", new Integer(ID)); + ELEMENTS.put("page", Integer.valueOf(PAGE)); + ELEMENTS.put("text", Integer.valueOf(BODY)); + ELEMENTS.put("timestamp", Integer.valueOf(DATE)); + ELEMENTS.put("title", Integer.valueOf(TITLE)); + ELEMENTS.put("id", Integer.valueOf(ID)); } /** Index: contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java =================================================================== --- contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java (revision 821119) +++ contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java (working copy) @@ -287,7 +287,7 @@ StringTokenizer st = new StringTokenizer(s,":"); while (st.hasMoreTokens()) { String t = st.nextToken(); - a.add(new Integer(t)); + a.add(Integer.valueOf(t)); } int res[] = new int[a.size()]; for (int i=0; i maxFieldLength) break; } @@ -327,7 +327,7 @@ //message(term.field() + ":" + term.text() + " freq:" + terms.docFreq()); //if we're either not looking by field or we're matching the specific field if ((field == null) || field.equals(term.field())) - termMap.put(term.field() + ":" + term.text(), new Integer((terms.docFreq()))); + termMap.put(term.field() + ":" + term.text(), Integer.valueOf((terms.docFreq()))); } Iterator termIterator = termMap.keySet().iterator(); Index: contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java =================================================================== --- contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java (revision 821119) +++ contrib/memory/src/java/org/apache/lucene/index/memory/SynonymMap.java (working copy) @@ -236,7 +236,7 @@ Integer group = lastGroup; if (num != lastNum) { - group = new Integer(num); + group = Integer.valueOf(num); lastGroup = group; lastNum = num; } Index: contrib/misc/src/java/org/apache/lucene/index/TermVectorAccessor.java =================================================================== --- contrib/misc/src/java/org/apache/lucene/index/TermVectorAccessor.java (revision 821119) +++ contrib/misc/src/java/org/apache/lucene/index/TermVectorAccessor.java (working copy) @@ -106,7 +106,7 @@ TermPositions termPositions = indexReader.termPositions(termEnum.term()); if (termPositions.skipTo(documentNumber)) { - frequencies.add(new Integer(termPositions.freq())); + frequencies.add(Integer.valueOf(termPositions.freq())); tokens.add(termEnum.term().text()); Index: contrib/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java =================================================================== --- contrib/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java (revision 821119) +++ contrib/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java (working copy) @@ -123,9 +123,9 @@ */ public void setLengthNormFactors(String field, int min, int max, float steepness, boolean discountOverlaps) { - ln_mins.put(field, new Integer(min)); - ln_maxs.put(field, new Integer(max)); - ln_steeps.put(field, new Float(steepness)); + ln_mins.put(field, Integer.valueOf(min)); + ln_maxs.put(field, Integer.valueOf(max)); + ln_steeps.put(field, Float.valueOf(steepness)); ln_overlaps.put(field, new Boolean(discountOverlaps)); } Index: contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java =================================================================== --- contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java (revision 821119) +++ contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java (working copy) @@ -668,10 +668,10 @@ // only really need 1st 3 entries, other ones are for troubleshooting res.insert(new Object[]{word, // the word topField, // the top field - new Float(score), // overall score - new Float(idf), // idf - new Integer(docFreq), // freq in all docs - new Integer(tf) + Float.valueOf(score), // overall score + Float.valueOf(idf), // idf + Integer.valueOf(docFreq), // freq in all docs + Integer.valueOf(tf) }); } return res; Index: contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java =================================================================== --- contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java (revision 821119) +++ contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java (working copy) @@ -119,7 +119,7 @@ for (int i = 0; i < clauses.size(); i++) { BooleanClause clause = (BooleanClause) clauses.get(i); TermQuery tq = (TermQuery) clause.getQuery(); - originalValues.put(tq.getTerm().text(), new Float(tq.getBoost())); + originalValues.put(tq.getTerm().text(), Float.valueOf(tq.getBoost())); } return originalValues; } Index: contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java =================================================================== --- contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java (revision 821119) +++ contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java (working copy) @@ -91,7 +91,7 @@ * @return the parsed value */ private CharSequence getValueString() { - Float f = new Float(this.value); + Float f = Float.valueOf(this.value); if (f == f.longValue()) return "" + f.longValue(); else Index: contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java =================================================================== --- contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java (revision 821119) +++ contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java (working copy) @@ -58,7 +58,7 @@ } private CharSequence getValueString() { - Float f = new Float(this.value); + Float f = Float.valueOf(this.value); if (f == f.longValue()) return "" + f.longValue(); else Index: contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java =================================================================== --- contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java (revision 821119) +++ contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java (working copy) @@ -65,7 +65,7 @@ } private CharSequence getValueString() { - Float f = new Float(this.value); + Float f = Float.valueOf(this.value); if (f == f.longValue()) return "" + f.longValue(); else Index: contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQPHelper.java =================================================================== --- contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQPHelper.java (revision 821119) +++ contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQPHelper.java (working copy) @@ -147,8 +147,8 @@ public void testBoostsSimple() throws Exception { Map boosts = new HashMap(); - boosts.put("b", new Float(5)); - boosts.put("t", new Float(10)); + boosts.put("b", Float.valueOf(5)); + boosts.put("t", Float.valueOf(10)); String[] fields = { "b", "t" }; StandardQueryParser mfqp = new StandardQueryParser(); mfqp.setMultiFields(fields); Index: contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQueryParserWrapper.java =================================================================== --- contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQueryParserWrapper.java (revision 821119) +++ contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQueryParserWrapper.java (working copy) @@ -142,8 +142,8 @@ public void testBoostsSimple() throws Exception { Map boosts = new HashMap(); - boosts.put("b", new Float(5)); - boosts.put("t", new Float(10)); + boosts.put("b", Float.valueOf(5)); + boosts.put("t", Float.valueOf(10)); String[] fields = { "b", "t" }; MultiFieldQueryParserWrapper mfqp = new MultiFieldQueryParserWrapper( fields, new StandardAnalyzer(), boosts); Index: contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java =================================================================== --- contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java (revision 821119) +++ contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java (working copy) @@ -219,7 +219,7 @@ } public Comparable value(int slot) { - return new Integer(slotValues[slot]); + return Integer.valueOf(slotValues[slot]); } } @@ -414,7 +414,7 @@ Document doc = searcher.doc(hits[i].doc); String[] v = doc.getValues("tracer"); assertEquals (v.length, 1); - scoreMap.put (v[0], new Float(hits[i].score)); + scoreMap.put (v[0], Float.valueOf(hits[i].score)); } return scoreMap; } Index: contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashDistanceFilter.java =================================================================== --- contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashDistanceFilter.java (revision 821119) +++ contrib/spatial/src/java/org/apache/lucene/spatial/geohash/GeoHashDistanceFilter.java (working copy) @@ -118,10 +118,10 @@ /** Returns a hash code value for this object.*/ @Override public int hashCode() { - int h = new Double(distance).hashCode(); + int h = Double.valueOf(distance).hashCode(); h ^= startingFilter.hashCode(); - h ^= new Double(lat).hashCode(); - h ^= new Double(lng).hashCode(); + h ^= Double.valueOf(lat).hashCode(); + h ^= Double.valueOf(lng).hashCode(); h ^= geoHashField.hashCode(); return h; Index: contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceHandler.java =================================================================== --- contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceHandler.java (revision 821119) +++ contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceHandler.java (working copy) @@ -84,7 +84,7 @@ double xLat = getPrecision(lat, precise); double xLng = getPrecision(lng, precise); - String k = new Double(xLat).toString() +","+ new Double(xLng).toString(); + String k = Double.valueOf(xLat).toString() +","+ Double.valueOf(xLng).toString(); Double d = (distanceLookupCache.get(k)); if (d != null){ Index: contrib/spatial/src/java/org/apache/lucene/spatial/tier/LatLongDistanceFilter.java =================================================================== --- contrib/spatial/src/java/org/apache/lucene/spatial/tier/LatLongDistanceFilter.java (revision 821119) +++ contrib/spatial/src/java/org/apache/lucene/spatial/tier/LatLongDistanceFilter.java (working copy) @@ -124,10 +124,10 @@ /** Returns a hash code value for this object.*/ @Override public int hashCode() { - int h = new Double(distance).hashCode(); + int h = Double.valueOf(distance).hashCode(); h ^= startingFilter.hashCode(); - h ^= new Double(lat).hashCode(); - h ^= new Double(lng).hashCode(); + h ^= Double.valueOf(lat).hashCode(); + h ^= Double.valueOf(lng).hashCode(); h ^= latField.hashCode(); h ^= lngField.hashCode(); return h; Index: contrib/spatial/src/java/org/apache/lucene/spatial/tier/projections/CartesianTierPlotter.java =================================================================== --- contrib/spatial/src/java/org/apache/lucene/spatial/tier/projections/CartesianTierPlotter.java (revision 821119) +++ contrib/spatial/src/java/org/apache/lucene/spatial/tier/projections/CartesianTierPlotter.java (working copy) @@ -31,7 +31,7 @@ int tierVerticalPosDivider; final IProjector projector; final String fieldPrefix; - Double idd = new Double(180); + Double idd = Double.valueOf(180); public CartesianTierPlotter (int tierLevel, IProjector projector, String fieldPrefix) { @@ -65,8 +65,8 @@ // ceiling of log base 10 of tierLen - tierVerticalPosDivider = new Double(Math.ceil( - Math.log10(new Integer(this.tierLength).doubleValue()))).intValue(); + tierVerticalPosDivider = Double.valueOf(Math.ceil( + Math.log10(Integer.valueOf(this.tierLength).doubleValue()))).intValue(); // tierVerticalPosDivider = (int)Math.pow(10, tierVerticalPosDivider ); Index: contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java =================================================================== --- contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java (revision 821119) +++ contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java (working copy) @@ -197,7 +197,7 @@ distance = 1.0d; //boost by distance is invertly proportional to // to distance from center point to location - float score = new Float((miles - distance) / miles ).floatValue(); + float score = (float) ((miles - distance) / miles ); return score * subQueryScore; } }; @@ -284,7 +284,7 @@ distance = 1.0d; //boost by distance is invertly proportional to // to distance from center point to location - float score = new Float((miles - distance) / miles ).floatValue(); + float score = (float) ((miles - distance) / miles ); return score * subQueryScore; } }; @@ -373,7 +373,7 @@ distance = 1.0d; //boost by distance is invertly proportional to // to distance from center point to location - float score = new Float((miles - distance) / miles ).floatValue(); + float score = (float) ( (miles - distance) / miles ); return score * subQueryScore; } }; @@ -462,7 +462,7 @@ distance = 1.0d; //boost by distance is invertly proportional to // to distance from center point to location - float score = new Float((miles - distance) / miles ).floatValue(); + float score = (float) ( (miles - distance) / miles ); return score * subQueryScore; } }; Index: contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SpanNearClauseFactory.java =================================================================== --- contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SpanNearClauseFactory.java (revision 821119) +++ contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/SpanNearClauseFactory.java (working copy) @@ -101,9 +101,9 @@ protected void addSpanQueryWeighted(SpanQuery sq, float weight) { Float w = (Float) weightBySpanQuery.get(sq); if (w != null) - w = new Float(w.floatValue() + weight); + w = Float.valueOf(w.floatValue() + weight); else - w = new Float(weight); + w = Float.valueOf(weight); weightBySpanQuery.put(sq, w); } Index: contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java =================================================================== --- contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (revision 821119) +++ contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (working copy) @@ -191,7 +191,7 @@ for (int t=0; tSegmentReader for (int i = 0; i < oldReaders.length; i++) { - segmentReaders.put(oldReaders[i].getSegmentName(), new Integer(i)); + segmentReaders.put(oldReaders[i].getSegmentName(), Integer.valueOf(i)); } } Index: src/java/org/apache/lucene/index/DocumentsWriter.java =================================================================== --- src/java/org/apache/lucene/index/DocumentsWriter.java (revision 821119) +++ src/java/org/apache/lucene/index/DocumentsWriter.java (working copy) @@ -1040,12 +1040,12 @@ // Buffer a specific docID for deletion. Currently only // used when we hit a exception when adding a document synchronized private void addDeleteDocID(int docID) { - deletesInRAM.docIDs.add(new Integer(flushedDocCount+docID)); + deletesInRAM.docIDs.add(Integer.valueOf(flushedDocCount+docID)); deletesInRAM.addBytesUsed(BYTES_PER_DEL_DOCID); } synchronized private void addDeleteQuery(Query query, int docID) { - deletesInRAM.queries.put(query, new Integer(flushedDocCount + docID)); + deletesInRAM.queries.put(query, Integer.valueOf(flushedDocCount + docID)); deletesInRAM.addBytesUsed(BYTES_PER_DEL_QUERY); } Index: src/java/org/apache/lucene/index/IndexReader.java =================================================================== --- src/java/org/apache/lucene/index/IndexReader.java (revision 821119) +++ src/java/org/apache/lucene/index/IndexReader.java (working copy) @@ -635,7 +635,7 @@ public static long lastModified(final Directory directory2) throws CorruptIndexException, IOException { return ((Long) new SegmentInfos.FindSegmentsFile(directory2) { public Object doBody(String segmentFileName) throws IOException { - return new Long(directory2.fileModified(segmentFileName)); + return Long.valueOf(directory2.fileModified(segmentFileName)); } }.run()).longValue(); } Index: src/java/org/apache/lucene/index/IndexWriter.java =================================================================== --- src/java/org/apache/lucene/index/IndexWriter.java (revision 821119) +++ src/java/org/apache/lucene/index/IndexWriter.java (working copy) @@ -1631,7 +1631,7 @@ rollbackSegments = new HashMap(); final int size = rollbackSegmentInfos.size(); for(int i=0;i maxPosition) maxPosition = position; } Index: src/java/org/apache/lucene/search/QueryTermVector.java =================================================================== --- src/java/org/apache/lucene/search/QueryTermVector.java (revision 821119) +++ src/java/org/apache/lucene/search/QueryTermVector.java (working copy) @@ -87,13 +87,13 @@ String term = queryTerms[i]; Integer position = (Integer)tmpSet.get(term); if (position == null) { - tmpSet.put(term, new Integer(j++)); + tmpSet.put(term, Integer.valueOf(j++)); tmpList.add(term); - tmpFreqs.add(new Integer(1)); + tmpFreqs.add(Integer.valueOf(1)); } else { Integer integer = (Integer)tmpFreqs.get(position.intValue()); - tmpFreqs.set(position.intValue(), new Integer(integer.intValue() + 1)); + tmpFreqs.set(position.intValue(), Integer.valueOf(integer.intValue() + 1)); } } terms = (String[])tmpList.toArray(terms); Index: src/java/org/apache/lucene/search/ScoreDocComparator.java =================================================================== --- src/java/org/apache/lucene/search/ScoreDocComparator.java (revision 821119) +++ src/java/org/apache/lucene/search/ScoreDocComparator.java (working copy) @@ -37,7 +37,7 @@ return 0; } public Comparable sortValue (ScoreDoc i) { - return new Float (i.score); + return Float.valueOf(i.score); } public int sortType() { return SortField.SCORE; @@ -52,7 +52,7 @@ return 0; } public Comparable sortValue (ScoreDoc i) { - return new Integer (i.doc); + return Integer.valueOf(i.doc); } public int sortType() { return SortField.DOC; Index: src/java/org/apache/lucene/search/SortComparator.java =================================================================== --- src/java/org/apache/lucene/search/SortComparator.java (revision 821119) +++ src/java/org/apache/lucene/search/SortComparator.java (working copy) @@ -77,7 +77,7 @@ * Returns an object which, when sorted according to natural order, * will order the Term values in the correct order. *

For example, if the Terms contained integer values, this method - * would return new Integer(termtext). Note that this + * would return Integer.valueOf(termtext). Note that this * might not always be the most efficient implementation - for this * particular example, a better implementation might be to make a * ScoreDocLookupComparator that uses an internal lookup table of int. Index: src/java/org/apache/lucene/util/AverageGuessMemoryModel.java =================================================================== --- src/java/org/apache/lucene/util/AverageGuessMemoryModel.java (revision 821119) +++ src/java/org/apache/lucene/util/AverageGuessMemoryModel.java (working copy) @@ -28,14 +28,14 @@ // best guess primitive sizes private final Map sizes = new IdentityHashMap() { { - put(boolean.class, new Integer(1)); - put(byte.class, new Integer(1)); - put(char.class, new Integer(2)); - put(short.class, new Integer(2)); - put(int.class, new Integer(4)); - put(float.class, new Integer(4)); - put(double.class, new Integer(8)); - put(long.class, new Integer(8)); + put(boolean.class, Integer.valueOf(1)); + put(byte.class, Integer.valueOf(1)); + put(char.class, Integer.valueOf(2)); + put(short.class, Integer.valueOf(2)); + put(int.class, Integer.valueOf(4)); + put(float.class, Integer.valueOf(4)); + put(double.class, Integer.valueOf(8)); + put(long.class, Integer.valueOf(8)); } }; Index: src/java/org/apache/lucene/util/FieldCacheSanityChecker.java =================================================================== --- src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (revision 821119) +++ src/java/org/apache/lucene/util/FieldCacheSanityChecker.java (working copy) @@ -130,7 +130,7 @@ final ReaderField rf = new ReaderField(item.getReaderKey(), item.getFieldName()); - final Integer valId = new Integer(System.identityHashCode(val)); + final Integer valId = Integer.valueOf(System.identityHashCode(val)); // indirect mapping, so the MapOfSet will dedup identical valIds for us valIdToItems.put(valId, item); Index: src/test/org/apache/lucene/analysis/TestCharArraySet.java =================================================================== --- src/test/org/apache/lucene/analysis/TestCharArraySet.java (revision 821119) +++ src/test/org/apache/lucene/analysis/TestCharArraySet.java (working copy) @@ -57,14 +57,14 @@ public void testObjectContains() { CharArraySet set = new CharArraySet(10, true); - Integer val = new Integer(1); + Integer val = Integer.valueOf(1); set.add(val); assertTrue(set.contains(val)); - assertTrue(set.contains(new Integer(1))); + assertTrue(set.contains(Integer.valueOf(1))); // test unmodifiable set = CharArraySet.unmodifiableSet(set); assertTrue(set.contains(val)); - assertTrue(set.contains(new Integer(1))); + assertTrue(set.contains(Integer.valueOf(1))); } public void testClear(){ Index: src/test/org/apache/lucene/index/TestIndexModifier.java =================================================================== --- src/test/org/apache/lucene/index/TestIndexModifier.java (revision 821119) +++ src/test/org/apache/lucene/index/TestIndexModifier.java (working copy) @@ -238,7 +238,7 @@ } catch (EmptyStackException e) { continue; } - Term delTerm = new Term("id", new Integer(delId).toString()); + Term delTerm = new Term("id", Integer.valueOf(delId).toString()); int delCount = index.deleteDocuments(delTerm); if (delCount != 1) { throw new RuntimeException("Internal error: " + threadNumber + " deleted " + delCount + Index: src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java =================================================================== --- src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (revision 821119) +++ src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java (working copy) @@ -257,8 +257,8 @@ // System.out.println("Modifying: for "+i+" from "+origNorm+" to // "+newNorm); // System.out.println(" and: for "+k+" from "+newNorm+" to "+origNorm); - modifiedNorms.set(i, new Float(newNorm)); - modifiedNorms.set(k, new Float(origNorm)); + modifiedNorms.set(i, Float.valueOf(newNorm)); + modifiedNorms.set(k, Float.valueOf(origNorm)); ir.setNorm(i, "f" + 1, newNorm); ir.setNorm(k, "f" + 1, origNorm); // System.out.println("setNorm i: "+i); @@ -326,8 +326,8 @@ } norm += normDelta; } while (true); - norms.add(numDocNorms, new Float(norm)); - modifiedNorms.add(numDocNorms, new Float(norm)); + norms.add(numDocNorms, Float.valueOf(norm)); + modifiedNorms.add(numDocNorms, Float.valueOf(norm)); // System.out.println("creating norm("+numDocNorms+"): "+norm); numDocNorms++; lastNorm = (norm > 10 ? 0 : norm); // there's a limit to how many distinct Index: src/test/org/apache/lucene/index/TestNorms.java =================================================================== --- src/test/org/apache/lucene/index/TestNorms.java (revision 821119) +++ src/test/org/apache/lucene/index/TestNorms.java (working copy) @@ -169,8 +169,8 @@ float newNorm = ((Float)modifiedNorms.get(k)).floatValue(); //System.out.println("Modifying: for "+i+" from "+origNorm+" to "+newNorm); //System.out.println(" and: for "+k+" from "+newNorm+" to "+origNorm); - modifiedNorms.set(i, new Float(newNorm)); - modifiedNorms.set(k, new Float(origNorm)); + modifiedNorms.set(i, Float.valueOf(newNorm)); + modifiedNorms.set(k, Float.valueOf(origNorm)); ir.setNorm(i, "f"+1, newNorm); ir.setNorm(k, "f"+1, origNorm); } @@ -229,8 +229,8 @@ } norm += normDelta; } while (true); - norms.add(numDocNorms, new Float(norm)); - modifiedNorms.add(numDocNorms, new Float(norm)); + norms.add(numDocNorms, Float.valueOf(norm)); + modifiedNorms.add(numDocNorms, Float.valueOf(norm)); //System.out.println("creating norm("+numDocNorms+"): "+norm); numDocNorms ++; lastNorm = (norm>10 ? 0 : norm); //there's a limit to how many distinct values can be stored in a ingle byte Index: src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java =================================================================== --- src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java (revision 821119) +++ src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java (working copy) @@ -130,8 +130,8 @@ public void testBoostsSimple() throws Exception { Map boosts = new HashMap(); - boosts.put("b", new Float(5)); - boosts.put("t", new Float(10)); + boosts.put("b", Float.valueOf(5)); + boosts.put("t", Float.valueOf(10)); String[] fields = {"b", "t"}; MultiFieldQueryParser mfqp = new MultiFieldQueryParser(fields, new StandardAnalyzer(), boosts); Index: src/test/org/apache/lucene/search/CheckHits.java =================================================================== --- src/test/org/apache/lucene/search/CheckHits.java (revision 821119) +++ src/test/org/apache/lucene/search/CheckHits.java (working copy) @@ -47,12 +47,12 @@ String d = q.toString(defaultFieldName); Set ignore = new TreeSet(); for (int i = 0; i < results.length; i++) { - ignore.add(new Integer(results[i])); + ignore.add(Integer.valueOf(results[i])); } int maxDoc = searcher.maxDoc(); for (int doc = 0; doc < maxDoc; doc++) { - if (ignore.contains(new Integer(doc))) continue; + if (ignore.contains(Integer.valueOf(doc))) continue; Explanation exp = searcher.explain(q, doc); Assert.assertNotNull("Explanation of [["+d+"]] for #"+doc+" is null", @@ -87,7 +87,7 @@ Set correct = new TreeSet(); for (int i = 0; i < results.length; i++) { - correct.add(new Integer(results[i])); + correct.add(Integer.valueOf(results[i])); } final Set actual = new TreeSet(); final Collector c = new SetCollector(actual); @@ -124,7 +124,7 @@ private int base = 0; public void setScorer(Scorer scorer) throws IOException {} public void collect(int doc) { - bag.add(new Integer(doc + base)); + bag.add(Integer.valueOf(doc + base)); } public void setNextReader(IndexReader reader, int docBase) { base = docBase; @@ -162,12 +162,12 @@ Set correct = new TreeSet(); for (int i = 0; i < results.length; i++) { - correct.add(new Integer(results[i])); + correct.add(Integer.valueOf(results[i])); } Set actual = new TreeSet(); for (int i = 0; i < hits.length; i++) { - actual.add(new Integer(hits[i].doc)); + actual.add(Integer.valueOf(hits[i].doc)); } Assert.assertEquals(query.toString(defaultFieldName), correct, actual); Index: src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java =================================================================== --- src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java (revision 821119) +++ src/test/org/apache/lucene/search/function/TestCustomScoreQuery.java (working copy) @@ -244,7 +244,7 @@ private HashMap topDocsToMap(TopDocs td) { HashMap h = new HashMap(); for (int i=0; i>>shift)+"L),new Long(0x"+Long.toHexString(max>>>shift)+"L),"); + //System.out.println("Long.valueOf(0x"+Long.toHexString(min>>>shift)+"L),Long.valueOf(0x"+Long.toHexString(max>>>shift)+"L),"); assertEquals( "inner min bound", ((Long)neededBounds.next()).longValue(), min>>>shift); assertEquals( "inner max bound", ((Long)neededBounds.next()).longValue(), max>>>shift); } @@ -204,45 +204,45 @@ public void testSplitLongRange() throws Exception { // a hard-coded "standard" range assertLongRangeSplit(-5000L, 9500L, 4, true, Arrays.asList(new Long[]{ - new Long(0x7fffffffffffec78L),new Long(0x7fffffffffffec7fL), - new Long(0x8000000000002510L),new Long(0x800000000000251cL), - new Long(0x7fffffffffffec8L), new Long(0x7fffffffffffecfL), - new Long(0x800000000000250L), new Long(0x800000000000250L), - new Long(0x7fffffffffffedL), new Long(0x7fffffffffffefL), - new Long(0x80000000000020L), new Long(0x80000000000024L), - new Long(0x7ffffffffffffL), new Long(0x8000000000001L) + Long.valueOf(0x7fffffffffffec78L),Long.valueOf(0x7fffffffffffec7fL), + Long.valueOf(0x8000000000002510L),Long.valueOf(0x800000000000251cL), + Long.valueOf(0x7fffffffffffec8L), Long.valueOf(0x7fffffffffffecfL), + Long.valueOf(0x800000000000250L), Long.valueOf(0x800000000000250L), + Long.valueOf(0x7fffffffffffedL), Long.valueOf(0x7fffffffffffefL), + Long.valueOf(0x80000000000020L), Long.valueOf(0x80000000000024L), + Long.valueOf(0x7ffffffffffffL), Long.valueOf(0x8000000000001L) }).iterator()); // the same with no range splitting assertLongRangeSplit(-5000L, 9500L, 64, true, Arrays.asList(new Long[]{ - new Long(0x7fffffffffffec78L),new Long(0x800000000000251cL) + Long.valueOf(0x7fffffffffffec78L),Long.valueOf(0x800000000000251cL) }).iterator()); // this tests optimized range splitting, if one of the inner bounds // is also the bound of the next lower precision, it should be used completely assertLongRangeSplit(0L, 1024L+63L, 4, true, Arrays.asList(new Long[]{ - new Long(0x800000000000040L), new Long(0x800000000000043L), - new Long(0x80000000000000L), new Long(0x80000000000003L) + Long.valueOf(0x800000000000040L), Long.valueOf(0x800000000000043L), + Long.valueOf(0x80000000000000L), Long.valueOf(0x80000000000003L) }).iterator()); // the full long range should only consist of a lowest precision range; no bitset testing here, as too much memory needed :-) assertLongRangeSplit(Long.MIN_VALUE, Long.MAX_VALUE, 8, false, Arrays.asList(new Long[]{ - new Long(0x00L),new Long(0xffL) + Long.valueOf(0x00L),Long.valueOf(0xffL) }).iterator()); // the same with precisionStep=4 assertLongRangeSplit(Long.MIN_VALUE, Long.MAX_VALUE, 4, false, Arrays.asList(new Long[]{ - new Long(0x0L),new Long(0xfL) + Long.valueOf(0x0L),Long.valueOf(0xfL) }).iterator()); // the same with precisionStep=2 assertLongRangeSplit(Long.MIN_VALUE, Long.MAX_VALUE, 2, false, Arrays.asList(new Long[]{ - new Long(0x0L),new Long(0x3L) + Long.valueOf(0x0L),Long.valueOf(0x3L) }).iterator()); // the same with precisionStep=1 assertLongRangeSplit(Long.MIN_VALUE, Long.MAX_VALUE, 1, false, Arrays.asList(new Long[]{ - new Long(0x0L),new Long(0x1L) + Long.valueOf(0x0L),Long.valueOf(0x1L) }).iterator()); // a inverse range should produce no sub-ranges @@ -250,7 +250,7 @@ // a 0-length range should reproduce the range itsself assertLongRangeSplit(9500L, 9500L, 4, false, Arrays.asList(new Long[]{ - new Long(0x800000000000251cL),new Long(0x800000000000251cL) + Long.valueOf(0x800000000000251cL),Long.valueOf(0x800000000000251cL) }).iterator()); } @@ -270,7 +270,7 @@ // make unsigned ints for easier display and understanding min ^= 0x80000000; max ^= 0x80000000; - //System.out.println("new Integer(0x"+Integer.toHexString(min>>>shift)+"),new Integer(0x"+Integer.toHexString(max>>>shift)+"),"); + //System.out.println("Integer.valueOf(0x"+Integer.toHexString(min>>>shift)+"),Integer.valueOf(0x"+Integer.toHexString(max>>>shift)+"),"); assertEquals( "inner min bound", ((Integer)neededBounds.next()).intValue(), min>>>shift); assertEquals( "inner max bound", ((Integer)neededBounds.next()).intValue(), max>>>shift); } @@ -286,45 +286,45 @@ public void testSplitIntRange() throws Exception { // a hard-coded "standard" range assertIntRangeSplit(-5000, 9500, 4, true, Arrays.asList(new Integer[]{ - new Integer(0x7fffec78),new Integer(0x7fffec7f), - new Integer(0x80002510),new Integer(0x8000251c), - new Integer(0x7fffec8), new Integer(0x7fffecf), - new Integer(0x8000250), new Integer(0x8000250), - new Integer(0x7fffed), new Integer(0x7fffef), - new Integer(0x800020), new Integer(0x800024), - new Integer(0x7ffff), new Integer(0x80001) + Integer.valueOf(0x7fffec78),Integer.valueOf(0x7fffec7f), + Integer.valueOf(0x80002510),Integer.valueOf(0x8000251c), + Integer.valueOf(0x7fffec8), Integer.valueOf(0x7fffecf), + Integer.valueOf(0x8000250), Integer.valueOf(0x8000250), + Integer.valueOf(0x7fffed), Integer.valueOf(0x7fffef), + Integer.valueOf(0x800020), Integer.valueOf(0x800024), + Integer.valueOf(0x7ffff), Integer.valueOf(0x80001) }).iterator()); // the same with no range splitting assertIntRangeSplit(-5000, 9500, 32, true, Arrays.asList(new Integer[]{ - new Integer(0x7fffec78),new Integer(0x8000251c) + Integer.valueOf(0x7fffec78),Integer.valueOf(0x8000251c) }).iterator()); // this tests optimized range splitting, if one of the inner bounds // is also the bound of the next lower precision, it should be used completely assertIntRangeSplit(0, 1024+63, 4, true, Arrays.asList(new Integer[]{ - new Integer(0x8000040), new Integer(0x8000043), - new Integer(0x800000), new Integer(0x800003) + Integer.valueOf(0x8000040), Integer.valueOf(0x8000043), + Integer.valueOf(0x800000), Integer.valueOf(0x800003) }).iterator()); // the full int range should only consist of a lowest precision range; no bitset testing here, as too much memory needed :-) assertIntRangeSplit(Integer.MIN_VALUE, Integer.MAX_VALUE, 8, false, Arrays.asList(new Integer[]{ - new Integer(0x00),new Integer(0xff) + Integer.valueOf(0x00),Integer.valueOf(0xff) }).iterator()); // the same with precisionStep=4 assertIntRangeSplit(Integer.MIN_VALUE, Integer.MAX_VALUE, 4, false, Arrays.asList(new Integer[]{ - new Integer(0x0),new Integer(0xf) + Integer.valueOf(0x0),Integer.valueOf(0xf) }).iterator()); // the same with precisionStep=2 assertIntRangeSplit(Integer.MIN_VALUE, Integer.MAX_VALUE, 2, false, Arrays.asList(new Integer[]{ - new Integer(0x0),new Integer(0x3) + Integer.valueOf(0x0),Integer.valueOf(0x3) }).iterator()); // the same with precisionStep=1 assertIntRangeSplit(Integer.MIN_VALUE, Integer.MAX_VALUE, 1, false, Arrays.asList(new Integer[]{ - new Integer(0x0),new Integer(0x1) + Integer.valueOf(0x0),Integer.valueOf(0x1) }).iterator()); // a inverse range should produce no sub-ranges @@ -332,7 +332,7 @@ // a 0-length range should reproduce the range itsself assertIntRangeSplit(9500, 9500, 4, false, Arrays.asList(new Integer[]{ - new Integer(0x8000251c),new Integer(0x8000251c) + Integer.valueOf(0x8000251c),Integer.valueOf(0x8000251c) }).iterator()); }