Repository navigation
Closed
Description
Describe the bug
Using quarkus with graphql and hibernate validator, I get the following warnings.
2021-09-22 10:09:38,512 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for RandomAccessWrappedList(AbstractMapBasedMultimap, Object, List, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
2021-09-22 10:09:38,518 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for WrappedList(AbstractMapBasedMultimap, Object, List, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
2021-09-22 10:09:38,528 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for WrappedCollection(AbstractMapBasedMultimap, Object, Collection, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
2021-09-22 10:09:38,535 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for WrappedList(AbstractMapBasedMultimap, Object, List, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
2021-09-22 10:09:38,545 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for WrappedCollection(AbstractMapBasedMultimap, Object, Collection, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
2021-09-22 10:09:38,555 WARN [org.hib.val.int.pro.jav.JavaBeanExecutable] (Quarkus Main Thread) HV000254: Missing parameter metadata for WrappedCollection(AbstractMapBasedMultimap, Object, Collection, WrappedCollection), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
Which comes from classes from graphql-java like graphql.com.google.common.collect.AbstractMapBasedMultimap$RandomAccessWrappedList
For debugging, put a break point at org.hibernate.validator.internal.util.logging.Log_$logger#missingParameterMetadataWithSyntheticOrImplicitParameters
Could you add '-parameters' flag to compilation?
To Reproduce
code-with-quarkus-graphql-validator.zip
Metadata
Metadata
Assignees
Labels
No labels
Activity
andimarek commentedon Sep 22, 2021
I don't really understand: these are private classes which are no exposed, why does it affect you?
gsmet commentedon Jan 6, 2022
Sorry for the delay in answering, Hibernate Validator lead here. The issue is that in the reproducer, there is an
@Validon ajava.util.Listwhich at runtime ends up being one of your private implementations. Thus Hibernate Validator creates metadata for these classes.When you have synthetic parameters, we need the classes to be compiled with
-parametersto be able to make a proper link between the parameters and the generic parameters (which are separate arrays with very weird rules in Java).Anyway, I think it's now considered good practice to compile things with
-parameters. I will provide a workaround for the OP but I think it would be nice to compile your library with this option.