[jira] [Comment Edited] (CAMEL-11235) Simple Language: Set#size fails with AmbiguousMethodCallException when using guava collections
[ https://issues.apache.org/jira/browse/CAMEL-11235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000428#comment-16000428 ] Pascal Schumacher edited comment on CAMEL-11235 at 5/8/17 8:44 AM: --- Sorry, I missed that the problem does not seem to occur with java.util collections. But it occurs for guava collections (which are pretty popular imho). To reproduce use: {code:xml} com.google.guava guava 21.0 {code} {code:java} import org.apache.camel.EndpointInject; import org.apache.camel.Produce; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.ExchangeBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; import com.google.common.collect.ImmutableSet; public class AmbiguousMethodCallExceptionTest extends CamelTestSupport { public static class AmbiguousMethodCallExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.size} != 0")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new AmbiguousMethodCallExceptionRoute(); } @Test public void ambiguousMethodCallException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } } {code} {code:java} import org.apache.camel.EndpointInject; import org.apache.camel.Produce; import org.apache.camel.ProducerTemplate; import org.apache.camel.builder.ExchangeBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; import com.google.common.collect.ImmutableSet; public class MethodNotFoundExceptionTest extends CamelTestSupport { public static class MethodNotFoundExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.isEmpty()} != true")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new MethodNotFoundExceptionRoute(); } @Test public void methodNotFoundExceptionException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } }{code} was (Author: pascalschumacher): Sorry, I missed that the problem does not seem to occur with java.util collections. But it occurs for guava collections (which are pretty popular imho). To reproduce use: {code:xml} com.google.guava guava 21.0 {code} {code:java} public class AmbiguousMethodCallExceptionTest extends CamelTestSupport { public static class AmbiguousMethodCallExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.size} != 0")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new AmbiguousMethodCallExceptionRoute(); } @Test public void ambiguousMethodCallException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } }{code} {code:java} public class MethodNotFoundExceptionTest extends CamelTestSupport { public static class MethodNotFoundExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.isEmpty()} != true")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new MethodNotFoundExceptionRoute(); } @Test public void
[jira] [Comment Edited] (CAMEL-11235) Simple Language: Set#size fails with AmbiguousMethodCallException when using guava collections
[ https://issues.apache.org/jira/browse/CAMEL-11235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000428#comment-16000428 ] Pascal Schumacher edited comment on CAMEL-11235 at 5/8/17 8:34 AM: --- Sorry, I missed that the problem does not seem to occur with java.util collections. But it occurs for guava collections (which are pretty popular imho). To reproduce use: {code:xml} com.google.guava guava 21.0 {code} {code:java} public class AmbiguousMethodCallExceptionTest extends CamelTestSupport { public static class AmbiguousMethodCallExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.size} != 0")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new AmbiguousMethodCallExceptionRoute(); } @Test public void ambiguousMethodCallException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } }{code} {code:java} public class MethodNotFoundExceptionTest extends CamelTestSupport { public static class MethodNotFoundExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.isEmpty()} != true")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new MethodNotFoundExceptionRoute(); } @Test public void methodNotFoundExceptionException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } } {code} was (Author: pascalschumacher): Sorry, I missed that the problem does not seem to occur with java.util collections. But it occurs for guava collections (which are pretty wildly used imho). To reproduce use: {code:xml} com.google.guava guava 21.0 {code} {code:java} public class AmbiguousMethodCallExceptionTest extends CamelTestSupport { public static class AmbiguousMethodCallExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.size} != 0")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new AmbiguousMethodCallExceptionRoute(); } @Test public void ambiguousMethodCallException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } }{code} {code:java} public class MethodNotFoundExceptionTest extends CamelTestSupport { public static class MethodNotFoundExceptionRoute extends RouteBuilder { @Override public void configure() throws Exception { from("seda:in").choice().when(simple("${headers.set.isEmpty()} != true")).to("mock:out"); } } @Produce(uri = "seda:in") private ProducerTemplate in; @EndpointInject(uri = "mock:out") private MockEndpoint out; @Override protected RouteBuilder createRouteBuilder() { return new MethodNotFoundExceptionRoute(); } @Test public void methodNotFoundExceptionException() throws Exception { out.expectedMessageCount(1); ExchangeBuilder exchangeBuilder = new ExchangeBuilder(context).withHeader("set", ImmutableSet.of("a")); in.send(exchangeBuilder.build()); out.assertIsSatisfied(); } } {code} > Simple Language: Set#size fails with AmbiguousMethodCallException when using > guava collections > -- > > Key: CAMEL-11235 > URL: https://issues.apache.org/jira/browse/CAMEL-11235 > Project: Camel > Issue Type: Bug > Components: camel-core >Affects Versions: 2.19.0 >Reporter: Pascal Schumacher >