SonarQube error while analyzing code with binary l

2019-07-20 18:59发布

I want to use SonarQube to analyse my project which is built on Jenkins. In my project I have some literals written in binary system (e.g. 0b00001111).

When I'm trying to do an analysis, I am obtaining fallowing error:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project org: 
SonarQube is unable to analyze file : 'whatever': For input string: "b00001111" -> [Help 1]
[...]
Caused by: java.lang.NumberFormatException: For input string: "b00001111"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.valueOf(Long.java:776)
at java.lang.Long.decode(Long.java:928)
at org.sonar.java.checks.SillyBitOperationCheck.evaluateExpression(SillyBitOperationCheck.java:101)
....

Versioning informations:

SonarQube Jenkins plugin version: 2.2.1

SonarQube version: 5.1

SonarQube maven Plugin version: 2.5/2.6 (I've tried both of them)

In project I am using JDK 1.8. I don't know how to check if SonarQube is using also 1.8, but I've choosen "Inherit from Project" in SonarQube configuration panel in Jenkins.

1条回答
Anthone
2楼-- · 2019-07-20 19:46

I solved the problem by updating the java plugin to 3.5

查看更多
登录 后发表回答