From b378440b6aeca7f0fb9f3a07d980f684a2b0aed4 Mon Sep 17 00:00:00 2001 From: Adam Gent Date: Wed, 13 Nov 2024 10:25:48 -0500 Subject: [PATCH] Fix formatting --- .../kiwi/kvs/DefaultKeyValuesSourceLoader.java | 3 +-- .../src/main/java/io/jstach/kiwi/kvs/FlagSet.java | 9 ++++----- .../main/java/io/jstach/kiwi/kvs/KeyValues.java | 15 +++++++-------- .../jstach/kiwi/kvs/KeyValuesResourceParser.java | 4 +--- .../kiwi/kvs/interpolate/StrSubstitutor.java | 10 +++------- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/DefaultKeyValuesSourceLoader.java b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/DefaultKeyValuesSourceLoader.java index d2dffd2..4de6750 100644 --- a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/DefaultKeyValuesSourceLoader.java +++ b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/DefaultKeyValuesSourceLoader.java @@ -201,8 +201,7 @@ enum LoadFlag { NO_EMPTY, /** * Confusing but this means the resource should not have its properties overriden. Not - * to be confused with {@link #NO_REPLACE} which sounds like what - * this does. + * to be confused with {@link #NO_REPLACE} which sounds like what this does. */ LOCK, /** diff --git a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/FlagSet.java b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/FlagSet.java index 94820ea..1088bb7 100644 --- a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/FlagSet.java +++ b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/FlagSet.java @@ -13,9 +13,8 @@ import org.jspecify.annotations.Nullable; /** - * Sadly there is no ImmutableEnumSet in Java. - * We don't use Set.of because its order - * is not predictable. + * Sadly there is no ImmutableEnumSet in Java. We don't use Set.of because + * its order is not predictable. */ @SuppressWarnings({}) final class FlagSet> implements Set { @@ -95,7 +94,7 @@ public boolean removeAll(Collection c) { } @Override - @SuppressWarnings({"override.return", "override.param", "toarray.nullable.elements.not.newarray"}) + @SuppressWarnings({ "override.return", "override.param", "toarray.nullable.elements.not.newarray" }) public @Nullable T[] toArray(T[] a) { return set.toArray(a); } @@ -142,7 +141,7 @@ public Set clone() { @Override // I'm not sure it is possible to placate checker with jspecify for toArray - @SuppressWarnings({"override.return", "override.param"}) + @SuppressWarnings({ "override.return", "override.param" }) public @Nullable T[] toArray(IntFunction generator) { return set.toArray(generator); } diff --git a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValues.java b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValues.java index d8b812c..338e6bf 100644 --- a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValues.java +++ b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValues.java @@ -31,13 +31,13 @@ * manipulation, transformation, and expansion. This interface serves as a central point * for managing key-value pairs, allowing operations such as filtering, mapping, and * interpolation. - * + * *

- * KeyValues is basically a glorified {@code Supplier>}. If the key values - * will be streamed multiple times it is recommended to call {@link #memoize()} which will - * copy the key values if the key values are not already memoized. + * KeyValues is basically a glorified {@code Supplier>}. If the key + * values will be streamed multiple times it is recommended to call {@link #memoize()} + * which will copy the key values if the key values are not already memoized. *

- * + * * *

Key Features:

*
    @@ -341,9 +341,8 @@ default KeyValues expand(Variables variables) { } /** - * Returns a memoized version of this {@code KeyValues} which - * means repeated calls to iteratore or stream over the KeyValues - * will always generate the same result. + * Returns a memoized version of this {@code KeyValues} which means repeated calls to + * iteratore or stream over the KeyValues will always generate the same result. * @return a memoized {@code KeyValues} instance. */ default KeyValues memoize() { diff --git a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValuesResourceParser.java b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValuesResourceParser.java index 14523d8..614b204 100644 --- a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValuesResourceParser.java +++ b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValuesResourceParser.java @@ -8,7 +8,6 @@ import org.jspecify.annotations.Nullable; - /* * The idea here is to keep all the parsing logic separated from the core domain so that * we can switch the key value patterns of loading. @@ -151,7 +150,7 @@ public KeyValues filterResources(KeyValues keyValues) { return builder.build(); } - private KeyValuesResource. @Nullable Builder builderOrNull(KeyValue reference) { + private KeyValuesResource.@Nullable Builder builderOrNull(KeyValue reference) { var resource = parseOrNull(reference); if (resource == null) { return null; @@ -177,7 +176,6 @@ private boolean filter(KeyValue kv) { return null; } - private @Nullable ResourceKey resourceKeyOrNull(KeyValue kv) { for (var key : ResourceKey.values()) { if (kv.key().startsWith(key.prefix)) { diff --git a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/interpolate/StrSubstitutor.java b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/interpolate/StrSubstitutor.java index ed70e58..86388f8 100644 --- a/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/interpolate/StrSubstitutor.java +++ b/kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/interpolate/StrSubstitutor.java @@ -269,13 +269,9 @@ private void checkCyclicSubstitution(final String varName, final List pr throw new IllegalStateException(buf.toString()); } - private @Nullable String resolveVariable(final String variableName, - @SuppressWarnings("unused") - final StringBuilder buf, - @SuppressWarnings("unused") - final int startPos, - @SuppressWarnings("unused") - final int endPos, boolean defaultValue) { + private @Nullable String resolveVariable(final String variableName, + @SuppressWarnings("unused") final StringBuilder buf, @SuppressWarnings("unused") final int startPos, + @SuppressWarnings("unused") final int endPos, boolean defaultValue) { final StrLookup resolver = variableResolver; return resolver.lookup(variableName, defaultValue); }