use of org.sonar.plugins.java.api.tree.ParameterizedTypeTree in project sonar-java by SonarSource.
the class TypeAndReferenceSolver method resolveIdentifierType.
private JavaType resolveIdentifierType(Resolve.Env newClassEnv, @Nullable ExpressionTree enclosingExpression, TypeTree typeTree, String typeName) {
if (enclosingExpression != null) {
resolveAs(enclosingExpression, JavaSymbol.VAR);
Resolution idType = resolve.findIdentInType(newClassEnv, (JavaSymbol.TypeJavaSymbol) enclosingExpression.symbolType().symbol(), typeName, JavaSymbol.TYP);
JavaType type = idType.type();
if (typeTree.is(Tree.Kind.PARAMETERIZED_TYPE)) {
TypeArguments typeArguments = ((ParameterizedTypeTree) typeTree).typeArguments();
scan(typeArguments);
type = parametrizedTypeWithTypeArguments(type.symbol, typeArguments);
}
registerType(typeTree, type);
} else {
resolveAs(typeTree, JavaSymbol.TYP, newClassEnv, false);
}
return (JavaType) typeTree.symbolType();
}
Aggregations