-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Avoid class initializations more aggressively in the Hibernate ORM extension #15822
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good except for some missing tests in non-ORM modules (envers, etc.).
But I'd really like a more future-proof approach when it comes to tests... if maintainers have to think of adding a test every time they add a constant, you can bet that eventually they will forget to. I made a suggestion to avoid that (to some extent) below.
...-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
Outdated
Show resolved
Hide resolved
...deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateUserTypeProcessor.java
Outdated
Show resolved
Hide resolved
...eployment/src/main/java/io/quarkus/hibernate/envers/deployment/HibernateEnversProcessor.java
Show resolved
Hide resolved
...rm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmAnnotations.java
Show resolved
Hide resolved
What's the status of this? |
Seems like I have to add the tests. I will try to get it done before tonight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanne @gsmet Done. I pushed two additional commits to regroup all class name constants in the same util class, so that hopefully someone adding a new constant will add it there and will automatically have their constant tested.
I tried adding DotName.createSimple
to the forbidden APIs, but we cannot do that because there are valid uses of that method with dynamic arguments (class names retrieved from annotations).
So I guess this will have to do.
Rebased to fix a conflict. |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs
Test Failures⚙️ JVM Tests - JDK 11 #📦 extensions/resteasy-reactive/quarkus-resteasy-reactive-jsonb/deployment# Tests: 16
+ Success: 14
- Failures: 1
- Errors: 0
! Skipped: 1 ❌
|
…gle class So that we can test them easily.
As discussed on the mailing list, this takes better advantage of the Forbidden API plugin to avoid unnecessarily initialization of classes, which is particularly important in this extension.
Fixes #15728