Details
-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
5.0
-
None
-
None
Description
Any generic parameter in a setter/getter, that is array (e.g. Map<String,String[]>) causes exception that is below.
See attached file with a test that covers this issue.
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be cast to java.lang.Class at info.magnolia.jcr.node2bean.impl.TypeMappingImpl.inferGenericTypes(TypeMappingImpl.java:161) at info.magnolia.jcr.node2bean.impl.TypeMappingImpl.getPropertyTypeDescriptor(TypeMappingImpl.java:110) at info.magnolia.jcr.node2bean.TypeDescriptor.getPropertyDescriptors(TypeDescriptor.java:131) at info.magnolia.jcr.node2bean.TypeDescriptor.getPropertyTypeDescriptor(TypeDescriptor.java:108) at info.magnolia.jcr.node2bean.impl.Node2BeanTransformerImpl.resolveType(Node2BeanTransformerImpl.java:182) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:117) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toMap(Node2BeanProcessorImpl.java:227) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:132) at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:89) at info.magnolia.jcr.node2bean.Node2BeanTest.testShouldHandleArrayTypes(Node2BeanTest.java:994) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Checklists
Acceptance criteria