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)
- quarkus cognito user pool extension proxy config HOT 2
- `@TenantFeature` is used instead of `@Tenant` with OIDC `TenantIdentityProvider` HOT 2
- [Extension Proposal] easy-retrofit for Quarkus Extension HOT 3
- SQS Sending/Receiving Message in mutiny reactive HOT 11
- [Extension Proposal] Auto-compensating saga extension HOT 1
- Kafka Reactive Messaging are not automatically acknowledged when input is payload and output is Message<payload> HOT 3
- Support Kotlin 2.0 HOT 3
- extensions (quarkus-container-image-buildpack) : Not able to run container image built using BuildPacks extension HOT 2
- Emitter AMQP protocol stucked after MQ broker restart HOT 4
- Micrometer performance improvements - Stork and binder HOT 1
- Micrometer performance improvements - runtime package HOT 1
- Micrometer performance improvements - mpmetrics package HOT 1
- Implement low memory mode in the OpenTelemetry exporters. HOT 1
- HTTP Access Logs should allow ISO 8601 date format HOT 5
- [Extension Proposal] Nagios health endpoint HOT 3
- Avro AVSC compilation fails with version 3.10 HOT 3
- WebSockets Next: Support for secure upgrade with security annotations only
- Quarkus Rest Client MTLS configuration guide HOT 14
- Add Docs: smallrye-pulsar cannot publish message in sample Quarkus project HOT 13
- Funq not sending CloudEvent / CloudEvent not received by broker HOT 2
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.