groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 01/03: Trivial refactoring: simplify code with `Objects.equals`
Date Thu, 16 Jan 2020 02:10:12 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit fac657470bc4dd511ed8b26319eba2823f4067a2
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Thu Jan 16 09:40:33 2020 +0800

    Trivial refactoring: simplify code with `Objects.equals`
---
 .../java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
index b1f840e..7f1b563 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
@@ -28,6 +28,7 @@ import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.regex.Pattern;
 
 public class SimpleGroovyRootDoc extends SimpleGroovyDoc implements GroovyRootDoc {
@@ -223,7 +224,7 @@ public class SimpleGroovyRootDoc extends SimpleGroovyDoc implements GroovyRootDo
 
                 final Entry entry = (Entry) o;
 
-                if (groovyClass != null ? !groovyClass.equals(entry.groovyClass) : entry.groovyClass
!= null)
+                if (!Objects.equals(groovyClass, entry.groovyClass))
                     return false;
                 return name.equals(entry.name);
             }


Mime
View raw message