NPE in AbstractBadFieldNameChecker.visitNode while executing sonar-maven-plugin:3.6.0.1398:sonar

java
scanner

(Patrik Jetzer) #1

Versions used:
SonarQube: 7.5.0.20543
SonarJava: 5.10.1 (build 16922)
sonar-maven-plugin: 3.6.0.1398

Error observed:

[ERROR] Unable to run check class org.sonar.java.checks.naming.BadFieldNameStaticNonFinalCheck - S3008 on file D:\jenkins\workspace\WM_6_Trunk_Windows_-_Static_Code_Analysis_(SonarUpgrade)\wm6-trainingwhp-project\wm6-trainingwhp-builder\src\main\java\com\swisslog\wm6\trainingwhp\impl\launchers\ExerciseBuilder.java, To help improve SonarJava, please report this problem to SonarSource : see https://www.sonarqube.org/community/
java.lang.NullPointerException: null
	at org.sonar.java.checks.AbstractBadFieldNameChecker.visitNode(AbstractBadFieldNameChecker.java:62)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:95)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:120)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:97)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:78)
	at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:64)
	at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:135)
	at org.sonar.java.model.VisitorsBridge.lambda$visitFile$0(VisitorsBridge.java:127)
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)

Reported Java Class:
attached ExerciseBuilder.java
ExerciseBuilder.java.txt (12.0 KB)