How to let Inspector revisit class field when modify method?
Answered
When modify a method content, some like add a statement or delete, I noticed that Inspection visitor not to revisit class field statement.
Maybe it is right. But how can I break that rule ?
An actual case shows below.
class Foo {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); // (1)
public void foo() {
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); // (2)
}
}
When someone write (1), I say that it may be vulnerable to XXE attack. So He needs write (2) to disallow something.
Now in IDEA, when he writes (1), my Inspector will show WARNING on statement (1), that's right.
And, when he writes (2), my Inspector will only check (2) statement, but not revisit (1). So the problemsHolder about (1) could not clean, WARNING can not clean.
What I want is let Inspector revisit (1). Can any let me known how could I do that?
Please sign in to leave a comment.
See com.intellij.codeInspection.LocalInspectionTool#runForWholeFile