-
Notifications
You must be signed in to change notification settings - Fork 571
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
Jandex - Follow-up on Marko's work #621
base: main
Are you sure you want to change the base?
Conversation
Minor cleanup in passing
We will probably need to ask the Jandex guys to add a proper method. Same for the constructor thing.
Hi @gsmet ! Sorry to hear that, hope you feel better now! As for the tests - I've run it with maven -U option and they passed now... so maybe it was some problem with the local libs ? I don't know ... but it works now! so this issue is resolved (at least for now :) ). I'll look into that maven plugin and let you know when I have something ... |
Also one more thing - I was thinking about this metadata provider - and it is very similar to the annotation based one with similar logic but different types. But as you were saying about the index - that we can only use it up to certain part and then move to reflection, the same apply here - that without some major changes it seems not possible to group the same logic of both providers (annotation and index based ones) in one place ... |
And then there's also this thought that I had related to HV in general, not related to Jandex, about unwrapping validated values with I don't know if this would be of any value to you but I was feeling like share this thought with you... :) |
@marko-bekhta |
Yes. My current opinion is that we should try to get Jandex to work and see how it behaves. If we see it has some value, we will think about how we have to change HV to better fit this addition. Not relying to much on the reflection API in our internals is one of it I think. |
Hi @marko-bekhta and happy new year!
So here is the current state of the Jandex implementation rebased on master. Sorry for it taking so long, I got sick during the holidays and wasn't sufficiently well to make progress on this.
I squashed all your preliminary work in one unique commit as it turned out to be a real pain to rebase given all the changes made by Gunnar in his container work. So I thought fixing the conflicts only once next time would be great ;).
I think it's in a not too bad shape. What is a bit of a shame is that we can use the index only to a certain extent and then we need to go back to reflection. I think we won't be able to do otherwise except if we start a major refactoring to avoid depending too much on reflection in the core HV. Not sure it's gonna happen soon so let's keep it that way for now.
So, the next question is what to do next?
I think it might be a good idea to build an index for each HV module containing annotations we might look for and also an index for validation-api. This could be done with the Jandex Maven plugin (https://github.com/wildfly/jandex-maven-plugin). I think it would be a good idea to create separate indexes for main classes and test classes.
I think you might then be able to assemble a view of all these indexes with
CompositeIndex
, asking the ClassLoader for allMETA-INF/jandex.idx
resources.As for the test failure you have, I really got no idea. It works perfectly for me in Eclipse and Maven with the following configuration: