public static boolean isCompileTimeConstant(@Nullable PsiExpression initializer, @Nullable PsiType type) {
    return type != null && (type instanceof PsiPrimitiveType || type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) &&
           PsiUtil.isConstantExpression(initializer);
  }
public static boolean isCompileTimeConstant(@Nullable PsiExpression initializer, @Nullable PsiType type)