@Override public void visitAnonymousClass(@NotNull PsiAnonymousClass aClass) { super.visitAnonymousClass(aClass); if (aClass instanceof PsiEnumConstantInitializer) { return; } registerClassError(aClass); }
@Override public void visitAnonymousClass( @NotNull PsiAnonymousClass aClass) { if (aClass instanceof PsiEnumConstantInitializer) { return; } final int totalMethodCount = calculateTotalMethodCount(aClass); if (totalMethodCount <= getLimit()) { return; } registerClassError(aClass, Integer.valueOf(totalMethodCount)); }
@Override public void visitClass(@NotNull PsiClass aClass) { // no call to super, so it doesn't drill down if (aClass.isInterface() || aClass.isAnnotationType() || aClass.isEnum()) { return; } if (aClass instanceof PsiTypeParameter || aClass instanceof PsiEnumConstantInitializer) { return; } if (ignoreAnonymousInnerClasses && aClass instanceof PsiAnonymousClass) { return; } if (!SerializationUtils.isSerializable(aClass)) { return; } final boolean hasReadObject = SerializationUtils.hasReadObject(aClass); final boolean hasWriteObject = SerializationUtils.hasWriteObject(aClass); if (hasWriteObject && hasReadObject) { return; } if (isIgnoredSubclass(aClass)) { return; } registerClassError(aClass, Boolean.valueOf(hasReadObject), Boolean.valueOf(hasWriteObject)); }
@Override public void visitEnumConstantInitializer(PsiEnumConstantInitializer enumConstantInitializer) { mVisitor.report("PsiEnumConstantInitializer", enumConstantInitializer.getText(), enumConstantInitializer); super.visitAnonymousClass(enumConstantInitializer); }