PsiModifierList (PsiElement element) { PsiElement parent = element.getParent(); if (!(parent instanceof PsiWhileStatement whileStatement)) return null; PsiExpression condition = whileStatement.getCondition(); PsiField field = getFieldIfSimpleFieldComparison(condition); if (field == null) return null; return field.getModifierList(); }