-
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
Fix 'Failed to index' warnings for arrays from entities #17890
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.
LGTM. The check skips arrays of enums, but then the code after the check isn't able to handle those anyway, so it's just a pre-existing limitation (which I'm perfectly fine with, BTW).
@@ -350,7 +350,8 @@ private void addClassHierarchyToReflectiveList(Collector collector, DotName clas | |||
// we need to check for enums | |||
for (FieldInfo fieldInfo : classInfo.fields()) { | |||
Type fieldType = fieldInfo.type(); | |||
if (Type.Kind.PRIMITIVE == fieldType.kind()) { | |||
if (Type.Kind.CLASS != fieldType.kind()) { |
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.
Hm, this would also skip parameterized types. I don't know if it could be a problem in the context of hibernate extension... just saying.
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 loop is about registering enum types for reflection. I don't think an enum can even be parameterized? Even if it can, I don't think the code below would work.
Regardless... I'm sure there are problems with this code (I mean the whole class), in particular with complex models involving generics. IMO our best way forward is to just avoid the need for registering types for reflection. Which is something we've been working on :)
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.
Ok np, I didn't know it's for enums only ;-)
See https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/.5B2.2E0.2E0.2ECR3.2B.5D.20.22Failed.20to.20index.22.20warnings
Fix as suggested by @yrodiere