This is an automated email from the ASF dual-hosted git repository. jermy pushed a commit to branch assert-throws-bugfix in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-commons.git
commit 1d692daf503a8793879b305640a6386eca87bd33 Author: jermy <[email protected]> AuthorDate: Sun Nov 26 22:18:31 2023 +0800 fix some warnings --- .../main/java/org/apache/hugegraph/config/HugeConfig.java | 12 ++++++------ .../src/main/java/org/apache/hugegraph/perf/PerfUtil.java | 12 ++++++------ .../java/org/apache/hugegraph/rest/RestClientConfig.java | 1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java b/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java index c48219f..4837154 100644 --- a/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java +++ b/hugegraph-common/src/main/java/org/apache/hugegraph/config/HugeConfig.java @@ -22,8 +22,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.hugegraph.util.E; -import org.apache.hugegraph.util.Log; +import javax.annotation.Nullable; + import org.apache.commons.configuration2.Configuration; import org.apache.commons.configuration2.FileBasedConfiguration; import org.apache.commons.configuration2.PropertiesConfiguration; @@ -35,10 +35,10 @@ import org.apache.commons.configuration2.ex.ConfigurationException; import org.apache.commons.configuration2.io.FileHandler; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.hugegraph.util.E; +import org.apache.hugegraph.util.Log; import org.slf4j.Logger; -import javax.annotation.Nullable; - public class HugeConfig extends PropertiesConfiguration { private static final Logger LOG = Log.logger(HugeConfig.class); @@ -117,7 +117,7 @@ public class HugeConfig extends PropertiesConfiguration { value = this.validateOption(key, value); } if (this.containsKey(key) && value instanceof List) { - for (Object item : (List<Object>) value) { + for (Object item : (List<?>) value) { super.addPropertyDirect(key, item); } } else { @@ -137,7 +137,7 @@ public class HugeConfig extends PropertiesConfiguration { return option.parseConvert((String) value); } - Class dataType = option.dataType(); + Class<?> dataType = option.dataType(); if (dataType.isInstance(value)) { return value; } diff --git a/hugegraph-common/src/main/java/org/apache/hugegraph/perf/PerfUtil.java b/hugegraph-common/src/main/java/org/apache/hugegraph/perf/PerfUtil.java index 456611b..77b68d6 100644 --- a/hugegraph-common/src/main/java/org/apache/hugegraph/perf/PerfUtil.java +++ b/hugegraph-common/src/main/java/org/apache/hugegraph/perf/PerfUtil.java @@ -556,7 +556,7 @@ public final class PerfUtil { } } - public static final class LocalStack<E> { + public static final class LocalStack<T> { private final Object[] elementData; private int elementCount; @@ -574,27 +574,27 @@ public final class PerfUtil { return this.elementCount == 0; } - public void push(E elem) { + public void push(T elem) { this.elementData[this.elementCount++] = elem; } - public E pop() { + public T pop() { if (this.elementCount == 0) { throw new EmptyStackException(); } this.elementCount--; @SuppressWarnings("unchecked") - E elem = (E) this.elementData[this.elementCount]; + T elem = (T) this.elementData[this.elementCount]; this.elementData[this.elementCount] = null; return elem; } - public E peek() { + public T peek() { if (this.elementCount == 0) { throw new EmptyStackException(); } @SuppressWarnings("unchecked") - E elem = (E) this.elementData[this.elementCount - 1]; + T elem = (T) this.elementData[this.elementCount - 1]; return elem; } } diff --git a/hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java b/hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java index ef3e9b0..fc63613 100644 --- a/hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java +++ b/hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClientConfig.java @@ -24,6 +24,7 @@ import lombok.Setter; @Builder @Getter @Setter +@SuppressWarnings("unused") public class RestClientConfig { private String user;
