jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject UnmodifiableJMeterVariables implementation
Date Sun, 23 Jul 2017 14:45:33 GMT
Hi all,

I wonder if the implementation for 'equals', 'hashCode' and possibly 
'toString' of UnmodifiableJMeterVariables are correct.

I think - for symmetry and since they are not the same classes - the 
methods 'hashCode' and 'equals' should include a test for the class.

Currently with:

  JMeterVariables vars = somehowGetThem();
  UnmodifiableJMeterVariables unmodifiable = new 
UnmodifiableJMeterVariables(vars);

we have

  unmodifiable.equals(vars) == true
  vars.equals(unmodifiable) != true

and

  unmodifiable.hashCode() == vars.hashCode()

I think we should have

  unmodifiable.equals(vars) != true
  vars.equals(unmodifiable) != true

and

  unmodifiable.hashCode() != vars.hashCode()

What do you think?

  Felix



Mime
View raw message