Temporary workaround for Checkstyle bug

Attempting to name a variable in an "instanceof pattern" the same as
a field results in a Checkstyle violation similar to the following if
the "instanceof pattern matching" is located within a constructor.

Reference to instance variable 'document' needs "this.". [RequireThis]

See gh-28188
This commit is contained in:
Sam Brannen 2022-05-30 19:35:16 +02:00
parent bbaf7578b2
commit 43dd813ee6
1 changed files with 2 additions and 2 deletions

View File

@ -50,8 +50,8 @@ class DomContentHandler implements ContentHandler {
*/
DomContentHandler(Node node) {
this.node = node;
if (node instanceof Document document) {
this.document = document;
if (node instanceof Document doc) {
this.document = doc;
}
else {
this.document = node.getOwnerDocument();