You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2022/07/05 11:03:49 UTC
[solr] branch branch_9x updated: SOLR-16281: review boxing unboxing (#930)
This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 1693647d45f SOLR-16281: review boxing unboxing (#930)
1693647d45f is described below
commit 1693647d45f7a8118f673ae3a1581fe32a1a9596
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Tue Jul 5 07:02:53 2022 -0400
SOLR-16281: review boxing unboxing (#930)
---
.../test/org/apache/solr/TestRandomDVFaceting.java | 2 +-
.../solr/cloud/DistributedVersionInfoTest.java | 2 +-
.../OverseerCollectionConfigSetProcessorTest.java | 2 +-
.../solr/cloud/SegmentTerminateEarlyTestState.java | 22 +++++++++++-----------
.../TestCloudPhrasesIdentificationComponent.java | 6 ++----
.../solr/cloud/TestCloudPseudoReturnFields.java | 10 +++++-----
.../apache/solr/cloud/TestRandomFlRTGCloud.java | 5 ++---
.../cloud/TestStressCloudBlindAtomicUpdates.java | 2 +-
.../solr/cloud/TestStressInPlaceUpdates.java | 16 +++++++---------
.../TestTolerantUpdateProcessorRandomCloud.java | 2 +-
.../DocumentAnalysisRequestHandlerTest.java | 2 +-
.../TestDistributedStatsComponentCardinality.java | 2 +-
.../solr/index/WrapperMergePolicyFactoryTest.java | 10 ++--------
.../org/apache/solr/response/JSONWriterTest.java | 4 ++--
.../org/apache/solr/response/SmileWriterTest.java | 4 ++--
.../org/apache/solr/schema/TestPointFields.java | 2 +-
.../solr/search/AnalyticsMergeStrategyTest.java | 12 ++++++------
.../solr/search/AnalyticsTestQParserPlugin.java | 6 +++---
.../apache/solr/search/SolrIndexSearcherTest.java | 2 +-
.../org/apache/solr/search/TestBlockCollapse.java | 2 +-
.../apache/solr/search/TestFilteredDocIdSet.java | 6 +++---
.../test/org/apache/solr/search/TestRecovery.java | 6 +++---
.../apache/solr/update/SolrIndexConfigTest.java | 2 +-
.../org/apache/solr/update/VersionInfoTest.java | 2 +-
.../CategoryRoutedAliasUpdateProcessorTest.java | 2 +-
...reCommitOptimizeUpdateProcessorFactoryTest.java | 2 +-
.../processor/RoutedAliasUpdateProcessorTest.java | 2 +-
.../org/apache/solr/util/SolrPluginUtilsTest.java | 2 +-
28 files changed, 64 insertions(+), 75 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
index 0e08dbc319f..fda513eb11d 100644
--- a/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
+++ b/solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
@@ -292,7 +292,7 @@ public class TestRandomDVFaceting extends SolrTestCaseJ4 {
// Don't check points if facet.mincount=0
if (h.getCore().getLatestSchema().getFieldOrNull(facet_field + "_p") != null
&& params.get("facet.mincount") != null
- && params.getInt("facet.mincount").intValue() > 0) {
+ && params.getInt("facet.mincount") > 0) {
params.set("facet.field", "{!key=" + facet_field + "}" + facet_field + "_p");
String strResponse = h.query(req(params));
responses.add(strResponse);
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
index 94f804bf1da..9986f45e23c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java
@@ -309,7 +309,7 @@ public class DistributedVersionInfoTest extends SolrCloudTestCase {
if (vers == null)
fail("Failed to get version using query " + query + " from " + replica.getCoreUrl());
- return vers.longValue();
+ return vers;
}
protected void assertDocsExistInAllReplicas(
diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java
index e9beee6f2ad..eff94d0e72e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java
@@ -922,7 +922,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {
+ numberOfNodesToCreateOn
+ " is not allowed to be higher than numberOfNodes "
+ numberOfNodes,
- numberOfNodes.intValue() >= numberOfNodesToCreateOn.intValue());
+ numberOfNodes >= numberOfNodesToCreateOn);
assertTrue(
"Wrong usage of testTemplate. createNodeListOption has to be "
+ CreateNodeListOptions.SEND
diff --git a/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java b/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
index b62fdd0cdd9..e5c93141aa6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
@@ -67,15 +67,15 @@ class SegmentTerminateEarlyTestState {
SolrInputDocument doc = new SolrInputDocument();
doc.setField(KEY_FIELD, "" + docKey);
final int MM = rand.nextInt(60); // minutes
- if (minTimestampMM == null || MM <= minTimestampMM.intValue()) {
- if (minTimestampMM != null && MM < minTimestampMM.intValue()) {
+ if (minTimestampMM == null || MM <= minTimestampMM) {
+ if (minTimestampMM != null && MM < minTimestampMM) {
minTimestampDocKeys.clear();
}
minTimestampMM = MM;
minTimestampDocKeys.add(docKey);
}
- if (maxTimestampMM == null || maxTimestampMM.intValue() <= MM) {
- if (maxTimestampMM != null && maxTimestampMM.intValue() < MM) {
+ if (maxTimestampMM == null || maxTimestampMM <= MM) {
+ if (maxTimestampMM != null && maxTimestampMM < MM) {
maxTimestampDocKeys.clear();
}
maxTimestampMM = MM;
@@ -96,7 +96,7 @@ class SegmentTerminateEarlyTestState {
void queryTimestampDescending(CloudSolrClient cloudSolrClient) throws Exception {
TestSegmentSorting.assertFalse(maxTimestampDocKeys.isEmpty());
TestSegmentSorting.assertTrue("numDocs=" + numDocs + " is not even", (numDocs % 2) == 0);
- final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next().intValue() % 2);
+ final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next() % 2);
final SolrQuery query = new SolrQuery(ODD_FIELD + ":" + oddFieldValue);
query.setSort(TIMESTAMP_FIELD, SolrQuery.ORDER.desc);
query.setFields(KEY_FIELD, ODD_FIELD, TIMESTAMP_FIELD);
@@ -133,7 +133,7 @@ class SegmentTerminateEarlyTestState {
throws Exception {
TestSegmentSorting.assertFalse(maxTimestampDocKeys.isEmpty());
TestSegmentSorting.assertTrue("numDocs=" + numDocs + " is not even", (numDocs % 2) == 0);
- final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next().intValue() % 2);
+ final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next() % 2);
final SolrQuery query = new SolrQuery(ODD_FIELD + ":" + oddFieldValue);
query.setSort(TIMESTAMP_FIELD, SolrQuery.ORDER.desc);
query.setFields(KEY_FIELD, ODD_FIELD, TIMESTAMP_FIELD);
@@ -141,7 +141,7 @@ class SegmentTerminateEarlyTestState {
query.setRows(rowsWanted);
final Boolean shardsInfoWanted = (rand.nextBoolean() ? null : rand.nextBoolean());
if (shardsInfoWanted != null) {
- query.set(ShardParams.SHARDS_INFO, shardsInfoWanted.booleanValue());
+ query.set(ShardParams.SHARDS_INFO, shardsInfoWanted);
}
query.set(CommonParams.SEGMENT_TERMINATE_EARLY, true);
final QueryResponse rsp = cloudSolrClient.query(query);
@@ -202,14 +202,14 @@ class SegmentTerminateEarlyTestState {
throws Exception {
TestSegmentSorting.assertFalse(maxTimestampDocKeys.isEmpty());
TestSegmentSorting.assertTrue("numDocs=" + numDocs + " is not even", (numDocs % 2) == 0);
- final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next().intValue() % 2);
+ final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next() % 2);
final SolrQuery query = new SolrQuery(ODD_FIELD + ":" + oddFieldValue);
query.setSort(TIMESTAMP_FIELD, SolrQuery.ORDER.desc);
query.setFields(KEY_FIELD, ODD_FIELD, TIMESTAMP_FIELD);
query.setRows(1);
final Boolean shardsInfoWanted = (rand.nextBoolean() ? null : rand.nextBoolean());
if (shardsInfoWanted != null) {
- query.set(ShardParams.SHARDS_INFO, shardsInfoWanted.booleanValue());
+ query.set(ShardParams.SHARDS_INFO, shardsInfoWanted);
}
query.set(CommonParams.SEGMENT_TERMINATE_EARLY, false);
final QueryResponse rsp = cloudSolrClient.query(query);
@@ -267,7 +267,7 @@ class SegmentTerminateEarlyTestState {
throws Exception {
TestSegmentSorting.assertFalse(maxTimestampDocKeys.isEmpty());
TestSegmentSorting.assertTrue("numDocs=" + numDocs + " is not even", (numDocs % 2) == 0);
- final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next().intValue() % 2);
+ final Long oddFieldValue = (long) (maxTimestampDocKeys.iterator().next() % 2);
final SolrQuery query = new SolrQuery(ODD_FIELD + ":" + oddFieldValue);
query.setSort(TIMESTAMP_FIELD, SolrQuery.ORDER.desc);
query.setFields(KEY_FIELD, ODD_FIELD, TIMESTAMP_FIELD);
@@ -311,7 +311,7 @@ class SegmentTerminateEarlyTestState {
throws Exception {
TestSegmentSorting.assertFalse(minTimestampDocKeys.isEmpty());
TestSegmentSorting.assertTrue("numDocs=" + numDocs + " is not even", (numDocs % 2) == 0);
- final Long oddFieldValue = (long) (minTimestampDocKeys.iterator().next().intValue() % 2);
+ final Long oddFieldValue = (long) (minTimestampDocKeys.iterator().next() % 2);
final SolrQuery query = new SolrQuery(ODD_FIELD + ":" + oddFieldValue);
// a sort order that is _not_ compatible with the merge sort order
query.setSort(TIMESTAMP_FIELD, SolrQuery.ORDER.asc);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
index 77593018238..49a1e5e9dc1 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPhrasesIdentificationComponent.java
@@ -152,13 +152,11 @@ public class TestCloudPhrasesIdentificationComponent extends SolrCloudTestCase {
final NamedList<Object> lazy_dog = details.get(0);
assertEquals("dog text", "the lazy dog", lazy_dog.get("text"));
- assertEquals(
- "dog score", 0.166666D, ((Double) lazy_dog.get("score")).doubleValue(), 0.000001D);
+ assertEquals("dog score", 0.166666D, (Double) lazy_dog.get("score"), 0.000001D);
final NamedList<Object> brown_fox = details.get(1);
assertEquals("fox text", "brown FOX", brown_fox.get("text"));
- assertEquals(
- "fox score", 0.083333D, ((Double) brown_fox.get("score")).doubleValue(), 0.000001D);
+ assertEquals("fox score", 0.083333D, (Double) brown_fox.get("score"), 0.000001D);
} catch (AssertionError e) {
throw new AssertionError(e.getMessage() + " ::: " + path + " ==> " + rsp, e);
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
index b9214139dde..9e34af13afb 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java
@@ -687,7 +687,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
String msg = id + ": fl=[docid] => " + doc;
assertEquals(msg, 1, doc.size());
assertTrue(msg, doc.getFieldValue("[docid]") instanceof Integer);
- assertTrue(msg, -1 <= ((Integer) doc.getFieldValue("[docid]")).intValue());
+ assertTrue(msg, -1 <= (Integer) doc.getFieldValue("[docid]"));
}
}
@@ -717,7 +717,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
assertTrue(msg, doc.getFieldValue("x_alias") instanceof Integer);
assertEquals(msg, 10, doc.getFieldValue("x_alias"));
assertTrue(msg, doc.getFieldValue("[docid]") instanceof Integer);
- assertTrue(msg, -1 <= ((Integer) doc.getFieldValue("[docid]")).intValue());
+ assertTrue(msg, -1 <= (Integer) doc.getFieldValue("[docid]"));
}
}
}
@@ -778,7 +778,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
assertTrue(msg, doc.getFieldValue("x_alias") instanceof Integer);
assertEquals(msg, 10, doc.getFieldValue("x_alias"));
assertTrue(msg, doc.getFieldValue("[docid]") instanceof Integer);
- assertTrue(msg, -1 <= ((Integer) doc.getFieldValue("[docid]")).intValue());
+ assertTrue(msg, -1 <= (Integer) doc.getFieldValue("[docid]"));
}
}
}
@@ -868,7 +868,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
assertEquals(msg, 10, doc.getFieldValue("x_alias"));
// RTG: [explain] and score should be missing (ignored)
assertTrue(msg, doc.getFieldValue("d_alias") instanceof Integer);
- assertTrue(msg, -1 <= ((Integer) doc.getFieldValue("d_alias")).intValue());
+ assertTrue(msg, -1 <= (Integer) doc.getFieldValue("d_alias"));
}
}
}
@@ -936,7 +936,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
assertEquals(msg, 1, doc.getFieldValue("val_i"));
assertTrue(msg, doc.getFieldValue("subject") instanceof String);
assertTrue(msg, doc.getFieldValue("[docid]") instanceof Integer);
- assertTrue(msg, -1 <= ((Integer) doc.getFieldValue("[docid]")).intValue());
+ assertTrue(msg, -1 <= (Integer) doc.getFieldValue("[docid]"));
// RTG: [explain] and score should be missing (ignored)
}
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
index 9f3574ee288..0829723ae32 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java
@@ -475,7 +475,7 @@ public class TestRandomFlRTGCloud extends SolrCloudTestCase {
// response
if (null != knownDocs[docId]) {
Integer filterVal = (Integer) knownDocs[docId].getFieldValue("aaa_i");
- if (null == FQ_MAX || ((null != filterVal) && filterVal.intValue() <= FQ_MAX.intValue())) {
+ if (null == FQ_MAX || ((null != filterVal) && filterVal <= FQ_MAX)) {
docsToExpect.add(knownDocs[docId]);
}
}
@@ -977,8 +977,7 @@ public class TestRandomFlRTGCloud extends SolrCloudTestCase {
}
}
assertTrue(
- USAGE + " must be >= " + minValidDocId + ": " + value,
- minValidDocId <= ((Integer) value).intValue());
+ USAGE + " must be >= " + minValidDocId + ": " + value, minValidDocId <= (Integer) value);
return Collections.<String>singleton(resultKey);
}
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
index 6776217cc9c..be27cabcdcf 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java
@@ -383,7 +383,7 @@ public class TestStressCloudBlindAtomicUpdates extends SolrCloudTestCase {
}
Long actual = (null == doc) ? null : (Long) doc.getFirstValue(numericFieldName);
- if (actual == null || expect != actual.longValue() || !foundWithFilter) {
+ if (actual == null || expect != actual || !foundWithFilter) {
log.error(
"docId={}, foundWithFilter={}, expected={}, actual={}",
docId,
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java b/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java
index 3bf3adb1bf8..8be2199f91f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java
@@ -262,8 +262,8 @@ public class TestStressInPlaceUpdates extends AbstractFullDistribZkTestBase {
synchronized (model) {
DocInfo currInfo = model.get(id);
if (null != returnedVersion
- && (Math.abs(returnedVersion.longValue()) > Math.abs(currInfo.version))) {
- model.put(id, new DocInfo(returnedVersion.longValue(), 0, 0));
+ && (Math.abs(returnedVersion) > Math.abs(currInfo.version))) {
+ model.put(id, new DocInfo(returnedVersion, 0, 0));
}
}
@@ -356,8 +356,8 @@ public class TestStressInPlaceUpdates extends AbstractFullDistribZkTestBase {
synchronized (model) {
DocInfo currInfo = model.get(id);
if (null != returnedVersion
- && (Math.abs(returnedVersion.longValue()) > Math.abs(currInfo.version))) {
- model.put(id, new DocInfo(returnedVersion.longValue(), nextVal1, nextVal2));
+ && (Math.abs(returnedVersion) > Math.abs(currInfo.version))) {
+ model.put(id, new DocInfo(returnedVersion, nextVal1, nextVal2));
}
}
}
@@ -434,9 +434,7 @@ public class TestStressInPlaceUpdates extends AbstractFullDistribZkTestBase {
final Long foundVersion = (Long) actual.getFieldValue("_version_");
assertNotNull(msg, foundVersion);
- assertTrue(
- msg + "... solr doc has non-positive version???",
- 0 < foundVersion.longValue());
+ assertTrue(msg + "... solr doc has non-positive version???", 0 < foundVersion);
final Integer intVal = (Integer) actual.getFieldValue("val1_i_dvo");
assertNotNull(msg, intVal);
@@ -447,9 +445,9 @@ public class TestStressInPlaceUpdates extends AbstractFullDistribZkTestBase {
msg
+ " ...solr returned older version then model. "
+ "should not be possible given the order of operations in writer threads",
- Math.abs(expected.version) <= foundVersion.longValue());
+ Math.abs(expected.version) <= foundVersion);
- if (foundVersion.longValue() == expected.version) {
+ if (foundVersion == expected.version) {
assertEquals(msg, expected.intFieldValue, intVal.intValue());
assertEquals(msg, expected.longFieldValue, longVal.longValue());
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
index 51c2f694ca3..2d9cab0a779 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorRandomCloud.java
@@ -404,7 +404,7 @@ public class TestTolerantUpdateProcessorRandomCloud extends SolrCloudTestCase {
docsOnThisPage = 0;
for (SolrDocument doc : rsp.getResults()) {
docsOnThisPage++;
- int id_i = ((Integer) doc.get("id_i")).intValue();
+ int id_i = (Integer) doc.get("id_i");
assertTrue(
"found id_i bigger then expected " + maxDocIdExpected + ": " + id_i,
id_i <= maxDocIdExpected);
diff --git a/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
index 05e38972c41..2d2511c7aa8 100644
--- a/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/DocumentAnalysisRequestHandlerTest.java
@@ -118,7 +118,7 @@ public class DocumentAnalysisRequestHandlerTest extends AnalysisRequestHandlerTe
this.bytes = bytes;
this.contentType = contentType;
name = null;
- size = Long.valueOf(bytes.length);
+ size = (long) bytes.length;
sourceInfo = "rawBytes";
}
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
index ec30e46a8a1..40e515a4530 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
@@ -180,7 +180,7 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSea
// check the relative error of the estimate returned against the known truth
final double relErr = expectedRelativeError(log2m);
- final long estimate = stats.get(f).getCardinality().longValue();
+ final long estimate = stats.get(f).getCardinality();
assertTrue(
f
+ ": relativeErr="
diff --git a/solr/core/src/test/org/apache/solr/index/WrapperMergePolicyFactoryTest.java b/solr/core/src/test/org/apache/solr/index/WrapperMergePolicyFactoryTest.java
index d217ceca8b5..811d90aa4f4 100644
--- a/solr/core/src/test/org/apache/solr/index/WrapperMergePolicyFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/index/WrapperMergePolicyFactoryTest.java
@@ -103,17 +103,11 @@ public class WrapperMergePolicyFactoryTest extends SolrTestCaseJ4 {
final MergePolicy mp = mpf.getMergePolicy();
if (wrappingNoCFSRatio != null) {
assertEquals(
- "#" + ii + " wrappingNoCFSRatio",
- wrappingNoCFSRatio.doubleValue(),
- mp.getNoCFSRatio(),
- 0.0d);
+ "#" + ii + " wrappingNoCFSRatio", wrappingNoCFSRatio, mp.getNoCFSRatio(), 0.0d);
}
if (wrappedNoCFSRatio != null) {
assertEquals(
- "#" + ii + " wrappedNoCFSRatio",
- wrappedNoCFSRatio.doubleValue(),
- mp.getNoCFSRatio(),
- 0.0d);
+ "#" + ii + " wrappedNoCFSRatio", wrappedNoCFSRatio, mp.getNoCFSRatio(), 0.0d);
}
assertSame(mp.getClass(), UpgradeIndexMergePolicy.class);
}
diff --git a/solr/core/src/test/org/apache/solr/response/JSONWriterTest.java b/solr/core/src/test/org/apache/solr/response/JSONWriterTest.java
index 9af64108cfc..289db6721ac 100644
--- a/solr/core/src/test/org/apache/solr/response/JSONWriterTest.java
+++ b/solr/core/src/test/org/apache/solr/response/JSONWriterTest.java
@@ -104,8 +104,8 @@ public class JSONWriterTest extends SolrTestCaseJ4 {
nl.add(null, null);
rsp.add("nl", nl);
- rsp.add("byte", Byte.valueOf((byte) -3));
- rsp.add("short", Short.valueOf((short) -4));
+ rsp.add("byte", (byte) -3);
+ rsp.add("short", (short) -4);
rsp.add("bytes", "abc".getBytes(StandardCharsets.UTF_8));
w.write(buf, req, rsp);
diff --git a/solr/core/src/test/org/apache/solr/response/SmileWriterTest.java b/solr/core/src/test/org/apache/solr/response/SmileWriterTest.java
index 9e56119e10c..d2ea23695ad 100644
--- a/solr/core/src/test/org/apache/solr/response/SmileWriterTest.java
+++ b/solr/core/src/test/org/apache/solr/response/SmileWriterTest.java
@@ -96,8 +96,8 @@ public class SmileWriterTest extends SolrTestCaseJ4 {
nl.add(null, 42);
rsp.add("nl", nl);
- rsp.add("byte", Byte.valueOf((byte) -3));
- rsp.add("short", Short.valueOf((short) -4));
+ rsp.add("byte", (byte) -3);
+ rsp.add("short", (short) -4);
String expected = "{\"nl\":[[\"data1\",\"he\\u2028llo\\u2029!\"],[null,42]],byte:-3,short:-4}";
w.write(buf, req, rsp);
@SuppressWarnings({"rawtypes"})
diff --git a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
index 963c563d98e..70a55534e27 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java
@@ -4524,7 +4524,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
}
} catch (NumberFormatException e) {
try {
- if (Double.valueOf(numbers[1]) < Double.valueOf(numbers[2])) {
+ if (Double.parseDouble(numbers[1]) < Double.parseDouble(numbers[2])) {
smaller = numbers[1];
larger = numbers[2];
} else {
diff --git a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
index fe59f104ff6..b0ea08d1041 100644
--- a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
@@ -97,8 +97,8 @@ public class AnalyticsMergeStrategyTest extends BaseDistributedSearchTestCase {
@SuppressWarnings({"rawtypes"})
NamedList analytics = (NamedList) response.get("analytics");
Integer c = (Integer) analytics.get("mycount");
- if (c.intValue() != count) {
- throw new Exception("Count is not correct:" + count + ":" + c.intValue());
+ if (c != count) {
+ throw new Exception("Count is not correct:" + count + ":" + c);
}
}
@@ -108,13 +108,13 @@ public class AnalyticsMergeStrategyTest extends BaseDistributedSearchTestCase {
@SuppressWarnings({"rawtypes"})
NamedList analytics = (NamedList) response.get("analytics");
Integer c = (Integer) analytics.get("mycount");
- if (c.intValue() != count) {
- throw new Exception("Count is not correct:" + count + ":" + c.intValue());
+ if (c != count) {
+ throw new Exception("Count is not correct:" + count + ":" + c);
}
long numFound = rsp.getResults().getNumFound();
- if (c.intValue() != numFound) {
- throw new Exception("Count does not equal numFound:" + c.intValue() + ":" + numFound);
+ if (c != numFound) {
+ throw new Exception("Count does not equal numFound:" + c + ":" + numFound);
}
}
}
diff --git a/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java
index 72b96f83d32..8570090d0aa 100644
--- a/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java
@@ -124,7 +124,7 @@ public class AnalyticsTestQParserPlugin extends QParserPlugin {
@SuppressWarnings({"rawtypes"})
NamedList analytics = (NamedList) response.get("analytics");
Integer c = (Integer) analytics.get("mycount");
- count += c.intValue();
+ count += c;
}
merged.add("mycount", count);
@@ -143,7 +143,7 @@ public class AnalyticsTestQParserPlugin extends QParserPlugin {
@SuppressWarnings({"rawtypes"})
NamedList analytics = (NamedList) response.get("analytics");
Integer c = (Integer) analytics.get("mycount");
- count += c.intValue();
+ count += c;
}
ModifiableSolrParams params = new ModifiableSolrParams();
@@ -165,7 +165,7 @@ public class AnalyticsTestQParserPlugin extends QParserPlugin {
@SuppressWarnings({"rawtypes"})
NamedList analytics = (NamedList) response.getResponse().get("analytics");
Integer c = (Integer) analytics.get("mycount");
- nextCount += c.intValue();
+ nextCount += c;
}
@SuppressWarnings({"rawtypes"})
diff --git a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
index 612b16b7ba1..2736ec78ba4 100644
--- a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
+++ b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java
@@ -273,7 +273,7 @@ public class SolrIndexSearcherTest extends SolrTestCaseJ4 {
if (fixedScore == null) {
expectedScore = 1f;
} else {
- expectedScore = fixedScore.floatValue();
+ expectedScore = fixedScore;
cmd.setQuery(new FixedScoreReRankQuery(cmd.getQuery(), expectedScore));
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java b/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
index 6cc8d8b5b6a..0d041ba603a 100644
--- a/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
+++ b/solr/core/src/test/org/apache/solr/search/TestBlockCollapse.java
@@ -1134,7 +1134,7 @@ public class TestBlockCollapse extends SolrTestCaseJ4 {
// as num_i value increases, the asc_* fields increase
// as num_i value increases, the desc_* fields decrease
if (doc.getFieldNames().contains("num_i")) {
- final int val = ((Integer) doc.getFieldValue("num_i")).intValue();
+ final int val = (Integer) doc.getFieldValue("num_i");
for (String suffix : SELECTOR_FIELD_SUFFIXES) {
doc.setField("asc" + suffix, val);
doc.setField("desc" + suffix, 0 - val);
diff --git a/solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java b/solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java
index 87afd9fce33..8bed7195b66 100644
--- a/solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java
@@ -94,9 +94,9 @@ public class TestFilteredDocIdSet extends SolrTestCase {
ArrayList<Integer> list = new ArrayList<>();
int doc = iter.advance(3);
if (doc != DocIdSetIterator.NO_MORE_DOCS) {
- list.add(Integer.valueOf(doc));
+ list.add(doc);
while ((doc = iter.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
- list.add(Integer.valueOf(doc));
+ list.add(doc);
}
}
@@ -104,7 +104,7 @@ public class TestFilteredDocIdSet extends SolrTestCase {
int c = 0;
Iterator<Integer> intIter = list.iterator();
while (intIter.hasNext()) {
- docs[c++] = intIter.next().intValue();
+ docs[c++] = intIter.next();
}
int[] answer = new int[] {4, 6, 8};
boolean same = Arrays.equals(answer, docs);
diff --git a/solr/core/src/test/org/apache/solr/search/TestRecovery.java b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
index 4910f1d0dde..333da89485f 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRecovery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
@@ -246,10 +246,10 @@ public class TestRecovery extends SolrTestCaseJ4 {
assertEquals(UpdateLog.State.REPLAYING.ordinal(), state.getValue().intValue());
@SuppressWarnings({"unchecked"})
Gauge<Integer> replayingLogs = (Gauge<Integer>) metrics.get("TLOG.replay.remaining.logs");
- assertTrue(replayingLogs.getValue().intValue() > 0);
+ assertTrue(replayingLogs.getValue() > 0);
@SuppressWarnings({"unchecked"})
Gauge<Long> replayingDocs = (Gauge<Long>) metrics.get("TLOG.replay.remaining.bytes");
- assertTrue(replayingDocs.getValue().longValue() > 0);
+ assertTrue(replayingDocs.getValue() > 0);
Meter replayDocs = (Meter) metrics.get("TLOG.replay.ops");
long initialOps = replayDocs.getCount();
@@ -722,7 +722,7 @@ public class TestRecovery extends SolrTestCaseJ4 {
// be bad for updates to be visible if we're just buffering.
assertJQ(req("qt", "/get", "id", "B3"), "=={'doc':null}");
- assertEquals(6, bufferedOps.getValue().intValue() - initialOps);
+ assertEquals(6, bufferedOps.getValue() - initialOps);
rinfoFuture = ulog.applyBufferedUpdates();
assertTrue(rinfoFuture != null);
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
index 41fbfe32731..79b166c3df7 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
@@ -223,7 +223,7 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
++mSizeExpected;
assertTrue(m.get("infoStreamEnabled") instanceof Boolean);
{
- assertFalse(Boolean.valueOf(m.get("infoStreamEnabled").toString()).booleanValue());
+ assertFalse(Boolean.valueOf(m.get("infoStreamEnabled").toString()));
}
++mSizeExpected;
diff --git a/solr/core/src/test/org/apache/solr/update/VersionInfoTest.java b/solr/core/src/test/org/apache/solr/update/VersionInfoTest.java
index 034a4beddb5..a80dd3f20cd 100644
--- a/solr/core/src/test/org/apache/solr/update/VersionInfoTest.java
+++ b/solr/core/src/test/org/apache/solr/update/VersionInfoTest.java
@@ -115,7 +115,7 @@ public class VersionInfoTest extends SolrTestCaseJ4 {
+ version
+ " ?< "
+ maxVersionFromUlog,
- version < maxVersionFromUlog.longValue());
+ version < maxVersionFromUlog);
version = vInfo.getVersionFromIndex(idBytes);
assertNull("version info should be null for uncommitted test doc: " + docId, version);
diff --git a/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
index 7a4428b7c92..45d181040c8 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/CategoryRoutedAliasUpdateProcessorTest.java
@@ -547,7 +547,7 @@ public class CategoryRoutedAliasUpdateProcessorTest extends RoutedAliasUpdatePro
public UpdateRequestProcessor getInstance(
SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
return FieldValueMutatingUpdateProcessor.valueMutator(
- getSelector(), next, (src) -> Integer.valueOf(src.toString()) + 1);
+ getSelector(), next, (src) -> Integer.parseInt(src.toString()) + 1);
}
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java
index dfed0d8e089..71933920415 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/IgnoreCommitOptimizeUpdateProcessorFactoryTest.java
@@ -76,7 +76,7 @@ public class IgnoreCommitOptimizeUpdateProcessorFactoryTest extends SolrTestCase
if (commitEndPoint != null) {
((ModifiableSolrParams) req.getParams())
- .set(DistributedUpdateProcessor.COMMIT_END_POINT, commitEndPoint.booleanValue());
+ .set(DistributedUpdateProcessor.COMMIT_END_POINT, commitEndPoint);
}
try {
diff --git a/solr/core/src/test/org/apache/solr/update/processor/RoutedAliasUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/RoutedAliasUpdateProcessorTest.java
index f94853996cc..6478f769994 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/RoutedAliasUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/RoutedAliasUpdateProcessorTest.java
@@ -408,7 +408,7 @@ public abstract class RoutedAliasUpdateProcessorTest extends SolrCloudTestCase {
public UpdateRequestProcessor getInstance(
SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
return FieldValueMutatingUpdateProcessor.valueMutator(
- getSelector(), next, (src) -> Integer.valueOf(src.toString()) + 1);
+ getSelector(), next, (src) -> Integer.parseInt(src.toString()) + 1);
}
}
}
diff --git a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
index 6fd821023c3..4f3c3a01232 100644
--- a/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
@@ -438,7 +438,7 @@ public class SolrPluginUtilsTest extends SolrTestCaseJ4 {
final Map<String, Object> initArgs = new HashMap<>();
initArgs.put("aFloat", theFloatObject);
SolrPluginUtils.invokeSetters(bean, initArgs.entrySet());
- assertEquals(bean.getAFloat(), theFloat.floatValue(), 0.0);
+ assertEquals(bean.getAFloat(), theFloat, 0.0);
}
/** macro */