mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
generate equals/hashCode: pass wildcards as type arguments when needed (IDEA-127939)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
class A<T extends String, K> {
|
||||
Object[] a1;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
final A<?, ?> a = (A<?, ?>) o;
|
||||
|
||||
// Probably incorrect - comparing Object[] arrays with Arrays.equals
|
||||
if (!Arrays.equals(a1, a.a1)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(a1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
class A<T extends String, K> {
|
||||
Object[] a1;
|
||||
<caret>
|
||||
}
|
||||
Reference in New Issue
Block a user