don't calculate PsiType annotations when not asked to

This commit is contained in:
peter
2016-06-10 17:50:28 +02:00
parent 3dff559512
commit 4fd1e82d0a
3 changed files with 5 additions and 5 deletions
@@ -78,8 +78,8 @@ public class PsiPrimitiveType extends PsiType.Stub {
}
private String getText(boolean qualified, boolean annotated) {
PsiAnnotation[] annotations = getAnnotations();
if (!annotated || annotations.length == 0) return myName;
PsiAnnotation[] annotations = annotated ? getAnnotations() : PsiAnnotation.EMPTY_ARRAY; ;
if (annotations.length == 0) return myName;
StringBuilder sb = new StringBuilder();
PsiNameHelper.appendAnnotations(sb, annotations, qualified);
@@ -100,8 +100,8 @@ public class PsiWildcardType extends PsiType.Stub {
}
private String getText(boolean qualified, boolean annotated, @Nullable String suffix) {
PsiAnnotation[] annotations = getAnnotations();
if ((!annotated || annotations.length == 0) && suffix == null) return "?";
PsiAnnotation[] annotations = annotated ? getAnnotations() : PsiAnnotation.EMPTY_ARRAY;
if (annotations.length == 0 && suffix == null) return "?";
StringBuilder sb = new StringBuilder();
if (annotated) {