Skip to content

Commit 37c0a13

Browse files
author
Andrey Turbanov
committed
8292350: Use static methods for hashCode/toString primitives
Reviewed-by: prr, rriggs, amenkov, jpai
1 parent 4453200 commit 37c0a13

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, 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
@@ -420,9 +420,9 @@ private static int getHashCode(final Component m) {
420420
final KeyStroke ks = mi.getAccelerator();
421421
if (ks != null) hashCode ^= ks.hashCode();
422422

423-
hashCode ^= Boolean.valueOf(mi.isVisible()).hashCode();
424-
hashCode ^= Boolean.valueOf(mi.isEnabled()).hashCode();
425-
hashCode ^= Boolean.valueOf(mi.isSelected()).hashCode();
423+
hashCode ^= Boolean.hashCode(mi.isVisible());
424+
hashCode ^= Boolean.hashCode(mi.isEnabled());
425+
hashCode ^= Boolean.hashCode(mi.isSelected());
426426

427427
} else if (m instanceof JSeparator) {
428428
hashCode ^= "-".hashCode();

src/java.management/share/classes/javax/management/openmbean/ArrayType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public int hashCode() {
745745
int value = 0;
746746
value += dimension;
747747
value += elementType.hashCode();
748-
value += Boolean.valueOf(primitiveArray).hashCode();
748+
value += Boolean.hashCode(primitiveArray);
749749
myHashCode = Integer.valueOf(value);
750750
}
751751

src/java.sql.rowset/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ private void writeInteger(int i) throws java.io.IOException {
569569
}
570570

571571
private void writeBoolean(boolean b) throws java.io.IOException {
572-
writer.write(Boolean.valueOf(b).toString());
572+
writer.write(Boolean.toString(b));
573573
}
574574

575575
private void writeFloat(float f) throws java.io.IOException {

src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/WizardDlg.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, 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
@@ -149,7 +149,7 @@ public void setPanels(Vector panels)
149149
this.panels = panels;
150150
panesPanel.removeAll();
151151
for(int i = 0; i < numCards; i++)
152-
panesPanel.add((JPanel)panels.elementAt(i), (Integer.valueOf(i)).toString());
152+
panesPanel.add((JPanel)panels.elementAt(i), Integer.toString(i));
153153

154154
validate();
155155
enableBackNextButtons();

0 commit comments

Comments
 (0)