From f44f08b895a6e3c7ec3f6e4b07e2a549a553eec1 Mon Sep 17 00:00:00 2001 From: Aldaron7 Date: Wed, 30 May 2018 23:50:32 +0200 Subject: [PATCH] TYPEExpr fixed for newClass. --- .../dhbwstuttgart/strucTypes/Construct.java | 5 ++ .../strucTypes/InferredTypes.java | 22 +++--- .../dhbwstuttgart/strucTypes/StrucTYPE.java | 5 +- src/de/dhbwstuttgart/strucTypes/TYPEExpr.java | 60 +++++++++++------ .../constraint/SubTypeConstraint.java | 33 +++++++++ .../printutils/SyntaxTreePrinter.java | 5 +- .../strucTypes/visitor/InferTypes.java | 8 +-- .../strucTypes/visitor/TypeExtract.java | 47 ++++++++++++- .../syntaxtree/type/GenericRefType.java | 25 +++++++ .../syntaxtree/type/RefType.java | 67 +++++++------------ test/strucType/TestPaperExample.java | 25 ++++--- test/strucType/TestSolve.java | 4 +- test/strucType/constructed/A.java | 3 +- .../strucType/typedtestclasses/MyInteger.java | 1 + 14 files changed, 218 insertions(+), 92 deletions(-) diff --git a/src/de/dhbwstuttgart/strucTypes/Construct.java b/src/de/dhbwstuttgart/strucTypes/Construct.java index f4fce6b5..88619bb1 100644 --- a/src/de/dhbwstuttgart/strucTypes/Construct.java +++ b/src/de/dhbwstuttgart/strucTypes/Construct.java @@ -85,6 +85,11 @@ public class Construct extends DefaultASTVisitor { throw new IllegalInterfaceTypeException( String.format("%s is not a valid type to generate an interface for.", refType)); } + + @Override + public void visit(GenericRefType genericRefType) { + System.out.println(String.format("%s is not a valid type to generate an interface for.", genericRefType)); + } private ClassOrInterface constructInterface(TypePlaceholder i, JavaClassName name) { List fielddecl = new ArrayList<>(); diff --git a/src/de/dhbwstuttgart/strucTypes/InferredTypes.java b/src/de/dhbwstuttgart/strucTypes/InferredTypes.java index fb9621cd..ec6207c1 100644 --- a/src/de/dhbwstuttgart/strucTypes/InferredTypes.java +++ b/src/de/dhbwstuttgart/strucTypes/InferredTypes.java @@ -9,15 +9,15 @@ import java.util.Set; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; -public class InferredTypes implements Map { +public class InferredTypes implements Map { - private Map inferredTypes = new HashMap<>(); + private Map inferredTypes = new HashMap<>(); public static final InferredTypes EMPTY = new InferredTypes(); public void resolveTransitiveTypes() { - Set keySet = this.inferredTypes.keySet(); - for (TypePlaceholder key : keySet) { + Set keySet = this.inferredTypes.keySet(); + for (RefTypeOrTPHOrWildcardOrGeneric key : keySet) { RefTypeOrTPHOrWildcardOrGeneric value = this.inferredTypes.get(key); if (value instanceof TypePlaceholder && keySet.contains(value)) { this.inferredTypes.put(key, this.inferredTypes.get(value)); @@ -51,7 +51,7 @@ public class InferredTypes implements Map m) { + public void putAll(Map m) { inferredTypes.putAll(m); } @@ -71,7 +71,7 @@ public class InferredTypes implements Map keySet() { + public Set keySet() { return inferredTypes.keySet(); } @@ -81,7 +81,7 @@ public class InferredTypes implements Map> entrySet() { + public Set> entrySet() { return inferredTypes.entrySet(); } @@ -92,10 +92,10 @@ public class InferredTypes implements Map iterator = this.inferredTypes.keySet().iterator(); + Iterator iterator = this.inferredTypes.keySet().iterator(); while (iterator.hasNext()) { - TypePlaceholder tph = iterator.next(); - s += tph + " -> " + inferredTypes.get(tph); + RefTypeOrTPHOrWildcardOrGeneric type = iterator.next(); + s += type + " -> " + inferredTypes.get(type); if (iterator.hasNext()) { s += ", "; } diff --git a/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java b/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java index fe512c21..0f00a25a 100644 --- a/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java +++ b/src/de/dhbwstuttgart/strucTypes/StrucTYPE.java @@ -56,8 +56,9 @@ public class StrucTYPE extends DefaultASTVisitor { this.inferredTypes.putAll(typeExpr.getInferredTypes()); this.inferredTypes.resolveTransitiveTypes(); - this.constraintsSet.addConstraintsSet(typeExpr.getConstraints()); - this.constraintsSet.inferTypes(this.inferredTypes); + ConstraintsSet constraints = typeExpr.getConstraints(); + constraints.inferTypes(this.inferredTypes); + this.constraintsSet.addConstraintsSet(constraints); } } diff --git a/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java b/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java index f16f1f82..5ac34137 100644 --- a/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java +++ b/src/de/dhbwstuttgart/strucTypes/TYPEExpr.java @@ -2,6 +2,7 @@ package de.dhbwstuttgart.strucTypes; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import de.dhbwstuttgart.strucTypes.constraint.ConstraintsSet; import de.dhbwstuttgart.strucTypes.constraint.FieldConstraint; @@ -14,6 +15,7 @@ import de.dhbwstuttgart.syntaxtree.Field; import de.dhbwstuttgart.syntaxtree.FormalParameter; import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.statement.ArgumentList; +import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr; import de.dhbwstuttgart.syntaxtree.statement.Block; import de.dhbwstuttgart.syntaxtree.statement.CastExpr; import de.dhbwstuttgart.syntaxtree.statement.Expression; @@ -118,21 +120,25 @@ public class TYPEExpr extends DefaultASTVisitor { } List arguments = methodCall.getArgumentList().getArguments(); - if (!methodTypeVisitor.isTypeVariable() - && methodTypeVisitor.getMethod(methodCall.name, arguments.size()).isPresent()) { - methodTypeVisitor.getMethod(methodCall.name, arguments.size()).ifPresent(m -> { - for (int i = 0; i < arguments.size(); i++) { - this.constraints.addConstraint(new SubTypeConstraint(arguments.get(i).getType(), - m.getParameterList().getParameterAt(i).getType())); - } - this.inferredTypes.put((TypePlaceholder) methodCall.getType(), m.getReturnType()); - }); + Optional method = methodTypeVisitor.getMethod(methodCall.name, arguments.size()); + if (!methodTypeVisitor.isTypeVariable() && method.isPresent()) { + Method m = method.get(); + for (int i = 0; i < arguments.size(); i++) { + this.constraints.addConstraint(new SubTypeConstraint(arguments.get(i).getType(), + m.getParameterList().getParameterAt(i).getType())); + } + this.inferredTypes.put((TypePlaceholder) methodCall.getType(), m.getReturnType()); + } else { MethodConstraint methodConstraint = new MethodConstraint(methodCall.receiver.getType(), methodCall.name, new ArrayList(), methodCall.getType()); arguments.forEach(e -> methodConstraint.addArguments(e.getType())); this.constraints.addConstraint(methodConstraint); } +// System.out.println("\ninferred grt:"); +// System.out.println("map: " + methodTypeVisitor.getGrtToTphMap()); +// System.out.println("generics: " + methodTypeVisitor.getGenerics()); + this.constraints.inferTypes(methodTypeVisitor.getGrtToTphMap()); } @Override @@ -160,6 +166,10 @@ public class TYPEExpr extends DefaultASTVisitor { } else { type.accept(typeExtract); // implement generics nicht nötig + // ClassOrInterface orDefault = + // typedClasses.getOrDefault(type.getName(), + // ClassOrInterfaceFactory.createClass(type).get()); + // orDefault.accept(typeExtract); } this.createNewClassSubTypeConstraints(newClass, typeExtract); } @@ -174,21 +184,29 @@ public class TYPEExpr extends DefaultASTVisitor { "The number of fields (%d) in %s doesn't match the number of arguments (%d) passed to its constructor.", fieldsSize, newClass.name, argumentsSize)); } - + // List of Generics of newClass - List paraList = ((RefType)newClass.getType()).getParaList(); - List formalparalist = typeExtract.getConstructors().get(0).getParameterList().getFormalparalist(); + List paraList = ((RefType) newClass.getType()).getParaList(); + List formalparalist = typeExtract.getConstructors().get(0).getParameterList() + .getFormalparalist(); for (int i = 0; i < argumentsSize; i++) { - // Bei Fields wird kein GenericRefType sondern Object als Typ geparst. - // SubTypeConstraint subTypeConstraint = new SubTypeConstraint(arguments.get(i).getType(), + // Bei Fields wird kein GenericRefType sondern Object als Typ + // geparst. + // SubTypeConstraint subTypeConstraint = new + // SubTypeConstraint(arguments.get(i).getType(), // fields.get(i).getType()); - + // Es darf nur einen Konstruktor mit allen Feldern geben. RefTypeOrTPHOrWildcardOrGeneric supertype = formalparalist.get(i).getType(); supertype = supertype instanceof GenericRefType ? paraList.remove(0) : supertype; SubTypeConstraint subTypeConstraint = new SubTypeConstraint(arguments.get(i).getType(), supertype); this.constraints.addConstraint(subTypeConstraint); } + typeExtract.getSubTypeConstraints().forEach(this.constraints::addConstraint); +// System.out.println("\ninferred grt:"); +// System.out.println("map: " + typeExtract.getGrtToTphMap()); +// System.out.println("generics: " + typeExtract.getGenerics()); + this.constraints.inferTypes(typeExtract.getGrtToTphMap()); } @Override @@ -221,14 +239,18 @@ public class TYPEExpr extends DefaultASTVisitor { public void visit(Return aReturn) { aReturn.retexpr.accept(this); } - + @Override - public void visit(GenericRefType genericRefType){ - + public void visit(GenericRefType genericRefType) { + } - + @Override public void visit(Literal literal) { } + @Override + public void visit(BinaryExpr binary) { + } + } diff --git a/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java b/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java index e14cce7c..11fede11 100644 --- a/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java +++ b/src/de/dhbwstuttgart/strucTypes/constraint/SubTypeConstraint.java @@ -75,6 +75,39 @@ public class SubTypeConstraint { } return null; } + + + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((subtype == null) ? 0 : subtype.hashCode()); + result = prime * result + ((supertype == null) ? 0 : supertype.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + SubTypeConstraint other = (SubTypeConstraint) obj; + if (subtype == null) { + if (other.subtype != null) + return false; + } else if (!subtype.equals(other.subtype)) + return false; + if (supertype == null) { + if (other.supertype != null) + return false; + } else if (!supertype.equals(other.supertype)) + return false; + return true; + } @Override public String toString() { diff --git a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java index 19972fc1..e3e4bbb2 100644 --- a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java +++ b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java @@ -312,7 +312,10 @@ public class SyntaxTreePrinter implements ASTVisitor { @Override public void visit(BinaryExpr binary) { - throw new NotImplementedException(); + System.out.println("binary"); +// binary.lexpr.accept(this); +// System.out.println(binary.operation); +// binary.rexpr.accept(this); } @Override diff --git a/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java b/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java index bdfa69ad..bb70713a 100644 --- a/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/InferTypes.java @@ -206,8 +206,9 @@ public class InferTypes implements ASTReturnVisitor { } @Override - public GenericRefType visit(GenericRefType genericRefType) { - return genericRefType; + public RefTypeOrTPHOrWildcardOrGeneric visit(GenericRefType genericRefType) { + RefTypeOrTPHOrWildcardOrGeneric inferredType = inferredTypes.infer(genericRefType); + return inferredType; } @Override @@ -229,8 +230,7 @@ public class InferTypes implements ASTReturnVisitor { @Override public BinaryExpr visit(BinaryExpr binary) { - throw new NotImplementedException(); - + return binary; } @Override diff --git a/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java b/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java index 7df4d76e..03de7394 100644 --- a/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java +++ b/src/de/dhbwstuttgart/strucTypes/visitor/TypeExtract.java @@ -1,18 +1,23 @@ package de.dhbwstuttgart.strucTypes.visitor; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Optional; import de.dhbwstuttgart.parser.scope.JavaClassName; +import de.dhbwstuttgart.strucTypes.InferredTypes; import de.dhbwstuttgart.strucTypes.classorinterface.ClassOrInterfaceFactory; +import de.dhbwstuttgart.strucTypes.constraint.SubTypeConstraint; import de.dhbwstuttgart.syntaxtree.ClassOrInterface; import de.dhbwstuttgart.syntaxtree.Constructor; import de.dhbwstuttgart.syntaxtree.Field; import de.dhbwstuttgart.syntaxtree.GenericDeclarationList; import de.dhbwstuttgart.syntaxtree.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.Method; +import de.dhbwstuttgart.syntaxtree.type.GenericRefType; import de.dhbwstuttgart.syntaxtree.type.RefType; +import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; /** @@ -28,6 +33,8 @@ public class TypeExtract extends DefaultASTVisitor { private List methods = new ArrayList<>(); private List constructors = new ArrayList<>(); private List generics = new ArrayList<>(); + private InferredTypes grtToTphMap = InferredTypes.EMPTY; + private List subTypeConstraints = new ArrayList<>(); private boolean typeVariable = false; private boolean initialClass = true; @@ -47,6 +54,14 @@ public class TypeExtract extends DefaultASTVisitor { return generics; } + public InferredTypes getGrtToTphMap() { + return grtToTphMap; + } + + public List getSubTypeConstraints() { + return subTypeConstraints; + } + public Optional getField(String fieldName) { return this.fields.stream().filter(f -> f.getName().equals(fieldName)) // keine statische Polymorphie zugelassen @@ -85,7 +100,26 @@ public class TypeExtract extends DefaultASTVisitor { @Override public void visit(RefType refType) { this.typeVariable = false; - ClassOrInterfaceFactory.createClass(refType).ifPresent(c -> c.accept(this)); + Optional createClass = ClassOrInterfaceFactory.createClass(refType); + // refType und createClass haben evtl. unterschiedliche + // Klassenparameter (refType -> tph| createClass -> gtv). Diese werden + // in grtToTphMap gespeichert. + if (createClass.isPresent()) { + ClassOrInterface cls = createClass.get(); + cls.getGenerics().accept(this); + Iterator iteratorGtv = cls.getGenerics().iterator(); + Iterator iteratorTPH = refType.getParaList().iterator(); + while (iteratorGtv.hasNext()) { + GenericTypeVar nextGtv = iteratorGtv.next(); + GenericRefType grt = new GenericRefType(nextGtv.getName(), nextGtv.getOffset()); + RefTypeOrTPHOrWildcardOrGeneric nextTPH = iteratorTPH.next(); + if (nextTPH instanceof TypePlaceholder) { + TypePlaceholder tph = (TypePlaceholder) nextTPH; + this.grtToTphMap.put(grt, tph); + } + } + cls.accept(this); + } } @Override @@ -117,6 +151,17 @@ public class TypeExtract extends DefaultASTVisitor { public void visit(GenericTypeVar genericTypeVar) { if (!this.generics.contains(genericTypeVar)) { this.generics.add(genericTypeVar); + // Aus den bounds können die Subtypconstraints abgeleitet werden. + RefTypeOrTPHOrWildcardOrGeneric bound = genericTypeVar.getBounds().get(0); + if (!((bound instanceof RefType) + && ((RefType) bound).getName().equals(new JavaClassName("java.lang.Object")))) { + this.subTypeConstraints.add(new SubTypeConstraint( + new GenericRefType(genericTypeVar.getName(), genericTypeVar.getOffset()), bound)); + } } } + + @Override + public void visit(GenericRefType genericRefType) { + } } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java b/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java index fb9fb142..aeaae27a 100644 --- a/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java @@ -39,5 +39,30 @@ public class GenericRefType extends RefType public RefTypeOrTPHOrWildcardOrGeneric accept(ASTReturnVisitor visitor) { return visitor.visit(this); } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + GenericRefType other = (GenericRefType) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } } diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java index 4af79edd..3636a306 100644 --- a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java @@ -46,10 +46,11 @@ public class RefType extends RefTypeOrTPHOrWildcardOrGeneric @Override public int hashCode() { - int hash = 0; - hash += super.hashCode(); - hash += this.name.hashCode();//Nur den Name hashen. Sorgt für langsame, aber funktionierende HashMaps - return hash; + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((parameter == null) ? 0 : parameter.hashCode()); + return result; } public RefType(JavaClassName fullyQualifiedName, List parameter, Token offset) @@ -69,43 +70,27 @@ public class RefType extends RefTypeOrTPHOrWildcardOrGeneric return this.parameter; } - /** - * Author: Jrg Buerle
- * @return - */ - public boolean equals(Object obj) - { - if(obj instanceof RefType){ - boolean ret = true; - - if(!super.equals(obj)) - return false; - - if(parameter==null || parameter.size()==0){ - ret &= (((RefType)obj).getParaList()==null || ((RefType)obj).getParaList().size()==0); - } - else{ - if(((RefType)obj).getParaList()==null){ - ret = false; - } - else if(parameter.size() != ((RefType)obj).getParaList().size()) - { - ret = false; - } - else - { - for(int i = 0; i files = new ArrayList<>(); -// files.add(new File(rootDirectory + "testPaperExample.jav")); -// trans(files); -// files.clear(); - files.add(new File(rootDirectory + "constructed/A.java")); + files.add(new File(rootDirectory + "javFiles/testPaperExample.jav")); + trans(files); + files.clear(); +// files.add(new File(rootDirectory + "constructed/A.java")); +// files.add(new File(rootDirectory + "typedtestclasses/MyInteger.java")); files.add(new File(rootDirectory + "javFiles/testMain.jav")); trans(files); } @@ -49,42 +51,45 @@ public class TestPaperExample { // Print SourceFile Infos SyntaxTreePrinter syntaxtreeprinter = new SyntaxTreePrinter(); sourceFile.accept(syntaxtreeprinter); + // List typedClasses = + // compiler.sourceFiles.values().stream().flatMap(sf->sf.getClasses().stream()).collect(Collectors.toList()); + System.out.println("\n--StrucTYPE--"); StrucTYPE strucTYPE = new StrucTYPE(sourceFile); final ConstraintsSet constraints = strucTYPE.getConstraints(); final InferredTypes inferredTypesType = strucTYPE.getInferredTypes(); - System.out.println("\n--StrucTYPE--"); printConstraints.print(constraints); PrintInferredTypes.print(inferredTypesType); + System.out.println("\n--Construct--"); Construct construct = new Construct(constraints, inferredTypesType); final List constructedInterfaces = construct.getConstructedInterfaces(); final Set subTypeConstraints = construct.getSubTypeConstraints(); final InferredTypes inferredTypesConstruct = construct.getInferredTypes(); - System.out.println("\n--Construct--"); System.out.println("\nConstructed Interfaces:"); constructedInterfaces.forEach(i -> i.accept(syntaxtreeprinter)); printConstraints.printSubTypeConstraints(subTypeConstraints); PrintInferredTypes.print(inferredTypesConstruct); - + System.out.println("\n--Solve--"); // Alle Klassen aus allen SourceFiles List availableClasses = compiler.getAvailableClasses(sourceFile); FiniteClosure finiteClosure = UnifyTypeFactory.generateFC(availableClasses); System.out.println("\nFinite Closure:"); System.out.println(finiteClosure); - Solve solve = new Solve(subTypeConstraints, sourceFile.getClasses().get(0), finiteClosure, inferredTypesConstruct); + Solve solve = new Solve(subTypeConstraints, sourceFile.getClasses().get(0), finiteClosure, + inferredTypesConstruct); ClassOrInterfaceWithConstraints solvedClass = solve.getSolvedClass(); System.out.println("\nSolved Class:"); solvedClass.accept(syntaxtreeprinter); System.out.println("\nRemaining Constraints:"); printConstraints.printSubTypeConstraints(solvedClass.getConstraints()); PrintInferredTypes.print(inferredTypesConstruct); - + System.out.println("____________________________________________________________________________"); } } diff --git a/test/strucType/TestSolve.java b/test/strucType/TestSolve.java index 72882043..e59f8eb8 100644 --- a/test/strucType/TestSolve.java +++ b/test/strucType/TestSolve.java @@ -47,15 +47,16 @@ public class TestSolve { SyntaxTreePrinter syntaxtreeprinter = new SyntaxTreePrinter(); sourceFile.accept(syntaxtreeprinter); + System.out.println("\n--StrucTYPE--"); StrucTYPE strucTYPE = new StrucTYPE(sourceFile); final ConstraintsSet constraints = strucTYPE.getConstraints(); final InferredTypes inferredTypesType = strucTYPE.getInferredTypes(); - System.out.println("\n--StrucTYPE--"); printConstraints.print(constraints); PrintInferredTypes.print(inferredTypesType); + System.out.println("\n--Construct--"); Construct construct = new Construct(constraints, inferredTypesType); final List constructedInterfaces = construct.getConstructedInterfaces(); @@ -63,7 +64,6 @@ public class TestSolve { // Set subTypeConstraints = construct.getSubTypeConstraintsAsUnifyPairs(); final InferredTypes inferredTypesConstruct = construct.getInferredTypes(); - System.out.println("\n--Construct--"); System.out.println("\nConstructed Interfaces:"); constructedInterfaces.forEach(i -> i.accept(syntaxtreeprinter)); printConstraints.printSubTypeConstraints(subTypeConstraints); diff --git a/test/strucType/constructed/A.java b/test/strucType/constructed/A.java index 2125bf92..b3642499 100644 --- a/test/strucType/constructed/A.java +++ b/test/strucType/constructed/A.java @@ -1,8 +1,9 @@ package strucType.constructed; + import strucType.constructed.L; import strucType.constructed.O; -public class A, M extends U, P, N extends V, V, AD extends O, U> { +public class A, AD extends O, M extends U, N extends V, U, P, V> { public A() { } diff --git a/test/strucType/typedtestclasses/MyInteger.java b/test/strucType/typedtestclasses/MyInteger.java index d8b8a5db..e63aeff8 100644 --- a/test/strucType/typedtestclasses/MyInteger.java +++ b/test/strucType/typedtestclasses/MyInteger.java @@ -2,6 +2,7 @@ package strucType.typedtestclasses; import strucType.constructed.L; import strucType.constructed.O; +import java.lang.Integer; public class MyInteger implements L, O {