groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 02/02: remove a couple of checkstyle warnings
Date Mon, 25 Mar 2019 01:25:02 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 19caa86c6d74319e11b396fd0209914633634dac
Author: Paul King <paulk@asert.com.au>
AuthorDate: Mon Mar 25 09:57:21 2019 +1000

    remove a couple of checkstyle warnings
---
 .../src/main/groovy/groovy/text/XmlTemplateEngine.java              | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
index 27e2599..6f505af 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
@@ -197,7 +197,7 @@ public class XmlTemplateEngine extends TemplateEngine {
 
         protected boolean printSpecialNode(Node node) {
             Object name = node.name();
-            if (name != null && name instanceof QName) {
+            if (name instanceof QName) {
                 QName qn = (QName) name;
                 // check uri and for legacy cases just check prefix name (not recommended)
                 if (qn.getNamespaceURI().equals("http://groovy.codehaus.org/2005/gsp") ||
qn.getPrefix().equals("gsp")) {
@@ -242,7 +242,7 @@ public class XmlTemplateEngine extends TemplateEngine {
         public XmlWritable(Script script, Binding binding) {
             this.script = script;
             this.binding = binding;
-            this.result = new WeakReference(null);
+            this.result = new WeakReference<>(null);
         }
 
         public Writer writeTo(Writer out) {
@@ -259,7 +259,7 @@ public class XmlTemplateEngine extends TemplateEngine {
                 return result.get().toString();
             }
             String string = writeTo(new StringBuilderWriter(1024)).toString();
-            result = new WeakReference(string);
+            result = new WeakReference<>(string);
             return string;
         }
     }


Mime
View raw message