From 7cb03bbab6bb0feaff8159ed90a6c818fdcdefc1 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 11 Jan 2025 08:45:51 -0800 Subject: [PATCH] Use Spotless version 7 --- build.gradle | 2 +- src/main/java/org/plumelib/util/CollectionsPlume.java | 9 ++++++--- .../org/plumelib/util/IdentityMostlySingletonSet.java | 2 +- src/main/java/org/plumelib/util/MostlySingletonSet.java | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 94643b63..40ca659d 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { // Code formatting; defines targets "spotlessApply" and "spotlessCheck" // Version 6.14.0 and later requires JRE 11+, but version 6.13.0 doesn't work on JRE 21. - id 'com.diffplug.spotless' version '6.25.0' + id 'com.diffplug.spotless' version '7.0.1' // Error Prone linter id('net.ltgt.errorprone') version '4.1.0' diff --git a/src/main/java/org/plumelib/util/CollectionsPlume.java b/src/main/java/org/plumelib/util/CollectionsPlume.java index 93678cde..a2db4b15 100644 --- a/src/main/java/org/plumelib/util/CollectionsPlume.java +++ b/src/main/java/org/plumelib/util/CollectionsPlume.java @@ -538,7 +538,8 @@ List transform( "signedness", // problem with clone() "nullness" // generics problem }) - public static > @PolyNull C cloneElements(@PolyNull C orig) { + public static > + @PolyNull C cloneElements(@PolyNull C orig) { if (orig == null) { return null; } @@ -562,7 +563,8 @@ List transform( * @return a copy of {@code orig}, as described above */ @SuppressWarnings({"signedness", "nullness:argument"}) // problem with clone() - public static , C extends @Nullable Collection> @PolyNull C deepCopy(@PolyNull C orig) { + public static , C extends @Nullable Collection> + @PolyNull C deepCopy(@PolyNull C orig) { if (orig == null) { return null; } @@ -1791,7 +1793,8 @@ public static int mapCapacity(Map m) { * @return a copy of {@code orig}, as described above */ @SuppressWarnings({"nullness", "signedness"}) // generics problem with clone - public static , M extends @Nullable Map> @PolyNull M deepCopyValues(@PolyNull M orig) { + public static , M extends @Nullable Map> + @PolyNull M deepCopyValues(@PolyNull M orig) { if (orig == null) { return null; } diff --git a/src/main/java/org/plumelib/util/IdentityMostlySingletonSet.java b/src/main/java/org/plumelib/util/IdentityMostlySingletonSet.java index 958745b3..f8687a71 100644 --- a/src/main/java/org/plumelib/util/IdentityMostlySingletonSet.java +++ b/src/main/java/org/plumelib/util/IdentityMostlySingletonSet.java @@ -46,7 +46,7 @@ public boolean add(@GuardSatisfied IdentityMostlySingletonSet this, @FindDist return false; } makeNonSingleton(); - // fall through + // fall through case ANY: assert set != null : "@AssumeAssertion(nullness): set initialized before"; return set.add(e); diff --git a/src/main/java/org/plumelib/util/MostlySingletonSet.java b/src/main/java/org/plumelib/util/MostlySingletonSet.java index 924a7afe..0e8b6638 100644 --- a/src/main/java/org/plumelib/util/MostlySingletonSet.java +++ b/src/main/java/org/plumelib/util/MostlySingletonSet.java @@ -47,7 +47,7 @@ public boolean add(@GuardSatisfied MostlySingletonSet this, T e) { return false; } makeNonSingleton(); - // fall through + // fall through case ANY: assert set != null : "@AssumeAssertion(nullness): ANY => value != null"; return set.add(e);