You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/03/16 09:09:07 UTC
[camel] branch camel-2.20.x updated: CAMEL-12352 - make system
property uppercase if given lowercase in simple expression
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.20.x by this push:
new 74fcb8c CAMEL-12352 - make system property uppercase if given lowercase in simple expression
74fcb8c is described below
commit 74fcb8cbe251276be6352f1135051229d72adbcd
Author: Sezgin <on...@nokia.com>
AuthorDate: Thu Mar 15 14:26:23 2018 +0300
CAMEL-12352 - make system property uppercase if given lowercase in simple expression
---
.../src/main/java/org/apache/camel/builder/ExpressionBuilder.java | 2 +-
.../src/test/java/org/apache/camel/language/simple/SimpleTest.java | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
index db91f21..bab24bc 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
@@ -765,7 +765,7 @@ public final class ExpressionBuilder {
return new ExpressionAdapter() {
public Object evaluate(Exchange exchange) {
String text = simpleExpression(propertyName).evaluate(exchange, String.class);
- String answer = System.getenv(text);
+ String answer = System.getenv(text.toUpperCase());
if (answer == null) {
String text2 = simpleExpression(defaultValue).evaluate(exchange, String.class);
answer = text2;
diff --git a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index 21c816d..71ccc22 100644
--- a/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++ b/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -252,6 +252,13 @@ public class SimpleTest extends LanguageTestSupport {
assertExpression("sysenv.PATH", path);
}
}
+
+ public void testSimpleSystemEnvironmentExpressionsIfLowercase() throws Exception {
+ String path = System.getenv("PATH");
+ if (path != null) {
+ assertExpression("sysenv.path", path);
+ }
+ }
public void testSimpleCamelId() throws Exception {
assertExpression("camelId", context.getName());
--
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.