diff --git a/src/typinferenz/GenericTypeInsertPoint.java b/src/typinferenz/GenericTypeInsertPoint.java index 44562bae3..32a241550 100644 --- a/src/typinferenz/GenericTypeInsertPoint.java +++ b/src/typinferenz/GenericTypeInsertPoint.java @@ -39,7 +39,21 @@ public class GenericTypeInsertPoint extends TypeInsertPoint { @Override protected Type getInsertType(){ if(genericPairs.size()==0)return this.type; - Iterator it = genericPairs.iterator(); + + Vector pairs = new Vector(); + //Problem: ist falsch! Es muss: heißen: + Vector P1s = new Vector(); + Vector P2s = new Vector(); + 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 it = pairs.iterator(); String genericTypeParameters = "<"; while(it.hasNext()){ genericTypeParameters += new GenericTypeVar(it.next(), 0).printJavaCode(this.getResultSet());