hhu-stups / prob-issues

ProB issues (for probcli, ProB Tcl/Tk, ProB2, ProB2UI)
6 stars 0 forks source link

Equality / Hashcode on AbstractEvalElement broken #343

Closed pkoerner closed 5 months ago

pkoerner commented 5 months ago

Neither de.prob.animator.domainobjects.AbstractEvalElement nor the ClassicalB or EventB classes implement Equality or HashCode. This renders it overly cumbersome to retrieve the values of state variables from a state object (e.g., via getVariableValues(...)) if the variable name is known.

The docstring of AbstractEvalElement promises correct implementation of hashCode() and equals(obj): https://github.com/hhu-stups/prob2_kernel/blob/develop/prob-java/src/main/java/de/prob/animator/domainobjects/AbstractEvalElement.java#L8-L12

It seems like it was once implemented but removed in this commit: https://github.com/hhu-stups/prob2_kernel/commit/fcb07db9f0c10ebd05e07f8673c9ee7bfc68159e#diff-dd1fef13065939f6b4e78553a6bef04ee459589cb132030df42b6914ddd84efc

iTitus commented 5 months ago

Added as of https://github.com/hhu-stups/prob2_kernel/commit/edbb1c6b2835dfb823af79d4734011746d57c0f7