Hello--We have a maven module (Java project) and when analyzing with sonar maven plugin (3.0.2), below exception will be thrown.
Caused by: java.lang.IllegalStateException: bridge method not marked as synthetic in class scala/Tuple2
at com.google.common.base.Preconditions.checkState(Preconditions.java:174)
at org.sonar.java.resolve.BytecodeVisitor.visitMethod(BytecodeVisitor.java:209)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:911)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
at org.sonar.java.resolve.BytecodeCompleter.complete(BytecodeCompleter.java:100)
at org.sonar.java.resolve.JavaSymbol.complete(JavaSymbol.java:111)The offending class is from one scala library dependency in pom:
<dependency>
<groupId>scala-library</groupId>
<artifactId>scala-library</artifactId>
<version>1.0</version>
</dependency>After testing, it seems very other module with this dependency will fail the same.I am not sure whether it's sonar scala analysis issue (it's a Java project), or what will be the workaround.
Our platform is: CentOS 7/Sonar 5.6 docker
Thanks in advance
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/2ef27b36-d435-41f1-8879-6c6e79c4e422%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bridge method not marked as synthetic")
in the analysis of a mixed Java/Groovy codebase... (Java 8 Update 60, Groovy 2.4.7, SonarQube 6.0, Windows 7)To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/c273a6f5-032e-4173-b904-5ccb15a7b085%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/49bc3546-166d-4df8-bdfe-451c71e6b3ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- Kotlin compiler seems to interpret this as "ACC_BRIDGE" flag is enough because it implies "synthetic".
- SonarQube analyzer seems to interpret this as "any method flagged ACC_BRIDGE must also be flagged ACC_SYNTHETIC".
A method may be marked with the ACC_SYNTHETIC
flag to indicate that it was generated by a compiler and does not appear in source code, unless it is one of the methods named in §4.7.8.
Keyword here is _may_
Not that interestingly this word disappeared from jvms 8 which makes it more ambiguous (but not explicitely mandatory) :
https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6
Given all this : I tend to think that Kotlin should mark its bridge method as Synthetic but SonarJava is a bit too strict on this :
https://jira.sonarsource.com/browse/SONARJAVA-2044
(even though it helps to reveal this kind of problems in compilers :) )
Thanks for reporting it.
Cheers,
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/b9cdaf55-87f6-487d-8f68-fac714e56a0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.