Fix s-i-core and SF @Nullable Changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -92,19 +92,19 @@ public class AsyncMessagingTemplate extends MessagingTemplate implements AsyncMe
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncReceiveAndConvert() {
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(null));
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncReceiveAndConvert(final PollableChannel channel) {
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(channel, null));
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(channel, Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncReceiveAndConvert(final String channelName) {
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(channelName, null));
|
||||
return this.executor.submit(() -> (R) receiveAndConvert(channelName, Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,40 +125,42 @@ public class AsyncMessagingTemplate extends MessagingTemplate implements AsyncMe
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final Object request) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(request, null));
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(request, Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final MessageChannel channel, final Object request) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channel, request, null));
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channel, request, Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final String channelName, final Object request) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channelName, request, null));
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channelName, request, Object.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final Object request,
|
||||
final MessagePostProcessor requestPostProcessor) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(request, null, requestPostProcessor));
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(request, Object.class, requestPostProcessor));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final MessageChannel channel, final Object request,
|
||||
final MessagePostProcessor requestPostProcessor) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channel, request, null, requestPostProcessor));
|
||||
return this.executor
|
||||
.submit(() -> (R) convertSendAndReceive(channel, request, Object.class, requestPostProcessor));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <R> Future<R> asyncConvertSendAndReceive(final String channelName, final Object request,
|
||||
final MessagePostProcessor requestPostProcessor) {
|
||||
return this.executor.submit(() -> (R) convertSendAndReceive(channelName, request, null, requestPostProcessor));
|
||||
return this.executor
|
||||
.submit(() -> (R) convertSendAndReceive(channelName, request, Object.class, requestPostProcessor));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MessagingTemplate extends GenericMessagingTemplate {
|
||||
public Object receiveAndConvert(MessageChannel destination, long timeout) {
|
||||
Message<?> message = doReceive(destination, timeout);
|
||||
if (message != null) {
|
||||
return doConvert(message, null);
|
||||
return doConvert(message, Object.class);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
|
||||
@@ -407,7 +407,7 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint
|
||||
MessageChannel replyChannel = getReplyChannel();
|
||||
Assert.state(replyChannel != null && (replyChannel instanceof PollableChannel),
|
||||
"receive is not supported, because no pollable reply channel has been configured");
|
||||
return this.messagingTemplate.receiveAndConvert(replyChannel, null);
|
||||
return this.messagingTemplate.receiveAndConvert(replyChannel, Object.class);
|
||||
}
|
||||
|
||||
protected Message<?> receiveMessage() {
|
||||
@@ -462,7 +462,7 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint
|
||||
this.messageCount.incrementAndGet();
|
||||
}
|
||||
if (shouldConvert) {
|
||||
reply = this.messagingTemplate.convertSendAndReceive(requestChannel, object, null,
|
||||
reply = this.messagingTemplate.convertSendAndReceive(requestChannel, object, Object.class,
|
||||
this.historyWritingPostProcessor);
|
||||
if (reply instanceof Throwable) {
|
||||
error = (Throwable) reply;
|
||||
|
||||
@@ -204,7 +204,7 @@ public class ServiceActivatorParserTests {
|
||||
MessagingTemplate template = new MessagingTemplate();
|
||||
template.setDefaultDestination(channel);
|
||||
|
||||
return template.convertSendAndReceive(payload, null);
|
||||
return template.convertSendAndReceive(payload, Object.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,10 +58,10 @@ public class TransactionInterceptorBuilderTests {
|
||||
verify(this.interceptor2, null);
|
||||
}
|
||||
|
||||
private void verify(TransactionInterceptor interceptor, PlatformTransactionManager txm) {
|
||||
private void verify(TransactionInterceptor interceptor, PlatformTransactionManager txm) throws Exception {
|
||||
assertSame(txm, interceptor.getTransactionManager());
|
||||
TransactionAttribute atts = interceptor.getTransactionAttributeSource()
|
||||
.getTransactionAttribute(null, null);
|
||||
.getTransactionAttribute(TransactionInterceptorBuilderTests.class.getDeclaredMethod("test"), null);
|
||||
Assert.assertThat(atts.getPropagationBehavior(), equalTo(Propagation.REQUIRES_NEW.value()));
|
||||
Assert.assertThat(atts.getIsolationLevel(), equalTo(Isolation.SERIALIZABLE.value()));
|
||||
Assert.assertThat(atts.getTimeout(), equalTo(42));
|
||||
|
||||
Reference in New Issue
Block a user