rewrite-static-analysis icon indicating copy to clipboard operation
rewrite-static-analysis copied to clipboard

Enhance FinalClass with new exclusion options and includeNeverExtended option

Open e5LA opened this issue 3 months ago • 0 comments

What's changed?

  • Added includeNeverExtended option that allows to finalize classes that are never extended in the codebase
  • Added excludePackages option for package pattern exclusions (e.g., com.example.api.*)
  • Added excludeAnnotations option to exclude classes with specified annotations (annotations like: @Deprecated, Deprecated, @java.lang.Deprecated)
  • Fixed inheritance chain bug

What's your motivation?

  • Following up on https://github.com/openrewrite/rewrite-static-analysis/pull/646#issuecomment-3218095322
  • Covering as well: https://github.com/openrewrite/rewrite-static-analysis/issues/729

@timtebeek - FYI.

Checklist

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

e5LA avatar Sep 08 '25 17:09 e5LA