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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]