-
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
Support record inside JandexUtil #28229
Conversation
This comment has been minimized.
This comment has been minimized.
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.
This change LGTM, but I've got 2 notes:
- The
isSubclassOf
method didn't work correctly whenparentName
wasjava.lang.Object
. Now, it won't work correclty ifparentName
is alsojava.lang.Record
. I guess that's not too big of an issue by now? - RESTEasy Reactive carries a copy of
JandexUtil
that has already drifted a little. Maybe we should do this change there as well? CC @geoand
96a769c
to
ee1e07c
Compare
I'm rescinding my approval here, because I don't really understand how Quarkus uses Jandex internally. I also think that using the "computing" index (which indexes classes on demand) is probably a better choice.
Sounds like a good idea to me |
@Ladicek I added your commit to the branch so we have now an almost fully functionning JandexUtil for records. |
I would agree with the original form of this PR, as an optimization. (Also done in the RESTEasy Reactive copy of |
Ok I'll change it tomorrow. I did it thus way because there is a bunch of places in Panache code where the same if is made. |
Can you please try using the computed index and see if those |
This comment has been minimized.
This comment has been minimized.
@Ladicek using the computing index didn't change anything, I can do it if you prefere (I prepare a PR for some changes that must be done at MongoDB with Panache side but I need to do more test). I propose to revert to my previous changes without the new method and also impact the resteasy reactive JandexUtil, by the way, some methods are not used (at least it's what IntelliJ said), can I remove them? |
I think I'd prefer to keep the 2 |
224b416
to
2453904
Compare
BTW if there's a need to special-case for records, you can always check |
Sooooo, @Ladicek your undertanding of records is OK, I was hit by a testing issue by the CLI not recompiling ... Yes, using the computing index inside the processor fix the issue. Should I dismiss this PR ? |
You can see the difference here: https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/steps/CombinedIndexBuildStep.java In short, the computing index is a composite of the original index (that you currently use) and a mutable index that produces |
And we don't have to dismiss the PR. Your commit works as an optimization, and my commit actually fixes a method that previously wasn't aware of records. |
OK, great. I'll prepare a PR that switch to the computing index for Panache and make some test (this will be the hard part). I wonder if I should create an integration test running Java 17 with some records in it. I'll open a discussion in Zulip about this. |
@holly-cummins this PR fails on the MacOS build very ealry, you may want to have a look. As CI failres seems unrelated, I merge this one. |
Improve Java records support.
The only place where I tested it is with MongoDB with Panache, thanks to this PR MongoDB entity can now be declared as records. Other places should require more work.
There is no test as there is no facility in Quarkus yet to test functionalities provided by java version different than the one we build with.