mirror of
https://github.com/openstreetmap/osmosis.git
synced 2026-01-14 00:36:36 +00:00
Use valueOf for number type instantiation
The constructors for Character, Integer, and Long are deprecated as of Java 9, the static valueOf methods should be used instead.
This commit is contained in:
@ -24,8 +24,8 @@ public class TransactionSnapshotTest {
|
||||
Assert.assertEquals("xMax is incorrect.", 5678, snapshot.getXMax());
|
||||
Assert.assertEquals("xIpList is incorrect.",
|
||||
Arrays.asList(new Long[] {
|
||||
new Long(101112), new Long(131415),
|
||||
new Long(161718) }),
|
||||
Long.valueOf(101112), Long.valueOf(131415),
|
||||
Long.valueOf(161718) }),
|
||||
snapshot.getXIpList());
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ public abstract class TaskManager {
|
||||
if (pipeArgName.indexOf(pipeArgumentPrefix) == 0) {
|
||||
Integer pipeIndex;
|
||||
|
||||
pipeIndex = new Integer(
|
||||
pipeIndex = Integer.valueOf(
|
||||
getPipeIndex(pipeArgName.substring(pipeArgumentPrefix.length()))
|
||||
);
|
||||
|
||||
@ -155,7 +155,7 @@ public abstract class TaskManager {
|
||||
*/
|
||||
protected Task getInputTask(PipeTasks pipeTasks, int pipeIndex, Class<? extends Task> requiredTaskType) {
|
||||
Task inputTask;
|
||||
Integer pipeIndexO = new Integer(pipeIndex);
|
||||
Integer pipeIndexO = Integer.valueOf(pipeIndex);
|
||||
|
||||
// We use the specified pipe name if it exists, otherwise we get the
|
||||
// next available default pipe.
|
||||
@ -180,7 +180,7 @@ public abstract class TaskManager {
|
||||
* The index of the pipe on the current task.
|
||||
*/
|
||||
protected void setOutputTask(PipeTasks pipeTasks, Task outputTask, int pipeIndex) {
|
||||
Integer pipeIndexO = new Integer(pipeIndex);
|
||||
Integer pipeIndexO = Integer.valueOf(pipeIndex);
|
||||
|
||||
// We use the specified pipe name if it exists, otherwise we register
|
||||
// using the next available default pipe name.
|
||||
|
||||
@ -89,8 +89,8 @@ public class ReplicationLagReader implements RunnableTask {
|
||||
|
||||
// more than a day
|
||||
Object[] args = {
|
||||
new Long(lag / 86400),
|
||||
new Long((lag % 86400) / 3600)
|
||||
Long.valueOf(lag / 86400),
|
||||
Long.valueOf((lag % 86400) / 3600)
|
||||
};
|
||||
System.out.println(
|
||||
new MessageFormat("{0} day(s) and {1} hour(s)").format(args)
|
||||
@ -100,8 +100,8 @@ public class ReplicationLagReader implements RunnableTask {
|
||||
|
||||
// morte than an hour
|
||||
Object[] args = {
|
||||
new Long(lag / 3600),
|
||||
new Long((lag % 3600) / 60)
|
||||
Long.valueOf(lag / 3600),
|
||||
Long.valueOf((lag % 3600) / 60)
|
||||
};
|
||||
System.out.println(
|
||||
new MessageFormat("{0} hour(s) and {1} minute(s)").format(args)
|
||||
@ -111,8 +111,8 @@ public class ReplicationLagReader implements RunnableTask {
|
||||
|
||||
// more than a minute
|
||||
Object[] args = {
|
||||
new Long(lag / 60),
|
||||
new Long(lag % 60)
|
||||
Long.valueOf(lag / 60),
|
||||
Long.valueOf(lag % 60)
|
||||
};
|
||||
System.out.println(
|
||||
new MessageFormat("{0} minute(s) and {1} second(s)").format(args)
|
||||
@ -120,7 +120,7 @@ public class ReplicationLagReader implements RunnableTask {
|
||||
|
||||
} else {
|
||||
Object[] args = {
|
||||
new Long(lag)
|
||||
Long.valueOf(lag)
|
||||
};
|
||||
|
||||
// just some seconds
|
||||
|
||||
@ -35,19 +35,19 @@ public class ElementWriter {
|
||||
// with the exception of tab, carriage return and line feed.
|
||||
for (int i = 0; i <= 0x1F; i++) {
|
||||
if (i != 0x9 && i != 0xA && i != 0xD) {
|
||||
XML_ENCODING.put(new Character((char) i), "");
|
||||
XML_ENCODING.put(Character.valueOf((char) i), "");
|
||||
}
|
||||
}
|
||||
XML_ENCODING.put(new Character((char) 0x7F), "");
|
||||
XML_ENCODING.put(Character.valueOf((char) 0x7F), "");
|
||||
|
||||
XML_ENCODING.put(new Character('<'), "<");
|
||||
XML_ENCODING.put(new Character('>'), ">");
|
||||
XML_ENCODING.put(new Character('"'), """);
|
||||
XML_ENCODING.put(new Character('\''), "'");
|
||||
XML_ENCODING.put(new Character('&'), "&");
|
||||
XML_ENCODING.put(new Character('\n'), "
");
|
||||
XML_ENCODING.put(new Character('\r'), "
");
|
||||
XML_ENCODING.put(new Character('\t'), "	");
|
||||
XML_ENCODING.put(Character.valueOf('<'), "<");
|
||||
XML_ENCODING.put(Character.valueOf('>'), ">");
|
||||
XML_ENCODING.put(Character.valueOf('"'), """);
|
||||
XML_ENCODING.put(Character.valueOf('\''), "'");
|
||||
XML_ENCODING.put(Character.valueOf('&'), "&");
|
||||
XML_ENCODING.put(Character.valueOf('\n'), "
");
|
||||
XML_ENCODING.put(Character.valueOf('\r'), "
");
|
||||
XML_ENCODING.put(Character.valueOf('\t'), "	");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +128,7 @@ public class ElementWriter {
|
||||
for (int i = 0; i < data.length(); ++i) {
|
||||
char currentChar = data.charAt(i);
|
||||
|
||||
String replacement = XML_ENCODING.get(new Character(currentChar));
|
||||
String replacement = XML_ENCODING.get(Character.valueOf(currentChar));
|
||||
|
||||
if (replacement != null) {
|
||||
if (buffer == null) {
|
||||
|
||||
Reference in New Issue
Block a user