LocalQuickFix (Object... infos) { final PsiClass aClass = (PsiClass)infos[0]; final PsiElement parent = PsiTreeUtil.skipParentsOfType(aClass, PsiNewExpression.class, PsiParenthesizedExpression.class); if (!(parent instanceof PsiVariable) && !(parent instanceof PsiAssignmentExpression)) { return null; } PsiElement anchor = PsiTreeUtil.getParentOfType(aClass, PsiMember.class, PsiStatement.class); if (anchor instanceof PsiMember) { PsiClass surroundingClass = ((PsiMember)anchor).getContainingClass(); if (surroundingClass == null || surroundingClass.isInterface()) return null; } return new DoubleBraceInitializationFix(); }