You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by bl...@apache.org on 2023/08/29 16:04:05 UTC
[groovy] branch feature/improve_secure_ast_method_check created (now c7f4de37d9)
This is an automated email from the ASF dual-hosted git repository.
blackdrag pushed a change to branch feature/improve_secure_ast_method_check
in repository https://gitbox.apache.org/repos/asf/groovy.git
at c7f4de37d9 Improve method selection for script body in SecureASTCustomizer
This branch includes the following new commits:
new c7f4de37d9 Improve method selection for script body in SecureASTCustomizer
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[groovy] 01/01: Improve method selection for script body in SecureASTCustomizer
Posted by bl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
blackdrag pushed a commit to branch feature/improve_secure_ast_method_check
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit c7f4de37d9ba3817c9366c62f90a0f07717be8f3
Author: Jochen Theodorou <bl...@gmx.org>
AuthorDate: Tue Aug 29 18:03:40 2023 +0200
Improve method selection for script body in SecureASTCustomizer
---
.../org/codehaus/groovy/control/customizers/SecureASTCustomizer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
index 7a76491070..00b8bf0aad 100644
--- a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
+++ b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
@@ -963,7 +963,7 @@ public class SecureASTCustomizer extends CompilationCustomizer {
List<MethodNode> methods = owner.getMethods();
for (MethodNode method : methods) {
if (method.getDeclaringClass() == owner && !method.isSynthetic()) {
- if ("main".equals(method.getName()) || "run".equals(method.getName()) && owner.isScriptBody()) continue;
+ if (("main".equals(method.getName()) || "run".equals(method.getName())) && owner.isScriptBody()) continue;
result.add(method);
}
}