rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

`Comparators` should be `Serializable`.`RSPEC-2063`

Open yeikel opened this issue 2 years ago • 1 comments

https://rules.sonarsource.com/java/RSPEC-2063

yeikel avatar May 04 '22 15:05 yeikel

This should also schedule AddSerialVersionUidToSerializable since we already have a recipe in place to do this work.

This will also need to consider any instance variables in the comparator (to make sure those are serializable).

You could probably call this method and make any non-serializable fields as transient:

https://github.com/openrewrite/rewrite/blob/main/rewrite-java/src/main/java/org/openrewrite/java/cleanup/FixSerializableFields.java

tkvangorder avatar May 04 '22 23:05 tkvangorder