From e8e56c29bb15efa2350479e9e7110bec1517e432 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 7 Jan 2024 00:04:18 +0000 Subject: [PATCH 1/2] chore(deps): Update patch dependency changes --- gradle/libs.versions.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ddac8f13..a4492c98 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ assertj="3.25.1" autoValue="1.10.4" checkerQual="3.42.0" -checkstyle="10.12.5" +checkstyle="10.12.7" geantyref = "1.3.14" errorprone="2.24.1" indra = "3.1.3" @@ -10,7 +10,7 @@ junit="5.10.1" ktlint="0.49.1" ktfmt="0.46" pmd = "6.55.0" -spotless = "6.23.2" +spotless = "6.23.3" [libraries] # Shared @@ -47,7 +47,7 @@ guice-runtime = "com.google.inject:guice:5.0.1" # Formats gson = "com.google.code.gson:gson:2.8.0" # Fixed version, to avoid using API not present in older MC -jackson = "com.fasterxml.jackson.core:jackson-core:2.16.0" +jackson = "com.fasterxml.jackson.core:jackson-core:2.16.1" # Tool clikt = "com.github.ajalt:clikt:2.8.0" @@ -55,7 +55,7 @@ jansi = "org.fusesource.jansi:jansi:2.4.1" # Build build-codenarc = { module = "org.codenarc:CodeNarc", version = "3.3.0-groovy-4.0" } -build-codenarcGroovy = { module = "org.apache.groovy:groovy-all", version = "4.0.16" } +build-codenarcGroovy = { module = "org.apache.groovy:groovy-all", version = "4.0.17" } build-errorprone = "net.ltgt.gradle:gradle-errorprone-plugin:3.1.0" build-forbiddenApis = "de.thetaphi:forbiddenapis:3.6" build-goomph = "com.diffplug.gradle:goomph:3.44.0" From 18cbf246ebdfb86c9ee76be733ad3b7c4cd1a2c0 Mon Sep 17 00:00:00 2001 From: zml Date: Sat, 6 Jan 2024 16:14:56 -0800 Subject: [PATCH 2/2] chore(core): Resolve warnings and new checkstyle errors --- .../java/org/spongepowered/configurate/ConfigValue.java | 2 ++ .../org/spongepowered/configurate/ListConfigValue.java | 2 +- .../configurate/loader/AbstractConfigurationFormat.java | 8 ++++---- .../configurate/loader/ConfigurationFormat.java | 8 ++++---- .../configurate/reactive/TransactionalRegistration.java | 1 + .../configurate/reference/ValueReferenceImpl.java | 2 +- .../configurate/serialize/OptionalSerializer.java | 1 + .../configurate/serialize/TypeSerializerCollection.java | 5 +++++ .../spongepowered/configurate/jackson/JacksonVisitor.java | 1 + 9 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/spongepowered/configurate/ConfigValue.java b/core/src/main/java/org/spongepowered/configurate/ConfigValue.java index 2cd9835a..36f5aa9f 100644 --- a/core/src/main/java/org/spongepowered/configurate/ConfigValue.java +++ b/core/src/main/java/org/spongepowered/configurate/ConfigValue.java @@ -20,6 +20,8 @@ /** * The value in a {@link ConfigurationNode}. + * + * @since 4.0.0 */ interface ConfigValue, A extends AbstractConfigurationNode> { diff --git a/core/src/main/java/org/spongepowered/configurate/ListConfigValue.java b/core/src/main/java/org/spongepowered/configurate/ListConfigValue.java index b4200418..c46457fe 100644 --- a/core/src/main/java/org/spongepowered/configurate/ListConfigValue.java +++ b/core/src/main/java/org/spongepowered/configurate/ListConfigValue.java @@ -124,7 +124,7 @@ public void set(@Nullable Object value) { if (!(value instanceof Collection)) { value = Collections.singleton(value); } - final Collection<@Nullable ?> valueAsList = (Collection<@Nullable ?>) value; + final Collection valueAsList = (Collection) value; final List newValue = new ArrayList<>(valueAsList.size()); int count = 0; diff --git a/core/src/main/java/org/spongepowered/configurate/loader/AbstractConfigurationFormat.java b/core/src/main/java/org/spongepowered/configurate/loader/AbstractConfigurationFormat.java index d8eaf5da..fc67226d 100644 --- a/core/src/main/java/org/spongepowered/configurate/loader/AbstractConfigurationFormat.java +++ b/core/src/main/java/org/spongepowered/configurate/loader/AbstractConfigurationFormat.java @@ -79,14 +79,14 @@ public Set supportedExtensions() { } @Override - public ConfigurationLoader<@NonNull ?> create(final Path file) { + public ConfigurationLoader create(final Path file) { return this.builderMaker.get() .path(file) .build(); } @Override - public ConfigurationLoader<@NonNull ?> create(final Path file, final ConfigurationNode options) { + public ConfigurationLoader create(final Path file, final ConfigurationNode options) { return this.builderMaker.get() .from(LoaderOptionSource.node(options)) .path(file) @@ -94,14 +94,14 @@ public Set supportedExtensions() { } @Override - public ConfigurationLoader<@NonNull ?> create(final URL url) { + public ConfigurationLoader create(final URL url) { return this.builderMaker.get() .url(url) .build(); } @Override - public ConfigurationLoader<@NonNull ?> create(final URL url, final ConfigurationNode options) { + public ConfigurationLoader create(final URL url, final ConfigurationNode options) { return this.builderMaker.get() .from(LoaderOptionSource.node(options)) .url(url) diff --git a/core/src/main/java/org/spongepowered/configurate/loader/ConfigurationFormat.java b/core/src/main/java/org/spongepowered/configurate/loader/ConfigurationFormat.java index bef1c10a..b86b59d1 100644 --- a/core/src/main/java/org/spongepowered/configurate/loader/ConfigurationFormat.java +++ b/core/src/main/java/org/spongepowered/configurate/loader/ConfigurationFormat.java @@ -93,7 +93,7 @@ static Set supportedFormats() { * @return a newly configured loader * @since 4.2.0 */ - default ConfigurationLoader<@NonNull ?> create(Path file) { + default ConfigurationLoader create(Path file) { return create(file, BasicConfigurationNode.factory().createNode()); } @@ -105,7 +105,7 @@ static Set supportedFormats() { * @return a newly configured loader * @since 4.2.0 */ - ConfigurationLoader<@NonNull ?> create(Path file, ConfigurationNode options); + ConfigurationLoader create(Path file, ConfigurationNode options); /** * Create a new loader configured to load from the provided URL, @@ -117,7 +117,7 @@ static Set supportedFormats() { * @return a newly configured loader * @since 4.2.0 */ - default ConfigurationLoader<@NonNull ?> create(URL url) { + default ConfigurationLoader create(URL url) { return create(url, BasicConfigurationNode.factory().createNode()); } @@ -131,6 +131,6 @@ static Set supportedFormats() { * @return a newly configured loader * @since 4.2.0 */ - ConfigurationLoader<@NonNull?> create(URL url, ConfigurationNode options); + ConfigurationLoader create(URL url, ConfigurationNode options); } diff --git a/core/src/main/java/org/spongepowered/configurate/reactive/TransactionalRegistration.java b/core/src/main/java/org/spongepowered/configurate/reactive/TransactionalRegistration.java index f445a6d9..bc08d8f1 100644 --- a/core/src/main/java/org/spongepowered/configurate/reactive/TransactionalRegistration.java +++ b/core/src/main/java/org/spongepowered/configurate/reactive/TransactionalRegistration.java @@ -24,6 +24,7 @@ * A registration that is transaction-aware. * * @param value type + * @since 4.0.0 */ interface TransactionalRegistration extends AbstractProcessor.Registration { diff --git a/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java b/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java index f644b79c..c1543900 100644 --- a/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java +++ b/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java @@ -33,7 +33,7 @@ import java.util.concurrent.Executor; import java.util.function.Function; -class ValueReferenceImpl<@Nullable T, N extends ScopedConfigurationNode> implements ValueReference, Publisher { +class ValueReferenceImpl> implements ValueReference, Publisher { // Information about the reference private final ManualConfigurationReference root; diff --git a/core/src/main/java/org/spongepowered/configurate/serialize/OptionalSerializer.java b/core/src/main/java/org/spongepowered/configurate/serialize/OptionalSerializer.java index 4d2fd8fe..91ea4909 100644 --- a/core/src/main/java/org/spongepowered/configurate/serialize/OptionalSerializer.java +++ b/core/src/main/java/org/spongepowered/configurate/serialize/OptionalSerializer.java @@ -55,6 +55,7 @@ public Optional deserialize(final AnnotatedType type, final ConfigurationNode } @Override + @SuppressWarnings("NullableOptional") // needed for type signature public void serialize(final AnnotatedType type, final @Nullable Optional obj, final ConfigurationNode node) throws SerializationException { if (obj == null || !obj.isPresent()) { node.set(null); diff --git a/core/src/main/java/org/spongepowered/configurate/serialize/TypeSerializerCollection.java b/core/src/main/java/org/spongepowered/configurate/serialize/TypeSerializerCollection.java index 874dffd2..bb1bd78b 100644 --- a/core/src/main/java/org/spongepowered/configurate/serialize/TypeSerializerCollection.java +++ b/core/src/main/java/org/spongepowered/configurate/serialize/TypeSerializerCollection.java @@ -501,6 +501,11 @@ public TypeSerializerCollection build() { } } + /** + * A serializer registration. + * + * @since 4.2.0 + */ interface RegisteredSerializer { boolean matches(Type test); diff --git a/format/jackson/src/main/java/org/spongepowered/configurate/jackson/JacksonVisitor.java b/format/jackson/src/main/java/org/spongepowered/configurate/jackson/JacksonVisitor.java index 7f2494fd..d2787fe0 100644 --- a/format/jackson/src/main/java/org/spongepowered/configurate/jackson/JacksonVisitor.java +++ b/format/jackson/src/main/java/org/spongepowered/configurate/jackson/JacksonVisitor.java @@ -24,6 +24,7 @@ import java.io.IOException; +@SuppressWarnings("AlmostJavadoc") final class JacksonVisitor implements ConfigurationVisitor { static final ThreadLocal INSTANCE = ThreadLocal.withInitial(JacksonVisitor::new);