mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change signature: highest visibility should not return PUBLIC all at once (IDEA-111739)
This commit is contained in:
@@ -50,13 +50,7 @@ public class VisibilityUtil {
|
||||
|
||||
@PsiModifier.ModifierConstant
|
||||
public static String getHighestVisibility(@PsiModifier.ModifierConstant String v1, @PsiModifier.ModifierConstant String v2) {
|
||||
if(v1.equals(v2)) return v1;
|
||||
|
||||
if(PsiModifier.PRIVATE.equals(v1)) return v2;
|
||||
if(PsiModifier.PUBLIC.equals(v1)) return PsiModifier.PUBLIC;
|
||||
if(PsiModifier.PRIVATE.equals(v2)) return v1;
|
||||
|
||||
return PsiModifier.PUBLIC;
|
||||
return compare(v1, v2) < 0 ? v1 : v2;
|
||||
}
|
||||
|
||||
public static void escalateVisibility(PsiMember modifierListOwner, PsiElement place) throws IncorrectOperationException {
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Test {
|
||||
protected void fo<caret>o() {
|
||||
}
|
||||
}
|
||||
|
||||
class subclass extends Test {
|
||||
@Override
|
||||
protected void foo() {
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
class subclass extends Test {
|
||||
@Override
|
||||
protected void foo() {
|
||||
}
|
||||
}
|
||||
@@ -355,6 +355,10 @@ public class ChangeSignatureTest extends LightRefactoringTestCase {
|
||||
doTest(null, null, "Exception", new SimpleParameterGen(), new SimpleExceptionsGen(), false);
|
||||
}
|
||||
|
||||
public void testVisibilityOfOverriddenMethod() throws Exception {
|
||||
doTest(PsiModifier.PACKAGE_LOCAL, "foo", "void", new ParameterInfoImpl[0], new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
public void testRemoveExceptions() throws Exception {
|
||||
doTest(null, null, "void", new SimpleParameterGen(), new SimpleExceptionsGen(), false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user