Skip to content

Commit

Permalink
#loops: warnings off
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jun 21, 2017
1 parent 6a27707 commit b809452
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/ArrayAsIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public final class ArrayAsIterable<X> implements Iterable<X> {
* @param items The array
*/
@SafeVarargs
@SuppressWarnings("varargs")
public ArrayAsIterable(final X... items) {
this.array = items;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/ConcatIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public final class ConcatIterable<T> implements Iterable<T> {
* @param items Items to concatenate
*/
@SafeVarargs
@SuppressWarnings("varargs")
public ConcatIterable(final Iterable<T>... items) {
this(new IterableAsList<>(items));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/ConcatIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public final class ConcatIterator<T> implements Iterator<T> {
* @param items Items to concatenate
*/
@SafeVarargs
@SuppressWarnings("varargs")
public ConcatIterator(final Iterator<T>... items) {
this(new IterableAsList<>(items));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/IterableAsList.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public final class IterableAsList<T> implements List<T> {
* @param array An array of some elements
*/
@SafeVarargs
@SuppressWarnings("varargs")
public IterableAsList(final T... array) {
this(new ArrayAsIterable<>(array));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/IterableAsMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public final class IterableAsMap<X, Y> implements Map<X, Y> {
* @param list List of entries
*/
@SafeVarargs
@SuppressWarnings("varargs")
public IterableAsMap(final Map.Entry<X, Y>... list) {
this(new ArrayAsIterable<>(list));
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/cactoos/list/SortedIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
* @param src The underlying iterable
*/
@SafeVarargs
@SuppressWarnings("varargs")
public SortedIterable(final T... src) {
this(new ArrayAsIterable<>(src));
}
Expand All @@ -74,7 +73,6 @@ public SortedIterable(final Iterable<T> src) {
* @param cmp The comparator
*/
@SafeVarargs
@SuppressWarnings("varargs")
public SortedIterable(final Comparator<T> cmp, final T... src) {
this(cmp, new ArrayAsIterable<>(src));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/StickyList.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public final class StickyList<X> implements List<X> {
* @param items The array
*/
@SafeVarargs
@SuppressWarnings("varargs")
public StickyList(final X... items) {
this(new ArrayAsIterable<>(items));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/cactoos/list/StickyMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public final class StickyMap<X, Y> implements Map<X, Y> {
* @param list List of entries
*/
@SafeVarargs
@SuppressWarnings("varargs")
public StickyMap(final Map.Entry<X, Y>... list) {
this(new ArrayAsIterable<>(list));
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/cactoos/list/StickyMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,16 @@ public void ignoresChangesInMap() throws Exception {
);
}

@Test
public void decoratesEntries() throws Exception {
MatcherAssert.assertThat(
"Can't decorate a list of entries",
new StickyMap<>(
new AbstractMap.SimpleEntry<>("first", "Jeffrey"),
new AbstractMap.SimpleEntry<>("last", "Lebowski")
),
Matchers.hasValue(Matchers.endsWith("ski"))
);
}

}

0 comments on commit b809452

Please sign in to comment.