Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-350

Marshalling generator fails when portable type contains a field of type Map<String, String[]>

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.1.Final
    • Fix Version/s: 2.0.2.Final, 2.1.0.Beta1
    • Component/s: None
    • Labels:
      None

      Description

      Generating marshallers for portable types that contain map fields using array values (e.g. Map<String, String[]>) fails with an exception in codegen:

      java.lang.RuntimeException: error generating method call for: setData([((java.util.Map)((java.util.Map)[Statement:[StackReset] -> [[LoadVariable<java_util_Map>][[MethodCall<demarshall([[Statement:[[LoadVariable<obj>][[MethodCall<get([data])>]null]]], [Statement:[[LoadVariable<a1>]null]]])>]null]]]))])
      at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:117)
      at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46)
      at org.jboss.errai.codegen.builder.callstack.LoadVariable.handleCall(LoadVariable.java:122)
      at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      at org.jboss.errai.codegen.control.IfBlock.generate(IfBlock.java:65)
      at org.jboss.errai.codegen.builder.callstack.ConditionalBlockCallElement.handleCall(ConditionalBlockCallElement.java:46)
      at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      at org.jboss.errai.codegen.control.TryBlock.generate(TryBlock.java:59)
      at org.jboss.errai.codegen.builder.impl.TryBlockBuilderImpl$1.doDeferred(TryBlockBuilderImpl.java:54)
      at org.jboss.errai.codegen.builder.callstack.DeferredCallElement.handleCall(DeferredCallElement.java:39)
      at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$2$1.doGenerate(AnonymousClassStructureBuilderImpl.java:109)
      at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.doGenerate(AnonymousClassStructureBuilderImpl.java:180)
      at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.access$3(AnonymousClassStructureBuilderImpl.java:162)
      at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$3.generate(AnonymousClassStructureBuilderImpl.java:148)
      at org.jboss.errai.codegen.builder.impl.ObjectBuilder$2.doDeferred(ObjectBuilder.java:172)
      at org.jboss.errai.codegen.builder.callstack.DeferredCallElement.handleCall(DeferredCallElement.java:39)
      at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46)
      at org.jboss.errai.codegen.builder.callstack.ResetCallElement.handleCall(ResetCallElement.java:29)
      at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      at org.jboss.errai.codegen.builder.impl.ObjectBuilder.generate(ObjectBuilder.java:180)
      at org.jboss.errai.codegen.util.GenUtil.generate(GenUtil.java:138)
      at org.jboss.errai.codegen.builder.callstack.AssignVariable.handleCall(AssignVariable.java:46)
      at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46)
      at org.jboss.errai.codegen.builder.callstack.LoadVariable.handleCall(LoadVariable.java:122)
      at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:63)
      at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:67)
      at org.jboss.errai.codegen.meta.impl.build.BuildMetaConstructor.toJavaString(BuildMetaConstructor.java:282)
      at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.membersToString(BuildMetaClass.java:642)
      at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.toJavaString(BuildMetaClass.java:587)
      at org.jboss.errai.codegen.builder.impl.ClassBuilder.toJavaString(ClassBuilder.java:486)
      at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory._generate(MarshallerGeneratorFactory.java:253)
      at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory.generate(MarshallerGeneratorFactory.java:109)
      at org.jboss.errai.marshalling.server.util.ServerMarshallUtil.getGeneratedMarshallerFactoryForServer(ServerMarshallUtil.java:109)
      at org.jboss.errai.marshalling.server.MappingContextSingleton.loadPrecompiledMarshallers(MappingContextSingleton.java:98)
      at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:78)
      at org.jboss.errai.marshalling.tests.MarshallingAPITest.ensureMarshallingSystemInitialized(MarshallingAPITest.java:55)
      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:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: java.lang.RuntimeException: unknown class reference type: org.jboss.errai.codegen.meta.impl.java.JavaReflectionGenericArrayType@2c3299f6
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference._getClassReference(LoadClassReference.java:116)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference.getClassReference(LoadClassReference.java:92)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference.getClassReference(LoadClassReference.java:74)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference.getClassReferencesForParameterizedTypes(LoadClassReference.java:172)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference._getClassReference(LoadClassReference.java:135)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference.getClassReference(LoadClassReference.java:92)
      at org.jboss.errai.codegen.builder.callstack.LoadClassReference.getClassReference(LoadClassReference.java:74)
      at org.jboss.errai.codegen.Cast.generate(Cast.java:60)
      at org.jboss.errai.codegen.Cast.generate(Cast.java:51)
      at org.jboss.errai.codegen.util.GenUtil.generate(GenUtil.java:138)
      at org.jboss.errai.codegen.util.GenUtil.generateCallParameters(GenUtil.java:86)
      at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:60)
      ... 61 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                csa Christian Sadilek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: