Skip to content

Commit

Permalink
SOLR-17588: fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
noblepaul committed Jan 9, 2025
1 parent f1a5216 commit ea1fcb1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
24 changes: 12 additions & 12 deletions solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,28 +441,28 @@ public boolean writeKnownType(Object val) throws IOException {
writeBoolean(((AtomicBoolean) val).get());
return true;
}
if (val instanceof float[] ff) {
writeFloatArr(ff);
if (val instanceof float[]) {
writeFloatArr((float[]) val);
return true;
}
if (val instanceof int[] ii) {
writeIntArr(ii);
if (val instanceof int[]) {
writeIntArr((int[]) val);
return true;
}
if (val instanceof long[] ll) {
writeLongArr(ll);
if (val instanceof long[]) {
writeLongArr((long[]) val);
return true;
}
if (val instanceof double[] dd) {
writeDoubleArr(dd);
if (val instanceof double[]) {
writeDoubleArr((double[]) val);
return true;
}
if (val instanceof short[] ss) {
writeShortArr(ss);
if (val instanceof short[]) {
writeShortArr((short[]) val);
return true;
}
if (val instanceof boolean[] bb) {
writeBoolArr(bb);
if (val instanceof boolean[]) {
writeBoolArr((boolean[]) val);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,23 +239,20 @@ private void compareObjects(List<?> unmarshalledObj, List<?> matchObj) {
} else if (unmarshalledObj.get(i) instanceof SolrInputField
&& matchObj.get(i) instanceof SolrInputField) {
assertTrue(assertSolrInputFieldEquals(unmarshalledObj.get(i), matchObj.get(i)));
} else if (unmarshalledObj.get(i) instanceof float[] a
&& matchObj.get(i) instanceof float[] e) {
assertArrayEquals(e, a, 0.000000f);
} else if (unmarshalledObj.get(i) instanceof double[] a
&& matchObj.get(i) instanceof double[] e) {
assertArrayEquals(e, a, 0.000000d);
} else if (unmarshalledObj.get(i) instanceof long[] a
&& matchObj.get(i) instanceof long[] e) {
assertArrayEquals(e, a);
} else if (unmarshalledObj.get(i) instanceof int[] a && matchObj.get(i) instanceof int[] e) {
assertArrayEquals(e, a);
} else if (unmarshalledObj.get(i) instanceof short[] a
&& matchObj.get(i) instanceof short[] e) {
assertArrayEquals(e, a);
} else if (unmarshalledObj.get(i) instanceof boolean[] a
&& matchObj.get(i) instanceof boolean[] e) {
assertArrayEquals(e, a);
} else if (unmarshalledObj.get(i) instanceof float[] && matchObj.get(i) instanceof float[]) {
assertArrayEquals((float[]) matchObj.get(i), (float[]) unmarshalledObj.get(i), 0.000000f);
} else if (unmarshalledObj.get(i) instanceof double[]
&& matchObj.get(i) instanceof double[]) {
assertArrayEquals((double[]) matchObj.get(i), (double[]) unmarshalledObj.get(i), 0.000000d);
} else if (unmarshalledObj.get(i) instanceof long[] && matchObj.get(i) instanceof long[]) {
assertArrayEquals((long[]) matchObj.get(i), (long[]) unmarshalledObj.get(i));
} else if (unmarshalledObj.get(i) instanceof int[] && matchObj.get(i) instanceof int[]) {
assertArrayEquals((int[]) matchObj.get(i), (int[]) unmarshalledObj.get(i));
} else if (unmarshalledObj.get(i) instanceof short[] && matchObj.get(i) instanceof short[]) {
assertArrayEquals((short[]) matchObj.get(i), (short[]) unmarshalledObj.get(i));
} else if (unmarshalledObj.get(i) instanceof boolean[]
&& matchObj.get(i) instanceof boolean[]) {
assertArrayEquals((boolean[]) matchObj.get(i), (boolean[]) unmarshalledObj.get(i));
} else {
assertEquals(unmarshalledObj.get(i), matchObj.get(i));
}
Expand Down

0 comments on commit ea1fcb1

Please sign in to comment.