Skip to content

Commit 1bded71

Browse files
committed
8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hashCode
Reviewed-by: prr, serb
1 parent 89242ee commit 1bded71

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private void sync() {
324324

325325
@Override
326326
public int hashCode() {
327-
int bits = (int)(currentEncodedProperties ^ (currentEncodedProperties >>> 32));
327+
int bits = Long.hashCode(currentEncodedProperties);
328328
bits ^= nativeMap.hashCode();
329329
bits ^= changes.hashCode();
330330
return bits;

src/java.desktop/macosx/classes/apple/laf/JRSUIState.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public boolean is(Property property) {
9090

9191
@Override
9292
public int hashCode() {
93-
return (int)(encodedState ^ (encodedState >>> 32)) ^ getClass().hashCode();
93+
return Long.hashCode(encodedState) ^ getClass().hashCode();
9494
}
9595

9696
public static class AnimationFrameState extends JRSUIState {
@@ -183,8 +183,7 @@ public boolean equals(final Object obj) {
183183

184184
@Override
185185
public int hashCode() {
186-
final long bits = Double.doubleToRawLongBits(value);
187-
return super.hashCode() ^ (int)bits ^ (int)(bits >>> 32);
186+
return super.hashCode() ^ Double.hashCode(value);
188187
}
189188
}
190189

@@ -258,7 +257,7 @@ public boolean equals(final Object obj) {
258257
@Override
259258
public int hashCode() {
260259
final long bits = Double.doubleToRawLongBits(thumbProportion) ^ Double.doubleToRawLongBits(thumbStart);
261-
return super.hashCode() ^ (int)bits ^ (int)(bits >>> 32);
260+
return super.hashCode() ^ Long.hashCode(bits);
262261
}
263262
}
264263
}

0 commit comments

Comments
 (0)