8292350: Use static methods for hashCode/toString primitives

Reviewed-by: prr, rriggs, amenkov, jpai
This commit is contained in:
Andrey Turbanov 2022-08-20 10:05:48 +00:00
parent 44532009ff
commit 37c0a13647
4 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2022, 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
@ -420,9 +420,9 @@ final class ScreenMenu extends Menu
final KeyStroke ks = mi.getAccelerator();
if (ks != null) hashCode ^= ks.hashCode();
hashCode ^= Boolean.valueOf(mi.isVisible()).hashCode();
hashCode ^= Boolean.valueOf(mi.isEnabled()).hashCode();
hashCode ^= Boolean.valueOf(mi.isSelected()).hashCode();
hashCode ^= Boolean.hashCode(mi.isVisible());
hashCode ^= Boolean.hashCode(mi.isEnabled());
hashCode ^= Boolean.hashCode(mi.isSelected());
} else if (m instanceof JSeparator) {
hashCode ^= "-".hashCode();

View File

@ -745,7 +745,7 @@ public class ArrayType<T> extends OpenType<T> {
int value = 0;
value += dimension;
value += elementType.hashCode();
value += Boolean.valueOf(primitiveArray).hashCode();
value += Boolean.hashCode(primitiveArray);
myHashCode = Integer.valueOf(value);
}

View File

@ -569,7 +569,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
}
private void writeBoolean(boolean b) throws java.io.IOException {
writer.write(Boolean.valueOf(b).toString());
writer.write(Boolean.toString(b));
}
private void writeFloat(float f) throws java.io.IOException {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, 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
@ -149,7 +149,7 @@ public class WizardDlg extends JDialog
this.panels = panels;
panesPanel.removeAll();
for(int i = 0; i < numCards; i++)
panesPanel.add((JPanel)panels.elementAt(i), (Integer.valueOf(i)).toString());
panesPanel.add((JPanel)panels.elementAt(i), Integer.toString(i));
validate();
enableBackNextButtons();