@Override public void visitField(@NotNull PsiField field) { super.visitField(field); final PsiType type = field.getType(); if (!type.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUFFER) && !type.equalsToText(CommonClassNames.JAVA_LANG_STRING_BUILDER)) { return; } registerFieldError(field, type); }
@Override public void visitField(@NotNull PsiField field) { super.visitField(field); if (!field.hasModifierProperty(PsiModifier.PRIVATE)) { return; } if (HighlightUtil.isSerializationImplicitlyUsedField(field)) { return; } final PsiClass containingClass = PsiUtil.getTopLevelClass(field); if (!shouldCheckVariable(field, containingClass)) { return; } final ArrayReadWriteVisitor visitor = new ArrayReadWriteVisitor(field, !isSimpleArrayExpression(field.getInitializer())); containingClass.accept(visitor); final boolean written = visitor.isWritten(); if (!visitor.isReferenced() || written == visitor.isRead()) { return; } registerFieldError(field, Boolean.valueOf(written)); }
@Override public void visitField(PsiField field) { super.visitField(field); checkTypeElement(field.getTypeElement()); }