Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222381

Assertion error on com.sun.tools.javac.comp.DeferredAttr$2$1.setOverloadKind(DeferredAttr.java:172)

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      os_x

      Description

      ADDITIONAL SYSTEM INFORMATION :
      MAC OS X

      A DESCRIPTION OF THE PROBLEM :
      Seems related to https://bugs.openjdk.java.net/browse/JDK-8216206

      build is not OK, changing the code structure without altering the result fix the compilation problem




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      mvn clean compile

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      BUILD OK
      ACTUAL -
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 14.691 s
      [INFO] Finished at: 2019-04-11T10:21:02+02:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project lark-content-api: Compilation failure
      [ERROR] An exception has occurred in the compiler (11.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
      [ERROR] java.lang.AssertionError
      [ERROR] at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
      [ERROR] at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$2$1.setOverloadKind(DeferredAttr.java:172)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.visitReference(ArgumentAttr.java:283)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:2190)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:197)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:653)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:751)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1997)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1866)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1546)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:743)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2598)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1807)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$4.complete(DeferredAttr.java:374)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:335)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:321)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1060)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:887)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:775)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:896)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:181)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:605)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:644)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:4120)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3913)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3814)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.checkId(Attr.java:3803)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3696)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2110)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2006)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3573)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2110)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2006)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:498)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:481)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.lambda$processArg$0(ArgumentAttr.java:220)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:242)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:219)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.visitApply(ArgumentAttr.java:307)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:197)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:653)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:751)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1997)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1866)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1546)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:743)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1294)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1020)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1098)
      [ERROR] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4683)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4574)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4503)
      [ERROR] at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:4448)
      [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1341)
      [ERROR] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973)
      [ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
      [ERROR] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
      [ERROR] at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:75)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:626)
      [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcessWithProperClassloader(JavacCompiler.java:607)
      [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:596)
      [ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:178)
      [ERROR] at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1129)
      [ERROR] at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:188)
      [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
      [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
      [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
      [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
      [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
      [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
      [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
      [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      [ERROR]
      [ERROR]
      [ERROR] -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

      ---------- BEGIN SOURCE ----------
      This code is NOT compiling :

      @Component
      @RequiredArgsConstructor
      public class VirtualRestrictionService {

          private final ReadOnlyMeshRestClient readOnlyMeshRestClient;

          private final GroupVirtualRestrictionConverter groupVirtualRestrictionConverter;

          /**
           * Will fetch and publish restriction in the output stream sorted in order : non virtual restrictions FIRST then virtual restriction
           * LAST, as this we can optimize the call and the need of fetching restrictions in the caller service
           *
           * @param cmsResourceRepresentation the component restrictions to fetch if needed (if containing viruals restrictions)
           * @return flux of restrictions
           */
          Flux<RestrictionRepresentation> fetchRestrictionsIfNeeded(AbstractCmsResourceRepresentation cmsResourceRepresentation) {
              
              return Flux.concat(Flux.fromIterable(cmsResourceRepresentation.getRestrictions())//return non virtual restrictions first
                      .filter(restrictionRepresentation -> !(restrictionRepresentation instanceof VirtualRestrictionRepresentation))
                      ,Flux.fromIterable(cmsResourceRepresentation.getRestrictions())
                              .filter(VirtualRestrictionRepresentation.class::isInstance)
                              .cast(VirtualRestrictionRepresentation.class)
                              .flatMap(restrictionRepresentation -> {
      // //fetch virtual restriction (it is pointing to real restrictions)
                                  return readOnlyMeshRestClient.findNodeByUuid(UuidUtil.toShortUuid(restrictionRepresentation.getVirtualRestriction()))
                                          .map(groupVirtualRestrictionConverter)
                                          .doOnNext(restrictionRepresentation::setFetchedVirtualRestriction);
                              })
                              .flatMap(groupRestrictionRepresentation -> Flux.fromIterable(groupRestrictionRepresentation.getRestrictions())));

          }
      }


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      BUT this code is compiling fine :

      /**
       * Manage the virtual restrictions (restrictions linked and aggregated together in another getmesh node)
       */
      @Component
      @RequiredArgsConstructor
      public class VirtualRestrictionService {

          private final ReadOnlyMeshRestClient readOnlyMeshRestClient;

          private final GroupVirtualRestrictionConverter groupVirtualRestrictionConverter;

          /**
           * Will fetch and publish restriction in the output stream sorted in order : non virtual restrictions FIRST then virtual restriction
           * LAST, as this we can optimize the call and the need of fetching restrictions in the caller service
           *
           * @param cmsResourceRepresentation the component restrictions to fetch if needed (if containing viruals restrictions)
           * @return flux of restrictions
           */
          Flux<RestrictionRepresentation> fetchRestrictionsIfNeeded(AbstractCmsResourceRepresentation cmsResourceRepresentation) {

              Flux<RestrictionRepresentation> virtualRestrictions = Flux.fromIterable(cmsResourceRepresentation.getRestrictions())
                      .filter(VirtualRestrictionRepresentation.class::isInstance)
                      .cast(VirtualRestrictionRepresentation.class)
                      .flatMap(restrictionRepresentation -> {
      // //fetch virtual restriction (it is pointing to real restrictions)
                          return readOnlyMeshRestClient.findNodeByUuid(UuidUtil.toShortUuid(restrictionRepresentation.getVirtualRestriction()))
                                  .map(groupVirtualRestrictionConverter)
                                  .doOnNext(restrictionRepresentation::setFetchedVirtualRestriction);
                      })
                      .flatMap(groupRestrictionRepresentation -> Flux.fromIterable(groupRestrictionRepresentation.getRestrictions()));
              
              return Flux.concat(Flux.fromIterable(cmsResourceRepresentation.getRestrictions())//return non virtual restrictions first
                      .filter(restrictionRepresentation -> !(restrictionRepresentation instanceof VirtualRestrictionRepresentation))
                      ,virtualRestrictions);

          }
      }


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fmatte Fairoz Matte
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: