Comments (7)
https://quarkus.io/guides/update-quarkus can help if you want to do a quick update/test on newer versions.
from quarkus.
@mkouba - Thank you for trying this out! Yes if I change the signature to match (I've tried Strings to ensure not confusing ints and longs again..) the tests pass on both 3.2 and 3.8 versions.
👍
I'm still running into the issue with the 2.16 version my company uses, but I'll just use the workaround of calling a wrapper method on a non-cdi bean.
Unfortunately, we do not plan to backport any qute-related fixes into 2.16. But your workaround seems reasonable.
@TemplateExtension(namespace = "obj") public class ObjectExtensionMethods { public static Object[] varargs(Object... args) { return args; } }(Not knowing the workflow on this repo I'm fine with this ticket being closed)
Yes, I will close this issue and create a new one to implement "Widening Primitive Conversion" in templates.
from quarkus.
/cc @mkouba (qute)
from quarkus.
@markus-lehr-dedalus Have you tried with some newer version, i.e. Quarkus 3.2 or 3.8? I do remember that some problems with varargs parameters were fixed.
from quarkus.
Have you tried with some newer version, i.e. Quarkus 3.2 or 3.8?
I created a small reproducer project with both Quarkus 3.8.3 and 3.2.11.Final and indeed the varargs issue persists for CDI beans.
If you look at the test: QuteVarargsTest.java
You can see that varargs work with static namespaced extension methods (first few tests with obj:varargs) but not with the cdi bean's method (i.e. the last 3 tests fail). (Just to prove that the cdi bean is being called and works for non-varargs methods, I created an identity method which just returns whatever int is being haded to it).
from quarkus.
@markus-lehr-dedalus So I've tried to reproduce the problem locally and found an error in the test. The first parameter of the method declared on the CdiExtension
is long
but you pass an integer literal in the template. If you change the type of the param to int
or modify the template like {cdi:varargsTemplateExtension.varargs(5l, foo)}
then the test passes.
That said, I understand that Java does convert the type automatically (Widening Primitive Conversion) but templates don't support this feature yet.
from quarkus.
@mkouba - Thank you for trying this out! Yes if I change the signature to match (I've tried Strings to ensure not confusing ints and longs again..) the tests pass on both 3.2 and 3.8 versions.
I'm still running into the issue with the 2.16 version my company uses, but I'll just use the workaround of calling a wrapper method on a non-cdi bean.
@TemplateExtension(namespace = "obj")
public class ObjectExtensionMethods {
public static Object[] varargs(Object... args) {
return args;
}
}
(Not knowing the workflow on this repo I'm fine with this ticket being closed)
from quarkus.
Related Issues (20)
- [BUG] Reactive MSSQL client randomly loses connection on large queries. HOT 4
- Regression: Unexpected `DisabledOidcClientException` HOT 2
- quarkus echo with bash not working HOT 2
- Move more of Hibernate ORM startup to build-time initialization HOT 1
- CIRCULAR REFERENCE: io.quarkus.runtime.configuration.ConfigurationException: 'quarkus.oidc.client.auth-server-url' property must be configured HOT 3
- Gather build-time data in JVM-mode like we do in native-mode HOT 2
- RestEasy Server - @RestForm List<T>/Set<T> parameters not being split HOT 8
- Support Salesforce oauth_jwt_flow HOT 11
- HTTP 400 while invoking RESTeasy endpoint HOT 4
- UUID and import.sql not working in Quarkus 3.11 with MariaDB 10.11 HOT 11
- Getting io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype intermitently HOT 2
- Clarify kafka commit strategy "latest" in documentation HOT 5
- Qute templates to support Kotlin value classes HOT 2
- 3.11.0 causes carrier thread pinning regression (compared to 3.10.2) while loading classes HOT 75
- ConnectionBase logs NULL messages even with FINE log level HOT 6
- [CI] - Mongock extension - Quarkus main HOT 2
- quarkus-electron (?) ability to make a electron desktop spp HOT 8
- turn on hibernate.highlight_sql HOT 4
- how can I tell what database I'm connecting to? HOT 13
- `@OidcClientFilter` triggers several tokens in concurrency conditions 💣 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus.