SonarQube 6.7.3
also SonarLint 3.4.0.201803051332
“::” is reported as an operator which needs parens to clarify precedence.
import java.util.concurrent.Executor;
public class S864 {
private Executor executor;
public S864(Executor exParm) {
executor = (exParm == null) ? Runnable::run : exParm;
}
public Executor getExecutor() {
return executor;
}
}
This resolves the issue, but should not be necessary.
executor = (exParm == null) ? (Runnable::run) : exParm;
Edited: originally reported with wrong squid code. Fixed.