String (PsiType type, boolean customDefaultValues) { if (type instanceof PsiArrayType) { int count = type.getArrayDimensions() - 1; PsiType componentType = type.getDeepComponentType(); if (componentType instanceof PsiClassType) { final PsiClassType classType = (PsiClassType)componentType; if (classType.resolve() instanceof PsiTypeParameter) { return PsiKeyword.NULL; } } PsiType erasedComponentType = TypeConversionUtil.erasure(componentType); StringBuilder buffer = new StringBuilder(); buffer.append(PsiKeyword.NEW); buffer.append(" "); buffer.append(erasedComponentType.getCanonicalText()); buffer.append("[0]"); for (int i = 0; i < count; i++) { buffer.append("[]"); } return buffer.toString(); } if (type instanceof PsiPrimitiveType) { return PsiTypes.booleanType().equals(type) ? PsiKeyword.FALSE : "0"; } if (customDefaultValues) { PsiType rawType = type instanceof PsiClassType ? ((PsiClassType)type).rawType() : null; if (rawType != null && rawType.equalsToText(CommonClassNames.JAVA_UTIL_OPTIONAL)) { return CommonClassNames.JAVA_UTIL_OPTIONAL + ".empty()"; } } return PsiKeyword.NULL; }