quarkus: Minus not working with Integer in qute after upgrading to 3.0.1.Final
Describe the bug
After upgrading quarkus version to 3.0.1.Final, without changing anything else, appeared an error in qute templates:
io.quarkus.qute.TemplateException: Rendering error in template [HtmlPagesController/commentaries.html] line 60:
Method "minus(2)" not found on the base object "java.lang.Integer" in expression {commentariesRenderingInformation.renderingPageNumber.minus(2)}
It appeared in this line:
{#let indexOfPreviousPage = commentariesRenderingInformation.renderingPageNumber.minus(2)}
Expected behavior
This expression worked fine until quarkus version upgrade, so the expected behavior is a correct subtraction.
Actual behavior
Subtraction falls with an error
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
17.0.2
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.0.1.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Gradle 8.1
Additional information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (16 by maintainers)
Commits related to this issue
- Qute - fix a regression introduced in #32653 (3.0.1) - value resolvers are not registered for non-application classes after hot reload - fixes #32959 — committed to mkouba/quarkus by mkouba a year ago
- Qute - fix a regression introduced in #32653 (3.0.1) - value resolvers are not registered for non-application classes after hot reload - fixes #32959 — committed to mkouba/quarkus by mkouba a year ago
- Qute - fix a regression introduced in #32653 (3.0.1) - value resolvers are not registered for non-application classes after hot reload - fixes #32959 — committed to mkouba/quarkus by mkouba a year ago
- Qute - fix a regression introduced in #32653 (3.0.1) - value resolvers are not registered for non-application classes after hot reload - fixes #32959 (cherry picked from commit 157aac4c1c7ab878e54e5... — committed to gsmet/quarkus by mkouba a year ago
- chore(deps): update all non-major dependencies (mulk/quarkus-googlecloud-jsonlogging!15) This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.quarkus:... — committed to benkard/quarkus-googlecloud-jsonlogging by deleted user a year ago
You can only the minus
-sign in output expressions; i.e.{commentariesRenderingInformation.renderingPageNumber - 2}is supported. In section params you either need to use the method notation (commentariesRenderingInformation.renderingPageNumber.minu(2)) or parentheses:{#let indexOfPreviousPage = (commentariesRenderingInformation.renderingPageNumber - 2)}(see https://quarkus.io/guides/qute-reference#sections).Thanks. I was able to reproduce the problem with qute-quickstart. It’s actually a regression introduced in https://github.com/quarkusio/quarkus/pull/32653 (3.0.1.Final). I’m working on a fix.
I have added reproducer to logn.html file. Please, get the latest commit of the same branch, start the application as before and go to
/pages/login(it will work fine), after that trigger live reload(for example, comment line 152 of HtmlPagesController) and refresh the page and you will get the errorIt is strange but this error appears after live reload as @rasmushaglund said. On the first start of the application it works fine. After first live reload it crashes with this error. Here is a reproducer. To get the error you should clone the repo, checkout the branch 9-connect-backend-with-frontend, start the application, after that please comment line 152 in HtmlPagesController.kt to trigger live reload and to see the page without authentication and then if you go to http://localhost:8080/pages/resumes?pageIndex=0&pageSize=5 you will get that error.
2.16.6.Final