mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't warn when calling @VisibleForTesting method with no original visibility specified (IDEA-107730)
This commit is contained in:
@@ -4,13 +4,18 @@ public class A {
|
||||
visibleMethod(1);
|
||||
}
|
||||
|
||||
@com.google.common.annotations.VisibleForTesting()
|
||||
@com.android.annotations.VisibleForTesting
|
||||
void invisibleMethod(int a) {
|
||||
|
||||
}
|
||||
|
||||
@com.google.common.annotations.VisibleForTesting(visibility=com.google.common.annotations.VisibleForTesting.Visibility.PROTECTED)
|
||||
@com.android.annotations.VisibleForTesting(visibility=com.android.annotations.VisibleForTesting.Visibility.PROTECTED)
|
||||
void visibleMethod(int a) {
|
||||
|
||||
}
|
||||
|
||||
@com.google.common.annotations.VisibleForTesting
|
||||
void unknownRealVisibilityMethod(int a) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,6 @@ public class B {
|
||||
void publicMethod() {
|
||||
new A().invisibleMethod(2);
|
||||
new A().visibleMethod(2);
|
||||
new A().unknownRealVisibilityMethod(2);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.android.annotations;
|
||||
|
||||
public @interface VisibleForTesting {
|
||||
enum Visibility {
|
||||
/** The element should be considered protected. */
|
||||
PROTECTED,
|
||||
/** The element should be considered package-private. */
|
||||
PACKAGE,
|
||||
/** The element should be considered private. */
|
||||
PRIVATE
|
||||
}
|
||||
|
||||
Visibility visibility() default Visibility.PRIVATE;
|
||||
}
|
||||
+1
-10
@@ -1,14 +1,5 @@
|
||||
package com.google.common.annotations;
|
||||
|
||||
public @interface VisibleForTesting {
|
||||
enum Visibility {
|
||||
/** The element should be considered protected. */
|
||||
PROTECTED,
|
||||
/** The element should be considered package-private. */
|
||||
PACKAGE,
|
||||
/** The element should be considered private. */
|
||||
PRIVATE
|
||||
}
|
||||
|
||||
Visibility visibility() default Visibility.PRIVATE;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user