Skip to content

Commit

Permalink
Use bounded wildcards in API in constructors/final methods to make it…
Browse files Browse the repository at this point in the history
… more conventional and flexible
  • Loading branch information
cdracm committed Oct 2, 2018
1 parent 18127c4 commit de14514
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public class AnnotationExprent extends Exprent {
public static final int ANNOTATION_SINGLE_ELEMENT = 3;

private final String className;
private final List<String> parNames;
private final List<Exprent> parValues;
private final List<? extends String> parNames;
private final List<? extends Exprent> parValues;

public AnnotationExprent(String className, List<String> parNames, List<Exprent> parValues) {
public AnnotationExprent(String className, List<? extends String> parNames, List<? extends Exprent> parValues) {
super(EXPRENT_ANNOTATION);
this.className = className;
this.parNames = parNames;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

public class AssertExprent extends Exprent {

private final List<Exprent> parameters;
private final List<? extends Exprent> parameters;

public AssertExprent(List<Exprent> parameters) {
public AssertExprent(List<? extends Exprent> parameters) {
super(EXPRENT_ASSERT);
this.parameters = parameters;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public InvocationExprent() {
public InvocationExprent(int opcode,
LinkConstant cn,
List<PooledConstant> bootstrapArguments,
ListStack<Exprent> stack,
ListStack<? extends Exprent> stack,
Set<Integer> bytecodeOffsets) {
this();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private GeneralStatement() {
type = Statement.TYPE_GENERAL;
}

public GeneralStatement(Statement head, Collection<Statement> statements, Statement post) {
public GeneralStatement(Statement head, Collection<? extends Statement> statements, Statement post) {

this();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private SequenceStatement() {
type = Statement.TYPE_SEQUENCE;
}

public SequenceStatement(List<Statement> lst) {
public SequenceStatement(List<? extends Statement> lst) {

this();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class FastSparseSetFactory<E> {

private int lastMask;

public FastSparseSetFactory(Collection<E> set) {
public FastSparseSetFactory(Collection<? extends E> set) {

int block = -1;
int mask = -1;
Expand Down
2 changes: 1 addition & 1 deletion src/org/jetbrains/java/decompiler/util/ListStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ListStack() {
super();
}

public ListStack(ArrayList<T> list) {
public ListStack(ArrayList<? extends T> list) {
super(list);
}

Expand Down

0 comments on commit de14514

Please sign in to comment.