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 tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/962#discussion_r186256748
  
    --- 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 --
    
    Same a above. Also, not sure I understand why converting to JSON primitive here? 


---