Skip to content

Commit a46ebc8

Browse files
committed
unnecessary autoboxing removed
1 parent 1d6a9f8 commit a46ebc8

File tree

20 files changed

+27
-29
lines changed

20 files changed

+27
-29
lines changed

visualvm/application/src/org/graalvm/visualvm/application/ApplicationSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static synchronized ApplicationSupport getInstance() {
5050

5151
Application createCurrentApplication() {
5252
String selfName = ManagementFactory.getRuntimeMXBean().getName();
53-
final int selfPid = Integer.valueOf(selfName.substring(0, selfName.indexOf('@')));
53+
final Integer selfPid = Integer.valueOf(selfName.substring(0, selfName.indexOf('@')));
5454
return new CurrentApplication(selfPid, Host.LOCALHOST, Host.LOCALHOST.getHostName() + "-" + selfPid);
5555
}
5656

visualvm/appui/src/org/graalvm/visualvm/modules/appui/options/NetworkOptionsModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private static void testProxy(NetworkOptionsPanel panel, int proxyType,
265265
String host = ProxySettings.getTestSystemHttpHost();
266266
int port = 0;
267267
try {
268-
port = Integer.valueOf(ProxySettings.getTestSystemHttpPort());
268+
port = Integer.parseInt(ProxySettings.getTestSystemHttpPort());
269269
} catch (NumberFormatException ex) {
270270
LOGGER.log(Level.INFO, "Cannot parse port number", ex); //NOI18N
271271
}
@@ -278,7 +278,7 @@ private static void testProxy(NetworkOptionsPanel panel, int proxyType,
278278
testingProxy = Proxy.NO_PROXY;
279279
} else {
280280
try {
281-
int proxyPort = Integer.valueOf(proxyPortString);
281+
int proxyPort = Integer.parseInt(proxyPortString);
282282
testingProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort));
283283
} catch (NumberFormatException ex) {
284284
// shouldn't fall into this code

visualvm/core/src/org/graalvm/visualvm/core/datasupport/Positionable.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,11 @@ public int compare(Object o1, Object o2) {
121121
if (result != 0) return result;
122122

123123
// Compare using System.identityHashCode(o)
124-
result = Integer.valueOf(System.identityHashCode(o1)).compareTo(
125-
Integer.valueOf(System.identityHashCode(o2)));
124+
result = Integer.compare(System.identityHashCode(o1), System.identityHashCode(o2));
126125
if (result != 0) return result;
127126

128127
// Compare using o.hashCode()
129-
result = Integer.valueOf(o1.hashCode()).compareTo(
130-
Integer.valueOf(o2.hashCode()));
128+
result = Integer.compare(o1.hashCode(), o2.hashCode());
131129
if (result != 0) return result;
132130

133131
// Give up, pretend that second number is greater

visualvm/core/src/org/graalvm/visualvm/core/datasupport/Utils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public DataSourcePath(X dataSource) {
201201
}
202202

203203
public int compareTo(DataSourcePath dataSourcePath) {
204-
Integer thisSize = size();
205-
return thisSize.compareTo(dataSourcePath.size());
204+
int thisSize = size();
205+
return Integer.compare(thisSize, dataSourcePath.size());
206206
}
207207

208208
public X getDataSource() {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/cpu/CCTDisplay.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ protected String getNodeSecondaryTime(long time) {
675675
}
676676

677677
protected String getNodeInvocations(int nCalls) {
678-
return Integer.valueOf(nCalls).toString();
678+
return Integer.toString(nCalls);
679679
}
680680

681681
private void initFilterPanel() {
@@ -759,7 +759,7 @@ protected void initColumnSelectorItems() {
759759

760760
for (int i = 0; i < columnCount; i++) {
761761
menuItem = new JCheckBoxMenuItem(columnNames[i]);
762-
menuItem.setActionCommand(Integer.valueOf(i).toString());
762+
menuItem.setActionCommand(Integer.toString(i));
763763
addMenuItemListener(menuItem);
764764

765765
if (treeTable != null) {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/cpu/DiffCCTDisplay.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected String getNodeSecondaryTime(long time) {
8080
}
8181

8282
protected String getNodeInvocations(int nCalls) {
83-
return (nCalls > 0 ? "+" : "") + Integer.valueOf(nCalls).toString(); // NOI18N
83+
return (nCalls > 0 ? "+" : "") + Integer.toString(nCalls); // NOI18N
8484
}
8585

8686
protected void initColumnsData() {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/cpu/FlatProfilePanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ protected void initColumnSelectorItems() {
418418

419419
for (int i = 0; i < columnCount; i++) {
420420
menuItem = new JCheckBoxMenuItem(columnNames[i]);
421-
menuItem.setActionCommand(Integer.valueOf(i).toString());
421+
menuItem.setActionCommand(Integer.toString(i));
422422
addMenuItemListener(menuItem);
423423

424424
if (resTable != null) {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/cpu/ReverseCallGraphPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ protected void initColumnSelectorItems() {
671671

672672
for (int i = 0; i < columnCount; i++) {
673673
menuItem = new JCheckBoxMenuItem(columnNames[i]);
674-
menuItem.setActionCommand(Integer.valueOf(i).toString());
674+
menuItem.setActionCommand(Integer.toString(i));
675675
addMenuItemListener(menuItem);
676676

677677
if (treeTable != null) {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/cpu/SubtreeCallGraphPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ protected void initColumnSelectorItems() {
647647

648648
for (int i = 0; i < columnCount; i++) {
649649
menuItem = new JCheckBoxMenuItem(columnNames[i]);
650-
menuItem.setActionCommand(Integer.valueOf(i).toString());
650+
menuItem.setActionCommand(Integer.toString(i));
651651
addMenuItemListener(menuItem);
652652

653653
if (treeTable != null) {

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/memory/AllocResultsPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ protected void initColumnSelectorItems() {
350350

351351
for (int i = 0; i < columnNames.length; i++) {
352352
menuItem = new JCheckBoxMenuItem(columnNames[i]);
353-
menuItem.setActionCommand(Integer.valueOf(i).toString());
353+
menuItem.setActionCommand(Integer.toString(i));
354354
addMenuItemListener(menuItem);
355355

356356
if (resTable != null) {

0 commit comments

Comments
 (0)