Browse Source

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
pull/28542/head
Sam Brannen 2 years ago
parent
commit
43dd813ee6
  1. 4
      spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java

4
spring-core/src/main/java/org/springframework/util/xml/DomContentHandler.java

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

Loading…
Cancel
Save