Skip to content

Commit 5af7f25

Browse files
author
Andrey Turbanov
committedJan 19, 2022
8274811: Remove superfluous use of boxing in java.base
Reviewed-by: lancea
1 parent 44fe958 commit 5af7f25

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed
 

‎src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -112,7 +112,7 @@ private static int[] getKernelVersion() {
112112
int[] majorMinorMicro = new int[3];
113113
int length = Math.min(matches.length, majorMinorMicro.length);
114114
for (int i = 0; i < length; i++) {
115-
majorMinorMicro[i] = Integer.valueOf(matches[i]);
115+
majorMinorMicro[i] = Integer.parseInt(matches[i]);
116116
}
117117
return majorMinorMicro;
118118
}

‎src/java.base/share/classes/java/util/ResourceBundle.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3729,7 +3729,7 @@ private static String toPackageName(String bundleName) {
37293729

37303730
}
37313731

3732-
private static final boolean TRACE_ON = Boolean.valueOf(
3732+
private static final boolean TRACE_ON = Boolean.parseBoolean(
37333733
GetPropertyAction.privilegedGetProperty("resource.bundle.debug", "false"));
37343734

37353735
private static void trace(String format, Object... params) {

‎src/java.base/share/classes/sun/security/tools/keytool/Main.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -4161,18 +4161,18 @@ private static Date getStartDate(String s) throws IOException {
41614161
}
41624162
if (date != null) {
41634163
if (date.matches("\\d\\d\\d\\d\\/\\d\\d\\/\\d\\d")) {
4164-
c.set(Integer.valueOf(date.substring(0, 4)),
4165-
Integer.valueOf(date.substring(5, 7))-1,
4166-
Integer.valueOf(date.substring(8, 10)));
4164+
c.set(Integer.parseInt(date.substring(0, 4)),
4165+
Integer.parseInt(date.substring(5, 7))-1,
4166+
Integer.parseInt(date.substring(8, 10)));
41674167
} else {
41684168
throw ioe;
41694169
}
41704170
}
41714171
if (time != null) {
41724172
if (time.matches("\\d\\d:\\d\\d:\\d\\d")) {
4173-
c.set(Calendar.HOUR_OF_DAY, Integer.valueOf(time.substring(0, 2)));
4174-
c.set(Calendar.MINUTE, Integer.valueOf(time.substring(3, 5)));
4175-
c.set(Calendar.SECOND, Integer.valueOf(time.substring(6, 8)));
4173+
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time.substring(0, 2)));
4174+
c.set(Calendar.MINUTE, Integer.parseInt(time.substring(3, 5)));
4175+
c.set(Calendar.SECOND, Integer.parseInt(time.substring(6, 8)));
41764176
c.set(Calendar.MILLISECOND, 0);
41774177
} else {
41784178
throw ioe;

‎src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -605,7 +605,7 @@ String getCacheKey() {
605605
}
606606
}
607607

608-
private static final boolean TRACE_ON = Boolean.valueOf(
608+
private static final boolean TRACE_ON = Boolean.parseBoolean(
609609
GetPropertyAction.privilegedGetProperty("locale.resources.debug", "false"));
610610

611611
public static void trace(String format, Object... params) {

0 commit comments

Comments
 (0)
Please sign in to comment.