void (final PsiTreeChangeEvent event, PsiElement parent, PsiElement child) { PsiFile psiFile = event.getFile(); if (processConfigFileChange(psiFile)) return; if (!(psiFile instanceof PsiClassOwner)) { return; } // added/removed annotation if (parent instanceof PsiModifierList && child instanceof PsiAnnotation) { checkRelevantAnnotation((PsiAnnotation)child); return; } // psiClass modifier changed (static, public) if (parent instanceof PsiModifierList && parent.getParent() instanceof PsiClass) { incModificationCount(); return; } // added/removed inner class (it could contain stereotype anno) if (parent instanceof PsiClass) { if (child instanceof PsiClass || event.getNewChild() instanceof PsiClass || event.getOldChild() instanceof PsiClass) { incModificationCount(); } return; } if (parent instanceof PsiImportList || // add import child instanceof PsiImportList || // remove import PsiTreeUtil.getParentOfType(parent, PsiImportList.class) != null) // change import identifier (completion, typing) { incModificationCount(); return; } // editing on existing or inside annotation final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(parent, PsiAnnotation.class); if (annotation != null) { checkRelevantAnnotation(annotation); } }