gstackoverflow
gstackoverflow

Reputation: 36984

SonarQube doesn't see method reference

I have private method in my class.

public class MyClass {
     public void method(){
         ....
         List<String> filteredPaths = Arrays.asList(paths).stream().filter(this::validate).collect(Collectors.toList());
         ....
     }
     private boolean validate(String path){
        ...
     }
}

I see major issue:

Private method 'validate' is never used.

Is this issue known?

How to fix it? workarounds?

Upvotes: 5

Views: 2731

Answers (1)

benzonico
benzonico

Reputation: 10833

It is a known bug: please see http://jira.sonarsource.com/browse/SONARJAVA-583

To provide more context here : This unused private method is relying on an old implementation and is (at time of writing my answer) being migrating to rely on semantic analysis and not only bytecode analysis.

Upvotes: 7

Related Questions