You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am currently working on writing a Quarkus extension to convert all javax annotations to jakarta annotations (for e.g. javax.annotation.PostConstruct to jakarta.annotation.PostConstruct).
I have written an annotation transformer with a processor triggered during deployment time. But even though it seems that the transformer is picking up the javax PostConstruct annotations and converting them to jakarta PostConstruct annotations (verified with print statements), during runtime the behaviour does not seem to be reflected, and the behaviour is the same as if the transformer did not convert the annotations at all. (javax annotations does not work in Quarkus)
Attached is the code of my transformer and processor including tests, please let me know if I’m missing something. Thanks.
Expected behavior
The extension successfully transforms the javax.annotation.PostConstruct to jakarta.annotation.PostConstruct in Javax2JakartaResource. The changeValue method gets triggered and mutates this.value, causing the test the pass.
Actual behavior
After the transformation, the changeValue method still does not get triggered, which implies the transformation did not happen. this.value does not get mutated and the test fails.
[ERROR] Failures:
[ERROR] Javax2JakartaResourceTest.testValueEndpoint:19 1 expectation failed.
Response body doesn't match expectation.
Expected: is "Value is changed"
Actual: Value is not changed
Comment out line 23 and uncomment line 24 in Javax2JakartaResource.java (replace javax import to jakarta)
run mvn test
observe test pass
Output of uname -a or ver
No response
Output of java -version
openjdk version "23.0.1" 2024-10-15 OpenJDK Runtime Environment (build 23.0.1+11-39) OpenJDK 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)
Quarkus version or git rev
3.15.3
Build tool (ie. output of mvnw --version or gradlew --version)
Describe the bug
Hi, I am currently working on writing a Quarkus extension to convert all javax annotations to jakarta annotations (for e.g.
javax.annotation.PostConstruct
tojakarta.annotation.PostConstruct
).I have written an annotation transformer with a processor triggered during deployment time. But even though it seems that the transformer is picking up the javax PostConstruct annotations and converting them to jakarta PostConstruct annotations (verified with print statements), during runtime the behaviour does not seem to be reflected, and the behaviour is the same as if the transformer did not convert the annotations at all. (javax annotations does not work in Quarkus)
Attached is the code of my transformer and processor including tests, please let me know if I’m missing something. Thanks.
Expected behavior
The extension successfully transforms the
javax.annotation.PostConstruct
tojakarta.annotation.PostConstruct
in Javax2JakartaResource. The changeValue method gets triggered and mutatesthis.value
, causing the test the pass.Actual behavior
After the transformation, the changeValue method still does not get triggered, which implies the transformation did not happen.
this.value
does not get mutated and the test fails.How to Reproduce?
javax2jakarta.zip
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "23.0.1" 2024-10-15 OpenJDK Runtime Environment (build 23.0.1+11-39) OpenJDK 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)
Quarkus version or git rev
3.15.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Maven home: /opt/homebrew/Cellar/maven/3.9.9/libexec Java version: 23.0.2, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home Default locale: en_CA, platform encoding: UTF-8 OS name: "mac os x", version: "15.2", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: