Skip to content

Commit

Permalink
Suppress some warnings, remove Java 7 @SafeVarargs annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
aNNiMON committed Mar 22, 2019
1 parent e7e9506 commit 98004a3
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions stream/src/main/java/com/annimon/stream/Collectors.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
* @see Collector
*/
@SuppressWarnings({"WeakerAccess", "unused", "RedundantTypeArguments"})
public final class Collectors {

private static final Supplier<long[]> LONG_2ELEMENTS_ARRAY_SUPPLIER = new Supplier<long[]>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* @since 1.1.6
*/
@SuppressWarnings("WeakerAccess")
public final class ComparatorCompat<T> implements Comparator<T> {

private static final ComparatorCompat<Comparable<Object>>
Expand Down
1 change: 0 additions & 1 deletion stream/src/main/java/com/annimon/stream/DoubleStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @since 1.1.4
* @see Stream
*/
@SuppressWarnings("WeakerAccess")
public final class DoubleStream implements Closeable {

/**
Expand Down
1 change: 1 addition & 0 deletions stream/src/main/java/com/annimon/stream/Exceptional.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*
* @param <T> the type of the inner value
*/
@SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
public class Exceptional<T> {

/**
Expand Down
1 change: 0 additions & 1 deletion stream/src/main/java/com/annimon/stream/IntStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* A sequence of primitive int-valued elements supporting sequential operations. This is the {@code int}
* primitive specialization of {@link Stream}.
*/
@SuppressWarnings("WeakerAccess")
public final class IntStream implements Closeable {

/**
Expand Down
1 change: 0 additions & 1 deletion stream/src/main/java/com/annimon/stream/LongStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @since 1.1.4
* @see Stream
*/
@SuppressWarnings("WeakerAccess")
public final class LongStream implements Closeable {

/**
Expand Down
1 change: 1 addition & 0 deletions stream/src/main/java/com/annimon/stream/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/**
* Common operations with Object.
*/
@SuppressWarnings("WeakerAccess")
public final class Objects {

private Objects() { }
Expand Down
1 change: 1 addition & 0 deletions stream/src/main/java/com/annimon/stream/Optional.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
* @param <T> the type of the inner value
*/
@SuppressWarnings("WeakerAccess")
public class Optional<T> {

private static final Optional<?> EMPTY = new Optional();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @since 1.1.8
* @see Optional
*/
@SuppressWarnings("WeakerAccess")
public final class OptionalBoolean {

private static final OptionalBoolean EMPTY = new OptionalBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @since 1.1.4
* @see Optional
*/
@SuppressWarnings("WeakerAccess")
public final class OptionalDouble {

private static final OptionalDouble EMPTY = new OptionalDouble();
Expand Down
1 change: 0 additions & 1 deletion stream/src/main/java/com/annimon/stream/OptionalInt.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* If a value is present, {@code isPresent()} will return {@code true} and
* {@code getAsInt()} will return the value.
*/
@SuppressWarnings("WeakerAccess")
public final class OptionalInt {
/**
* Common instance for {@code empty()}.
Expand Down
1 change: 0 additions & 1 deletion stream/src/main/java/com/annimon/stream/OptionalLong.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* @since 1.1.4
* @see Optional
*/
@SuppressWarnings("WeakerAccess")
public final class OptionalLong {

private static final OptionalLong EMPTY = new OptionalLong();
Expand Down
1 change: 1 addition & 0 deletions stream/src/main/java/com/annimon/stream/Stream.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*
* @param <T> the type of the stream elements
*/
@SuppressWarnings("RedundantTypeArguments")
public class Stream<T> implements Closeable {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/**
* Compatibility methods for Android API &lt; 9.
*/
@SuppressWarnings("WeakerAccess")
public final class Compat {

static final long MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
Expand All @@ -25,7 +26,6 @@ public static <T> Queue<T> queue() {
}
}

@SafeVarargs
public static <E> E[] newArray(int length, E... array) {
try {
return Arrays.copyOf(array, length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Arrays;
import java.util.Iterator;

@SuppressWarnings({"WeakerAccess", "SameParameterValue"})
final class SpinedBuffer {

/**
Expand All @@ -27,7 +28,7 @@ final class SpinedBuffer {
/**
* Minimum array size for array-of-chunks.
*/
static final int MIN_SPINE_SIZE = 8;
private static final int MIN_SPINE_SIZE = 8;

private SpinedBuffer() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @param <T> the type of the iterator elements
* @since 1.1.6
*/
@SuppressWarnings("WeakerAccess")
public class IndexedIterator<T> implements Iterator<T> {

private final Iterator<? extends T> iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public boolean hasNext() {
return hasNext;
}

@SuppressWarnings("ResultOfMethodCallIgnored")
@Override
public T next() {
if (!isInit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public boolean hasNext() {
return hasNext;
}

@SuppressWarnings("ResultOfMethodCallIgnored")
@Override
public int nextInt() {
if (!isInit) {
Expand Down

0 comments on commit 98004a3

Please sign in to comment.