@Override @NotNull public PsiType[] getSuperTypes() { final PsiType[] superTypes = myComponentType.getSuperTypes(); final PsiType[] result = createArray(superTypes.length); for (int i = 0; i < superTypes.length; i++) { result[i] = superTypes[i].createArrayType(); } return result; }
@Override public PsiType visitEllipsisType(PsiEllipsisType ellipsisType) { final PsiType componentType = ellipsisType.getComponentType(); final PsiType newComponentType = componentType.accept(this); if (newComponentType == componentType) return ellipsisType; return newComponentType != null ? newComponentType.createArrayType() : null; }
@Override public PsiType visitArrayType(PsiArrayType arrayType) { final PsiType componentType = arrayType.getComponentType(); final PsiType newComponentType = componentType.accept(this); if (newComponentType == componentType) return arrayType; return newComponentType != null ? newComponentType.createArrayType() : null; } });
/** * Converts the ellipsis type to an array type with the same component type. * * @return the array type instance. */ public PsiType toArrayType() { return getComponentType().createArrayType(getAnnotations()); }
@Override public PsiType visitEllipsisType(PsiEllipsisType ellipsisType) { final PsiType componentType = ellipsisType.getComponentType(); final PsiType newComponentType = componentType.accept(this); if (newComponentType == componentType) return ellipsisType; return newComponentType != null ? newComponentType.createArrayType() : null; }
@Override public PsiType visitArrayType(PsiArrayType arrayType) { final PsiType componentType = arrayType.getComponentType(); final PsiType newComponentType = componentType.accept(this); if (newComponentType == componentType) return arrayType; return newComponentType != null ? newComponentType.createArrayType() : null; }
@Override public PsiType visitArrayType(PsiArrayType arrayType) { PsiType componentType = arrayType.getComponentType(); PsiType type = componentType.accept(this); if (type == componentType) return arrayType; return type.createArrayType(); }
@NotNull public static PsiType convertAnonymousToBaseType(@NotNull PsiType type) { PsiClass psiClass = resolveClassInType(type); if (psiClass instanceof PsiAnonymousClass) { int dims = type.getArrayDimensions(); type = ((PsiAnonymousClass) psiClass).getBaseClassType(); while (dims != 0) { type = type.createArrayType(); dims--; } } return type; }
componentType = ((PsiWildcardType)componentType).getExtendsBound(); int dims = transformed.getArrayDimensions(); for (int i = 0; i < dims; i++) componentType = componentType.createArrayType(); return componentType;
if (type != null) { for (int i = 0; i < binding.dimensions; i++) { type = type.createArrayType();
return captureToplevelWildcards(((PsiArrayType)type).getComponentType(), context).createArrayType();
return eliminateWildcards(((PsiArrayType)type).getComponentType(), false).createArrayType();
return PsiIntersectionType.createIntersection(componentType, cloneable, serializable); return componentType.createArrayType();