Java Code Examples for com.intellij.psi.PsiType#isValid()
The following examples show how to use
com.intellij.psi.PsiType#isValid() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PsiCustomUtil.java From intellij-spring-assistant with MIT License | 6 votes |
public static boolean isValidType(@NotNull PsiType type) { if (!type.isValid()) { TimeoutUtil.sleep( 1); // to see if processing in another thread suddenly makes the type valid again (which is a bug) if (!type.isValid()) { return false; } } if (type instanceof PsiArrayType) { return isValidType(PsiArrayType.class.cast(type).getComponentType()); } else if (type instanceof PsiWildcardType) { PsiType bound = ((PsiWildcardType) type).getBound(); return bound != null && isValidType(bound); } else if (type instanceof PsiCapturedWildcardType) { PsiType lowerBound = ((PsiCapturedWildcardType) type).getLowerBound(); type = (lowerBound != NULL ? lowerBound : ((PsiCapturedWildcardType) type).getUpperBound()); return type != NULL && isValidType(type); } else if (type instanceof PsiClassType) { PsiClassType.ClassResolveResult classResolveResult = ((PsiClassType) type).resolveGenerics(); return classResolveResult.isValidResult() && isValidElement( requireNonNull(classResolveResult.getElement())) && !hasUnresolvedComponents(type); } return true; }
Example 2
Source File: LombokLightParameter.java From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LombokLightParameter that = (LombokLightParameter) o; final PsiType thisType = getType(); final PsiType thatType = that.getType(); if (thisType.isValid() != thatType.isValid()) { return false; } return thisType.getCanonicalText().equals(thatType.getCanonicalText()); }