You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "vlsi (via GitHub)" <gi...@apache.org> on 2023/05/17 14:48:29 UTC

[GitHub] [jmeter] vlsi opened a new issue, #5923: Avoid relying on System#identityHashCode for Map and Collection properties

vlsi opened a new issue, #5923:
URL: https://github.com/apache/jmeter/issues/5923

   ### Use case
   
   JMeter seems to rely on `hashCode` uniqueness:
   
   The hashcode violating code is https://github.com/apache/jmeter/blob/c7279348335b820c35ee570462cb2e0b4eb1c370/src/core/src/main/java/org/apache/jmeter/testelement/property/AbstractProperty.java#L368-L381
     In other words, it generates property names based on `item.hashCode()`.
     One more significant issue is that `TestCompiler` produces wrong results since `TestElement` `equals`  is inconsistent with `hashCode`: https://github.com/apache/jmeter/blob/31281636281e03fc3379677b24052fe612e2e7b5/src/core/src/main/java/org/apache/jmeter/testelement/AbstractTestElement.java#L116-L132
   
     It causes various `Map<TestElement, ...>`, `Map<Sampler, ...>`  behave wrong. For instance, `TestCompiler` fails to property associate `SamplePackage` with the corresponding elements: https://github.com/apache/jmeter/blob/b3b2eecc396d1fc38a4c4d1cf89e3c7ade1d95d7/src/core/src/main/java/org/apache/jmeter/threads/TestCompiler.java#L72-L75
   
   ### Possible solution
   
   _No response_
   
   ### Possible workarounds
   
   _No response_
   
   ### JMeter Version
   
   5.5
   
   ### Java Version
   
   _No response_
   
   ### OS Version
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org