openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
111 stars 75 forks source link

Replace `ArrayStoreException` with `TypeNotPresentException` in try/catch using `Class.getAnnotation()` #613

Closed BhavanaPidapa closed 6 days ago

BhavanaPidapa commented 1 week ago

What's changed?

This PR contains recipe - org.openrewrite.java.migrate.ArrayStoreExceptionToTypeNotPresentException Rule: image

What's your motivation?

This custom recipe replaces catch blocks for ArrayStoreException around getAnnotation() with TypeNotPresentException to ensure compatibility with Java 11+.

Anyone you would like to review specifically?

@timtebeek @cjobinabo

Checklist