diff --git a/core/src/main/java/com/github/steanky/element/core/dependency/ModuleDependencyProvider.java b/core/src/main/java/com/github/steanky/element/core/dependency/ModuleDependencyProvider.java index 1b51040..e52cdfd 100644 --- a/core/src/main/java/com/github/steanky/element/core/dependency/ModuleDependencyProvider.java +++ b/core/src/main/java/com/github/steanky/element/core/dependency/ModuleDependencyProvider.java @@ -30,9 +30,6 @@ * "named" dependencies by declaring a single {@link Key} object as a parameter. */ public class ModuleDependencyProvider implements DependencyProvider { - @SuppressWarnings({"unchecked"}) - private static final Map.Entry, Map>>[] EMPTY_ENTRY_ARRAY = new Map.Entry[0]; - private final DependencyModule module; private final Map, Map>> dependencyMap; @@ -42,6 +39,7 @@ public class ModuleDependencyProvider implements DependencyProvider { * @param keyParser the {@link KeyParser} object used to convert strings to keys * @param module the {@link DependencyModule} object to use */ + @SuppressWarnings("unchecked") public ModuleDependencyProvider(final @NotNull KeyParser keyParser, final @NotNull DependencyModule module) { Objects.requireNonNull(keyParser); this.module = Objects.requireNonNull(module); @@ -123,7 +121,7 @@ public ModuleDependencyProvider(final @NotNull KeyParser keyParser, final @NotNu } final Map.Entry, Map>>[] array = dependencyMap.entrySet() - .toArray(EMPTY_ENTRY_ARRAY); + .toArray(Map.Entry[]::new); for (int i = 0; i < array.length; i++) { final Map.Entry, Map>> entry = array[i]; diff --git a/core/src/main/java/com/github/steanky/element/core/util/ElementSearcher.java b/core/src/main/java/com/github/steanky/element/core/util/ElementSearcher.java index 0ce30ae..f95a26f 100644 --- a/core/src/main/java/com/github/steanky/element/core/util/ElementSearcher.java +++ b/core/src/main/java/com/github/steanky/element/core/util/ElementSearcher.java @@ -23,7 +23,7 @@ public final class ElementSearcher { * @return an unmodifiable set of classes contained in the given package */ public static @NotNull @Unmodifiable Set> getElementClassesInPackage(@NotNull String packageName) { - Objects.requireNonNull(packageName, "packageName"); + Objects.requireNonNull(packageName); return Set.copyOf(new Reflections(new ConfigurationBuilder().forPackage(packageName)) .getTypesAnnotatedWith(Model.class)); } diff --git a/core/src/main/java/com/github/steanky/element/core/util/Validate.java b/core/src/main/java/com/github/steanky/element/core/util/Validate.java index 9854dce..9d6a344 100644 --- a/core/src/main/java/com/github/steanky/element/core/util/Validate.java +++ b/core/src/main/java/com/github/steanky/element/core/util/Validate.java @@ -12,7 +12,9 @@ import java.util.function.Supplier; /** - * Contains utility methods designed to validate various conditions, usually in a reflection-related context. + * Contains utility methods designed to validate various conditions, usually in a reflection-related context. These + * methods are public for cross-package access within Element, but are not part of the public API and may be changed or + * removed at any time. */ @ApiStatus.Internal public final class Validate {