5 Replies Latest reply on Oct 13, 2015 4:57 PM by Jose Miguel Barone

    Annotation with String[] value fails

    Jose Miguel Barone Newbie

      Hi ... trying to use a qualifier annotation with a String[] value, errai fails at compile time.

      It happened when tries to create a java class with equals methods for the annotations (QualifierEqualityFactoryGenerator or something like that)

       

      With the java property errai.codegen.permissive in true it works ... but surely is not the way to go.

       

      Is this a bug or an expected behaviour?

      Thanks.

        • 1. Re: Annotation with String[] value fails
          Max Barkley Expert

          Hi Jose,

           

          That sounds like a bug. Could you post the error message and stack trace you get so we can take a look?

           

          Cheers.

          • 2. Re: Annotation with String[] value fails
            Jose Miguel Barone Newbie

            Ok... simply create a qualifier with that type of value in the client side, for example:

             

            @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE}) public @interface Test { String[] value(); }

             

            you don't need to use it ... simply create it

             

            [INFO] INFO [QualifierEqualityFactoryGenerator] Generating QualifierEqualityFactory... [INFO] ERROR [QualifierEqualityFactoryGenerator] Error generating QualifierEqualityFactory [INFO] org.jboss.errai.codegen.exception.InvalidTypeException: [Z is not assignable from [Ljava.lang.String; [INFO] in method call: java.util.Arrays.equals([[Z, [Z]) [INFO] at org.jboss.errai.codegen.util.GenUtil.assertAssignableTypes(GenUtil.java:170) [INFO] at org.jboss.errai.codegen.util.GenUtil.convert(GenUtil.java:187) [INFO] at org.jboss.errai.codegen.util.GenUtil.generateCallParameters(GenUtil.java:99) [INFO] at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:110) [INFO] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46) [INFO] at org.jboss.errai.codegen.builder.callstack.LoadClassReference.handleCall(LoadClassReference.java:48) [INFO] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:61) [INFO] at org.jboss.errai.codegen.util.Bool$1.generate(Bool.java:49) [INFO] at org.jboss.errai.codegen.util.GenUtil.generate(GenUtil.java:130) [INFO] at org.jboss.errai.codegen.builder.impl.BooleanExpressionBuilder.generate(BooleanExpressionBuilder.java:64) [INFO] at org.jboss.errai.codegen.control.IfBlock.generate(IfBlock.java:60) [INFO] at org.jboss.errai.codegen.builder.callstack.ConditionalBlockCallElement.handleCall(ConditionalBlockCallElement.java:46) [INFO] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:61) [INFO] at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:90) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaMethod.toJavaString(BuildMetaMethod.java:343) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.membersToString(BuildMetaClass.java:789) [INFO] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.doGenerate(AnonymousClassStructureBuilderImpl.java:183) [INFO] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl.access$200(AnonymousClassStructureBuilderImpl.java:43) [INFO] at org.jboss.errai.codegen.builder.impl.AnonymousClassStructureBuilderImpl$3.generate(AnonymousClassStructureBuilderImpl.java:152) [INFO] at org.jboss.errai.codegen.builder.impl.ObjectBuilder$2.doDeferred(ObjectBuilder.java:175) [INFO] at org.jboss.errai.codegen.builder.callstack.DeferredCallElement.handleCall(DeferredCallElement.java:42) [INFO] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:61) [INFO] at org.jboss.errai.codegen.builder.impl.ObjectBuilder.generate(ObjectBuilder.java:183) [INFO] at org.jboss.errai.codegen.util.GenUtil.generate(GenUtil.java:130) [INFO] at org.jboss.errai.codegen.util.GenUtil.generateCallParameters(GenUtil.java:76) [INFO] at org.jboss.errai.codegen.builder.callstack.MethodCall.handleCall(MethodCall.java:61) [INFO] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.nextOrReturn(AbstractCallElement.java:46) [INFO] at org.jboss.errai.codegen.builder.callstack.LoadVariable.handleCall(LoadVariable.java:122) [INFO] at org.jboss.errai.codegen.builder.impl.AbstractStatementBuilder.generate(AbstractStatementBuilder.java:61) [INFO] at org.jboss.errai.codegen.BlockStatement.generate(BlockStatement.java:90) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaConstructor.toJavaString(BuildMetaConstructor.java:279) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.membersToString(BuildMetaClass.java:779) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.toJavaString(BuildMetaClass.java:682) [INFO] at org.jboss.errai.codegen.meta.impl.build.BuildMetaClass.toJavaString(BuildMetaClass.java:582) [INFO] at org.jboss.errai.codegen.builder.impl.ClassBuilder.toJavaString(ClassBuilder.java:493) [INFO] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator.generateQualifierEqualityFactory(QualifierEqualityFactoryGenerator.java:173) [INFO] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator.generate(QualifierEqualityFactoryGenerator.java:72) [INFO] at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40) [INFO] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760) [INFO] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265) [INFO] at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306) [INFO] at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) [INFO] at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) [INFO] at com.google.gwt.dev.jjs.ast.JReturnStatement.traverse(JReturnStatement.java:40) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351) [INFO] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145) [INFO] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600) [INFO] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954) [INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303) [INFO] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:286) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) [INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:206) [INFO] at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333) [INFO] at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:161) [INFO] at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119) [INFO] at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:128) [INFO] at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:81) [INFO] at com.google.gwt.dev.codeserver.JobRunner.access$100(JobRunner.java:34) [INFO] at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:73) [INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [INFO] at java.lang.Thread.run(Thread.java:745) [INFO] Caused by: java.lang.RuntimeException: Problem was caused by this call [INFO] at org.jboss.errai.codegen.builder.callstack.AbstractCallElement.(AbstractCallElement.java:33) [INFO] at org.jboss.errai.codegen.builder.callstack.MethodCall.(MethodCall.java:52) [INFO] at org.jboss.errai.codegen.builder.impl.StatementBuilder.invokeStatic(StatementBuilder.java:250) [INFO] at org.jboss.errai.codegen.builder.impl.StatementBuilder.invokeStatic(StatementBuilder.java:256) [INFO] at org.jboss.errai.codegen.util.Stmt.invokeStatic(Stmt.java:231) [INFO] Caused by: java.lang.RuntimeException: External call to API [INFO] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator.generateComparatorFor(QualifierEqualityFactoryGenerator.java:220) [INFO] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator.generateQualifierEqualityFactory(QualifierEqualityFactoryGenerator.java:125) [INFO] at org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator.generate(QualifierEqualityFactoryGenerator.java:72) [INFO] at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40) [INFO] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760) [INFO] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) [INFO] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265) [INFO] at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306) [INFO] at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) [INFO] at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) [INFO] at com.google.gwt.dev.jjs.ast.JReturnStatement.traverse(JReturnStatement.java:40) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351) [INFO] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149) [INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145) [INFO] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600) [INFO] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) [INFO] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505) [INFO] at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038) [INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954) [INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303) [INFO] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:286) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) [INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:206) [INFO] at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333) [INFO] at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:161) [INFO] at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119) [INFO] at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:128) [INFO] at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:81) [INFO] at com.google.gwt.dev.codeserver.JobRunner.access$100(JobRunner.java:34) [INFO] at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:73) [INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [INFO] at java.lang.Thread.run(Thread.java:745) [INFO]          [ERROR] Errors in 'org/jboss/errai/ioc/client/Container.java' [INFO]            [ERROR] Line 54: Failed to resolve 'org.jboss.errai.ioc.client.QualifierEqualityFactory' via deferred binding [INFO]          Computing all possible rebind results for 'org.jboss.errai.marshalling.client.api.MarshallerFactory' [INFO]            Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory [INFO]                Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator [INFO]                  Generating Marshallers Bootstrapper... [INFO]          [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) [INFO]            [WARN] org.jboss.errai.ioc.client.QualifierEqualityFactoryImpl [INFO]          Unification traversed 29907 fields and methods and 2789 types. 2751 are considered part of the current module and 2751 had all of their fields and methods traversed. [INFO]      [ERROR] Compiler returned false [INFO]      [WARN] recompile failed [INFO]      [WARN] continuing to serve previous version

            • 3. Re: Annotation with String[] value fails
              Jose Miguel Barone Newbie

              Max ... any feedback on this?

              Cheers.

              • 4. Re: Annotation with String[] value fails
                Max Barkley Expert

                Jose,

                 

                The good news is that I have found the source of the bug and have scheduled a fix for 3.2.1.Final. You can follow the issue here.

                 

                Unfortunately, there is no workaround for the problem that I can think of.

                • 5. Re: Annotation with String[] value fails
                  Jose Miguel Barone Newbie

                  Ok Max ... no workaround but the issue will be fixed on the next release.

                   

                  That is the way the community works

                  Thank you