radai
radai

Reputation: 24192

Exception from sonarqube scan when using using kafka (or scala in general?)

I have a java project that uses kafka. im scanning it with sonarqube 5.0 (sonar maven plugin 2.5), and i get this:

[INFO] [13:48:22.488] Sensor JavaSquidSensor...
[INFO] [13:48:22.511] Java Main Files AST scan...
[INFO] [13:48:22.512] 8 source files to be analyzed
[ERROR] [13:48:22.655] Class not found: scala.Predef$$less
[ERROR] [13:48:22.655] Class not found: scala.Predef$$less$colon
[ERROR] [13:48:22.680] Class not found: scala.collection.immutable.Stream$$hash
[ERROR] [13:48:22.680] Class not found: scala.collection.immutable.Stream$$hash$colon
[ERROR] [13:48:22.685] Unable to create symbol table for : /path/to/KafkaNotifier.java
java.lang.IllegalStateException: Innerclass: colon and classSymbol: Stream are not the same.
    at com.google.common.base.Preconditions.checkState(Preconditions.java:145) ~[sonar-batch-maven-compat-5.0.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor.defineInnerClass(BytecodeVisitor.java:162) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor.visitInnerClass(BytecodeVisitor.java:144) ~[java-squid-2.9.1.jar:na]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:679) ~[asm-debug-all-5.0.3.jar:5.0.3]
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:506) ~[asm-debug-all-5.0.3.jar:5.0.3]
    at org.sonar.java.resolve.BytecodeCompleter.complete(BytecodeCompleter.java:100) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.Symbol.complete(Symbol.java:98) ~[java-squid-2.9.1.jar:na]
    at org.sonar.java.resolve.BytecodeVisitor$ReadType.visitEnd(BytecodeVisitor.java:541) ~[java-squid-2.9.1.jar:na]
...lots more ommitted

i get this for every class that uses kafka.

am i missing a configuration?

is this a squid bug?

Upvotes: 4

Views: 2299

Answers (1)

benzonico
benzonico

Reputation: 10833

This seems to me that you are hitting this reported bug of the bytecode loader : http://jira.codehaus.org/browse/SONARJAVA-805

Which is triggered more when working on Scala which produces a lot of classes with $ in their name.

Upvotes: 4

Related Questions