You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/03/01 12:01:11 UTC
[groovy] branch master updated (0aa469b -> 77505c8)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.
from 0aa469b GROOVY-9429: Illegal reflective access warnings occurred when getting property (#1179)
new 2cd0287 fix binary compatibility: restore method used by frameworks like Grails/GORM
new 77505c8 keep old methods as convenience methods
The 2 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.
Summary of changes:
.../org/codehaus/groovy/ast/tools/GenericsUtils.java | 18 +++++++++++++++++-
.../codehaus/groovy/classgen/VariableScopeVisitor.java | 8 ++++++++
.../groovy/classgen/asm/BinaryExpressionHelper.java | 5 +++++
.../org/codehaus/groovy/classgen/asm/MopWriter.java | 7 ++++++-
4 files changed, 36 insertions(+), 2 deletions(-)
[groovy] 02/02: keep old methods as convenience methods
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 77505c84c9fc4912ccbb04571197e105eff86154
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Mar 1 21:27:50 2020 +1000
keep old methods as convenience methods
---
.../java/org/codehaus/groovy/ast/tools/GenericsUtils.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index 1ffcf39..e48f2e5 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -677,7 +677,10 @@ public class GenericsUtils {
private static final boolean PARAMETERIZED_TYPE_CACHE_ENABLED = Boolean.parseBoolean(getSystemPropertySafe("groovy.enable.parameterized.type.cache", "true"));
- @Deprecated
+ /**
+ * Convenience method for {@link #findParameterizedTypeFromCache(ClassNode, ClassNode, boolean)}
+ * when the {@code tryToFindExactType} boolean is {@code false}.
+ */
public static ClassNode findParameterizedTypeFromCache(final ClassNode genericsClass, final ClassNode actualType) {
return findParameterizedTypeFromCache(genericsClass, actualType, false);
}
@@ -696,13 +699,16 @@ public class GenericsUtils {
return null == sr ? null : sr.get();
}
- @Deprecated
+ /**
+ * Convenience method for {@link #findParameterizedType(ClassNode, ClassNode, boolean)}
+ * when the {@code tryToFindExactType} boolean is {@code false}.
+ */
public static ClassNode findParameterizedType(final ClassNode genericsClass, final ClassNode actualType) {
return findParameterizedType(genericsClass, actualType, false);
}
/**
- * Get the parameterized type by search the whole class hierarchy according to generics class and actual receiver.
+ * Get the parameterized type by searching the whole class hierarchy according to generics class and actual receiver.
* {@link #findParameterizedTypeFromCache(ClassNode, ClassNode, boolean)} is strongly recommended for better performance.
*
* @param genericsClass the generics class
[groovy] 01/02: fix binary compatibility: restore method used by
frameworks like Grails/GORM
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 2cd0287be5192a3c8a0563482e756151c10fc950
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Mar 1 20:41:43 2020 +1000
fix binary compatibility: restore method used by frameworks like Grails/GORM
---
src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | 10 ++++++++++
.../org/codehaus/groovy/classgen/VariableScopeVisitor.java | 8 ++++++++
.../codehaus/groovy/classgen/asm/BinaryExpressionHelper.java | 5 +++++
src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java | 7 ++++++-
4 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index bda67c1..1ffcf39 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -677,6 +677,11 @@ public class GenericsUtils {
private static final boolean PARAMETERIZED_TYPE_CACHE_ENABLED = Boolean.parseBoolean(getSystemPropertySafe("groovy.enable.parameterized.type.cache", "true"));
+ @Deprecated
+ public static ClassNode findParameterizedTypeFromCache(final ClassNode genericsClass, final ClassNode actualType) {
+ return findParameterizedTypeFromCache(genericsClass, actualType, false);
+ }
+
/**
* Try to get the parameterized type from the cache.
* If no cached item found, cache and return the result of {@link #findParameterizedType(ClassNode, ClassNode, boolean)}
@@ -691,6 +696,11 @@ public class GenericsUtils {
return null == sr ? null : sr.get();
}
+ @Deprecated
+ public static ClassNode findParameterizedType(final ClassNode genericsClass, final ClassNode actualType) {
+ return findParameterizedType(genericsClass, actualType, false);
+ }
+
/**
* Get the parameterized type by search the whole class hierarchy according to generics class and actual receiver.
* {@link #findParameterizedTypeFromCache(ClassNode, ClassNode, boolean)} is strongly recommended for better performance.
diff --git a/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java b/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
index 3da0856..12edb39 100644
--- a/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
+++ b/src/main/java/org/codehaus/groovy/classgen/VariableScopeVisitor.java
@@ -460,6 +460,14 @@ public class VariableScopeVisitor extends ClassCodeVisitorSupport {
popState();
}
+ /**
+ * Sets the current class node context.
+ */
+ public void prepareVisit(ClassNode node) {
+ currentClass = node;
+ currentScope.setClassScope(node);
+ }
+
@Override
public void visitConstructorCallExpression(final ConstructorCallExpression expression) {
boolean oldInSpecialCtorFlag = inSpecialConstructorCall;
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionHelper.java b/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionHelper.java
index 1f7f256..60967e2 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionHelper.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionHelper.java
@@ -338,6 +338,11 @@ public class BinaryExpressionHelper {
}
}
+ @Deprecated
+ protected void assignToArray(final Expression parent, final Expression receiver, final Expression index, final Expression rhsValueLoader) {
+ assignToArray(parent, receiver, index, rhsValueLoader, false);
+ }
+
protected void assignToArray(final Expression parent, final Expression receiver, final Expression index, final Expression rhsValueLoader, final boolean safe) {
// let's replace this assignment to a subscript operator with a
// method call
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
index ad3f1bb..eb43abe 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
@@ -194,7 +194,7 @@ public class MopWriter {
operandStack.remove(parameters.length);
ClassNode declaringClass = method.getDeclaringClass();
// JDK 8 support for default methods in interfaces
- // TODO: this should probably be strenghtened when we support the A.super.foo() syntax
+ // TODO: this should probably be strengthened when we support the A.super.foo() syntax
int opcode = declaringClass.isInterface() ? INVOKEINTERFACE : INVOKESPECIAL;
mv.visitMethodInsn(opcode, BytecodeHelper.getClassInternalName(declaringClass), method.getName(), methodDescriptor, declaringClass.isInterface());
BytecodeHelper.doReturn(mv, method.getReturnType());
@@ -203,4 +203,9 @@ public class MopWriter {
controller.getClassNode().addMethod(name, ACC_PUBLIC | ACC_SYNTHETIC, method.getReturnType(), parameters, null, null);
}
}
+
+ @Deprecated
+ public static boolean equalParameterTypes(Parameter[] p1, Parameter[] p2) {
+ return ParameterUtils.parametersEqual(p1, p2);
+ }
}