Skip to content

Commit 899530c

Browse files
authored
Cleanup deprecated boxing (#124)
These boxed primitive constructors have been marked for removal in future versions of Java, see https://www.oracle.com/java/technologies/javase/9-deprecated-features.html#JDK-8065614.
1 parent c43b88f commit 899530c

17 files changed

+38
-42
lines changed

src/projections/Tools/CommunicationPerPE/ThreadedFileReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void run() {
9393
sentMsgCount[pIdx][EPid]++;
9494
sentByteCount[pIdx][EPid] +=
9595
logdata.msglen;
96-
localHistogram.add(new Integer(logdata.msglen));
96+
localHistogram.add(logdata.msglen);
9797
} else if ((logdata.type == ProjDefs.CREATION_BCAST) ||
9898
(logdata.type ==
9999
ProjDefs.CREATION_MULTICAST)) {

src/projections/Tools/NoiseMiner/NoiseMiner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private Duration period(){
185185
protected NoiseResult(Duration d, long o, int pe, EventWindow ew){
186186
pes = new TreeSet<Integer>();
187187
this.ew = ew;
188-
pes.add(new Integer(pe));
188+
pes.add(pe);
189189
duration = d;
190190
occurrences = o;
191191
}

src/projections/Tools/Streaming/MultiSeriesHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ private void updateDetailedPlot(){
481481
return;
482482

483483
if(b==0)
484-
addKnownCategories(new Integer(b), newDataset);
484+
addKnownCategories(b, newDataset);
485485

486486

487487
// Read the number of entries for this bin
@@ -502,7 +502,7 @@ private void updateDetailedPlot(){
502502
if(u > 0.0){
503503
// add datapoint to plot
504504
String epName = getName(ep,1000);
505-
newDataset.addValue(u, epName, new Integer(b));
505+
newDataset.addValue(u, epName, Integer.valueOf(b));
506506
}
507507

508508
}
@@ -519,7 +519,7 @@ private void updateStreamingPlot(){
519519
// TreeMap<Integer, TreeMap<String, Double> > plotData;
520520

521521
Iterator<Integer> stepIter = streamingData.keySet().iterator();
522-
Integer xValue = new Integer(0);
522+
Integer xValue = 0;
523523

524524
boolean firstTime = true;
525525

src/projections/Tools/Streaming/SingleSeriesHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void handleReply(byte[] data){
7474

7575
numData = data.length / 1;
7676
for(int i=0; i<numData; i++){
77-
Float v = new Float(ByteParser.unsignedByteToInt(data[i]));
77+
float v = (float) ByteParser.unsignedByteToInt(data[i]);
7878

7979
// Range of values supplied by this ccs handler is 0 to 200. Convert to percentages.
8080
v /= 2.0f;

src/projections/Tools/Streaming/StartupDialogBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void actionPerformed(ActionEvent e) {
137137
String hostname = hostnameTextField.getText();
138138
String portString = portTextField.getText();
139139
String stsFilename = stsFilenameTextField.getText();
140-
int port = new Integer(portString);
140+
int port = Integer.parseInt(portString);
141141
String ccsHandler = (String) handlerComboBox.getSelectedItem();
142142

143143
boolean saveReplies = saveRepliesCheckBox.isSelected();

src/projections/Tools/UserStatsOverTime/UserStatsTimeWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public void tableChanged(TableModelEvent e){
265265
if(model.getRowCount()==0) return;
266266
for(int row = e.getFirstRow(); row<=e.getLastRow();row++){
267267
if(row<0) continue;
268-
if(model.getValueAt(row,numColumns -1).equals(new Boolean(true))) {
268+
if(model.getValueAt(row,numColumns -1).equals(Boolean.TRUE)) {
269269
/*If dataset at row is marked Visible, Set the dataset
270270
For that row to be the XYSeriesCollection meant for that row */
271271
plot.setDataset(row,graphedData.get(row));

src/projections/analysis/Analysis.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ private void findEndTime() {
256256
totalTime = temp;
257257
}
258258
}
259-
rcReader.setValue("RC_GLOBAL_END_TIME", new Long(totalTime));
259+
rcReader.setValue("RC_GLOBAL_END_TIME", totalTime);
260260
}
261261

262262
// Find Pose End Time Data
@@ -273,8 +273,8 @@ public Object doInBackground() {
273273
return null;
274274
}
275275
public void done() {
276-
rcReader.setValue("RC_POSE_REAL_TIME", new Long(poseTotalTime));
277-
rcReader.setValue("RC_POSE_VIRT_TIME", new Long(poseTotalVirtualTime)); }
276+
rcReader.setValue("RC_POSE_REAL_TIME", poseTotalTime);
277+
rcReader.setValue("RC_POSE_VIRT_TIME", poseTotalVirtualTime); }
278278
};
279279
worker.execute();
280280
}

src/projections/analysis/GenericLogReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public LogEntry nextEvent(LogEntry data) throws InputMismatchException, IOExcept
201201
data.pe = (int) sc.nextLong();
202202
break;
203203
case USER_SUPPLIED:
204-
data.userSupplied = new Integer((int) sc.nextLong());
204+
data.userSupplied = (int) sc.nextLong();
205205
break;
206206
case USER_SUPPLIED_NOTE:
207207
data.time = sc.nextLong() + shiftAmount;

src/projections/analysis/LogLoaderBeginEventThread.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
/** This thread's run() method will lookup the begin computation time for an input log file */
1111
class LogLoaderBeginEventThread implements Runnable {
1212

13-
protected Long result;
13+
protected long result;
1414
private int myRun = 0;
1515
private int pe;
1616

1717
protected LogLoaderBeginEventThread(int pe) {
18-
result = new Long(Long.MAX_VALUE);
18+
result = Long.MAX_VALUE;
1919
this.pe = pe;
2020
}
2121

src/projections/analysis/LogLoaderEndEventThread.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
/** This thread's run() method will lookup the end computation time for an input log file */
1111
class LogLoaderEndEventThread implements Runnable {
1212

13-
protected Long result;
13+
protected long result;
1414
private int myRun = 0;
1515
private int pe;
1616

1717
protected LogLoaderEndEventThread(int pe) {
18-
result = new Long(Long.MIN_VALUE);
18+
result = Long.MIN_VALUE;
1919
this.pe = pe;
2020
}
2121

0 commit comments

Comments
 (0)