create constructor matching super: insert braces when no present (IDEA-77194)

This commit is contained in:
anna
2012-01-13 21:33:58 +01:00
parent 4fe09fbead
commit f63576f878
3 changed files with 20 additions and 0 deletions
@@ -112,6 +112,10 @@ public class CreateConstructorMatchingSuperFix extends BaseIntentionAction {
@Override
public void run() {
try {
if (targetClass.getLBrace() == null) {
PsiClass psiClass = JavaPsiFacade.getInstance(targetClass.getProject()).getElementFactory().createClass("X");
targetClass.addRangeAfter(psiClass.getLBrace(), psiClass.getRBrace(), targetClass.getLastChild());
}
PsiElementFactory factory = JavaPsiFacade.getInstance(project).getElementFactory();
CodeStyleManager reformatter = CodeStyleManager.getInstance(project);
PsiMethod derived = null;