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

8268764: Use Long.hashCode() instead of int-cast where applicable #4491

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -103,7 +103,7 @@ public static DLSID read(RIFFReader riff) throws IOException {

@Override
public int hashCode() {
return (int)i1;
return Long.hashCode(i1);
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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
@@ -91,7 +91,7 @@ public static GUID read(RIFFReader riff) throws IOException {

@Override
public int hashCode() {
return (int) i1;
return Long.hashCode(i1);
}

@Override
@@ -199,8 +199,9 @@ public static ObjID read(ObjectInput in) throws IOException {
*
* @return the hash code value for this object identifier
*/
@Override
public int hashCode() {
return (int) objNum;
return Long.hashCode(objNum);
}

/**
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
@@ -175,7 +175,7 @@ public boolean equals(Object obj) {

@Override
public int hashCode() {
return (int) getMetaspaceMethod();
return Long.hashCode(getMetaspaceMethod());
}

/**
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@@ -51,8 +51,9 @@ public boolean equals(Object obj) {
}
}

@Override
public int hashCode() {
return (int)ref();
return Long.hashCode(ref());
}

public int compareTo(Field field) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@@ -95,8 +95,9 @@ public boolean equals(Object obj) {
}
}

@Override
public int hashCode() {
return (int)ref();
return Long.hashCode(ref());
}

public final List<Location> allLineLocations()
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@@ -155,8 +155,9 @@ public boolean equals(Object obj) {
}
}

@Override
public int hashCode() {
return(int)ref();
return Long.hashCode(ref());
}

public Type type() {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@@ -152,8 +152,9 @@ public boolean equals(Object obj) {
}
}

@Override
public int hashCode() {
return(int)ref();
return Long.hashCode(ref());
}

public int compareTo(ReferenceType object) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -100,7 +100,8 @@ public boolean equals(Object o) {
*
* @return a hash code for this {@code NTNumericCredential}.
*/
@Override
public int hashCode() {
return (int)this.impersonationToken;
return Long.hashCode(this.impersonationToken);
}
}