Use bounded wildcards in API in constructors/final methods to make it more conventional and flexible
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.util.List;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class InvocationExprent extends Exprent {
|
||||
public InvocationExprent(int opcode,
|
||||
LinkConstant cn,
|
||||
List<PooledConstant> bootstrapArguments,
|
||||
ListStack<Exprent> stack,
|
||||
ListStack<? extends Exprent> stack,
|
||||
Set<Integer> bytecodeOffsets) {
|
||||
this();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class GeneralStatement extends Statement {
|
||||
type = Statement.TYPE_GENERAL;
|
||||
}
|
||||
|
||||
public GeneralStatement(Statement head, Collection<Statement> statements, Statement post) {
|
||||
public GeneralStatement(Statement head, Collection<? extends Statement> statements, Statement post) {
|
||||
|
||||
this();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class SequenceStatement extends Statement {
|
||||
type = Statement.TYPE_SEQUENCE;
|
||||
}
|
||||
|
||||
public SequenceStatement(List<Statement> lst) {
|
||||
public SequenceStatement(List<? extends Statement> lst) {
|
||||
|
||||
this();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ListStack<T> extends ArrayList<T> {
|
||||
super();
|
||||
}
|
||||
|
||||
public ListStack(ArrayList<T> list) {
|
||||
public ListStack(ArrayList<? extends T> list) {
|
||||
super(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user