This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new fc0cc10 CAMEL-13151: Removed deprecated property function from simple
language.
fc0cc10 is described below
commit fc0cc10ee4f2836ac16f71d7adc8b4722446251a
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Feb 11 19:57:41 2019 +0100
CAMEL-13151: Removed deprecated property function from simple language.
---
core/camel-core/src/main/docs/simple-language.adoc | 2 +-
.../src/main/java/org/apache/camel/builder/ExpressionBuilder.java | 2 +-
.../src/test/java/org/apache/camel/language/simple/SimpleTest.java | 4 ----
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/core/camel-core/src/main/docs/simple-language.adoc
b/core/camel-core/src/main/docs/simple-language.adoc
index 70d167b..1a47e23 100644
--- a/core/camel-core/src/main/docs/simple-language.adoc
+++ b/core/camel-core/src/main/docs/simple-language.adoc
@@ -165,7 +165,7 @@ exceptions (`Exchange.EXCEPTION_CAUGHT`) if the Exchange
has any.
Supported commands are: *now* for current timestamp, *in.header.xxx* or
*header.xxx* to use the Date object in the IN header with the key xxx.
*out.header.xxx* to use the Date object in the OUT header with the key xxx.
-*property.xxx* to use the Date object in the exchange property with the key
xxx.
+*exchangeProperty.xxx* to use the Date object in the exchange property with
the key xxx.
*file* for the last modified timestamp of the file (available with a File
consumer).
Command accepts offsets such as: *now-24h* or *in.header.xxx+1h* or even
*now+1h30m-100*.
diff --git
a/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
b/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
index 215aa72..caaea9c 100644
---
a/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
+++
b/core/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
@@ -1909,7 +1909,7 @@ public final class ExpressionBuilder {
if (date == null) {
throw new IllegalArgumentException("Cannot find
java.util.Date object at command: " + command);
}
- } else if (command.startsWith("property.") ||
command.startsWith("exchangeProperty.")) {
+ } else if (command.startsWith("exchangeProperty.")) {
String key = command.substring(command.lastIndexOf('.') +
1);
date = exchange.getProperty(key, Date.class);
if (date == null) {
diff --git
a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
index 25f5d0f..e0e69cb 100644
---
a/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
+++
b/core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleTest.java
@@ -554,10 +554,6 @@ public class SimpleTest extends LanguageTestSupport {
assertExpression("${date:out.header.birthday:yyyyMMdd}", "19750521");
assertExpression("${date:out.header.birthday+24h:yyyyMMdd}",
"19750522");
- assertExpression("${date:property.birthday}",
propertyCalendar.getTime());
- assertExpression("${date:property.birthday:yyyyMMdd}", "19760622");
- assertExpression("${date:property.birthday+24h:yyyyMMdd}", "19760623");
-
assertExpression("${date:exchangeProperty.birthday}",
propertyCalendar.getTime());
assertExpression("${date:exchangeProperty.birthday:yyyyMMdd}",
"19760622");
assertExpression("${date:exchangeProperty.birthday+24h:yyyyMMdd}",
"19760623");