SonarQube is unable to analyze file NPE thrown in PrivateFieldUsedLocallyCheck.java

11 views
Skip to first unread message

Chris Corriere

unread,
Jan 31, 2017, 12:31:14 PM1/31/17
to SonarQube
I've upgraded from sonarqube 5.4 to 6.0 and we're scanning with maven plugin 3.2. I'm getting an NPE in PrivateFieldUsedLocallyCheck.java that kills the scan on one file. It looks like similar issues have come up in the past but this isn't an open bug. We're using version 4.4.0.8066 of the java scanner. My guess is this is due to anonymous enumeration in the file that looks something like this (which I wouldn't expect to fail the scan with an NPE):


static class FilterParams {

//~ Static fields/initializers ---------------------------------------------------------------------------------

private static List<String> GROUP_A;

private static List<String> GROUP_B;

static {
GROUP_A = //list def goes here


GROUP_B = //more list def  goes here




}
}

Nicolas Peru

unread,
Jan 31, 2017, 3:39:37 PM1/31/17
to Chris Corriere, SonarQube
Hi, 

This is a known issue that I have actually fixed today : https://jira.sonarsource.com/browse/SONARJAVA-2056 

Should be shipped with version 4.5 of SonarJava analyzer which is about to be release (planned for end of the week). 

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/a1bca1d5-8344-4519-8c4d-e6b362554f4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages