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 { @@ -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();

Loading…
Cancel
Save