costajohnt opened a new pull request, #16592:
URL: https://github.com/apache/dubbo/pull/16592

   ## What is the purpose of the change?
   
   In `PathExpressionTest`, the `Equals` feature checks `path.hashCode() == 
other.hashCode()` inside an `if (result) { }` block in `expect:`. Spock only 
treats top-level expressions in `expect:`/`then:` as conditions, so that 
comparison was evaluated and discarded and the hashCode contract was never 
checked. This rewrites it as a top-level implication, `!result || 
path.hashCode() == other.hashCode()`, so equal paths must have equal hash codes.
   
   Test only, no production change. `PathExpressionTest` passes (109 tests). To 
confirm the check now runs, flipping it to `!=` makes the `/one` row fail.
   
   No related issue; it's a one-line test fix. Found while testing a Groovy 
linter on the repo.
   
   ## Checklist
   - [x] Write a pull request description that is detailed enough to understand 
what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction.
   - [x] Make sure gitHub actions can pass.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • [PR] Assert hashCode in P... costajohnt (via GitHub) via notifications

Reply via email to