daniellansun opened a new pull request, #3266: URL: https://github.com/apache/groovy/pull/3266
## Summary Guards four Sonar leak-period bugs in static type checking / static compilation: | Sonar key | Rule | Area | | --- | --- | --- | | AaGyaIdoscRIFX8Ad1JO | javabugs:S2259 | `StaticTypeCheckingVisitor.addPatternSwitchWarning` | | AaGHUGExkiEQWtpRQeFb | javabugs:S2259 | `StaticTypeCheckingVisitor.publishInferredReturnType` | | AaGGaMYw77HhxD8zwabf | javabugs:S2259 | `StaticTypeCheckingVisitor.nextCaseLabel` | | AaGwPANy8T2UUTamq79s | java:S6218 | `StaticTypesMethodReferenceExpressionWriter.Adaptation` | Pattern-switch warnings now use the same collector fallback as `addError`, so a popped collector no longer aborts the visit. Fall-through analysis no longer dereferences a missing enclosing switch expression. Inferred return types are published only when a list was recorded. The static-compilation method-reference adapter compares its parameter array by content. ## Links - [Sonar leak-period BUG filter](https://sonarcloud.io/project/issues?id=apache_groovy&s=IMPACT_RANK&severities=BLOCKER%2CCRITICAL%2CMAJOR%2CMINOR&sinceLeakPeriod=true&issueStatuses=OPEN%2CCONFIRMED&types=BUG) - [Compare](https://github.com/apache/groovy/compare/master...daniellansun:groovy:STC-sonar-npe-guards?expand=1) ## Test plan - [x] `CustomErrorCollectorSTCTest` covers the collector / pattern-switch path - [ ] Build-and-test / Lint / CodeQL on the PR -- 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]
