diff --git a/src/de/dhbwstuttgart/bytecode/utilities/Simplify.java b/src/de/dhbwstuttgart/bytecode/utilities/Simplify.java index 7a121fba..49b1b4f4 100644 --- a/src/de/dhbwstuttgart/bytecode/utilities/Simplify.java +++ b/src/de/dhbwstuttgart/bytecode/utilities/Simplify.java @@ -302,8 +302,12 @@ public class Simplify { if(!containTPH(methodTphs, superTphRes)) { HashSet equals = getEqualsTphsFromEqualCons(eqCons,superTphRes); + if(classTPHSContainsTPH(tphsClass,superTphRes)) { + result.put(new ExtendsConstraint(subTphRes, superTphRes, Relation.EXTENDS), equals); + } else { + result.put(new ExtendsConstraint(subTphRes, Type.getInternalName(Object.class), Relation.EXTENDS), equals); + } - result.put(new ExtendsConstraint(subTphRes, Type.getInternalName(Object.class), Relation.EXTENDS), equals); } else { HashSet equals = getEqualsTphsFromEqualCons(eqCons,subTphRes); result.put(new ExtendsConstraint(subTphRes, superTphRes, Relation.EXTENDS), equals); @@ -341,6 +345,14 @@ public class Simplify { return result; } + private static boolean classTPHSContainsTPH(ArrayList tphsClass, String superTphRes) { + for(TypePlaceholder tph : tphsClass) { + if(tph.getName().equals(superTphRes)) + return true; + } + return false; + } + private static boolean isTphInEqualSet(HashMap> result, String tph) { for(HashSet hs: result.values()) { if(hs.contains(tph))