You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Binder with types, that use covariant return types for overridden methods, results in IllegalStateException.
I extended com.vaadin.flow.data.binder.BeanPropertySetTest to reflect this bug. I uploaded a patch under example.
Test result:
java.lang.IllegalStateException: Two property definition for property number are discovered with different types: class java.lang.Number and class java.lang.Integer
at com.vaadin.flow.data.binder.BeanPropertySet.mergePropertyDefinitions(BeanPropertySet.java:348)
at java.base/java.util.HashMap.merge(HashMap.java:1383)
at java.base/java.util.stream.Collectors.lambda$toMap$68(Collectors.java:1673)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.vaadin.flow.data.binder.BeanPropertySet.<init>(BeanPropertySet.java:333)
at com.vaadin.flow.data.binder.BeanPropertySet.<init>(BeanPropertySet.java:371)
at com.vaadin.flow.data.binder.BeanPropertySet.lambda$get$3(BeanPropertySet.java:477)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at com.vaadin.flow.data.binder.BeanPropertySet.get(BeanPropertySet.java:477)
at com.vaadin.flow.data.binder.BeanPropertySetTest.get_beanImplementsSeveralInterfacesWithCovariantReturnTypes_noIllegalState(BeanPropertySetTest.java:389)
Expected behavior
This is valid Java Code. It should be possible to use this with Binder.
Description of the bug
Using Binder with types, that use covariant return types for overridden methods, results in IllegalStateException.
I extended com.vaadin.flow.data.binder.BeanPropertySetTest to reflect this bug. I uploaded a patch under example.
Test result:
Expected behavior
This is valid Java Code. It should be possible to use this with Binder.
Minimal reproducible example
Test_fails_for_covariant_return_types_.patch
Versions
The text was updated successfully, but these errors were encountered: