Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust CatchClauseOnlyRethrows to work with C# #395

Merged
merged 12 commits into from
Nov 28, 2024

Conversation

Laurens-W
Copy link
Contributor

What's changed?

Take into account a possible J.Empty expression for a throws statement

Anyone you would like to review specifically?

@OlegDokuka @knutwannheden @timtebeek

Any additional context

In C# an implicit throw like this

catch (Exception ex)
{
    throw;
}

is valid code and it's mapped to a J.Empty expression

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

@Laurens-W Laurens-W added enhancement New feature or request recipe labels Nov 26, 2024
@Laurens-W Laurens-W self-assigned this Nov 26, 2024
@Laurens-W Laurens-W marked this pull request as ready for review November 27, 2024 12:13
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Approved after my changes; but the one question about that J.Empty remains.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Laurens-W Laurens-W merged commit 14f7766 into main Nov 28, 2024
2 checks passed
@Laurens-W Laurens-W deleted the csharp-catch-only-rethrow branch November 28, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request recipe
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants