Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgt committed Nov 13, 2024
1 parent 0bdb472 commit b378440
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
/**
Expand Down
9 changes: 4 additions & 5 deletions kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/FlagSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
import org.jspecify.annotations.Nullable;

/**
* Sadly there is no ImmutableEnumSet in Java.
* We don't use <code>Set.of</code> because its order
* is not predictable.
* Sadly there is no ImmutableEnumSet in Java. We don't use <code>Set.of</code> because
* its order is not predictable.
*/
@SuppressWarnings({})
final class FlagSet<E extends Enum<E>> implements Set<E> {
Expand Down Expand Up @@ -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 <T> @Nullable T[] toArray(T[] a) {
return set.toArray(a);
}
Expand Down Expand Up @@ -142,7 +141,7 @@ public Set<E> 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 <T> @Nullable T[] toArray(IntFunction<T[]> generator) {
return set.toArray(generator);
}
Expand Down
15 changes: 7 additions & 8 deletions kiwi-kvs/src/main/java/io/jstach/kiwi/kvs/KeyValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
*
* <p>
* KeyValues is basically a glorified {@code Supplier<Stream<KeyValue>>}. 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<Stream<KeyValue>>}. 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.
* </p>
*
*
*
* <h2>Key Features:</h2>
* <ul>
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,9 @@ private void checkCyclicSubstitution(final String varName, final List<String> 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);
}
Expand Down

0 comments on commit b378440

Please sign in to comment.