From 6f193b19abfce46f402a4525b03f204224344828 Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Tue, 7 Nov 2023 00:13:43 +0100 Subject: [PATCH] modified: src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java modified: src/test/java/TestComplete.java --- .../parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java | 3 +++ src/test/java/TestComplete.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java index 0a7106f3..895c4ecd 100644 --- a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java +++ b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java @@ -445,6 +445,9 @@ public class SyntaxTreeGenerator { MethodblockContext methodblock = (MethodblockContext) body; block = stmtgen.convert(methodblock.block(), true); } + else { + modifiers += Modifier.ABSTRACT; + } return new Method(modifiers, name, retType, paramlist, block, gtvDeclarations, bodydeclaration.getStart()); } diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index d3ca98f4..43c8883d 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -740,7 +740,7 @@ public class TestComplete { @Test public void testLambdaRunnable() throws Exception { var classFiles = generateClassFiles(new ByteArrayClassLoader(), "LambdaRunnable.jav"); - var clazz = classFiles.get("LamRunnable"); + var clazz = classFiles.get("LambdaRunnable"); var instance = clazz.getDeclaredConstructor().newInstance(); //var m = clazz.getDeclaredMethod("m", Integer.class); //assertEquals(m.invoke(instance, 10), 60);