diff --git a/micro-core/src/main/java/com/aol/micro/server/spring/properties/PropertyFileConfig.java b/micro-core/src/main/java/com/aol/micro/server/spring/properties/PropertyFileConfig.java index 97c24852e..e54ee48a3 100644 --- a/micro-core/src/main/java/com/aol/micro/server/spring/properties/PropertyFileConfig.java +++ b/micro-core/src/main/java/com/aol/micro/server/spring/properties/PropertyFileConfig.java @@ -36,7 +36,7 @@ public PropertyFileConfig(boolean set) { } @Bean - public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() throws IOException { + public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() throws IOException { PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); Properties props = propertyFactory(); @@ -47,7 +47,7 @@ public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() thro } @Bean - public static Properties propertyFactory() throws IOException { + public Properties propertyFactory() throws IOException { List resources = loadPropertyResource(); PropertiesFactoryBean factory = new PropertiesFactoryBean(); factory.setLocations(resources.toArray(new Resource[resources.size()])); @@ -57,7 +57,6 @@ public static Properties propertyFactory() throws IOException { new ConfigAccessor().get() .getProperties() .entrySet() - .stream() .forEach(e -> { if (props.getProperty(e.getKey()) == null) { props.put(e.getKey(), e.getValue()); @@ -66,15 +65,12 @@ public static Properties propertyFactory() throws IOException { System.getProperties() .entrySet() - .stream() - .forEach(e -> { - props.put(e.getKey(), e.getValue()); - }); + .forEach(e -> props.put(e.getKey(), e.getValue())); return props; } - private static List loadPropertyResource() { + private List loadPropertyResource() { List resources = new ArrayList<>(); String applicationPropertyFileName = new ConfigAccessor().get() .getPropertiesName(); @@ -91,7 +87,7 @@ private static List loadPropertyResource() { return resources; } - private static Optional loadProperties(String applicationPropertyFileName, String type) { + private Optional loadProperties(String applicationPropertyFileName, String type) { Optional resource = Optional.empty(); @@ -131,7 +127,7 @@ private static Optional loadProperties(String applicationPropertyFileN return resource; } - private static String createEnvBasedPropertyFileName(String applicationPropertyFileName) { + private String createEnvBasedPropertyFileName(String applicationPropertyFileName) { return applicationPropertyFileName.substring(0, applicationPropertyFileName.lastIndexOf(".")) + "-" + System.getProperty("application.env") + ".properties"; }