-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHE-450 do not fail if impossible to resolve variable in environment props #1132
Conversation
@@ -239,11 +243,16 @@ protected void bindProperties(String prefix, Map<String, String> properties) { | |||
if (actual == null) { | |||
actual = System.getenv(name); | |||
} | |||
if (actual == null) { | |||
if (!skipUnresolved && actual == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can rewrite it to avoid double check actual value
if (actual != null) {
buf.append(actual);
} else if (skipUnresolved) {
buf.append(pValue.substring(i, j));
LOG.warn("Environment variable " + name + " cannot be resolved, leaving as is.");
} else {
throw new ConfigurationException(...);
}
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
ok @garagatyi ? |
@@ -239,11 +243,16 @@ protected void bindProperties(String prefix, Map<String, String> properties) { | |||
if (actual == null) { | |||
actual = System.getenv(name); | |||
} | |||
if (actual == null) { | |||
if (actual != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use else instead of if (actual != null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will have +1 level nesting in your case. Can you provide full example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you can't
LGTM |
Signed-off-by: Max Shaposhnik mshaposhnik@codenvy.com