This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_5_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_5_0_X by this push:
new bb6b8fbb55 Fix compilation issue
bb6b8fbb55 is described below
commit bb6b8fbb55ceb6d9d070b3f9551d27f4078f88a8
Author: Daniel Sun <[email protected]>
AuthorDate: Sat Sep 6 16:56:37 2025 +0900
Fix compilation issue
---
src/main/java/groovy/lang/MetaClassImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/groovy/lang/MetaClassImpl.java
b/src/main/java/groovy/lang/MetaClassImpl.java
index 8d30d9670c..aa1781625e 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -2098,8 +2098,9 @@ public class MetaClassImpl implements MetaClass,
MutableMetaClass {
if (field == null
|| sender == null // GROOVY-11745
|| field.isPrivate()
- || !(field instanceof CachedField cachedField)) return false;
+ || !(field instanceof CachedField)) return false;
+ CachedField cachedField = (CachedField) field;
Class<?> owner = cachedField.getDeclaringClass();
// ensure access originates within the type hierarchy of the field
owner
if (owner.equals(sender) || !owner.isAssignableFrom(sender)) return
false;