You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/01/11 17:15:30 UTC
[groovy] 01/02: Trivial refactoring: remove redundant initializers
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 <su...@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")) {