This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit edc9fe2756f0b1485ea0cc33e405465e783dad7d Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Thu Jun 15 09:51:09 2023 +0200 (chores) camel-core-languages: cleanup duplicated code for appending class to the type --- .../camel/language/simple/ast/SimpleFunctionExpression.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java index d7413f0c9e6..0ce40d61838 100644 --- a/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java +++ b/core/camel-core-languages/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java @@ -876,11 +876,8 @@ public class SimpleFunctionExpression extends LiteralExpression { throw new SimpleParserException( "Valid syntax: ${bodyAsIndex(type, index).OGNL} was: " + function, token.getIndex()); } - type = StringHelper.removeQuotes(type); type = type.trim(); - if (!type.endsWith(".class")) { - type = type + ".class"; - } + type = appendClass(type); type = type.replace('$', '.'); index = StringHelper.removeQuotes(index); index = index.trim(); @@ -947,11 +944,8 @@ public class SimpleFunctionExpression extends LiteralExpression { throw new SimpleParserException( "Valid syntax: ${mandatoryBodyAsIndex(type, index).OGNL} was: " + function, token.getIndex()); } - type = StringHelper.removeQuotes(type); type = type.trim(); - if (!type.endsWith(".class")) { - type = type + ".class"; - } + type = appendClass(type); type = type.replace('$', '.'); index = StringHelper.removeQuotes(index); index = index.trim();
