Minor, annotate visibility constants with NotNull
To avoid nullability warnings on ClassDescriptor#getVisibility and implementations
This commit is contained in:
@@ -26,6 +26,7 @@ public class JavaVisibilities {
|
||||
private JavaVisibilities() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static final Visibility PACKAGE_VISIBILITY = new Visibility("package", false) {
|
||||
@Override
|
||||
public boolean isVisible(@Nullable ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||
@@ -63,6 +64,7 @@ public class JavaVisibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility PROTECTED_STATIC_VISIBILITY = new Visibility("protected_static", true) {
|
||||
@Override
|
||||
public boolean isVisible(@Nullable ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||
@@ -87,6 +89,7 @@ public class JavaVisibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility PROTECTED_AND_PACKAGE = new Visibility("protected_and_package", true) {
|
||||
@Override
|
||||
public boolean isVisible(@Nullable ReceiverValue receiver, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.jetbrains.kotlin.utils.CollectionsKt;
|
||||
import java.util.*;
|
||||
|
||||
public class Visibilities {
|
||||
@NotNull
|
||||
public static final Visibility PRIVATE = new Visibility("private", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -104,6 +105,7 @@ public class Visibilities {
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
@NotNull
|
||||
public static final Visibility PRIVATE_TO_THIS = new Visibility("private_to_this", false) {
|
||||
@Override
|
||||
public boolean isVisible(@Nullable ReceiverValue thisObject, @NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||
@@ -133,6 +135,7 @@ public class Visibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility PROTECTED = new Visibility("protected", true) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -198,6 +201,7 @@ public class Visibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility INTERNAL = new Visibility("internal", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -213,6 +217,7 @@ public class Visibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility PUBLIC = new Visibility("public", true) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -225,6 +230,7 @@ public class Visibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility LOCAL = new Visibility("local", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -237,6 +243,7 @@ public class Visibilities {
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static final Visibility INHERITED = new Visibility("inherited", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -250,6 +257,7 @@ public class Visibilities {
|
||||
};
|
||||
|
||||
/* Visibility for fake override invisible members (they are created for better error reporting) */
|
||||
@NotNull
|
||||
public static final Visibility INVISIBLE_FAKE = new Visibility("invisible_fake", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
@@ -264,6 +272,7 @@ public class Visibilities {
|
||||
|
||||
// Currently used as default visibility of FunctionDescriptor
|
||||
// It's needed to prevent NPE when requesting non-nullable visibility of descriptor before `initialize` has been called
|
||||
@NotNull
|
||||
public static final Visibility UNKNOWN = new Visibility("unknown", false) {
|
||||
@Override
|
||||
public boolean mustCheckInImports() {
|
||||
|
||||
Reference in New Issue
Block a user