Skip to content
Permalink
Browse files
8273168: Remove superfluous use of boxing in java.desktop
Reviewed-by: aivanov
  • Loading branch information
turbanoff authored and aivanov-jdk committed Sep 7, 2021
1 parent 270a9d9 commit 708407eddc9d52c01de02e3986c05e1c6225fa85
Showing 7 changed files with 17 additions and 18 deletions.
@@ -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;
}

1 comment on commit 708407e

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 708407e Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.