openrewrite / rewrite

Automated mass refactoring of source code.
https://docs.openrewrite.org
Apache License 2.0
2.09k stars 312 forks source link

RemoveObjectsIsNull also rewrites boxed ints #3915

Closed koppor closed 7 months ago

koppor commented 7 months ago

We have an issue in the code, where we have Objects.isNull(i), where i is an int.

Then, Java boxes the integer. when i != null is written, the auto boxing does not work and leads to a compile error:

operand types for binary operator '!='

Wish: when the method parameter type is not an object, do not rewrite.

See https://github.com/JabRef/jabref/pull/10788

timtebeek commented 7 months ago

Picked up in