OSDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] brooklyn-server pull request #962: allow tags to be set on catalog items


Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/962#discussion_r186258005
  
    --- Diff: rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java ---
    @@ -114,7 +116,8 @@ public ConfigSummary(ConfigKey<?> config, String label, Double priority, Boolean
                     : ImmutableList.<String>of();
             if (config.getType().isEnum()) {
                 this.type = Enum.class.getName();
    -            this.defaultValue = (config.getDefaultValue() == null) ? null : ((Enum<?>) config.getDefaultValue()).name();
    +            this.defaultValue = config.getDefaultValue() instanceof Enum? ((Enum<?>) config.getDefaultValue()).name() : 
    +                Jsonya.convertToJsonPrimitive(config.getDefaultValue());
    --- End diff --
    
    For consistency with code below, when it isn't an enum -- we always do that in case the default value is something complex (which it shouldn't be unless maybe a DSL but consistency with code below).


---