From 4a9eabc369e92310cafeacf7f78b0c32552d5fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristo=20Kuusk=C3=BCll?= Date: Fri, 22 Mar 2024 16:41:58 +0200 Subject: [PATCH] Fixing build. --- build.common.gradle | 1 - .../com/wise/common/environment/DefaultWiseEnvironment.java | 6 ++++++ .../environment/WiseDefaultsPropertiesPropertySource.java | 5 ----- .../WiseDefaultsSystemEnvironmentPropertySource.java | 4 ++-- .../java/com/wise/common/environment/WiseEnvironment.java | 1 + 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.common.gradle b/build.common.gradle index 616764c..70c1c76 100644 --- a/build.common.gradle +++ b/build.common.gradle @@ -12,7 +12,6 @@ apply plugin: "java-library" apply plugin: "checkstyle" apply plugin: "idea" apply plugin: "com.github.spotbugs" -apply plugin: "groovy" apply from: "$rootProject.rootDir/build.libraries.gradle" diff --git a/wise-environment-starter/src/main/java/com/wise/common/environment/DefaultWiseEnvironment.java b/wise-environment-starter/src/main/java/com/wise/common/environment/DefaultWiseEnvironment.java index 297695e..d7991c0 100644 --- a/wise-environment-starter/src/main/java/com/wise/common/environment/DefaultWiseEnvironment.java +++ b/wise-environment-starter/src/main/java/com/wise/common/environment/DefaultWiseEnvironment.java @@ -2,12 +2,14 @@ import com.wise.common.environment.WiseEnvironmentProperties.SubType; import com.wise.common.environment.WiseEnvironmentProperties.Type; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; public class DefaultWiseEnvironment implements WiseEnvironment { private final Type type; private final SubType subType; + @SuppressFBWarnings("CT") public DefaultWiseEnvironment(WiseEnvironmentProperties wiseEnvironmentProperties) { var type = wiseEnvironmentProperties.getType(); if (type == null) { @@ -23,6 +25,10 @@ public DefaultWiseEnvironment(WiseEnvironmentProperties wiseEnvironmentPropertie this.subType = wiseEnvironmentProperties.getSubType(); } + public void init(){ + + } + @Override public boolean isProduction() { return Type.PRODUCTION == type; diff --git a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsPropertiesPropertySource.java b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsPropertiesPropertySource.java index a9bf574..3260a4a 100644 --- a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsPropertiesPropertySource.java +++ b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsPropertiesPropertySource.java @@ -1,17 +1,12 @@ package com.wise.common.environment; import java.util.Map; -import java.util.Properties; import org.springframework.core.env.MapPropertySource; import org.springframework.lang.Nullable; public class WiseDefaultsPropertiesPropertySource extends MapPropertySource { @SuppressWarnings({"rawtypes", "unchecked"}) - public WiseDefaultsPropertiesPropertySource(String name, Properties source) { - super(name, (Map) source); - } - protected WiseDefaultsPropertiesPropertySource(String name, Map source) { super(name, source); } diff --git a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsSystemEnvironmentPropertySource.java b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsSystemEnvironmentPropertySource.java index 1674f5d..c92c170 100644 --- a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsSystemEnvironmentPropertySource.java +++ b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseDefaultsSystemEnvironmentPropertySource.java @@ -21,8 +21,8 @@ public boolean containsProperty(String name) { public Object getProperty(String name) { String actualName = resolvePropertyName(name); if (logger.isDebugEnabled() && !name.equals(actualName)) { - logger.debug("PropertySource '" + getName() + "' does not contain property '" + name + - "', but found equivalent '" + actualName + "'"); + logger.debug("PropertySource '" + getName() + "' does not contain property '" + name + + "', but found equivalent '" + actualName + "'"); } return super.getProperty(actualName); } diff --git a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseEnvironment.java b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseEnvironment.java index b5f03fe..f837aba 100644 --- a/wise-environment-starter/src/main/java/com/wise/common/environment/WiseEnvironment.java +++ b/wise-environment-starter/src/main/java/com/wise/common/environment/WiseEnvironment.java @@ -1,6 +1,7 @@ package com.wise.common.environment; public interface WiseEnvironment { + boolean isProduction(); boolean isStaging();