Skip to content

Commit

Permalink
Spotless formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Jan 8, 2025
1 parent 9c5040c commit 49bbec1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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 49bbec1

Please sign in to comment.