diff options
| -rw-r--r-- | .settings/org.eclipse.jdt.core.prefs | 102 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/Multimap.java | 2 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/Stack.java | 10 | ||||
| -rw-r--r-- | src/main/java/bjc/esodata/ThresholdSet.java | 10 | ||||
| -rw-r--r-- | src/test/java/bjc/TestUtils.java | 1 | ||||
| -rw-r--r-- | src/test/java/bjc/esodata/StackTest.java | 2 | ||||
| -rw-r--r-- | src/test/java/bjc/esodata/ThresholdSetTest.java | 1 |
7 files changed, 18 insertions, 110 deletions
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index ffd15a7..7ad3ace 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,109 +1,7 @@ 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/esodata/Multimap.java b/src/main/java/bjc/esodata/Multimap.java index f0876db..a79f1b0 100644 --- a/src/main/java/bjc/esodata/Multimap.java +++ b/src/main/java/bjc/esodata/Multimap.java @@ -11,6 +11,8 @@ import java.util.*; * have to remove that pair as many times as you added it. * * @author Ben Culkin + * @param <KeyType> The type of keys in the map. + * @param <ValueType> The type of values in the map. */ public class Multimap<KeyType, ValueType> { private Map<KeyType, ThresholdSet<ValueType>> backing; diff --git a/src/main/java/bjc/esodata/Stack.java b/src/main/java/bjc/esodata/Stack.java index f2e00e3..5ee5ef2 100644 --- a/src/main/java/bjc/esodata/Stack.java +++ b/src/main/java/bjc/esodata/Stack.java @@ -95,7 +95,7 @@ public abstract class Stack<T> { * @param elms * The elements to insert. */ - public void pushAll(T... elms) { + public void pushAll(@SuppressWarnings("unchecked") T... elms) { for (T elm : elms) { push(elm); } @@ -436,7 +436,7 @@ public abstract class Stack<T> { * @param actions * The actions to execute. */ - public void multicleave(final int n, final Consumer<Stack<T>>... actions) { + public void multicleave(final int n, @SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) { List<T> elms = multipoprev(n); for (final Consumer<Stack<T>> action : actions) { @@ -462,7 +462,7 @@ public abstract class Stack<T> { * @param actions * The actions to execute. */ - public void cleave(final Consumer<Stack<T>>... actions) { + public void cleave(@SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) { multicleave(1, actions); } @@ -501,7 +501,7 @@ public abstract class Stack<T> { * @param actions * The actions to execute. */ - public void multispread(final int n, final Consumer<Stack<T>>... actions) { + public void multispread(final int n, @SuppressWarnings("unchecked") final Consumer<Stack<T>>... actions) { List<List<T>> nelms = new LinkedList<>(); for (int i = 0; i < actions.length; i++) { @@ -536,7 +536,7 @@ public abstract class Stack<T> { * @param conses * The actions to execute. */ - public void spread(final Consumer<Stack<T>>... conses) { + public void spread(@SuppressWarnings("unchecked") final Consumer<Stack<T>>... conses) { multispread(1, conses); } diff --git a/src/main/java/bjc/esodata/ThresholdSet.java b/src/main/java/bjc/esodata/ThresholdSet.java index 50d95d0..ae277e1 100644 --- a/src/main/java/bjc/esodata/ThresholdSet.java +++ b/src/main/java/bjc/esodata/ThresholdSet.java @@ -46,6 +46,7 @@ public class ThresholdSet<KeyType> { @Override public boolean remove(Object o) { // Will throw a ClassCastException if you give us something bad. + @SuppressWarnings("unchecked") KeyType k = (KeyType) o; int ret = ThresholdSet.this.remove(k); @@ -60,6 +61,7 @@ public class ThresholdSet<KeyType> { @Override public boolean contains(Object o) { // Will throw a ClassCastException if you give us something bad. + @SuppressWarnings("unchecked") KeyType k = (KeyType) o; int ret = ThresholdSet.this.contains(k); @@ -107,7 +109,7 @@ public class ThresholdSet<KeyType> { * * @return An array containing the results of adding the keys. */ - public int[] addKeys(KeyType... keys) { + public int[] addKeys(@SuppressWarnings("unchecked") KeyType... keys) { int[] ret = new int[keys.length]; for (int i = 0; i < keys.length; i++) { @@ -157,7 +159,7 @@ public class ThresholdSet<KeyType> { * * @return The results from removing the keys. */ - public int[] removeKeys(KeyType... keys) { + public int[] removeKeys(@SuppressWarnings("unchecked") KeyType... keys) { int[] ret = new int[keys.length]; for (int i = 0; i < keys.length; i++) { @@ -212,7 +214,7 @@ public class ThresholdSet<KeyType> { * * @return The containment counts for each key. */ - public int[] containsKeys(KeyType... keys) { + public int[] containsKeys(@SuppressWarnings("unchecked") KeyType... keys) { int[] ret = new int[keys.length]; for (int i = 0; i < keys.length; i++) { @@ -264,9 +266,11 @@ public class ThresholdSet<KeyType> { /** * Static threshold set constructor. + * @param <KType> The type of keys for the threshold set. * * @param keys * The initial keys to add to the threshold set. + * @return A threshold set with the given keys. */ @SafeVarargs public static <KType> ThresholdSet<KType> TS(KType... keys) { diff --git a/src/test/java/bjc/TestUtils.java b/src/test/java/bjc/TestUtils.java index 17d6b7a..29e59e1 100644 --- a/src/test/java/bjc/TestUtils.java +++ b/src/test/java/bjc/TestUtils.java @@ -142,6 +142,7 @@ public class TestUtils { * @param exps * The values that are expected. */ + @SafeVarargs public static <T> void assertStackEquals(bjc.esodata.Stack<T> src, T... exps) { assertArrayEquals(exps, src.toArray()); } diff --git a/src/test/java/bjc/esodata/StackTest.java b/src/test/java/bjc/esodata/StackTest.java index c6e8e21..b4b98cc 100644 --- a/src/test/java/bjc/esodata/StackTest.java +++ b/src/test/java/bjc/esodata/StackTest.java @@ -11,6 +11,7 @@ import static org.junit.Assert.*; * * @author Ben Culkin */ +@SuppressWarnings("javadoc") public class StackTest { @Test public void testBasic() { @@ -165,6 +166,7 @@ public class StackTest { assertStackEquals(st, "a", "a", "c", "b", "a"); } + @SuppressWarnings("unchecked") @Test public void testDataComb() { Stack<Integer> stk = new SimpleStack<>(); diff --git a/src/test/java/bjc/esodata/ThresholdSetTest.java b/src/test/java/bjc/esodata/ThresholdSetTest.java index 8f1b995..c9403da 100644 --- a/src/test/java/bjc/esodata/ThresholdSetTest.java +++ b/src/test/java/bjc/esodata/ThresholdSetTest.java @@ -13,6 +13,7 @@ import static org.junit.Assert.*; * * @author Ben Culkin. */ +@SuppressWarnings("javadoc") public class ThresholdSetTest { @Test public void testAdd() { |
