From 722d897d4bffc1ddb1b189af52aa9b6e4ac21892 Mon Sep 17 00:00:00 2001 From: Etienne Zink Date: Wed, 6 Apr 2022 07:41:56 +0200 Subject: [PATCH] =?UTF-8?q?Verbesserung=20von=20getSpecializedFunNRefType?= =?UTF-8?q?=20->=20jetzt=20werden=20nur=20noch=20Generics=20und=20TPHs=20a?= =?UTF-8?q?ls=20Parameter=20=C3=BCbergeben.=20Zuvor=20wurden=20zu=20viele?= =?UTF-8?q?=20Parameter=20=C3=BCbergeben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/de/dhbwstuttgart/bytecode/funN/FunNGenerator.java | 2 ++ src/test/java/bytecode/funN/FunNGeneratorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/funN/FunNGenerator.java b/src/main/java/de/dhbwstuttgart/bytecode/funN/FunNGenerator.java index 83ed622d..903fe6d9 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/funN/FunNGenerator.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/funN/FunNGenerator.java @@ -174,6 +174,8 @@ public final class FunNGenerator implements FunNUtilities{ return new RefType(new JavaClassName(getSpecializedClassName(argumentTypes, returnType)), Stream .concat(argumentTypes.stream(), Stream.of(returnType)) + .filter(t -> t instanceof GenericRefType || + t instanceof TypePlaceholder) .collect(Collectors.toList()),null); } } diff --git a/src/test/java/bytecode/funN/FunNGeneratorTest.java b/src/test/java/bytecode/funN/FunNGeneratorTest.java index 2b53d135..b1e14cf0 100644 --- a/src/test/java/bytecode/funN/FunNGeneratorTest.java +++ b/src/test/java/bytecode/funN/FunNGeneratorTest.java @@ -73,13 +73,13 @@ public class FunNGeneratorTest { @Test public void signature_IntInt(){ var classSignature = funNGenerator.getSpecializedSignature(Arrays.asList(integerType), integerType); - assertEquals("LFun1$$Ljava$lang$Integer$_$Ljava$lang$Integer$_$;", classSignature); + assertEquals("LFun1$$Ljava$lang$Integer$_$Ljava$lang$Integer$_$;", classSignature); } @Test public void signature_IntT(){ var classSignature = funNGenerator.getSpecializedSignature(Arrays.asList(integerType), genericT); - assertEquals("LFun1$$Ljava$lang$Integer$_$LT$_$;", classSignature); + assertEquals("LFun1$$Ljava$lang$Integer$_$LT$_$;", classSignature); } @Test