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

AssertionError @ jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:244)

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      java version "10.0.2" 2018-07-17
      Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
      Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Maven project with maven-compiler-plugin.
      Trying to compile a class Foo, which references a nonexisting class Bar causes following error:

      Exception in thread "main" java.lang.AssertionError
      at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
      at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
      at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:244)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:829)
      at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete(JavacProcessingEnvironment.java:1506)
      at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
      at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1308)
      at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1139)
      at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1065)
      at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:237)
      at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:52)
      at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:992)
      at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
      at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:197)
      at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:165)
      at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
      at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
      at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:183)
      at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:165)
      at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
      at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
      at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic.getMessage(JCDiagnostic.java:771)
      at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$DiagnosticSourceUnwrapper.getMessage(ClientCodeWrapper.java:799)
      at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:149)
      at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
      at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
      at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

      In jdk.compiler/com.sun.tools.javac.comp.Modules.enter the variables are following:
      rootModules = null
      inInitModules = false
      allowModules = true

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Error message about unknown symbol/class.

      /home/user/my/project/Foo.java:55: error: cannot find symbol
          public List<Bar> getBarList(
                               ^
        symbol: class Bar
        location: class my.project.Foo
      ACTUAL -
      Exception when processing the message about unknown class.

        Attachments

          Activity

            People

            • Assignee:
              jlahoda Jan Lahoda
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: