(final MetaProperty field, final MetaMethod method, final Class<?> sender)
| 2350 | } |
| 2351 | |
| 2352 | private boolean isVisibleProperty(final MetaProperty field, final MetaMethod method, final Class<?> sender) { |
| 2353 | if (field == null |
| 2354 | || sender == null // GROOVY-11745 |
| 2355 | || field.isPrivate() |
| 2356 | || !(field instanceof CachedField cachedField)) return false; |
| 2357 | |
| 2358 | Class<?> owner = cachedField.getDeclaringClass(); |
| 2359 | // ensure access originates within the type hierarchy of the field owner |
| 2360 | if (owner.equals(sender) || !owner.isAssignableFrom(sender)) return false; |
| 2361 | |
| 2362 | if (!field.isPublic() && !field.isProtected() && !inSamePackage(owner, sender)) return false; |
| 2363 | |
| 2364 | // GROOVY-8283: non-private field that hides class access method |
| 2365 | return !owner.isAssignableFrom(method.getDeclaringClass().getTheClass()) && !method.getDeclaringClass().isInterface(); |
| 2366 | } |
| 2367 | |
| 2368 | private Tuple2<MetaMethod, MetaProperty> createMetaMethodAndMetaProperty(final Class<?> sender, final String name, final boolean useSuper, final boolean isStatic) { |
| 2369 | MetaMethod mm = null; |
no test coverage detected