diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java index 5b96e961..a83054d6 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java @@ -602,12 +602,13 @@ public class RefType extends ObjectType implements IMatchable } RefType newRefType=new RefType(this.getTypeName(), clonepara,this.getParent(),getOffset()); newRefType.setPrimitiveFlag(this.getPrimitiveFlag()); + newRefType.IsArray = this.IsArray; return newRefType; } else { RefType newRefType = new RefType(this.getTypeName(), null,getOffset()); newRefType.setPrimitiveFlag(this.getPrimitiveFlag()); - + newRefType.IsArray = this.IsArray; return newRefType; } } @@ -814,7 +815,13 @@ public class RefType extends ObjectType implements IMatchable } public org.apache.commons.bcel6.generic.Type getBytecodeType(ClassGenerator cg) { - return new org.apache.commons.bcel6.generic.ObjectType(this.getTypeName()); + org.apache.commons.bcel6.generic.ObjectType ret = new org.apache.commons.bcel6.generic.ObjectType(this.getTypeName()); + if(this.IsArray()){ + //Hier wird einfachhalber von einer Dimension ausgegangen. Arrays sind im Bytecode nur für main-Methode relevant + return new org.apache.commons.bcel6.generic.ArrayType(ret, 1); + }else{ + return ret; + } } @Override diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java index f809a843..d80ad80c 100755 --- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java @@ -305,7 +305,7 @@ public class TypeAssumptions { if(match && t instanceof RefType){ RefType tr = (RefType)t; RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) - + ret.setArray(((RefType) t).IsArray()); //Falls der RefType mit Parametern angegeben wurde, so müssen diese erhalten bleiben: if(tr.get_ParaList()!=null && tr.getParaList().size()>0){ ret.set_ParaList(tr.getParaList());