This rule flags any synchronization on instances of value-based classes. Synchronization on the following classes within your application is discouraged:
java.lang.Bytejava.lang.Shortjava.lang.Integerjava.lang.Longjava.lang.Floatjava.lang.Doublejava.lang.Booleanjava.lang.Characterjava.lang.Runtime.Versionjava.util.Optionaljava.util.OptionalIntjava.util.OptionalLongjava.util.OptionalDoublejava.time.Instantjava.time.LocalDatejava.time.LocalTimejava.time.LocalDateTimejava.time.ZonedDateTimejava.time.ZoneIdjava.time.OffsetTimejava.time.OffsetDateTimejava.time.ZoneOffsetjava.time.Durationjava.time.Periodjava.time.Yearjava.time.YearMonthjava.time.MonthDayjava.time.chrono.MinguoDatejava.time.chrono.HijrahDatejava.time.chrono.JapaneseDatejava.time.chrono.ThaiBuddhistDate
Also, synchronization should be avoided on the interface java.lang.ProcessHandle, its implementation classes, and
the implementation classes of the collection factories in java.util: List.of, List.copyOf, Set.of, Set.copyOf,
Map.of, Map.copyOf, Map.ofEntries, and Map.entry.
For more information on these jdk changes, see What's New in JDK 16.
For more information on the feature change, see Warnings for Value-Based Classes.