@Override
  public void visitModifierList(@NotNull GrModifierList modifierList) {
    final PsiElement parent = modifierList.getParent();
    if (parent instanceof GrMethod) {
      checkMethodDefinitionModifiers(myHolder, (GrMethod)parent);
    }
    else if (parent instanceof GrVariableDeclaration declaration) {
      if (isFieldDeclaration(declaration)) {
        checkFieldModifiers(myHolder, declaration);
      }
      else {
        checkVariableModifiers(myHolder, declaration);
        GrVariable[] variables = declaration.getVariables();
        checkDuplicateModifiers(myHolder, modifierList, variables.length == 0 ? null : variables[0]);
      }
    }
    else if (parent instanceof GrClassInitializer) {
      checkClassInitializerModifiers(myHolder, modifierList);
    }
  }
@Override
  public void visitModifierList(@NotNull GrModifierList modifierList)