diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java index 99e06328f94..d6a3380a84c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java @@ -579,20 +579,20 @@ null, emptyList(), } @Override - public void visitConstructor(ConstructorNode constructor_) { + public void visitConstructor(ConstructorNode constructor) { Space fmt = whitespace(); - List annotations = visitAndGetAnnotations(constructor_); - List modifiers = visitModifiers(constructor_.getModifiers()); + List annotations = visitAndGetAnnotations(constructor); + List modifiers = visitModifiers(constructor.getModifiers()); // Constructor name might be in quotes Space namePrefix = whitespace(); String constructorName; - if (source.startsWith(constructor_.getDeclaringClass().getName(), cursor)) { - constructorName = constructor_.getDeclaringClass().getName(); + if (source.startsWith(constructor.getDeclaringClass().getName(), cursor)) { + constructorName = constructor.getDeclaringClass().getName(); } else { char openingQuote = source.charAt(cursor); - constructorName = openingQuote + constructor_.getName() + openingQuote; + constructorName = openingQuote + constructor.getName() + openingQuote; } cursor += constructorName.length(); J.Identifier name = new J.Identifier(randomId(), @@ -602,12 +602,12 @@ public void visitConstructor(ConstructorNode constructor_) { constructorName, null, null); - RewriteGroovyVisitor bodyVisitor = new RewriteGroovyVisitor(constructor_, this); + RewriteGroovyVisitor bodyVisitor = new RewriteGroovyVisitor(constructor, this); // Parameter has no visit implementation, so we've got to do this by hand Space beforeParen = sourceBefore("("); - List> params = new ArrayList<>(constructor_.getParameters().length); - Parameter[] unparsedParams = constructor_.getParameters(); + List> params = new ArrayList<>(constructor.getParameters().length); + Parameter[] unparsedParams = constructor.getParameters(); for (int i = 0; i < unparsedParams.length; i++) { Parameter param = unparsedParams[i]; @@ -646,14 +646,14 @@ null, emptyList(), params.add(JRightPadded.build(new J.Empty(randomId(), sourceBefore(")"), Markers.EMPTY))); } - JContainer throws_ = constructor_.getExceptions().length == 0 ? null : JContainer.build( + JContainer throws_ = constructor.getExceptions().length == 0 ? null : JContainer.build( sourceBefore("throws"), - bodyVisitor.visitRightPadded(constructor_.getExceptions(), null), + bodyVisitor.visitRightPadded(constructor.getExceptions(), null), Markers.EMPTY ); - J.Block body = constructor_.getCode() == null ? null : - bodyVisitor.visit(constructor_.getCode()); + J.Block body = constructor.getCode() == null ? null : + bodyVisitor.visit(constructor.getCode()); queue.add(new J.MethodDeclaration( randomId(), fmt, Markers.EMPTY, @@ -666,7 +666,7 @@ null, emptyList(), throws_, body, null, - typeMapping.methodType(constructor_) + typeMapping.methodType(constructor) )); }