mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
javac ast indices: do not add a reference to index when qualifier type is not resolved
This commit is contained in:
@@ -19,6 +19,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.lang.model.element.*;
|
||||
import javax.lang.model.type.TypeKind;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
import java.util.Set;
|
||||
|
||||
public interface JavacRef {
|
||||
@@ -149,6 +151,12 @@ public interface JavacRef {
|
||||
|
||||
@Nullable
|
||||
public static JavacElementRefBase fromElement(Element element, Element qualifier, JavacNameTable nameTableCache) {
|
||||
if (qualifier != null) {
|
||||
TypeMirror type = qualifier.asType();
|
||||
if (type == null || type.getKind() == TypeKind.NONE) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (element instanceof TypeElement) {
|
||||
return new JavacElementClassImpl(element, qualifier, nameTableCache);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user