Skip to content

chore: #2058 Suppress java:S1206 on StringToStringsMap SoapUI port - #2083

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
Heyy-Himanshuu:chore/2058-suppress-soapui-port-sonar-finding
May 6, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
Heyy-Himanshuu:chore/2058-suppress-soapui-port-sonar-finding

Conversation

@Heyy-Himanshuu

Copy link
Copy Markdown
Contributor

StringToStringsMap is a manual port of com.eviware.soapui.support.types.StringToStringsMap, kept in-tree so SoapUI scripts hosted by Microcks behave the same way as in real SoapUI without taking a dependency on the outdated SoapUI library.

The upstream class (e.g. oysteing/soapui copy) overrides equals(Object) with a mode switch driven by an equalsOnThis flag and does not override hashCode. That equals/hashCode contract violation is exactly what Sonar's java:S1206 flags here.

Replacing #2068, which tried to fix the contract by overriding hashCode. As @lbroudoux pointed out on that PR, fixing it would make Microcks-hosted SoapUI scripts diverge from real SoapUI — the opposite of this file's stated purpose. The right move is to suppress the Sonar finding with explanation, not to fix the code.

Description

  • Added @SuppressWarnings("java:S1206") to the existing equals override, along with an inline comment that points future readers to the SoapUI port rationale.
  • Strengthened the class Javadoc with an explicit warning: any apparent bug or fragility here should first be checked against the SoapUI source, and if the upstream behaves the same way the finding should be suppressed rather than fixed.
  • No behavioural change.

Related issue(s)

See also #2058. Replaces #2068.

… port

StringToStringsMap is a manual port of
com.eviware.soapui.support.types.StringToStringsMap, kept in the tree
so SoapUI scripts hosted by Microcks behave the same way as in real
SoapUI without us having to depend on the outdated SoapUI library.

The upstream class (e.g. https://github.com/oysteing/soapui/blob/
master/src/java/com/eviware/soapui/support/types/StringToStringsMap.java)
overrides equals(Object) with a mode switch driven by an equalsOnThis
flag and does not override hashCode, so the equals/hashCode contract
is technically violated when equalsOnThis is true. That violation is
exactly what Sonar's java:S1206 flags here.

Replacing microcks#2068, which tried to fix the contract by overriding
hashCode. As @lbroudoux pointed out on that PR, fixing it would make
Microcks-hosted SoapUI scripts diverge from real SoapUI - the
opposite of this file's stated purpose. The right move is to
suppress the Sonar finding with explanation, not to fix the code.

Concretely:

- Add @SuppressWarnings("java:S1206") to the existing equals override
  along with an inline comment that points future readers to the
  SoapUI port rationale.
- Strengthen the class Javadoc with an explicit warning: any apparent
  bug or fragility here should first be checked against the SoapUI
  source, and if the upstream behaves the same way the finding should
  be suppressed rather than fixed.

No behavioural change.

Signed-off-by: Git-HimanshuRathi <[email protected]>

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks.

@lbroudoux lbroudoux added kind/task java Pull requests that update Java code labels May 6, 2026
@lbroudoux lbroudoux added this to the 1.15.0 milestone May 6, 2026
@lbroudoux
lbroudoux merged commit f3e2622 into microcks:master May 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code kind/task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants