mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
[serializer/performance] fixed broken hashCode() function
'parameterValues' was usually emptySet() so parameterValues.hashCode() returned 0 which caused this hashCode() method to return 0 nothing but collisions when used as key in maps! duh! Signed-off-by: Moritz Eysholdt <moritz.eysholdt@typefox.io>
This commit is contained in:
parent
17a85f155d
commit
93ca0d1487
1 changed files with 4 additions and 4 deletions
|
@ -363,13 +363,13 @@ public abstract class SerializationContext implements ISerializationContext {
|
|||
EClass type = getType();
|
||||
int result = 1;
|
||||
if (rule != null)
|
||||
result *= rule.hashCode();
|
||||
result = 31 * result + rule.hashCode();
|
||||
if (action != null)
|
||||
result *= action.hashCode() * 7;
|
||||
result = 31 * result + action.hashCode();
|
||||
if (type != null)
|
||||
result *= type.hashCode() * 19;
|
||||
result = 31 * result + type.hashCode();
|
||||
if (parameterValues != null)
|
||||
result *= parameterValues.hashCode() * 31;
|
||||
result = 31 * result + parameterValues.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue