brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <>
Subject [GitHub] brooklyn-server pull request #714: BROOKLYN-513: fix coercion for jclouds re...
Date Thu, 01 Jun 2017 13:23:16 GMT
Github user neykov commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/brooklyn/util/core/flags/
    @@ -83,10 +86,11 @@ public boolean apply(@Nullable Method input) {
             Optional<Method> matchingMethod = Iterables.tryFind(methods, matchSingleParameterMethod(methodName,
             if (matchingMethod.isPresent()) {
                 Method method = matchingMethod.get();
    +            Method accessibleMethod = Reflections.findAccessibleMethod(method);
    --- End diff --
    The approach will fail for classes which have similar methods and one of them is not accessible.
    For example the builder of `IpOptions` has
          abstract Builder address(Optional<String> address);
          public Builder address(String address) {
    If we have a registered coercion for `T -> Optional<T>`  it will choose the first
one, but there's no public alternative for it in the superclasses. A simpler case would be
two methods to have `int`, `string` arguments where again the former can be coerced to the
    A more resilient approach would be to get a list of the public methods for all interfaces
and superclasses (at line 76), filter them for public access and then do the name/parameter

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message