Skip to content

Commit

Permalink
change error requirements from public to non-private (#2289)
Browse files Browse the repository at this point in the history
untested, I just used the web editor
  • Loading branch information
O7410 committed Apr 27, 2024
1 parent 0a29cf0 commit 5992a6a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import com.intellij.psi.PsiModifier
class StaticMemberInspection : MixinInspection() {

override fun getStaticDescription() =
"A mixin class does not exist at runtime, and thus having them public does not make sense. " +
"A mixin class does not exist at runtime, and thus having them not private does not make sense. " +
"Make the field/method private instead."

override fun buildVisitor(holder: ProblemsHolder): PsiElementVisitor = Visitor(holder)
Expand All @@ -56,7 +56,7 @@ class StaticMemberInspection : MixinInspection() {
if (isProblematic(member)) {
holder.registerProblem(
member,
"Public static members are not allowed in Mixin classes",
"Non-private static members are not allowed in Mixin classes",
QuickFixFactory.getInstance().createModifierListFix(member, PsiModifier.PRIVATE, true, false),
)
}
Expand All @@ -70,7 +70,7 @@ class StaticMemberInspection : MixinInspection() {

val modifiers = member.modifierList!!

return modifiers.hasModifierProperty(PsiModifier.PUBLIC) &&
return !modifiers.hasModifierProperty(PsiModifier.PRIVATE) &&
modifiers.hasModifierProperty(PsiModifier.STATIC) &&
modifiers.findAnnotation(SHADOW) == null &&
modifiers.findAnnotation(OVERWRITE) == null &&
Expand Down

0 comments on commit 5992a6a

Please sign in to comment.