create public inner class in interface (IDEA-70577)

This commit is contained in:
anna
2011-06-06 19:07:36 +04:00
parent e1293791da
commit ea622c99f3
3 changed files with 16 additions and 1 deletions

View File

@@ -141,7 +141,11 @@ public class CreateInnerClassFromUsageFix extends CreateClassFromUsageBaseFix {
: myKind == CLASS ? elementFactory.createClass(refName) : elementFactory.createEnum(refName);
final PsiModifierList modifierList = created.getModifierList();
LOG.assertTrue(modifierList != null);
modifierList.setModifierProperty(PsiModifier.PRIVATE, true);
if (aClass.isInterface()) {
modifierList.setModifierProperty(PsiModifier.PACKAGE_LOCAL, true);
} else {
modifierList.setModifierProperty(PsiModifier.PRIVATE, true);
}
if (superClassName != null) {
PsiJavaCodeReferenceElement superClass =
elementFactory.createReferenceElementByFQClassName(superClassName, created.getResolveScope());

View File

@@ -0,0 +1,7 @@
// "Create Inner Class 'Foo'" "true"
public interface Test {
void foo(Fo<caret>o f){}
class Foo {
}
}

View File

@@ -0,0 +1,4 @@
// "Create Inner Class 'Foo'" "true"
public interface Test {
void foo(Fo<caret>o f){}
}