diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java index 9009e4165fa..17e0a466a6c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java @@ -26,7 +26,6 @@ import org.openrewrite.groovy.tree.GSpace; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.marker.CompactConstructor; -import org.openrewrite.java.marker.OmitParentheses; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; @@ -424,7 +423,8 @@ public J visitMethodInvocation(J.MethodInvocation method, PrintOutputCapture

boolean applyTrailingLambdaParenthese = true; for (int i = 0; i < args.size(); i++) { JRightPadded arg = args.get(i); - boolean omitParensCurrElem = arg.getElement().getMarkers().findFirst(OmitParentheses.class).isPresent(); + boolean omitParensCurrElem = arg.getElement().getMarkers().findFirst(OmitParentheses.class).isPresent() || + arg.getElement().getMarkers().findFirst(org.openrewrite.java.marker.OmitParentheses.class).isPresent(); if (i == 0) { if (omitParensCurrElem) { diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/OmitParentheses.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/OmitParentheses.java new file mode 100644 index 00000000000..b430dd3b566 --- /dev/null +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/OmitParentheses.java @@ -0,0 +1,34 @@ +/* + * Copyright 2021 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openrewrite.groovy.marker; + +import lombok.Value; +import lombok.With; +import org.openrewrite.marker.Marker; + +import java.util.UUID; + +/** + * See the Groovy style guide on Omitting parentheses. + * + * @deprecated Use {@link org.openrewrite.java.marker.OmitParentheses} instead. + */ +@Value +@With +@Deprecated +public class OmitParentheses implements Marker { + UUID id; +}