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 2019/05/03 05:15:25 UTC
[camel] 01/02: camel3 - Remove unusued cruft
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
commit 5f2a30b398c85613bd17c1041141536334bf0180
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri May 3 06:37:23 2019 +0200
camel3 - Remove unusued cruft
---
.../org/apache/camel/builder/ValueBuilder.java | 47 ----------------------
1 file changed, 47 deletions(-)
diff --git a/core/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java b/core/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
index ffe3465..7c8a039 100644
--- a/core/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
+++ b/core/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
@@ -19,14 +19,11 @@ package org.apache.camel.builder;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
import org.apache.camel.Predicate;
import org.apache.camel.spi.NamespaceAware;
-import org.apache.camel.support.ExpressionAdapter;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
import org.apache.camel.support.builder.xml.Namespaces;
/**
@@ -62,50 +59,6 @@ public class ValueBuilder implements Expression, Predicate {
// Predicate builders
// -------------------------------------------------------------------------
- public Predicate matches(Expression expression) {
- return onNewPredicate(ExpressionToPredicateAdapter.toPredicate(expression));
- }
-
- public ExpressionClause<Predicate> matches() {
- // chicken-and-egg situation as we need to return an ExpressionClause
- // which needs a right-hand side that is being built via the fluent
- // builder that is returned, and therefore we need to use a ref
- // to the expression (right hand side) that will be used below
- // in the onNewPredicate where the actual matching is executed
- final AtomicReference<Expression> ref = new AtomicReference<>();
-
- final ExpressionClause<Predicate> answer = new ExpressionClause<>(
- onNewPredicate(new Predicate() {
- @Override
- public boolean matches(Exchange exchange) {
- Expression left = expression;
- Expression right = ref.get();
- return PredicateBuilder.isEqualTo(left, right).matches(exchange);
- }
-
- @Override
- public String toString() {
- return expression + " == " + ref.get();
- }
- }));
-
- final Expression right = new ExpressionAdapter() {
- @Override
- public Object evaluate(Exchange exchange) {
- return answer.evaluate(exchange, Object.class);
- /*if (answer.getExpressionValue() != null) {
- return answer.getExpressionValue().evaluate(exchange, Object.class);
- } else {
- return answer.getExpressionType().evaluate(exchange);
- }*/
- }
- };
- // okay now we can set the reference to the right-hand-side
- ref.set(right);
-
- return answer;
- }
-
public Predicate isNotEqualTo(Object value) {
Expression right = asExpression(value);
return onNewPredicate(PredicateBuilder.isNotEqualTo(expression, right));