Skip to content

Conversation

@Laurens-W
Copy link
Contributor

@Laurens-W Laurens-W commented Nov 12, 2025

Add a recipe to remediate the sonar finding in regards to casting as a result of running ParameterizedLogging

What's changed?

Reduced the casting done in Parameterized logging to situations where otherwise ambiguity exists.
Added an additional recipe to remediate the follow-up "false positive" finding (Redundant casting)

What's your motivation?

Sometimes running ParameterizedLogging results in new redundant cast findings showing up

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Add a recipe to remediate the sonar finding in regards to casting as a result of running ParameterizedLogging
@Laurens-W Laurens-W self-assigned this Nov 12, 2025
@Laurens-W Laurens-W added the enhancement New feature or request label Nov 12, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Nov 12, 2025
@Laurens-W
Copy link
Contributor Author

Mostly still Claude's work at this point, haven't gone through a first self review

@Laurens-W Laurens-W marked this pull request as ready for review November 13, 2025 12:53
@Laurens-W Laurens-W requested a review from timtebeek November 13, 2025 12:54
@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Nov 18, 2025
@Laurens-W Laurens-W merged commit c182532 into main Nov 18, 2025
2 checks passed
@Laurens-W Laurens-W deleted the additional-csa-logging-recipe branch November 18, 2025 13:38
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Nov 18, 2025
@Laurens-W Laurens-W changed the title Reduce casting to Object to situations that are ambiguous. Apply do no harm to ParameterizedLogging by not changing statements with exceptions Nov 18, 2025
mergify bot added a commit to robfrank/linklift that referenced this pull request Nov 24, 2025
…rom 3.18.1 to 3.19.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-logging-frameworks](https://github.com/openrewrite/rewrite-logging-frameworks) from 3.18.1 to 3.19.0.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-logging-frameworks's releases](https://github.com/openrewrite/rewrite-logging-frameworks/releases).*

> 3.19.0
> ------
>
> What's Changed
> --------------
>
> * Apply do no harm to `ParameterizedLogging` by not changing statements with exceptions by [`@​Laurens-W`](https://github.com/Laurens-W) in [openrewrite/rewrite-logging-frameworks#264](https://redirect.github.com/openrewrite/rewrite-logging-frameworks/pull/264)
>
> **Full Changelog**: <openrewrite/rewrite-logging-frameworks@v3.18.1...v3.19.0>


Commits

* [`b8b459c`](openrewrite/rewrite-logging-frameworks@b8b459c) OpenRewrite recipe best practices
* [`c182532`](openrewrite/rewrite-logging-frameworks@c182532) Reduce casting to Object to situations that are ambiguous. ([#264](https://redirect.github.com/openrewrite/rewrite-logging-frameworks/issues/264))
* See full diff in [compare view](openrewrite/rewrite-logging-frameworks@v3.18.1...v3.19.0)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-logging-frameworks&package-manager=maven&previous-version=3.18.1&new-version=3.19.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants