title: Error while project analysis: SonarQube is unable to analyze file, IllegalStateException
body: <p>One of our Java projects cannot be analyzed on SQ. The following error is thrown:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project PPP: 
  SonarQube is unable to analyze file : '&lt;file-name&gt;.java': IllegalStateException
  </code></pre>
  
  <p>The java file itself looks good. Nothing extraordinary in code.</p>
  
  <p>We run SQ v5.6.3.</p>
  
  <p>Do you know what causes the problem and how it can be solved?</p>
  
  <p>Excerpt from the log:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project &lt;project-name&gt;: SonarQube is unable to analyze file : '&lt;file-name&gt;.java': IllegalStateException -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project &lt;project-name&gt;: SonarQube is unable to analyze file : '&lt;file-name&gt;.java'
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      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:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: SonarQube is unable to analyze file : '&lt;file-name&gt;.java'
      at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
      at org.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:81)
      at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '&lt;file-name&gt;.java'
      at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:93)
      at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
      at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:119)
      at org.sonar.java.JavaSquid.scan(JavaSquid.java:113)
      at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:87)
      at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
      at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
      at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
      at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
      at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
      at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
      at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
      at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
      at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
      at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
      at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
      at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
      at com.sun.proxy.$Proxy16.execute(Unknown Source)
      at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
      at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
      at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
      at org.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:78)
      ... 22 more
  Caused by: java.lang.IllegalStateException
      at com.google.common.base.Preconditions.checkState(Preconditions.java:159)
      at org.sonar.java.resolve.BytecodeCompleter.complete(BytecodeCompleter.java:85)
      at org.sonar.java.resolve.JavaSymbol.complete(JavaSymbol.java:111)
      at org.sonar.java.resolve.JavaSymbol.isFlag(JavaSymbol.java:246)
      at org.sonar.java.resolve.JavaSymbol.isEnum(JavaSymbol.java:197)
      at org.sonar.java.checks.MembersDifferOnlyByCapitalizationCheck.isVariableToExtract(MembersDifferOnlyByCapitalizationCheck.java:200)
      at org.sonar.java.checks.MembersDifferOnlyByCapitalizationCheck.extractMembers(MembersDifferOnlyByCapitalizationCheck.java:191)
      at org.sonar.java.checks.MembersDifferOnlyByCapitalizationCheck.retrieveMembers(MembersDifferOnlyByCapitalizationCheck.java:182)
      at org.sonar.java.checks.MembersDifferOnlyByCapitalizationCheck.visitNode(MembersDifferOnlyByCapitalizationCheck.java:56)
      at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:95)
      at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
      at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
      at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:78)
      at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:64)
      at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:123)
      at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84)
      ... 56 more
  [ERROR] 
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  </code></pre>