brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (BROOKLYN-513) yaml location for azurecompute-arm templateOptions.ipOptions fails
Date Thu, 01 Jun 2017 13:24:04 GMT


ASF GitHub Bot commented on BROOKLYN-513:

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

> yaml location for azurecompute-arm templateOptions.ipOptions fails
> ------------------------------------------------------------------
>                 Key: BROOKLYN-513
>                 URL:
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.11.0
>            Reporter: Aled Sage
> When attempting to use the very latest jclouds 2.1.0-SNAPSHOT azurecompute-arm with the
location yaml below, it fails to convert this to an {{IpOptions}} instance.
> {noformat}
> templateOptions:
>   ipOptions:
>   - subnet: manual-subnet-ambari
> {noformat}
> This is because of how jclouds declares its builder. The {{IpOptions.builder()}} method
returns an instance of {{AutoValue_IpOptions.Builder}}, but that class is package-private
[1]. Therefore reflectively trying to call {{builder.subnet("manual-subnet-ambari")}} is failing
because the method is not accessible.
> [1]

This message was sent by Atlassian JIRA

View raw message