diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index e264f0f4..4710a02e 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -188,7 +188,7 @@ public class JavaTXCompiler { cl.getMethods().add(new Method(m.modifier, m.name, m.getReturnType().acceptTV(new TypeExchanger(gtvs)), newParaList, m.block, //new GenericDeclarationList(newGenericsList, ((GenericDeclarationList)m.getGenerics()).getOffset()), (GenericDeclarationList)m.getGenerics(), - m.getOffset())); + m.getOffset(), true)); } } diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java index e52b3cd0..c7c6c6cc 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java @@ -679,8 +679,8 @@ public class RuleSet implements IRuleSet{ result = result.stream().map(x -> uni.apply(pair,x)).collect(Collectors.toCollection(ArrayList::new)); result1 = result1.stream().map(x -> uni.apply(pair,x)).collect(Collectors.toCollection(LinkedList::new)); - Function,? extends Constraint> applyUni = b -> b.stream().map( - x -> uni.apply(pair,x)).collect(Collectors.toCollection(Constraint::new)); + Function,? extends Constraint> applyUni = b -> b.stream().map( + x -> uni.apply(pair,x)).collect(Collectors.toCollection(() -> new Constraint(b.isInherited()))); List>> oderConstraintsRet = new ArrayList<>(); for(Set> oc : oderConstraints) { //Set> ocRet = new HashSet<>(); @@ -689,7 +689,7 @@ public class RuleSet implements IRuleSet{ oderConstraintsRet.add(csRet); //} } - oderConstraints.replaceAll(oc -> oc.stream().map(applyUni).collect(Collectors.toCollection(Constraint::new))); + oderConstraints.replaceAll(oc -> oc.stream().map(applyUni).collect(Collectors.toCollection(HashSet::new))); /* oderConstraints = oderConstraints.stream().map( a -> a.stream().map(applyUni diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 8ebce509..19a6c48b 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -1364,7 +1364,8 @@ public class TypeUnifyTask extends RecursiveTask>> { while (nextSetasListIt.hasNext()) { Set a_next = nextSetasListIt.next(); if (a_new.equals(a_next) || - (oup.compare(a_new, a_next) == -1)) { + ((oup.compare(a_new, a_next) == -1) && + (!oderConstraint || ((Constraint)a_new).isInherited()))){ writeLog("Removed: " + a_next.toString()); nextSetasList.remove(a_next); //PL geaendert 2019-01-09 } @@ -1383,7 +1384,8 @@ public class TypeUnifyTask extends RecursiveTask>> { while (nextSetasListIt.hasNext()) { Set a_next = nextSetasListIt.next(); if (a_new.equals(a_next) || - (oup.compare(a_new, a_next) == 1)) { + ((oup.compare(a_new, a_next) == 1) && + (!oderConstraint || ((Constraint)a_next).isInherited()))){ writeLog("Removed: " + a_next.toString()); nextSetasList.remove(a_next); }