Skip to content

Commit 1c17da0

Browse files
committed
MLE-23004 - Cleaning up compiler warnings
asdf
1 parent 0ea2bb6 commit 1c17da0

File tree

8 files changed

+435
-428
lines changed

8 files changed

+435
-428
lines changed

examples/src/main/java/com/marklogic/client/example/cookbook/datamovement/DatabaseClientSingleton.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ private static void registerHandlers() {
3838
} catch (JAXBException e) {
3939
throw new IllegalStateException(e);
4040
}
41-
ObjectMapper mapper = new JacksonDatabindHandle(null).getMapper();
41+
42+
@SuppressWarnings("unchecked")
43+
ObjectMapper mapper = new JacksonDatabindHandle(null).getMapper();
4244
// we do the next three lines so dates are written in xs:dateTime format
4345
// which makes them ready for range indexes in MarkLogic Server
4446
String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";

marklogic-client-api/src/main/java/com/marklogic/client/datamovement/TypedRow.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ public String getUri() {
2020
}
2121

2222
public long getRowNum() {
23-
return new Long(rowNum).longValue();
23+
try {
24+
return Long.valueOf(rowNum).longValue();
25+
} catch (NumberFormatException e) {
26+
throw new IllegalArgumentException("Invalid rowNum value: " + rowNum, e);
27+
}
2428
}
2529

2630
public XsAnyAtomicTypeVal put(String name, XsAnyAtomicTypeVal val) {

marklogic-client-api/src/main/java/com/marklogic/client/impl/BasicPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public BasicPage<T> setTotalSize(long totalSize) {
6969
}
7070

7171
public BasicPage<T> setSize(long size) {
72-
this.size = new Long(size);
72+
this.size = Long.valueOf(size);
7373
return this;
7474
}
7575

marklogic-client-api/src/main/java/com/marklogic/client/impl/OkHttpServices.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3580,10 +3580,10 @@ public Number getNumber() {
35803580
String value = getString();
35813581
if (value == null) return null;
35823582
if (getType() == EvalResult.Type.DECIMAL) return new BigDecimal(value);
3583-
else if (getType() == EvalResult.Type.DOUBLE) return new Double(value);
3584-
else if (getType() == EvalResult.Type.FLOAT) return new Float(value);
3583+
else if (getType() == EvalResult.Type.DOUBLE) return Double.valueOf(value);
3584+
else if (getType() == EvalResult.Type.FLOAT) return Float.valueOf(value);
35853585
// MarkLogic integers can be much larger than Java integers, so we'll use Long instead
3586-
else if (getType() == EvalResult.Type.INTEGER) return new Long(value);
3586+
else if (getType() == EvalResult.Type.INTEGER) return Long.valueOf(value);
35873587
else return new BigDecimal(value);
35883588
}
35893589

0 commit comments

Comments
 (0)