Skip to content

Commit

Permalink
Use Spotless version 7
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Jan 11, 2025
1 parent e228a03 commit 7cb03bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/org/plumelib/util/CollectionsPlume.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ List<TO> transform(
"signedness", // problem with clone()
"nullness" // generics problem
})
public static <T extends @Nullable Object, C extends @Nullable Collection<T>> @PolyNull C cloneElements(@PolyNull C orig) {
public static <T extends @Nullable Object, C extends @Nullable Collection<T>>
@PolyNull C cloneElements(@PolyNull C orig) {
if (orig == null) {
return null;
}
Expand All @@ -562,7 +563,8 @@ List<TO> transform(
* @return a copy of {@code orig}, as described above
*/
@SuppressWarnings({"signedness", "nullness:argument"}) // problem with clone()
public static <T extends @Nullable DeepCopyable<T>, C extends @Nullable Collection<T>> @PolyNull C deepCopy(@PolyNull C orig) {
public static <T extends @Nullable DeepCopyable<T>, C extends @Nullable Collection<T>>
@PolyNull C deepCopy(@PolyNull C orig) {
if (orig == null) {
return null;
}
Expand Down Expand Up @@ -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 <K, V extends @Nullable DeepCopyable<V>, M extends @Nullable Map<K, V>> @PolyNull M deepCopyValues(@PolyNull M orig) {
public static <K, V extends @Nullable DeepCopyable<V>, M extends @Nullable Map<K, V>>
@PolyNull M deepCopyValues(@PolyNull M orig) {
if (orig == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public boolean add(@GuardSatisfied IdentityMostlySingletonSet<T> this, @FindDist
return false;
}
makeNonSingleton();
// fall through
// fall through
case ANY:
assert set != null : "@AssumeAssertion(nullness): set initialized before";
return set.add(e);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/plumelib/util/MostlySingletonSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public boolean add(@GuardSatisfied MostlySingletonSet<T> this, T e) {
return false;
}
makeNonSingleton();
// fall through
// fall through
case ANY:
assert set != null : "@AssumeAssertion(nullness): ANY => value != null";
return set.add(e);
Expand Down

0 comments on commit 7cb03bb

Please sign in to comment.