Skip to content

Commit 3763243

Browse files
committed
equals() also needs hashCode()
1 parent 73df041 commit 3763243

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/jdbc/SQLFilterPanel.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ void set(Configuration o) {
338338
statements.clear();
339339
statements.addAll(o.statements);
340340
}
341+
342+
@Override
343+
public int hashCode() {
344+
int hash = 7;
345+
hash = 37 * hash + filter.hashCode();
346+
hash = 37 * hash + commands.hashCode();
347+
hash = 37 * hash + tables.hashCode();
348+
hash = 37 * hash + statements.hashCode();
349+
return hash;
350+
}
341351

342352
public boolean equals(Object o) {
343353
Configuration c = (Configuration)o;

visualvm/libs.profiler/profiler.attach/src/org/graalvm/visualvm/lib/profiler/attach/providers/TargetPlatformEnum.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public boolean equals(Object obj) {
9191
return ((TargetPlatformEnum) obj).jvmIndex == this.jvmIndex;
9292
}
9393

94+
@Override
95+
public int hashCode() {
96+
return jvmIndex;
97+
}
98+
9499
public static Iterator iterator() {
95100
List jvmList = new ArrayList(8);
96101
jvmList.add(JDK5);

0 commit comments

Comments
 (0)