[
https://issues.apache.org/jira/browse/GROOVY-12267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105428#comment-18105428
]
ASF GitHub Bot commented on GROOVY-12267:
-----------------------------------------
paulk-asert opened a new pull request, #2804:
URL: https://github.com/apache/groovy/pull/2804
…n export
buildOperationMapFrom guarded operation export with
(declaredMethods.contains(name) && !OPS_EXCEPTION_LIST.contains(name))
|| (!OPS_EXCEPTION_LIST.contains(name))
which reduces to its right operand, so the declaredMethods lookup above it
was computed and never used and the comment claiming it avoided methods from
parents described something the code did not do.
Drop the dead operand and the unused lookup, and state the actual contract
in the javadoc: the default export spans the whole inheritance chain, and a
caller wanting a narrower set names the operations explicitly in a descriptor.
Behaviour is unchanged. Making the declared-method check live instead was
considered and rejected: JmxBuilder's own embedded-descriptor fixtures declare
their operations on a base class, and 'operations: "*"' routes to this method
and has to mean all of them, so restricting to declared methods breaks four
existing tests and gives '*' a meaning it should not have.
Adds two tests pinning behaviour that was previously untested: inherited
operations are exported, and getMetaClass/setMetaClass are not, the latter
because they resolve to the metaClass MetaProperty and are dropped by the
getter/setter filter.
> JMX operation filter cleanup
> ----------------------------
>
> Key: GROOVY-12267
> URL: https://issues.apache.org/jira/browse/GROOVY-12267
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)