groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 01/02: Trivial refactoring: remove redundant initializers
Date Sat, 11 Jan 2020 17:15:30 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 076c445f17ac912d56d2a4e57b0bee84f8fa664e
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Sun Jan 12 01:13:24 2020 +0800

    Trivial refactoring: remove redundant initializers
---
 .../src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
b/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
index 5be5e48..58836d8 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
@@ -223,8 +223,8 @@ public class GroovydocVisitor extends ClassCodeVisitorSupport {
     private void processPropertiesFromGetterSetter(SimpleGroovyMethodDoc currentMethodDoc)
{
         String methodName = currentMethodDoc.name();
         int len = methodName.length();
-        String prefix = null;
-        String propName = null;
+        String prefix;
+        String propName;
         if (len > 3 && methodName.startsWith("get")) {
             prefix = "get";
             propName = methodName.substring(3);
@@ -247,7 +247,7 @@ public class GroovydocVisitor extends ClassCodeVisitorSupport {
         GroovyMethodDoc methods[] = classDoc.methods();
 
         //find expected method name
-        String expectedMethodName = null;
+        String expectedMethodName;
         if ("set".equals(prefix) && (currentMethodDoc.parameters().length >= 1
&& !currentMethodDoc.parameters()[0].typeName().equals("boolean"))) {
             expectedMethodName = "get" + propName;
         } else if ("get".equals(prefix) && !currentMethodDoc.returnType().typeName().equals("boolean"))
{


Mime
View raw message