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 2026/06/13 14:28:04 UTC

(groovy) branch master updated: Trivial refactor: use pattern variable instead

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 449cb4d2c3 Trivial refactor: use pattern variable instead
449cb4d2c3 is described below

commit 449cb4d2c3ef0a5e630154b121fa4015cef18ea5
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jun 13 23:27:38 2026 +0900

    Trivial refactor: use pattern variable instead
---
 .../main/groovy/org/apache/groovy/macrolib/MacroLibGroovyMethods.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-macro-library/src/main/groovy/org/apache/groovy/macrolib/MacroLibGroovyMethods.java b/subprojects/groovy-macro-library/src/main/groovy/org/apache/groovy/macrolib/MacroLibGroovyMethods.java
index efa414de8d..5a0eb5961b 100644
--- a/subprojects/groovy-macro-library/src/main/groovy/org/apache/groovy/macrolib/MacroLibGroovyMethods.java
+++ b/subprojects/groovy-macro-library/src/main/groovy/org/apache/groovy/macrolib/MacroLibGroovyMethods.java
@@ -238,7 +238,7 @@ public final class MacroLibGroovyMethods {
         for (int i = 0; i < genCount; i++) {
             Expression g = exps[i];
             if (!(g instanceof BinaryExpression bin)
-                    || ((BinaryExpression) g).getOperation().getType() != Types.KEYWORD_IN) {
+                    || bin.getOperation().getType() != Types.KEYWORD_IN) {
                 return error(ctx, g, "DO generator must have the form 'name in expression'");
             }
             if (!(bin.getLeftExpression() instanceof VariableExpression)) {