Search in sources :

Example 1 with MethodReferenceTreeImpl

use of org.sonar.java.model.expression.MethodReferenceTreeImpl in project sonar-java by SonarSource.

the class TypeAndReferenceSolver method visitMethodReference.

@Override
public void visitMethodReference(MethodReferenceTree methodReferenceTree) {
    MethodReferenceTreeImpl methodRefTree = (MethodReferenceTreeImpl) methodReferenceTree;
    if (methodRefTree.isTypeSet() && methodReferenceTree.typeArguments() == null) {
        resolve.getSamMethod((JavaType) methodRefTree.symbolType()).ifPresent(samMethod -> resolveMethodReference(samMethod, methodRefTree));
    } else {
        // TODO : SONARJAVA-1663 : consider type arguments for method resolution and substitution
        scan(methodReferenceTree.typeArguments());
        resolveAs(methodReferenceTree.expression(), JavaSymbol.VAR | JavaSymbol.TYP);
        registerType(methodRefTree, symbols.deferedType(methodRefTree));
    }
}
Also used : MethodReferenceTreeImpl(org.sonar.java.model.expression.MethodReferenceTreeImpl)

Aggregations

MethodReferenceTreeImpl (org.sonar.java.model.expression.MethodReferenceTreeImpl)1