forked from JavaTX/JavaCompilerCore
Einsetzen von generischen Typen gefixt
This commit is contained in:
parent
d053ce0b08
commit
64d01e8ee2
@ -39,7 +39,21 @@ public class GenericTypeInsertPoint extends TypeInsertPoint {
|
|||||||
@Override
|
@Override
|
||||||
protected Type getInsertType(){
|
protected Type getInsertType(){
|
||||||
if(genericPairs.size()==0)return this.type;
|
if(genericPairs.size()==0)return this.type;
|
||||||
Iterator<Pair> it = genericPairs.iterator();
|
|
||||||
|
Vector<Pair> pairs = new Vector<Pair>();
|
||||||
|
//Problem: <P1 extends P2> ist falsch! Es muss: <P2, P1 extends P2> heißen:
|
||||||
|
Vector<Type> P1s = new Vector<Type>();
|
||||||
|
Vector<Type> P2s = new Vector<Type>();
|
||||||
|
for(Pair p : genericPairs){
|
||||||
|
P1s.add(p.TA1);
|
||||||
|
P2s.add(p.TA2);
|
||||||
|
}
|
||||||
|
for(Type t : P2s){
|
||||||
|
if(!P1s.contains(t))pairs.add(new Pair(t,null));
|
||||||
|
}
|
||||||
|
pairs.addAll(this.genericPairs);
|
||||||
|
|
||||||
|
Iterator<Pair> it = pairs.iterator();
|
||||||
String genericTypeParameters = "<";
|
String genericTypeParameters = "<";
|
||||||
while(it.hasNext()){
|
while(it.hasNext()){
|
||||||
genericTypeParameters += new GenericTypeVar(it.next(), 0).printJavaCode(this.getResultSet());
|
genericTypeParameters += new GenericTypeVar(it.next(), 0).printJavaCode(this.getResultSet());
|
||||||
|
Loading…
Reference in New Issue
Block a user