diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-06 22:06:07 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-06 22:06:07 -0400 |
| commit | dd04fa3a64f7f9ea03691821eaa22a870e7a0529 (patch) | |
| tree | 544d424f87c632c5ae0a64e61c9a87ee9d465934 | |
| parent | 4bb080869e6770f7d707cc53b72cabf7a6de8ea5 (diff) | |
Cleanup some warnings
Cleanup some warnings
| -rw-r--r-- | .settings/org.eclipse.jdt.core.prefs | 101 | ||||
| -rw-r--r-- | src/main/java/bjc/data/QueuedIterator.java | 4 | ||||
| -rw-r--r-- | src/main/java/bjc/data/Tree.java | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/AbbrevMap2.java | 9 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/Multimap.java | 4 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/Stack.java | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/ThresholdSet.java | 5 | ||||
| -rw-r--r-- | src/test/java/bjc/data/BooleanToggleTest.java | 2 | ||||
| -rw-r--r-- | src/test/java/bjc/data/CircularIteratorTest.java | 2 | ||||
| -rw-r--r-- | src/test/java/bjc/data/QueuedIteratorTest.java | 2 | ||||
| -rw-r--r-- | src/test/java/bjc/esodata/StackTest.java | 4 | ||||
| -rw-r--r-- | src/test/java/bjc/esodata/ThresholdSetTest.java | 4 |
12 files changed, 116 insertions, 25 deletions
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 2f5cc74..ffd15a7 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,109 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=info +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=info +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=info +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=info +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=info +org.eclipse.jdt.core.compiler.problem.potentialNullReference=info +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=info +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=info +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=info +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=info +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=info +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=info +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=info +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=info +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=info +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=info +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 diff --git a/src/main/java/bjc/data/QueuedIterator.java b/src/main/java/bjc/data/QueuedIterator.java index eabfb79..1146018 100644 --- a/src/main/java/bjc/data/QueuedIterator.java +++ b/src/main/java/bjc/data/QueuedIterator.java @@ -9,7 +9,7 @@ import java.util.Iterator; * * @author bjculkin * - * @param <E> + * @param <E> The type of element this iterator iterates over */ public class QueuedIterator<E> implements Iterator<E> { private Iterator<E> cur; @@ -108,7 +108,7 @@ public class QueuedIterator<E> implements Iterator<E> { */ @SafeVarargs public QueuedIterator(E... vals) { - this(new ArrayIterator(vals)); + this(new ArrayIterator<>(vals)); } /** diff --git a/src/main/java/bjc/data/Tree.java b/src/main/java/bjc/data/Tree.java index ad2d677..d9ccb34 100644 --- a/src/main/java/bjc/data/Tree.java +++ b/src/main/java/bjc/data/Tree.java @@ -109,7 +109,7 @@ public class Tree<ContainedType> implements ITree<ContainedType> { @Override public void addChild(final ContainedType child) { - addChild(new Tree(child)); + addChild(new Tree<>(child)); } @Override diff --git a/src/main/java/bjc/esodata/AbbrevMap2.java b/src/main/java/bjc/esodata/AbbrevMap2.java index f79a2d2..db41471 100644 --- a/src/main/java/bjc/esodata/AbbrevMap2.java +++ b/src/main/java/bjc/esodata/AbbrevMap2.java @@ -3,7 +3,14 @@ package bjc.esodata; import java.util.*; /** - * A revised version of {@link AbbrevMap} + * A map that allows you to reference strings by unambiguous abbreviations to them. + * + * One example is that adding the string 'abc' would allow you to get it back with the following three keys + * <ul> + * <li>a</li> + * <li>ab</li> + * <li>abc</li> + * </ul> * * @author Ben Culkin */ diff --git a/src/main/java/bjc/esodata/Multimap.java b/src/main/java/bjc/esodata/Multimap.java index bb41b03..5706db3 100644 --- a/src/main/java/bjc/esodata/Multimap.java +++ b/src/main/java/bjc/esodata/Multimap.java @@ -2,8 +2,6 @@ package bjc.esodata; import java.util.*; -import bjc.data.*; - /** * A map that has support for multiple values for a given key. * @@ -34,7 +32,7 @@ public class Multimap<KeyType, ValueType> { */ public void add(KeyType key, ValueType value) { ThresholdSet<ValueType> container = backing.computeIfAbsent(key, - (k) -> new ThresholdSet()); + (k) -> new ThresholdSet<>()); container.add(value); } diff --git a/src/main/java/bjc/esodata/Stack.java b/src/main/java/bjc/esodata/Stack.java index 1a15764..31c92f1 100644 --- a/src/main/java/bjc/esodata/Stack.java +++ b/src/main/java/bjc/esodata/Stack.java @@ -125,7 +125,7 @@ public abstract class Stack<T> { public List<T> multipop(int n) { List<T> lst = new LinkedList<>(); - for (int i = 0; i < n; n++) { + for (int i = 0; i < n; i++) { lst.add(pop()); } diff --git a/src/main/java/bjc/esodata/ThresholdSet.java b/src/main/java/bjc/esodata/ThresholdSet.java index cc7c0e1..6076a2a 100644 --- a/src/main/java/bjc/esodata/ThresholdSet.java +++ b/src/main/java/bjc/esodata/ThresholdSet.java @@ -2,8 +2,6 @@ package bjc.esodata; import java.util.*; -import bjc.data.*; - /** * Represents a counted set, that overflows to a map. * @@ -97,7 +95,7 @@ public class ThresholdSet<KeyType> { /** * Add multiple keys at once to the map. * - * @param key + * @param keys * The keys to add. * * @return An array containing the results of adding the keys. @@ -260,6 +258,7 @@ public class ThresholdSet<KeyType> { * @param keys * The initial keys to add to the threshold set. */ + @SafeVarargs public static <KType> ThresholdSet<KType> TS(KType... keys) { ThresholdSet<KType> ts = new ThresholdSet<>(); diff --git a/src/test/java/bjc/data/BooleanToggleTest.java b/src/test/java/bjc/data/BooleanToggleTest.java index b3d33eb..3fb4490 100644 --- a/src/test/java/bjc/data/BooleanToggleTest.java +++ b/src/test/java/bjc/data/BooleanToggleTest.java @@ -4,8 +4,6 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; -import bjc.data.BooleanToggle; - /** * Test for boolean toggles. * @author bjculkin diff --git a/src/test/java/bjc/data/CircularIteratorTest.java b/src/test/java/bjc/data/CircularIteratorTest.java index 82a08c6..289c62a 100644 --- a/src/test/java/bjc/data/CircularIteratorTest.java +++ b/src/test/java/bjc/data/CircularIteratorTest.java @@ -6,8 +6,6 @@ import java.util.Arrays; import java.util.List; import org.junit.Test; - -import bjc.data.CircularIterator; /** * Test for circular iterators., * diff --git a/src/test/java/bjc/data/QueuedIteratorTest.java b/src/test/java/bjc/data/QueuedIteratorTest.java index 69f37b8..ef83469 100644 --- a/src/test/java/bjc/data/QueuedIteratorTest.java +++ b/src/test/java/bjc/data/QueuedIteratorTest.java @@ -4,8 +4,6 @@ import static java.util.Arrays.asList; import org.junit.Test; -import bjc.data.QueuedIterator; - import static bjc.TestUtils.*; import static bjc.data.QueuedIterator.queued; diff --git a/src/test/java/bjc/esodata/StackTest.java b/src/test/java/bjc/esodata/StackTest.java index 8603a8f..5dfe7d5 100644 --- a/src/test/java/bjc/esodata/StackTest.java +++ b/src/test/java/bjc/esodata/StackTest.java @@ -2,10 +2,6 @@ package bjc.esodata; import org.junit.Test; -import bjc.TestUtils; - -import java.util.*; - import static bjc.TestUtils.*; import static org.junit.Assert.*; diff --git a/src/test/java/bjc/esodata/ThresholdSetTest.java b/src/test/java/bjc/esodata/ThresholdSetTest.java index 6995ad8..1f9af04 100644 --- a/src/test/java/bjc/esodata/ThresholdSetTest.java +++ b/src/test/java/bjc/esodata/ThresholdSetTest.java @@ -2,10 +2,6 @@ package bjc.esodata; import org.junit.Test; -import bjc.TestUtils; - -import java.util.*; - import static bjc.TestUtils.*; import static bjc.esodata.ThresholdSet.*; |
