Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8273168: Remove superfluous use of boxing in java.desktop #5313

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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 @@ private void mergeNativeTree(Node root)
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)]);
@@ -1721,8 +1721,7 @@ public static Font decode(String str) {

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;
}
@@ -763,13 +763,13 @@ void setBaseFontSize(String size) {

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 @@ float getPointSize(String size, StyleSheet ss) {
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 @@ Object parseHtmlValue(String value) {
*/
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 @@ Object parseCssValue(String value) {
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) {
@@ -1262,7 +1262,7 @@ public static int getIntegerAttributeValue(AttributeSet attr,
String istr = (String) attr.getAttribute(key);
if (istr != null) {
try {
value = Integer.valueOf(istr).intValue();
value = Integer.parseInt(istr);
} catch (NumberFormatException e) {
value = def;
}
@@ -246,7 +246,7 @@ public void registerTextFlavorProperties(String nat, String charset,
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);
}
@@ -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) {
@@ -317,8 +317,8 @@ protected int platformFontCount(Font font, String str) {
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;
}