1
votes

I'm using Sonar 5.1.1 and when I analyze my code it give me the following exception:

SonarQube is unable to analyze file : '/var/lib/...guilisteners/MouseEventListener.java' at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 
[...] 
Caused by: java.lang.IllegalArgumentException
at org.sonar.java.model.SyntacticEquivalence.areLeafsEquivalent(SyntacticEquivalence.java:98)

If I search in the web about this exception I can see that it's a Sonar bug that it's already fixed but they didn't release the new version with this bug fixed still: http://jira.sonarsource.com/browse/SONARJAVA-1024 (Seems like some problem with the Java plugin)

I wonder if someone knows some workaround to solve this issue while I'm waiting for the new release of Sonar.

1
The release vote was closed on Fri., July 3. I would expect the release to take place in the next few days. - G. Ann - SonarSource Team
Thank you! I'll wait for it then. - Adrián Castillo

1 Answers

1
votes

It is quite easy to update the Java check for Sonar. Do the following

  1. Clone the sonar-java repor https://github.com/SonarSource/sonar-java
  2. Run "mvn package" in the directory
  3. Copy "sonar-java-plugin/target/sonar-java-plugin-$VERION.jar" to $SONAR_HOME/extensions/downloads
  4. Restart Sonar and you should have the new checker running