8273168: Remove superfluous use of boxing in java.desktop

Reviewed-by: aivanov
This commit is contained in:
Andrey Turbanov 2021-09-07 21:12:35 +00:00 committed by Alexey Ivanov
parent 270a9d9293
commit 708407eddc
7 changed files with 17 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1318,7 +1318,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
IHDR_width = getIntAttribute(node, "width");
IHDR_height = getIntAttribute(node, "height");
IHDR_bitDepth =
Integer.valueOf(IHDR_bitDepths[
Integer.parseInt(IHDR_bitDepths[
getEnumeratedAttribute(node,
"bitDepth",
IHDR_bitDepths)]);

View File

@ -1721,8 +1721,7 @@ public class Font implements java.io.Serializable
if (sizeIndex > 0 && sizeIndex+1 < strlen) {
try {
fontSize =
Integer.valueOf(str.substring(sizeIndex+1)).intValue();
fontSize = Integer.parseInt(str.substring(sizeIndex+1));
if (fontSize <= 0) {
fontSize = 12;
}

View File

@ -763,13 +763,13 @@ public class CSS implements Serializable {
if (size != null) {
if (size.startsWith("+")) {
relSize = Integer.valueOf(size.substring(1)).intValue();
relSize = Integer.parseInt(size.substring(1));
setBaseFontSize(baseFontSize + relSize);
} else if (size.startsWith("-")) {
relSize = -Integer.valueOf(size.substring(1)).intValue();
relSize = -Integer.parseInt(size.substring(1));
setBaseFontSize(baseFontSize + relSize);
} else {
setBaseFontSize(Integer.valueOf(size).intValue());
setBaseFontSize(Integer.parseInt(size));
}
}
}
@ -961,13 +961,13 @@ public class CSS implements Serializable {
ss = getStyleSheet(ss);
if (size != null) {
if (size.startsWith("+")) {
relSize = Integer.valueOf(size.substring(1)).intValue();
relSize = Integer.parseInt(size.substring(1));
return getPointSize(baseFontSize + relSize, ss);
} else if (size.startsWith("-")) {
relSize = -Integer.valueOf(size.substring(1)).intValue();
relSize = -Integer.parseInt(size.substring(1));
return getPointSize(baseFontSize + relSize, ss);
} else {
absSize = Integer.valueOf(size).intValue();
absSize = Integer.parseInt(size);
return getPointSize(absSize, ss);
}
}
@ -2137,11 +2137,11 @@ public class CSS implements Serializable {
*/
int baseFontSize = getBaseFontSize();
if (value.charAt(0) == '+') {
int relSize = Integer.valueOf(value.substring(1)).intValue();
int relSize = Integer.parseInt(value.substring(1));
fs.value = baseFontSize + relSize;
fs.index = true;
} else if (value.charAt(0) == '-') {
int relSize = -Integer.valueOf(value.substring(1)).intValue();
int relSize = -Integer.parseInt(value.substring(1));
fs.value = baseFontSize + relSize;
fs.index = true;
} else {
@ -2533,7 +2533,7 @@ public class CSS implements Serializable {
LengthValue lv;
try {
// Assume pixels
float absolute = Float.valueOf(value).floatValue();
float absolute = Float.parseFloat(value);
lv = new LengthValue();
lv.span = absolute;
} catch (NumberFormatException nfe) {

View File

@ -1262,7 +1262,7 @@ public class HTML {
String istr = (String) attr.getAttribute(key);
if (istr != null) {
try {
value = Integer.valueOf(istr).intValue();
value = Integer.parseInt(istr);
} catch (NumberFormatException e) {
value = def;
}

View File

@ -246,7 +246,7 @@ public abstract class DataTransferer {
nativeEOLNs.put(format, eoln);
}
if (terminators != null && terminators.length() != 0) {
Integer iTerminators = Integer.valueOf(terminators);
int iTerminators = Integer.parseInt(terminators);
if (iTerminators > 0) {
nativeTerminators.put(format, iTerminators);
}

View File

@ -120,7 +120,7 @@ public class PrintServiceLookupProvider extends PrintServiceLookup
if (refreshTimeStr != null) {
try {
minRefreshTime = (Integer.valueOf(refreshTimeStr)).intValue();
minRefreshTime = Integer.parseInt(refreshTimeStr);
} catch (NumberFormatException e) {
}
if (minRefreshTime < DEFAULT_MINREFRESH) {

View File

@ -317,8 +317,8 @@ final class WPathGraphics extends PathGraphics {
private static boolean isXP() {
String osVersion = System.getProperty("os.version");
if (osVersion != null) {
Float version = Float.valueOf(osVersion);
return (version.floatValue() >= 5.1f);
float version = Float.parseFloat(osVersion);
return version >= 5.1f;
} else {
return false;
}