public class SonarTest {
interface MyFunctional {
default String defaultMethod() {
return "defaultMethod";
}
String funcMethod();
}
public static void main(String[] args) {
MyFunctional func = new MyFunctional() { //S1604 FP raised here
@Override
public String funcMethod() {
return defaultMethod();
}
};
System.out.println(func.funcMethod());
}
}
--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/a9a5-UfTZZ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/927eb9c4-20fe-4c70-ba76-1cef18776fc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I should add that I'm running SonarQube 6.7.1 LTS and SonarJava 5.1.1On Fri, Mar 9, 2018 at 11:08 AM, Brant Boehmann <brant.b...@gmail.com> wrote:S1604 raises a false positive when an anonymous inner class calls a default method. Converting to a lambda would cause a compile error because the lambda has a lack of knowledge about "this" and thus cannot call a default method.I tried to file a ticket in Jira, but could not find a "New Issue" button. I'm assuming I don't have permissions or I overlooked it.public class SonarTest {
interface MyFunctional {
default String defaultMethod() {
return "defaultMethod";
}
String funcMethod();
}
public static void main(String[] args) {
MyFunctional func = new MyFunctional() { //S1604 FP raised here
@Override
public String funcMethod() {
return defaultMethod();
}
};
System.out.println(func.funcMethod());
}
}
--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/a9a5-UfTZZ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/927eb9c4-20fe-4c70-ba76-1cef18776fc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/CAGdygTqZbjLbmiOTWvQ0Y3jh7kTWuoCVAvcBi-5A8wrfKGSLbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Senior Developer