Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qute deployment errors with template parameter declaration of concrete classes and usage of default methods #16337

Closed
Maldivia opened this issue Apr 7, 2021 · 2 comments · Fixed by #16348
Assignees
Labels
area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@Maldivia
Copy link
Contributor

Maldivia commented Apr 7, 2021

Describe the bug

Given the following example classes:

package org.acme;
public class Name implements Something {
    public String name() {
        return "Name";
    }
}
package org.acme;
public interface Something {
    String name();
    default String fullName() {
        return name() + " Surname";
    }
}

And the following template:

{@org.acme.Name name}
Hello {name.fullName}

Running mvn quarkus:dev fails with the following error:

[error]: Build step io.quarkus.qute.deployment.QuteProcessor#processTemplateErrors threw an exception: io.quarkus.qute.TemplateException: Found template problems (1):
[1] Incorrect expression found: {name.fullName}
        - property/method [fullName] not found on class [org.acme.Name] nor handled by an extension method
        - at main.html:2
        at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:195)
(...)
        Suppressed: io.quarkus.qute.TemplateException: Incorrect expression found: {name.fullName}
        - property/method [fullName] not found on class [org.acme.Name] nor handled by an extension method
        - at main.html:2
                at io.quarkus.qute.deployment.QuteProcessor.processTemplateErrors(QuteProcessor.java:175)
                ... 10 more

If I change the templated to use the interface instead, it works as expected:

{@org.acme.Something name}
Hello {name.fullName}

mvn version: Apache Maven 3.8.1
java version: build 11.0.10+9
quarkus-plugin.version: 1.13.1.Final
quarkus.platform.version: 1.13.1.Final

@Maldivia Maldivia added the kind/bug Something isn't working label Apr 7, 2021
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Apr 7, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 7, 2021

/cc @mkouba

@mkouba mkouba self-assigned this Apr 8, 2021
mkouba added a commit to mkouba/quarkus that referenced this issue Apr 8, 2021
- resolves quarkusio#16337
- also replace some deprecated APIs from tests
@mkouba
Copy link
Contributor

mkouba commented Apr 8, 2021

It's the default method that was not handled correctly.

@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 8, 2021
@gsmet gsmet modified the milestones: 2.0 - main, 1.13.2.Final Apr 10, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 10, 2021
- resolves quarkusio#16337
- also replace some deprecated APIs from tests

(cherry picked from commit 7e3832b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants