Repository navigation
Conversation
…TestManager Sonar flagged two catch blocks in AsyncAPITestManager#runTest as catching Throwable. Catching Throwable swallows JVM-fatal Errors (OutOfMemoryError, StackOverflowError) that should be allowed to propagate, so narrow both to Exception. - Outer catch around invokeAny: rename t -> e and update log message and test-return reason to use the renamed variable. - Finally-block catch around messageConsumptionTask.close(): the variable is unused (best-effort cleanup), so use the unnamed pattern '_' (JEP 456, available since Java 22), matching the convention introduced in microcks#2059. No behavioural change for the normal exception path; JVM Errors will now propagate instead of being silently turned into FAILURE test returns, which is the intended behaviour. Signed-off-by: Git-HimanshuRathi <[email protected]>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
minions/async—AsyncAPITestManager#runTest: outer catch aroundexecutorService.invokeAnynarrowed fromThrowabletoException; variable renamedt→eand the log message and test-return reason text updated to match (rule:java:S1181, L141).minions/async—AsyncAPITestManager#runTest: finally-block catch aroundmessageConsumptionTask.close()narrowed fromThrowabletoException. The variable is unused (best-effort cleanup), so the unnamed pattern_is used (JEP 456, Java 22+), matching the convention introduced in chore: #2058 Use unnamed patterns in commons exception handlers #2059 (rule:java:S1181, L150).Exceptionpath. JVMErrors will now propagate instead of being silently turned intoFAILUREtest returns, which is the intended behaviour for fatal conditions likeOutOfMemoryError.mvn spotless:check -pl minions/asyncpasses locally.Related issue(s)
See also #2058