From e7822baa99ad10f310ef0ae912a9fc82f33c9fe1 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 8 Dec 2021 00:12:43 +0000 Subject: [PATCH] Fix varargs call warning --- .../husksync/velocity/config/ConfigLoader.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/velocity/src/main/java/me/william278/husksync/velocity/config/ConfigLoader.java b/velocity/src/main/java/me/william278/husksync/velocity/config/ConfigLoader.java index 7649ab15..4d9fee9b 100644 --- a/velocity/src/main/java/me/william278/husksync/velocity/config/ConfigLoader.java +++ b/velocity/src/main/java/me/william278/husksync/velocity/config/ConfigLoader.java @@ -31,19 +31,20 @@ public class ConfigLoader { } private static String getConfigString(ConfigurationNode rootNode, String defaultValue, String... nodePath) { - return !rootNode.getNode(nodePath).isVirtual() ? rootNode.getNode(nodePath).getString() : defaultValue; + return !rootNode.getNode((Object[]) nodePath).isVirtual() ? rootNode.getNode((Object[])nodePath).getString() : defaultValue; } + @SuppressWarnings("SameParameterValue") private static boolean getConfigBoolean(ConfigurationNode rootNode, boolean defaultValue, String... nodePath) { - return !rootNode.getNode(nodePath).isVirtual() ? rootNode.getNode(nodePath).getBoolean() : defaultValue; + return !rootNode.getNode((Object[]) nodePath).isVirtual() ? rootNode.getNode((Object[])nodePath).getBoolean() : defaultValue; } private static int getConfigInt(ConfigurationNode rootNode, int defaultValue, String... nodePath) { - return !rootNode.getNode(nodePath).isVirtual() ? rootNode.getNode(nodePath).getInt() : defaultValue; + return !rootNode.getNode((Object[]) nodePath).isVirtual() ? rootNode.getNode((Object[])nodePath).getInt() : defaultValue; } private static long getConfigLong(ConfigurationNode rootNode, long defaultValue, String... nodePath) { - return !rootNode.getNode(nodePath).isVirtual() ? rootNode.getNode(nodePath).getLong() : defaultValue; + return !rootNode.getNode((Object[])nodePath).isVirtual() ? rootNode.getNode((Object[])nodePath).getLong() : defaultValue; } public static void loadSettings(ConfigurationNode loadedConfig) throws IllegalArgumentException {