mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
generate equals/hashCode: support deep arrays equals for java > 1.5 (IDEA-131533)
This commit is contained in:
@@ -11,7 +11,7 @@ class Test {
|
||||
|
||||
final Test test = (Test) o;
|
||||
|
||||
// Compare nested arrays - values of myIIs here
|
||||
if (!Arrays.deepEquals(myIIs, test.myIIs)) return false;
|
||||
if (!Arrays.equals(myIs, test.myIs)) return false;
|
||||
// Probably incorrect - comparing Object[] arrays with Arrays.equals
|
||||
if (!Arrays.equals(myOs, test.myOs)) return false;
|
||||
@@ -21,7 +21,8 @@ class Test {
|
||||
|
||||
public int hashCode() {
|
||||
int result = myOs != null ? Arrays.hashCode(myOs) : 0;
|
||||
result = 31 * result + (myIIs != null ? Arrays.hashCode(myIIs) : 0);
|
||||
result = 31 * result + (myIIs != null ? // Probably incorrect - hashCode for high dimension arrays with Arrays.hashCode
|
||||
Arrays.hashCode(myIIs) : 0);
|
||||
result = 31 * result + (myIs != null ? Arrays.hashCode(myIs) : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user