From 70120104628d84aadf6040e6bf100de774f4564c Mon Sep 17 00:00:00 2001 From: Etienne Zink Date: Tue, 29 Mar 2022 15:58:10 +0200 Subject: [PATCH] Korrektur in TypeToDescriptor und TypeToSignature -> Ohne Angabe im Deskriptor wird automatisch angenommen es soll eine spezialisierte Signatur erstellt werden. --- .../bytecode/descriptor/TypeToDescriptor.java | 2 +- .../bytecode/signature/TypeToSignature.java | 12 ++++++------ src/test/resources/bytecode/javFiles/OLFun.jav | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java b/src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java index ca1b9476..f10f8070 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/descriptor/TypeToDescriptor.java @@ -8,7 +8,7 @@ public class TypeToDescriptor implements TypeVisitor{ private final boolean specializedFunN; - public TypeToDescriptor(){ this(false); } + public TypeToDescriptor(){ this(true); } public TypeToDescriptor(boolean specializedFunN) { this.specializedFunN = specializedFunN; } diff --git a/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java b/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java index 52c12cb7..8e5a87dd 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java @@ -19,26 +19,26 @@ import de.dhbwstuttgart.syntaxtree.type.TypeVisitor; public class TypeToSignature implements TypeVisitor { private List constraints; - private final boolean specializedFunN; + private final boolean superFunN; - public TypeToSignature() { this(new ArrayList<>(), false); } + public TypeToSignature() { this(new ArrayList<>(), true); } public TypeToSignature(boolean specializedFunN) { this(new ArrayList<>(), specializedFunN); } public TypeToSignature(List constraints) { - this(constraints, false); + this(constraints, true); } - public TypeToSignature(List constraints, boolean specializedFunN){ + public TypeToSignature(List constraints, boolean superFunN){ this.constraints = constraints; - this.specializedFunN = specializedFunN; + this.superFunN = superFunN; } @Override public String visit(RefType refType) { if(refType.getName().toString().equals("void")) return "V"; - if (refType.getName().toString().matches("Fun\\d+\\$\\$") && specializedFunN){ + if (refType.getName().toString().matches("Fun\\d+\\$\\$") && !superFunN){ FunNUtilities funNUtilities = FunNGenerator.getInstance(); return funNUtilities.getSpecializedSignature(funNUtilities.getArguments(refType.getParaList()), funNUtilities.getReturnType(refType.getParaList())); } diff --git a/src/test/resources/bytecode/javFiles/OLFun.jav b/src/test/resources/bytecode/javFiles/OLFun.jav index feffe034..e2d6f3f7 100644 --- a/src/test/resources/bytecode/javFiles/OLFun.jav +++ b/src/test/resources/bytecode/javFiles/OLFun.jav @@ -11,6 +11,6 @@ public class OLFun { //f = x -> {return x + x;}; m(f, x) { - x = f.apply(x+x); + x = f.apply(x+x); } } \ No newline at end of file