brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Minor misc tidies
Date Wed, 20 Aug 2014 13:04:04 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/113#discussion_r16473893
  
    --- Diff: core/src/main/java/brooklyn/config/BrooklynProperties.java ---
    @@ -72,17 +72,46 @@ public static BrooklynProperties newEmpty() {
             /** creates a new {@link BrooklynProperties} with contents loaded 
              * from the usual places, including *.properties files and environment variables
*/
             public static BrooklynProperties newDefault() {
    -            return new Builder().build();
    +            return new Builder(true).build();
    +        }
    +
    +        public static Builder builderDefault() {
    +            return new Builder(true);
    +        }
    +
    +        public static Builder builderEmpty() {
    +            return new Builder(true);
             }
     
             public static class Builder {
    -            private String defaultLocationMetadataUrl = "classpath://brooklyn/location-metadata.properties";
    -            private String globalLocationMetadataFile = Os.mergePaths(Os.home(), ".brooklyn",
"location-metadata.properties");
    -            private String globalPropertiesFile = Os.mergePaths(Os.home(), ".brooklyn",
"brooklyn.properties");
    +            private String defaultLocationMetadataUrl;
    +            private String globalLocationMetadataFile = null;
    +            private String globalPropertiesFile = null;
                 private String localPropertiesFile = null;
                 private BrooklynProperties originalProperties = null;
                 
    -            public Builder(){}
    +            /** @deprecated since 0.7.0 use static methods in {@link Factory} to create
*/
    +            public Builder() {
    +                this(true);
    +            }
    +            
    +            private Builder(boolean setGlobalFileDefaults) {
    --- End diff --
    
    Is this ever called with `false`? If not, can we simplify this code? Is there an advantage
to setting the defaults in `resetGlobalFiles` rather than in the field initialisers?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message