Eclipse/JDT Type Inference Workaround in Test

- Remove an unused type argument
- Add a missing type argument
This commit is contained in:
Gary Russell
2017-03-24 15:55:48 -04:00
parent 617b39b555
commit e9c4bb95a4
3 changed files with 95 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ import org.springframework.test.context.junit4.SpringRunner;
/**
* @author Artem Bilan
* @author Gary Russell
*
* @since 5.0
*/
@@ -177,7 +178,7 @@ public class CorrelationHandlerTests {
return f -> f.enrichHeaders(s -> s.header("FOO", "BAR"))
.split("testSplitterData", "buildList", c -> c.applySequence(false))
.channel(MessageChannels.executor(taskExecutor()))
.split(Message.class, Message::getPayload, c -> c.applySequence(false))
.split(Message.class, Message<?>::getPayload, c -> c.applySequence(false))
.channel(MessageChannels.executor(taskExecutor()))
.split(s -> s
.applySequence(false)

View File

@@ -54,6 +54,7 @@ import org.springframework.integration.dsl.channel.MessageChannels;
import org.springframework.integration.handler.advice.IdempotentReceiverInterceptor;
import org.springframework.integration.selector.MetadataStoreSelector;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.transformer.DecodingTransformer;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHeaders;
@@ -66,6 +67,7 @@ import org.springframework.test.context.junit4.SpringRunner;
/**
* @author Artem Bilan
* @author Ian Bondoc
* @author Gary Russell
*
* @since 5.0
*/
@@ -296,8 +298,10 @@ public class TransformerTests {
@Bean
public IntegrationFlow decodingFlow() {
// TODO: Stored in an unnecessary variable to work around an eclipse type inference issue.
DecodingTransformer<Integer> transformer = Transformers.decoding(new MyCodec(), m -> Integer.class);
return f -> f
.transform(Transformers.decoding(new MyCodec(), m -> Integer.class))
.transform(transformer)
.channel("codecReplyChannel");
}
@@ -350,7 +354,7 @@ public class TransformerTests {
return f -> f
.enrich(e -> e.<TestPojo>requestPayload(p -> p.getPayload().getName())
.requestSubFlow(sf -> sf
.<String>handle(someService::aTerminatingServiceMethod))
.handle(someService::aTerminatingServiceMethod))
.replyChannel("enricherReplyChannel")
.<String>headerFunction("foo", Message::getPayload)
.propertyFunction("name", Message::getPayload))