Skip to content

Commit

Permalink
(yegor256#1568) Generify Immutable class ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryBarskov committed Apr 1, 2022
1 parent 2d3d898 commit 6842ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/list/Immutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public final class Immutable<T> implements List<T> {
/**
* Encapsulated list.
*/
private final List<T> list;
private final List<? extends T> list;

/**
* Ctor.
* @param src Source collection
*/
public Immutable(final List<T> src) {
public Immutable(final List<? extends T> src) {
this.list = src;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/list/ImmutableListIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public final class ImmutableListIterator<T> implements ListIterator<T> {
/**
* Original list iterator.
*/
private final ListIterator<T> origin;
private final ListIterator<? extends T> origin;

/**
* Ctor.
* @param iter Original list iterator.
*/
public ImmutableListIterator(final ListIterator<T> iter) {
public ImmutableListIterator(final ListIterator<? extends T> iter) {
this.origin = iter;
}

Expand Down

0 comments on commit 6842ef8

Please sign in to comment.