- versions used (SonarQube, Scanner, Plugin, and any relevant extension)
Not really usefull as the problem can be reproduced with a test (see below)
SonarQube Community Edition Version 7.5 (build 20543)
The most revelant :
java-frontend 188.8.131.5222 (also tried with 184.108.40.20619)
- error observed (wrap logs/code around triple quote ``` for proper formatting)
org.sonar.plugins.java.api.semantic.Symbol.type() returns null because of org.sonar.plugins.java.api.tree.MethodInvocationTree.symbol() returning !unknownSymbol!
- steps to reproduce
- Clone the repository https://github.com/Droofit/sonar-unknown-symbol
- Import the project in your prefered editor (I used Eclipse)
- Run the test named org.test.testy.NoBigDecimalRuleTest
- Test should success
- Move the “Entity” class for src/test/java to src/main/java
- Run the test again
- Test should fail because of the raised IllegalStateException
That’s the same if you move the class to a dependency, which is the problem I encounter in some production code, but it’s more painfull to use a dependency within a test.