From fdd1ae4418ff3a7428553b02d8b07fecd69d0649 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Wed, 2 Oct 2024 15:13:11 +0200 Subject: [PATCH] Qute: fix generated ValueResolver for default methods with params - follows up on https://github.com/quarkusio/quarkus/pull/43602 --- .../io/quarkus/qute/generator/ValueResolverGenerator.java | 8 ++++---- .../java/io/quarkus/it/qute/DefaultMethodResource.java | 7 +++++-- .../resources/templates/DefaultMethodResource/hello.txt | 2 +- .../src/test/java/io/quarkus/it/qute/QuteTestCase.java | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ValueResolverGenerator.java b/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ValueResolverGenerator.java index b390b7b5a60a9..329acd30c1fc8 100644 --- a/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ValueResolverGenerator.java +++ b/independent-projects/qute/generator/src/main/java/io/quarkus/qute/generator/ValueResolverGenerator.java @@ -707,7 +707,7 @@ private void matchMethod(MethodInfo method, ClassInfo clazz, MethodCreator resol } if (Modifier.isStatic(method.flags())) { - if (Modifier.isInterface(clazz.flags())) { + if (Modifier.isInterface(method.declaringClass().flags())) { tryCatch.assign(invokeRet, tryCatch.invokeStaticInterfaceMethod(MethodDescriptor.of(method), realParamsHandle)); } else { @@ -715,7 +715,7 @@ private void matchMethod(MethodInfo method, ClassInfo clazz, MethodCreator resol tryCatch.invokeStaticMethod(MethodDescriptor.of(method), realParamsHandle)); } } else { - if (Modifier.isInterface(clazz.flags())) { + if (Modifier.isInterface(method.declaringClass().flags())) { tryCatch.assign(invokeRet, tryCatch.invokeInterfaceMethod(MethodDescriptor.of(method), whenBase, realParamsHandle)); } else { @@ -853,7 +853,7 @@ private void matchMethods(String matchName, int matchParamsCount, Collection