openrewrite / rewrite-static-analysis

OpenRewrite recipes for identifying and fixing static analysis issues.
Apache License 2.0
32 stars 54 forks source link

Adjust `CatchClauseOnlyRethrows` to work with C# #395

Open Laurens-W opened 1 day ago

Laurens-W commented 1 day ago

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