RequireThis rule and fixThis Gradle task

* `gradlew clean check -x test --parallel --continue` - to collect reports
* `gradlew fixThis --parallel` - to fix all possible vulnerabilities. With `-Dfile.encoding=UTF-8` on Windows

Since the `RequireThisCheck` doesn't see parents for anonymous classes (e.g. `Runnable` callback), its report doesn't contains the outer class name with `this.`,
therefore we still have to fix those cases manually.
Thanks to the wrong `replacer` just with `this.` we have uncompilable code enough easy to find problems.
Not so easy to fix for good readability though...

* Upgrade to Grade 2.12
* Upgrade to SonarQube native plugin

The fix contains at about 300 files. So, will be done on merge.

Fix `fixThis.gradle` according PR comments

Apply `fixThis` and also `fixModifiers` for test classes.
 Fix some `this.` inner issues manually.
 Make code polishing for long lines after `fixThis`

Fix conflicts and vulnerabilities after the rebase
This commit is contained in:
Artem Bilan
2016-03-17 17:02:15 -04:00
parent e189307ab6
commit 2b0598291c
348 changed files with 1828 additions and 1781 deletions

View File

@@ -1,8 +1,3 @@
description = 'Spring Integration'
apply plugin: 'base'
apply plugin: 'idea'
buildscript {
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
@@ -14,6 +9,16 @@ buildscript {
}
}
plugins {
id "org.sonarqube" version "1.2"
}
description = 'Spring Integration'
apply plugin: 'base'
apply plugin: 'idea'
def docsDir = 'src/reference/asciidoc' // Will be default with newer asciidoctor plugin
ext {
@@ -61,6 +66,7 @@ subprojects { subproject ->
apply from: "${rootDir}/src/checkstyle/fixHeaders.gradle"
apply from: "${rootDir}/src/checkstyle/fixModifiers.gradle"
apply from: "${rootDir}/src/checkstyle/fixThis.gradle"
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
@@ -243,7 +249,8 @@ subprojects { subproject ->
}
checkstyle {
configFile = new File(rootDir, "src/checkstyle/checkstyle.xml")
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
toolVersion = "6.16.1"
}
artifacts {
@@ -251,7 +258,7 @@ subprojects { subproject ->
archives javadocJar
}
build.dependsOn jacocoTestReport, check
build.dependsOn jacocoTestReport
}
project('spring-integration-test') {
@@ -801,10 +808,8 @@ reference.dependsOn asciidoctor
it.onlyIf { "$System.env.NO_REFERENCE_TASK" != 'true' || project.hasProperty('ignoreEnvToStopReference') }
}
apply plugin: 'sonar-runner'
sonarRunner {
sonarProperties {
sonarqube {
properties {
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
@@ -956,9 +961,3 @@ task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '2.5'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#Thu Jul 23 15:28:51 EDT 2015
#Thu Mar 17 13:20:50 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip

10
gradlew vendored
View File

@@ -42,11 +42,6 @@ case "`uname`" in
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

2
gradlew.bat vendored
View File

@@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -96,11 +96,11 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel
}
protected AmqpAdmin getAdmin() {
return admin;
return this.admin;
}
protected ConnectionFactory getConnectionFactory() {
return connectionFactory;
return this.connectionFactory;
}
@Override
@@ -181,7 +181,7 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel
this.dispatcher.dispatch(messageToSend);
}
else if (this.logger.isWarnEnabled()) {
logger.warn("MessageConverter returned null, no Message to dispatch");
this.logger.warn("MessageConverter returned null, no Message to dispatch");
}
}
catch (MessageDispatchingException e) {
@@ -189,8 +189,8 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel
+ this.channel.getFullChannelName() + "'.";
if (this.isPubSub) {
// log only for backwards compatibility with pub/sub
if (logger.isWarnEnabled()) {
logger.warn(exceptionMessage, e);
if (this.logger.isWarnEnabled()) {
this.logger.warn(exceptionMessage, e);
}
}
else {

View File

@@ -84,9 +84,11 @@ public class AmqpInboundChannelAdapter extends MessageProducerSupport implements
@Override
public void onMessage(Message message, Channel channel) throws Exception {
Object payload = messageConverter.fromMessage(message);
Map<String, Object> headers = headerMapper.toHeadersFromRequest(message.getMessageProperties());
if (messageListenerContainer.getAcknowledgeMode() == AcknowledgeMode.MANUAL) {
Object payload = AmqpInboundChannelAdapter.this.messageConverter.fromMessage(message);
Map<String, Object> headers =
AmqpInboundChannelAdapter.this.headerMapper.toHeadersFromRequest(message.getMessageProperties());
if (AmqpInboundChannelAdapter.this.messageListenerContainer.getAcknowledgeMode()
== AcknowledgeMode.MANUAL) {
headers.put(AmqpHeaders.DELIVERY_TAG, message.getMessageProperties().getDeliveryTag());
headers.put(AmqpHeaders.CHANNEL, channel);
}

View File

@@ -102,7 +102,7 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
public void setMessageConverter(MessageConverter messageConverter) {
Assert.notNull(messageConverter, "MessageConverter must not be null");
this.amqpMessageConverter = messageConverter;
if (!amqpTemplateExplicitlySet) {
if (!this.amqpTemplateExplicitlySet) {
((RabbitTemplate) this.amqpTemplate).setMessageConverter(messageConverter);
}
}
@@ -142,9 +142,10 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
this.messageListenerContainer.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) {
Object payload = amqpMessageConverter.fromMessage(message);
Map<String, Object> headers = headerMapper.toHeadersFromRequest(message.getMessageProperties());
if (messageListenerContainer.getAcknowledgeMode() == AcknowledgeMode.MANUAL) {
Object payload = AmqpInboundGateway.this.amqpMessageConverter.fromMessage(message);
Map<String, Object> headers =
AmqpInboundGateway.this.headerMapper.toHeadersFromRequest(message.getMessageProperties());
if (AmqpInboundGateway.this.messageListenerContainer.getAcknowledgeMode() == AcknowledgeMode.MANUAL) {
headers.put(AmqpHeaders.DELIVERY_TAG, message.getMessageProperties().getDeliveryTag());
headers.put(AmqpHeaders.CHANNEL, channel);
}
@@ -169,7 +170,8 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
String contentEncoding = messageProperties.getContentEncoding();
long contentLength = messageProperties.getContentLength();
String contentType = messageProperties.getContentType();
headerMapper.fromHeadersToReply(reply.getHeaders(), messageProperties);
AmqpInboundGateway.this.headerMapper.fromHeadersToReply(reply.getHeaders(),
messageProperties);
// clear the replyTo from the original message since we are using it now
messageProperties.setReplyTo(null);
// reset the content-* properties as determined by the MessageConverter
@@ -186,16 +188,17 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
};
if (replyTo != null) {
amqpTemplate.convertAndSend(replyTo.getExchangeName(), replyTo.getRoutingKey(),
reply.getPayload(), messagePostProcessor);
AmqpInboundGateway.this.amqpTemplate.convertAndSend(replyTo.getExchangeName(),
replyTo.getRoutingKey(), reply.getPayload(), messagePostProcessor);
}
else {
if (!amqpTemplateExplicitlySet) {
if (!AmqpInboundGateway.this.amqpTemplateExplicitlySet) {
throw new IllegalStateException("There is no 'replyTo' message property " +
"and the `defaultReplyTo` hasn't been configured.");
}
else {
amqpTemplate.convertAndSend(reply.getPayload(), messagePostProcessor);
AmqpInboundGateway.this.amqpTemplate.convertAndSend(reply.getPayload(),
messagePostProcessor);
}
}
}
@@ -203,7 +206,7 @@ public class AmqpInboundGateway extends MessagingGatewaySupport {
});
this.messageListenerContainer.afterPropertiesSet();
if (!amqpTemplateExplicitlySet) {
if (!this.amqpTemplateExplicitlySet) {
((RabbitTemplate) this.amqpTemplate).afterPropertiesSet();
}
super.onInit();

View File

@@ -262,7 +262,7 @@ public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducin
this.exchangeNameGenerator.setBeanFactory(beanFactory);
}
}
Assert.state(routingKeyExpression == null || routingKey == null,
Assert.state(this.routingKeyExpression == null || this.routingKey == null,
"Either a routingKey or a routingKeyExpression can be provided, but not both");
if (this.routingKeyExpression != null) {
this.routingKeyGenerator = new ExpressionEvaluatingMessageProcessor<String>(this.routingKeyExpression,
@@ -301,7 +301,7 @@ public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducin
if (!this.running) {
if (!this.lazyConnect && this.connectionFactory != null) {
try {
Connection connection = connectionFactory.createConnection();
Connection connection = this.connectionFactory.createConnection();
if (connection != null) {
connection.close();
}
@@ -440,7 +440,7 @@ public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducin
Message<?> confirmMessage = builder
.copyHeaders(headers)
.build();
if (ack && confirmAckChannel != null) {
if (ack && this.confirmAckChannel != null) {
sendOutput(confirmMessage, this.confirmAckChannel, true);
}
else if (!ack && this.confirmNackChannel != null) {

View File

@@ -85,7 +85,7 @@ public class AmqpOutboundEndpoint extends AbstractAmqpOutboundEndpoint
@Override
public String getComponentType() {
return expectReply ? "amqp:outbound-gateway" : "amqp:outbound-channel-adapter";
return this.expectReply ? "amqp:outbound-gateway" : "amqp:outbound-channel-adapter";
}
@Override

View File

@@ -124,8 +124,8 @@ public abstract class AbstractAggregatingMessageGroupProcessor implements Messag
}
}
for (String keyToRemove : conflictKeys) {
if (logger.isDebugEnabled()) {
logger.debug("Excluding header '" + keyToRemove + "' upon aggregation due to conflict(s) "
if (this.logger.isDebugEnabled()) {
this.logger.debug("Excluding header '" + keyToRemove + "' upon aggregation due to conflict(s) "
+ "in MessageGroup with correlation key: " + group.getGroupId());
}
aggregatedHeaders.remove(keyToRemove);

View File

@@ -140,7 +140,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
? new HeaderAttributeCorrelationStrategy(IntegrationMessageHeaderAccessor.CORRELATION_ID)
: correlationStrategy);
this.releaseStrategy = releaseStrategy == null ? new SequenceSizeReleaseStrategy() : releaseStrategy;
sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy;
this.sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy;
}
public AbstractCorrelatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store) {
@@ -152,7 +152,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
}
public void setLockRegistry(LockRegistry lockRegistry) {
Assert.isTrue(!lockRegistrySet, "'this.lockRegistry' can not be reset once its been set");
Assert.isTrue(!this.lockRegistrySet, "'this.lockRegistry' can not be reset once its been set");
Assert.notNull("'lockRegistry' must not be null");
this.lockRegistry = lockRegistry;
this.lockRegistrySet = true;
@@ -163,7 +163,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
store.registerMessageGroupExpiryCallback(new MessageGroupCallback() {
@Override
public void execute(MessageGroupStore messageGroupStore, MessageGroup group) {
forceReleaseProcessor.processMessageGroup(group);
AbstractCorrelatingMessageHandler.this.forceReleaseProcessor.processMessageGroup(group);
}
});
}
@@ -176,7 +176,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
public void setReleaseStrategy(ReleaseStrategy releaseStrategy) {
Assert.notNull(releaseStrategy);
this.releaseStrategy = releaseStrategy;
sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy;
this.sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy;
}
public void setGroupTimeoutExpression(Expression groupTimeoutExpression) {
@@ -228,7 +228,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
Assert.isInstanceOf(SequenceSizeReleaseStrategy.class, this.releaseStrategy,
"Release strategy of type [" + this.releaseStrategy.getClass().getSimpleName() +
"] cannot release partial sequences. Use the default SequenceSizeReleaseStrategy instead.");
((SequenceSizeReleaseStrategy) this.releaseStrategy).setReleasePartialSequences(releasePartialSequences);
((SequenceSizeReleaseStrategy) this.releaseStrategy).setReleasePartialSequences(this.releasePartialSequences);
}
if (this.evaluationContext == null) {
@@ -310,68 +310,68 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
}
public MessageGroupStore getMessageStore() {
return messageStore;
return this.messageStore;
}
protected Map<UUID, ScheduledFuture<?>> getExpireGroupScheduledFutures() {
return expireGroupScheduledFutures;
return this.expireGroupScheduledFutures;
}
protected MessageGroupProcessor getOutputProcessor() {
return outputProcessor;
return this.outputProcessor;
}
protected CorrelationStrategy getCorrelationStrategy() {
return correlationStrategy;
return this.correlationStrategy;
}
protected ReleaseStrategy getReleaseStrategy() {
return releaseStrategy;
return this.releaseStrategy;
}
protected MessageChannel getDiscardChannel() {
return discardChannel;
return this.discardChannel;
}
protected String getDiscardChannelName() {
return discardChannelName;
return this.discardChannelName;
}
protected boolean isSendPartialResultOnExpiry() {
return sendPartialResultOnExpiry;
return this.sendPartialResultOnExpiry;
}
protected boolean isSequenceAware() {
return sequenceAware;
return this.sequenceAware;
}
protected LockRegistry getLockRegistry() {
return lockRegistry;
return this.lockRegistry;
}
protected boolean isLockRegistrySet() {
return lockRegistrySet;
return this.lockRegistrySet;
}
protected long getMinimumTimeoutForEmptyGroups() {
return minimumTimeoutForEmptyGroups;
return this.minimumTimeoutForEmptyGroups;
}
protected boolean isReleasePartialSequences() {
return releasePartialSequences;
return this.releasePartialSequences;
}
protected Expression getGroupTimeoutExpression() {
return groupTimeoutExpression;
return this.groupTimeoutExpression;
}
protected EvaluationContext getEvaluationContext() {
return evaluationContext;
return this.evaluationContext;
}
@Override
protected void handleMessageInternal(Message<?> message) throws Exception {
Object correlationKey = correlationStrategy.getCorrelationKey(message);
Object correlationKey = this.correlationStrategy.getCorrelationKey(message);
Assert.state(correlationKey != null, "Null correlation not allowed. Maybe the CorrelationStrategy is failing?");
if (logger.isDebugEnabled()) {
@@ -391,7 +391,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
+ correlationKey + "].");
}
}
MessageGroup messageGroup = messageStore.getMessageGroup(correlationKey);
MessageGroup messageGroup = this.messageStore.getMessageGroup(correlationKey);
if (this.sequenceAware) {
messageGroup = new SequenceAwareMessageGroup(messageGroup);
}
@@ -402,7 +402,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
}
messageGroup = this.store(correlationKey, message);
if (releaseStrategy.canRelease(messageGroup)) {
if (this.releaseStrategy.canRelease(messageGroup)) {
Collection<Message<?>> completedMessages = null;
try {
completedMessages = this.completeGroup(message, correlationKey, messageGroup);
@@ -434,6 +434,8 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
*/
if (groupTimeout != null && groupTimeout >= 0) {
if (groupTimeout > 0) {
final MessageGroupProcessor forceReleaseProcessor =
AbstractCorrelatingMessageHandler.this.forceReleaseProcessor;
ScheduledFuture<?> scheduledFuture = this.getTaskScheduler()
.schedule(new Runnable() {
@@ -536,7 +538,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
&& group.getLastModified() == lastModifiedNow
&& group.getTimestamp() == groupNow.getTimestamp()) {
if (groupSize > 0) {
if (releaseStrategy.canRelease(groupNow)) {
if (this.releaseStrategy.canRelease(groupNow)) {
completeGroup(correlationKey, groupNow);
}
else {
@@ -595,7 +597,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
void remove(MessageGroup group) {
Object correlationKey = group.getGroupId();
messageStore.removeMessageGroup(correlationKey);
this.messageStore.removeMessageGroup(correlationKey);
}
protected int findLastReleasedSequenceNumber(Object groupId, Collection<Message<?>> partialSequence) {
@@ -604,14 +606,14 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
}
protected MessageGroup store(Object correlationKey, Message<?> message) {
return messageStore.addMessageToGroup(correlationKey, message);
return this.messageStore.addMessageToGroup(correlationKey, message);
}
protected void expireGroup(Object correlationKey, MessageGroup group) {
if (logger.isInfoEnabled()) {
logger.info("Expiring MessageGroup with correlationKey[" + correlationKey + "]");
}
if (sendPartialResultOnExpiry) {
if (this.sendPartialResultOnExpiry) {
if (logger.isDebugEnabled()) {
logger.debug("Prematurely releasing partially complete group with key ["
+ correlationKey + "] to: " + getOutputChannel());
@@ -630,7 +632,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
}
if (this.applicationEventPublisher != null) {
this.applicationEventPublisher.publishEvent(new MessageGroupExpiredEvent(this, correlationKey, group
.size(), new Date(group.getLastModified()), new Date(), !sendPartialResultOnExpiry));
.size(), new Date(group.getLastModified()), new Date(), !this.sendPartialResultOnExpiry));
}
}
@@ -648,7 +650,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
logger.debug("Completing group with correlationKey [" + correlationKey + "]");
}
Object result = outputProcessor.processMessageGroup(group);
Object result = this.outputProcessor.processMessageGroup(group);
Collection<Message<?>> partialSequence = null;
if (result instanceof Collection<?>) {
this.verifyResultCollectionConsistsOfMessages((Collection<?>) result);
@@ -671,7 +673,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP
@Override
public void destroy() throws Exception {
for (ScheduledFuture<?> future : expireGroupScheduledFutures.values()) {
for (ScheduledFuture<?> future : this.expireGroupScheduledFutures.values()) {
future.cancel(true);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2016 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.
@@ -183,7 +183,7 @@ public class BarrierMessageHandler extends AbstractReplyProducingMessageHandler
}
SynchronousQueue<Message<?>> syncQueue = createOrObtainQueue(key);
try {
if (!syncQueue.offer(message, timeout, TimeUnit.MILLISECONDS)) {
if (!syncQueue.offer(message, this.timeout, TimeUnit.MILLISECONDS)) {
this.logger.error("Suspending thread timed out or did not arrive within timeout for: " + message);
this.suspensions.remove(key);
}

View File

@@ -92,10 +92,10 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements
@Override
protected void handleMessageInternal(Message<?> message) throws Exception {
Object correlationKey = correlationStrategy.getCorrelationKey(message);
Object correlationKey = this.correlationStrategy.getCorrelationKey(message);
Object lock = getLock(correlationKey);
synchronized (lock) {
store.addMessageToGroup(correlationKey, message);
this.store.addMessageToGroup(correlationKey, message);
}
if (log.isDebugEnabled()) {
log.debug(String.format("Handled message for key [%s]: %s.", correlationKey, message));
@@ -103,20 +103,20 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements
}
private Object getLock(Object correlationKey) {
Object existingLock = correlationLocks.putIfAbsent(correlationKey, correlationKey);
Object existingLock = this.correlationLocks.putIfAbsent(correlationKey, correlationKey);
return existingLock == null ? correlationKey : existingLock;
}
@Override
public Message<Object> receive() {
for (Object key : correlationLocks.keySet()) {
for (Object key : this.correlationLocks.keySet()) {
Object lock = getLock(key);
synchronized (lock) {
MessageGroup group = store.getMessageGroup(key);
MessageGroup group = this.store.getMessageGroup(key);
//group might be removed by another thread
if (group != null) {
if (releaseStrategy.canRelease(group)) {
if (this.releaseStrategy.canRelease(group)) {
Message<?> nextMessage = null;
Iterator<Message<?>> messages = group.getMessages().iterator();
@@ -140,8 +140,8 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements
}
private void remove(Object key) {
correlationLocks.remove(key);
store.removeMessageGroup(key);
this.correlationLocks.remove(key);
this.store.removeMessageGroup(key);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -52,7 +52,7 @@ public class ExpressionEvaluatingCorrelationStrategy implements CorrelationStrat
}
public Object getCorrelationKey(Message<?> message) {
return processor.processMessage(message);
return this.processor.processMessage(message);
}
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -38,21 +38,21 @@ public class ExpressionEvaluatingMessageGroupProcessor extends AbstractAggregati
public ExpressionEvaluatingMessageGroupProcessor(String expression) {
processor = new ExpressionEvaluatingMessageListProcessor(expression);
this.processor = new ExpressionEvaluatingMessageListProcessor(expression);
}
@Override
public void setBeanFactory(BeanFactory beanFactory) {
super.setBeanFactory(beanFactory);
processor.setBeanFactory(beanFactory);
this.processor.setBeanFactory(beanFactory);
}
public void setConversionService(ConversionService conversionService) {
processor.setConversionService(conversionService);
this.processor.setConversionService(conversionService);
}
public void setExpectedType(Class<?> expectedType) {
processor.setExpectedType(expectedType);
this.processor.setExpectedType(expectedType);
}
/**
@@ -61,7 +61,7 @@ public class ExpressionEvaluatingMessageGroupProcessor extends AbstractAggregati
*/
@Override
protected Object aggregatePayloads(MessageGroup group, Map<String, Object> headers) {
return processor.process(group.getMessages());
return this.processor.process(group.getMessages());
}
}

View File

@@ -50,7 +50,7 @@ public class MessageCountReleaseStrategy implements ReleaseStrategy {
* receive messages from the same group concurrently.
*/
public boolean canRelease(MessageGroup group) {
return group.size() >= threshold;
return group.size() >= this.threshold;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2016 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.
@@ -52,23 +52,23 @@ public class MessageGroupExpiredEvent extends IntegrationEvent {
}
public Object getGroupId() {
return groupId;
return this.groupId;
}
public int getMessageCount() {
return messageCount;
return this.messageCount;
}
protected Date getLastModified() {
return lastModified;
return this.lastModified;
}
public Date getExpired() {
return expired;
return this.expired;
}
public boolean isDiscarded() {
return discarded;
return this.discarded;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -57,7 +57,7 @@ public class MethodInvokingCorrelationStrategy implements CorrelationStrategy, B
@Override
public Object getCorrelationKey(Message<?> message) {
return processor.processMessage(message);
return this.processor.processMessage(message);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -71,13 +71,13 @@ public class MethodInvokingMessageGroupProcessor extends AbstractAggregatingMess
}
public void setConversionService(ConversionService conversionService) {
processor.setConversionService(conversionService);
this.processor.setConversionService(conversionService);
}
@Override
public void setBeanFactory(BeanFactory beanFactory) {
super.setBeanFactory(beanFactory);
processor.setBeanFactory(beanFactory);
this.processor.setBeanFactory(beanFactory);
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -38,24 +38,24 @@ public class MethodInvokingMessageListProcessor<T> extends AbstractExpressionEva
private final MessagingMethodInvokerHelper<T> delegate;
public MethodInvokingMessageListProcessor(Object targetObject, Method method, Class<T> expectedType) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, expectedType, true);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, expectedType, true);
}
public MethodInvokingMessageListProcessor(Object targetObject, Method method) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, true);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, true);
}
public MethodInvokingMessageListProcessor(Object targetObject, String methodName, Class<T> expectedType) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName,
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName,
expectedType, true);
}
public MethodInvokingMessageListProcessor(Object targetObject, String methodName) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, true);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, true);
}
public MethodInvokingMessageListProcessor(Object targetObject, Class<? extends Annotation> annotationType) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, annotationType, Object.class, true);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, annotationType, Object.class, true);
}
@Override
@@ -65,12 +65,12 @@ public class MethodInvokingMessageListProcessor<T> extends AbstractExpressionEva
}
public String toString() {
return delegate.toString();
return this.delegate.toString();
}
public T process(Collection<Message<?>> messages, Map<String, Object> aggregateHeaders) {
try {
return delegate.process(messages, aggregateHeaders);
return this.delegate.process(messages, aggregateHeaders);
}
catch (RuntimeException e) {
throw e;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -71,7 +71,7 @@ public class SequenceSizeReleaseStrategy implements ReleaseStrategy {
Collection<Message<?>> messages = messageGroup.getMessages();
if (releasePartialSequences && !messages.isEmpty()) {
if (this.releasePartialSequences && !messages.isEmpty()) {
if (logger.isTraceEnabled()) {
logger.trace("Considering partial release of group [" + messageGroup + "]");

View File

@@ -63,7 +63,7 @@ public class TimeoutCountSequenceSizeReleaseStrategy implements ReleaseStrategy
public boolean canRelease(MessageGroup messages) {
long elapsedTime = System.currentTimeMillis() - findEarliestTimestamp(messages);
return messages.isComplete() || messages.getMessages().size() >= threshold || elapsedTime > timeout;
return messages.isComplete() || messages.getMessages().size() >= this.threshold || elapsedTime > this.timeout;
}
/**

View File

@@ -137,7 +137,7 @@ public abstract class AbstractExecutorChannel extends AbstractSubscribableChanne
Assert.notNull(messageHandler, "'messageHandler' must not be null");
Deque<ExecutorChannelInterceptor> interceptorStack = null;
try {
if (executorInterceptorsSize > 0) {
if (AbstractExecutorChannel.this.executorInterceptorsSize > 0) {
interceptorStack = new ArrayDeque<ExecutorChannelInterceptor>();
message = applyBeforeHandle(message, interceptorStack);
if (message == null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -537,8 +537,8 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
for (ChannelInterceptor interceptor : this.interceptors) {
message = interceptor.preSend(message, channel);
if (message == null) {
if (logger.isDebugEnabled()) {
logger.debug(interceptor.getClass().getSimpleName()
if (this.logger.isDebugEnabled()) {
this.logger.debug(interceptor.getClass().getSimpleName()
+ " returned null from preSend, i.e. precluding the send.");
}
afterSendCompletion(null, channel, false, null, interceptorStack);
@@ -552,7 +552,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
if (this.size > 0) {
for (ChannelInterceptor interceptor : interceptors) {
for (ChannelInterceptor interceptor : this.interceptors) {
interceptor.postSend(message, channel, sent);
}
}
@@ -566,14 +566,14 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
interceptor.afterSendCompletion(message, channel, sent, ex);
}
catch (Exception ex2) {
logger.error("Exception from afterSendCompletion in " + interceptor, ex2);
this.logger.error("Exception from afterSendCompletion in " + interceptor, ex2);
}
}
}
public boolean preReceive(MessageChannel channel, Deque<ChannelInterceptor> interceptorStack) {
if (this.size > 0) {
for (ChannelInterceptor interceptor : interceptors) {
for (ChannelInterceptor interceptor : this.interceptors) {
if (!interceptor.preReceive(channel)) {
afterReceiveCompletion(null, channel, null, interceptorStack);
return false;
@@ -586,7 +586,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
if (this.size > 0) {
for (ChannelInterceptor interceptor : interceptors) {
for (ChannelInterceptor interceptor : this.interceptors) {
message = interceptor.postReceive(message, channel);
if (message == null) {
return null;
@@ -604,7 +604,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport
interceptor.afterReceiveCompletion(message, channel, ex);
}
catch (Exception ex2) {
logger.error("Exception from afterReceiveCompletion in " + interceptor, ex2);
this.logger.error("Exception from afterReceiveCompletion in " + interceptor, ex2);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -63,7 +63,7 @@ public abstract class AbstractSubscribableChannel extends AbstractMessageChannel
}
else {
// some other dispatcher - hand-roll the counter
counter = handlerCounter.addAndGet(delta);
counter = this.handlerCounter.addAndGet(delta);
}
if (logger.isInfoEnabled()) {
logger.info("Channel '" + this.getFullChannelName() + "' has " + counter + " subscriber(s).");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2013-2016 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.
@@ -91,7 +91,7 @@ public class DefaultHeaderChannelRegistry extends IntegrationObjectSupport
}
public final long getReaperDelay() {
return reaperDelay;
return this.reaperDelay;
}
/**
@@ -161,7 +161,7 @@ public class DefaultHeaderChannelRegistry extends IntegrationObjectSupport
}
if (channel != null && channel instanceof MessageChannel) {
String name = this.uuid + DefaultHeaderChannelRegistry.id.incrementAndGet();
channels.put(name, new MessageChannelWrapper((MessageChannel) channel,
this.channels.put(name, new MessageChannelWrapper((MessageChannel) channel,
System.currentTimeMillis() + timeToLive));
if (logger.isDebugEnabled()) {
logger.debug("Registered " + channel + " as " + name);
@@ -238,11 +238,11 @@ public class DefaultHeaderChannelRegistry extends IntegrationObjectSupport
}
public final long getExpireAt() {
return expireAt;
return this.expireAt;
}
public final MessageChannel getChannel() {
return channel;
return this.channel;
}
}

View File

@@ -83,16 +83,16 @@ public final class FixedSubscriberChannel implements SubscribableChannel, BeanNa
@Override
public boolean subscribe(MessageHandler handler) {
if (handler != this.handler && logger.isDebugEnabled()) {
logger.debug(this.getComponentName() + ": cannot be subscribed to (it has a fixed single subscriber).");
if (handler != this.handler && this.logger.isDebugEnabled()) {
this.logger.debug(this.getComponentName() + ": cannot be subscribed to (it has a fixed single subscriber).");
}
return false;
}
@Override
public boolean unsubscribe(MessageHandler handler) {
if (logger.isDebugEnabled()) {
logger.debug(this.getComponentName() + ": cannot be unsubscribed from (it has a fixed single subscriber).");
if (this.logger.isDebugEnabled()) {
this.logger.debug(this.getComponentName() + ": cannot be unsubscribed from (it has a fixed single subscriber).");
}
return false;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -90,22 +90,22 @@ public class MessagePublishingErrorHandler implements ErrorHandler, BeanFactoryA
}
catch (Throwable errorDeliveryError) {//NOSONAR
// message will be logged only
if (logger.isWarnEnabled()) {
logger.warn("Error message was not delivered.", errorDeliveryError);
if (this.logger.isWarnEnabled()) {
this.logger.warn("Error message was not delivered.", errorDeliveryError);
}
if (errorDeliveryError instanceof Error) {
throw ((Error) errorDeliveryError);
}
}
}
if (!sent && logger.isErrorEnabled()) {
if (!sent && this.logger.isErrorEnabled()) {
Message<?> failedMessage = (t instanceof MessagingException) ?
((MessagingException) t).getFailedMessage() : null;
if (failedMessage != null) {
logger.error("failure occurred in messaging task with message: " + failedMessage, t);
this.logger.error("failure occurred in messaging task with message: " + failedMessage, t);
}
else {
logger.error("failure occurred in messaging task", t);
this.logger.error("failure occurred in messaging task", t);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -198,8 +198,8 @@ public class NullChannel implements PollableChannel, MessageChannelMetrics,
@Override
public boolean send(Message<?> message) {
if (this.loggingEnabled && logger.isDebugEnabled()) {
logger.debug("message sent to null channel: " + message);
if (this.loggingEnabled && this.logger.isDebugEnabled()) {
this.logger.debug("message sent to null channel: " + message);
}
if (this.countsEnabled) {
this.channelMetrics.afterSend(this.channelMetrics.beforeSend(), true);
@@ -214,8 +214,8 @@ public class NullChannel implements PollableChannel, MessageChannelMetrics,
@Override
public Message<?> receive() {
if (this.loggingEnabled && logger.isDebugEnabled()) {
logger.debug("receive called on null channel");
if (this.loggingEnabled && this.logger.isDebugEnabled()) {
this.logger.debug("receive called on null channel");
}
return null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -86,7 +86,7 @@ public class PriorityChannel extends QueueChannel {
@Override
protected boolean doSend(Message<?> message, long timeout) {
if (!upperBound.tryAcquire(timeout)) {
if (!this.upperBound.tryAcquire(timeout)) {
return false;
}
message = new MessageWrapper(message);
@@ -98,7 +98,7 @@ public class PriorityChannel extends QueueChannel {
Message<?> message = super.doReceive(timeout);
if (message != null) {
message = ((MessageWrapper)message).getRootMessage();
upperBound.release();
this.upperBound.release();
}
return message;
}
@@ -142,7 +142,7 @@ public class PriorityChannel extends QueueChannel {
private MessageWrapper(Message<?> rootMessage){
this.rootMessage = rootMessage;
this.sequence = sequenceCounter.incrementAndGet();
this.sequence = PriorityChannel.this.sequenceCounter.incrementAndGet();
}
public Message<?> getRootMessage(){
@@ -156,7 +156,7 @@ public class PriorityChannel extends QueueChannel {
@Override
public Object getPayload() {
return rootMessage.getPayload();
return this.rootMessage.getPayload();
}
long getSequence(){

View File

@@ -115,8 +115,8 @@ public abstract class ThreadStatePropagationChannelInterceptor<S>
@Override
public String toString() {
return "MessageWithThreadState{" +
"message=" + message +
", state=" + state +
"message=" + this.message +
", state=" + this.state +
'}';
}

View File

@@ -59,7 +59,7 @@ public class CodecMessageConverter extends IntegrationObjectSupport implements M
public Message<?> toMessage(Object payload, MessageHeaders headers) {
Assert.isInstanceOf(byte[].class, payload);
try {
Message<?> decoded = (Message<?>) this.codec.decode((byte[]) payload, messageClass);
Message<?> decoded = (Message<?>) this.codec.decode((byte[]) payload, this.messageClass);
if (headers != null) {
AbstractIntegrationMessageBuilder<?> builder = getMessageBuilderFactory().fromMessage(decoded);
builder.copyHeaders(headers);

View File

@@ -52,7 +52,7 @@ public abstract class AbstractKryoCodec implements Codec {
}
};
// Build pool with SoftReferences enabled (optional)
pool = new KryoPool.Builder(factory).softReferences().build();
this.pool = new KryoPool.Builder(factory).softReferences().build();
}
@Override

View File

@@ -58,8 +58,8 @@ public abstract class AbstractKryoRegistrar implements KryoRegistrar {
throw new RuntimeException((String.format("registration already exists %s", existing)));
}
if (log.isInfoEnabled()) {
log.info(String.format("registering %s with serializer %s", registration,
if (this.log.isInfoEnabled()) {
this.log.info(String.format("registering %s with serializer %s", registration,
registration.getSerializer().getClass().getName()));
}

View File

@@ -45,7 +45,7 @@ public class CompositeKryoRegistrar extends AbstractKryoRegistrar {
@Override
public List<Registration> getRegistrations() {
List<Registration> registrations = new ArrayList<Registration>();
for (KryoRegistrar registrar : delegates) {
for (KryoRegistrar registrar : this.delegates) {
registrations.addAll(registrar.getRegistrations());
}
return registrations;

View File

@@ -179,12 +179,12 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends MessageH
if (actualHandler instanceof AbstractReplyProducingMessageHandler) {
((AbstractReplyProducingMessageHandler) actualHandler).setAdviceChain(this.adviceChain);
}
else if (logger.isDebugEnabled()) {
else if (this.logger.isDebugEnabled()) {
String name = this.componentName;
if (name == null && actualHandler instanceof NamedComponent) {
name = ((NamedComponent) actualHandler).getComponentName();
}
logger.debug("adviceChain can only be set on an AbstractReplyProducingMessageHandler"
this.logger.debug("adviceChain can only be set on an AbstractReplyProducingMessageHandler"
+ (name == null ? "" : (", " + name)) + ".");
}
}
@@ -193,15 +193,15 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends MessageH
}
this.initialized = true;
}
if (handler instanceof InitializingBean) {
if (this.handler instanceof InitializingBean) {
try {
((InitializingBean) handler).afterPropertiesSet();
((InitializingBean) this.handler).afterPropertiesSet();
}
catch (Exception e) {
throw new BeanInitializationException("failed to initialize MessageHandler", e);
}
}
return handler;
return this.handler;
}
protected abstract H createHandler();
@@ -240,7 +240,7 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends MessageH
return extractTarget(advised.getTargetSource().getTarget());
}
catch (Exception e) {
logger.error("Could not extract target", e);
this.logger.error("Could not extract target", e);
return null;
}
}

View File

@@ -95,7 +95,7 @@ public abstract class AbstractStandardMessageHandlerFactoryBean
}
this.checkReuse(actualHandler);
this.postProcessReplyProducer(actualHandler);
handler = (MessageHandler) targetObject;
handler = (MessageHandler) this.targetObject;
}
else {
handler = this.createMethodInvokingHandler(this.targetObject, this.targetMethodName);

View File

@@ -63,18 +63,18 @@ final class ChannelInitializer implements BeanFactoryAware, InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.beanFactory, "'beanFactory' must not be null");
if (!autoCreate){
if (!this.autoCreate){
return;
}
else {
AutoCreateCandidatesCollector channelCandidatesCollector =
beanFactory.getBean(IntegrationContextUtils.AUTO_CREATE_CHANNEL_CANDIDATES_BEAN_NAME, AutoCreateCandidatesCollector.class);
this.beanFactory.getBean(IntegrationContextUtils.AUTO_CREATE_CHANNEL_CANDIDATES_BEAN_NAME, AutoCreateCandidatesCollector.class);
Assert.notNull(channelCandidatesCollector, "Failed to locate '" + IntegrationContextUtils.AUTO_CREATE_CHANNEL_CANDIDATES_BEAN_NAME);
// at this point channelNames are all resolved with placeholders and SpEL
Collection<String> channelNames = channelCandidatesCollector.getChannelNames();
if (channelNames != null){
for (String channelName : channelNames) {
if (!beanFactory.containsBean(channelName)){
if (!this.beanFactory.containsBean(channelName)){
if (this.logger.isDebugEnabled()){
this.logger.debug("Auto-creating channel '" + channelName + "' as DirectChannel");
}
@@ -97,7 +97,7 @@ final class ChannelInitializer implements BeanFactoryAware, InitializingBean {
}
public Collection<String> getChannelNames() {
return channelNames;
return this.channelNames;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -160,7 +160,7 @@ public class ConsumerEndpointFactoryBean
@Override
public void afterPropertiesSet() throws Exception {
if (this.beanName == null) {
logger.error("The MessageHandler [" + this.handler + "] will be created without a 'componentName'. " +
this.logger.error("The MessageHandler [" + this.handler + "] will be created without a 'componentName'. " +
"Consider specifying the 'beanName' property on this ConsumerEndpointFactoryBean.");
}
else {
@@ -179,8 +179,8 @@ public class ConsumerEndpointFactoryBean
}
}
catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Could not set component name for handler "
if (this.logger.isDebugEnabled()) {
this.logger.debug("Could not set component name for handler "
+ this.handler + " for " + this.beanName + " :" + e.getMessage());
}
}
@@ -256,8 +256,8 @@ public class ConsumerEndpointFactoryBean
Assert.isNull(this.pollerMetadata, "A poller should not be specified for endpoint '" + this.beanName
+ "', since '" + channel + "' is a SubscribableChannel (not pollable).");
this.endpoint = new EventDrivenConsumer((SubscribableChannel) channel, this.handler);
if (logger.isWarnEnabled() && !this.autoStartup && channel instanceof FixedSubscriberChannel) {
logger.warn("'autoStartup=\"false\"' has no effect when using a FixedSubscriberChannel");
if (this.logger.isWarnEnabled() && !this.autoStartup && channel instanceof FixedSubscriberChannel) {
this.logger.warn("'autoStartup=\"false\"' has no effect when using a FixedSubscriberChannel");
}
}
else if (channel instanceof PollableChannel) {
@@ -277,8 +277,8 @@ public class ConsumerEndpointFactoryBean
pollingConsumer.setReceiveTimeout(this.pollerMetadata.getReceiveTimeout());
pollingConsumer.setTransactionSynchronizationFactory(
this.pollerMetadata.getTransactionSynchronizationFactory());
pollingConsumer.setBeanClassLoader(beanClassLoader);
pollingConsumer.setBeanFactory(beanFactory);
pollingConsumer.setBeanClassLoader(this.beanClassLoader);
pollingConsumer.setBeanFactory(this.beanFactory);
this.endpoint = pollingConsumer;
}
else {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -69,8 +69,8 @@ class DefaultConfiguringBeanFactoryPostProcessor implements BeanFactoryPostProce
}
this.registerIdGeneratorConfigurer(registry);
}
else if (logger.isWarnEnabled()) {
logger.warn("BeanFactory is not a BeanDefinitionRegistry. The default '"
else if (this.logger.isWarnEnabled()) {
this.logger.warn("BeanFactory is not a BeanDefinitionRegistry. The default '"
+ IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME + "' and '"
+ IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME + "' cannot be configured."
+ " Also, any custom IdGenerator implementation configured in this BeanFactory"
@@ -83,8 +83,8 @@ class DefaultConfiguringBeanFactoryPostProcessor implements BeanFactoryPostProce
for (String definitionName : definitionNames) {
BeanDefinition definition = registry.getBeanDefinition(definitionName);
if (className.equals(definition.getBeanClassName())) {
if (logger.isInfoEnabled()) {
logger.info(className + " is already registered and will be used");
if (this.logger.isInfoEnabled()) {
this.logger.info(className + " is already registered and will be used");
}
return;
}
@@ -126,8 +126,8 @@ class DefaultConfiguringBeanFactoryPostProcessor implements BeanFactoryPostProce
* Register an error channel in the given BeanDefinitionRegistry.
*/
private void registerErrorChannel(BeanDefinitionRegistry registry) {
if (logger.isInfoEnabled()) {
logger.info("No bean named '" + IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME +
if (this.logger.isInfoEnabled()) {
this.logger.info("No bean named '" + IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME +
"' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.");
}
registry.registerBeanDefinition(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME,
@@ -154,8 +154,8 @@ class DefaultConfiguringBeanFactoryPostProcessor implements BeanFactoryPostProce
* Register a TaskScheduler in the given BeanDefinitionRegistry.
*/
private void registerTaskScheduler(BeanDefinitionRegistry registry) {
if (logger.isInfoEnabled()) {
logger.info("No bean named '" + IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME +
if (this.logger.isInfoEnabled()) {
this.logger.info("No bean named '" + IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME +
"' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.");
}
BeanDefinition scheduler = BeanDefinitionBuilder.genericBeanDefinition(ThreadPoolTaskScheduler.class)

View File

@@ -103,7 +103,7 @@ public class FilterFactoryBean extends AbstractStandardMessageHandlerFactoryBean
filter.setThrowExceptionOnRejection(this.throwExceptionOnRejection);
}
if (this.discardChannel != null) {
filter.setDiscardChannel(discardChannel);
filter.setDiscardChannel(this.discardChannel);
}
if (this.discardWithinAdvice != null) {
filter.setDiscardWithinAdvice(this.discardWithinAdvice);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -71,8 +71,8 @@ public final class IdGeneratorConfigurer implements ApplicationListener<Applicat
private boolean setIdGenerator(ApplicationContext context) {
try {
IdGenerator idGeneratorBean = context.getBean(IdGenerator.class);
if (logger.isDebugEnabled()) {
logger.debug("using custom MessageHeaders.IdGenerator [" + idGeneratorBean.getClass() + "]");
if (this.logger.isDebugEnabled()) {
this.logger.debug("using custom MessageHeaders.IdGenerator [" + idGeneratorBean.getClass() + "]");
}
Field idGeneratorField = ReflectionUtils.findField(MessageHeaders.class, "idGenerator");
ReflectionUtils.makeAccessible(idGeneratorField);
@@ -84,8 +84,8 @@ public final class IdGeneratorConfigurer implements ApplicationListener<Applicat
}
else {
if (IdGeneratorConfigurer.theIdGenerator.getClass() == idGeneratorBean.getClass()) {
if (logger.isWarnEnabled()) {
logger.warn("Another instance of " + idGeneratorBean.getClass() +
if (this.logger.isWarnEnabled()) {
this.logger.warn("Another instance of " + idGeneratorBean.getClass() +
" has already been established; ignoring");
}
return true;
@@ -96,8 +96,8 @@ public final class IdGeneratorConfigurer implements ApplicationListener<Applicat
}
}
}
if (logger.isInfoEnabled()) {
logger.info("Message IDs will be generated using custom IdGenerator [" + idGeneratorBean.getClass() + "]");
if (this.logger.isInfoEnabled()) {
this.logger.info("Message IDs will be generated using custom IdGenerator [" + idGeneratorBean.getClass() + "]");
}
ReflectionUtils.setField(idGeneratorField, null, idGeneratorBean);
IdGeneratorConfigurer.theIdGenerator = idGeneratorBean;
@@ -105,19 +105,19 @@ public final class IdGeneratorConfigurer implements ApplicationListener<Applicat
catch (NoSuchBeanDefinitionException e) {
// No custom IdGenerator. We will use the default.
int idBeans = context.getBeansOfType(IdGenerator.class).size();
if (idBeans > 1 && logger.isWarnEnabled()) {
logger.warn("Found too many 'IdGenerator' beans (" + idBeans + ") " +
if (idBeans > 1 && this.logger.isWarnEnabled()) {
this.logger.warn("Found too many 'IdGenerator' beans (" + idBeans + ") " +
"Will use the existing UUID strategy.");
}
else if (logger.isDebugEnabled()) {
logger.debug("Unable to locate MessageHeaders.IdGenerator. Will use the existing UUID strategy.");
else if (this.logger.isDebugEnabled()) {
this.logger.debug("Unable to locate MessageHeaders.IdGenerator. Will use the existing UUID strategy.");
}
return false;
}
catch (IllegalStateException e) {
// thrown from ReflectionUtils
if (logger.isWarnEnabled()) {
logger.warn("Unexpected exception occurred while accessing idGenerator of MessageHeaders." +
if (this.logger.isWarnEnabled()) {
this.logger.warn("Unexpected exception occurred while accessing idGenerator of MessageHeaders." +
" Will use the existing UUID strategy.", e);
}
return false;
@@ -133,8 +133,8 @@ public final class IdGeneratorConfigurer implements ApplicationListener<Applicat
IdGeneratorConfigurer.theIdGenerator = null;
}
catch (Exception e) {
if (logger.isWarnEnabled()) {
logger.warn("Unexpected exception occurred while accessing idGenerator of MessageHeaders.", e);
if (this.logger.isWarnEnabled()) {
this.logger.warn("Unexpected exception occurred while accessing idGenerator of MessageHeaders.", e);
}
}
}

View File

@@ -91,17 +91,17 @@ public class IntegrationComponentScanRegistrar implements ImportBeanDefinitionRe
}
};
for (TypeFilter typeFilter : componentRegistrars.keySet()) {
for (TypeFilter typeFilter : this.componentRegistrars.keySet()) {
scanner.addIncludeFilter(typeFilter);
}
scanner.setResourceLoader(resourceLoader);
scanner.setResourceLoader(this.resourceLoader);
for (String basePackage : basePackages) {
Set<BeanDefinition> candidateComponents = scanner.findCandidateComponents(basePackage);
for (BeanDefinition candidateComponent : candidateComponents) {
if (candidateComponent instanceof AnnotatedBeanDefinition) {
for (ImportBeanDefinitionRegistrar importBeanDefinitionRegistrar : componentRegistrars.values()) {
for (ImportBeanDefinitionRegistrar importBeanDefinitionRegistrar : this.componentRegistrars.values()) {
importBeanDefinitionRegistrar.registerBeanDefinitions(((AnnotatedBeanDefinition) candidateComponent).getMetadata(),
registry);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2016 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.
@@ -57,7 +57,7 @@ public class SpelFunctionFactoryBean implements FactoryBean<Method>, Initializin
}
public String getFunctionName() {
return functionName;
return this.functionName;
}
@Override
@@ -75,7 +75,7 @@ public class SpelFunctionFactoryBean implements FactoryBean<Method>, Initializin
@Override
public Method getObject() throws Exception {
return method;
return this.method;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2016 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.
@@ -36,7 +36,7 @@ class SpelPropertyAccessorRegistrar {
}
Map<String, PropertyAccessor> getPropertyAccessors() {
return propertyAccessors;
return this.propertyAccessors;
}
void addPropertyAccessor(String name, PropertyAccessor propertyAccessor) {

View File

@@ -51,7 +51,7 @@ public class SplitterFactoryBean extends AbstractStandardMessageHandlerFactoryBe
}
public boolean isRequiresReply() {
return requiresReply;
return this.requiresReply;
}
public void setRequiresReply(boolean requiresReply) {
@@ -116,7 +116,7 @@ public class SplitterFactoryBean extends AbstractStandardMessageHandlerFactoryBe
@Override
protected void postProcessReplyProducer(AbstractMessageProducingHandler handler) {
if (this.sendTimeout != null) {
handler.setSendTimeout(sendTimeout);
handler.setSendTimeout(this.sendTimeout);
}
if (this.requiresReply != null) {
if(handler instanceof AbstractReplyProducingMessageHandler) {
@@ -141,7 +141,7 @@ public class SplitterFactoryBean extends AbstractStandardMessageHandlerFactoryBe
((DefaultMessageSplitter) splitter).setDelimiters(this.delimiters);
}
if (this.applySequence != null) {
splitter.setApplySequence(applySequence);
splitter.setApplySequence(this.applySequence);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -91,18 +91,23 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
}
protected ConfigurableListableBeanFactory getBeanFactory() {
return this.beanFactory;
}
@Override
public void afterPropertiesSet() {
Assert.notNull(this.beanFactory, "BeanFactory must not be null");
postProcessors.put(Filter.class, new FilterAnnotationPostProcessor(this.beanFactory));
postProcessors.put(Router.class, new RouterAnnotationPostProcessor(this.beanFactory));
postProcessors.put(Transformer.class, new TransformerAnnotationPostProcessor(this.beanFactory));
postProcessors.put(ServiceActivator.class, new ServiceActivatorAnnotationPostProcessor(this.beanFactory));
postProcessors.put(Splitter.class, new SplitterAnnotationPostProcessor(this.beanFactory));
postProcessors.put(Aggregator.class, new AggregatorAnnotationPostProcessor(this.beanFactory));
postProcessors.put(InboundChannelAdapter.class, new InboundChannelAdapterAnnotationPostProcessor(this.beanFactory));
postProcessors.put(BridgeFrom.class, new BridgeFromAnnotationPostProcessor(this.beanFactory));
postProcessors.put(BridgeTo.class, new BridgeToAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(Filter.class, new FilterAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(Router.class, new RouterAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(Transformer.class, new TransformerAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(ServiceActivator.class, new ServiceActivatorAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(Splitter.class, new SplitterAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(Aggregator.class, new AggregatorAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(InboundChannelAdapter.class,
new InboundChannelAdapterAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(BridgeFrom.class, new BridgeFromAnnotationPostProcessor(this.beanFactory));
this.postProcessors.put(BridgeTo.class, new BridgeToAnnotationPostProcessor(this.beanFactory));
}
@Override
@@ -114,14 +119,14 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
public void afterSingletonsInstantiated() {
SmartLifecycleRoleController roleController;
try {
roleController = beanFactory.getBean(IntegrationContextUtils.INTEGRATION_LIFECYCLE_ROLE_CONTROLLER,
roleController = this.beanFactory.getBean(IntegrationContextUtils.INTEGRATION_LIFECYCLE_ROLE_CONTROLLER,
SmartLifecycleRoleController.class);
for (Entry<String, List<String>> entry : this.lazyLifecycleRoles.entrySet()) {
roleController.addLifecyclesToRole(entry.getKey(), entry.getValue());
}
}
catch (NoSuchBeanDefinitionException e) {
logger.error("No LifecycleRoleController in the context");
this.logger.error("No LifecycleRoleController in the context");
}
}
@@ -133,6 +138,7 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
// we only post-process stereotype components
return bean;
}
ReflectionUtils.doWithMethods(beanClass, new ReflectionUtils.MethodCallback() {
@Override
@@ -140,7 +146,8 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
Map<Class<? extends Annotation>, List<Annotation>> annotationChains =
new HashMap<Class<? extends Annotation>, List<Annotation>>();
for (Class<? extends Annotation> annotationType : postProcessors.keySet()) {
for (Class<? extends Annotation> annotationType :
MessagingAnnotationPostProcessor.this.postProcessors.keySet()) {
if (AnnotatedElementUtils.isAnnotated(method, annotationType.getName())) {
List<Annotation> annotationChain = getAnnotationChain(method, annotationType);
if (annotationChain.size() > 0) {
@@ -152,7 +159,8 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
for (Map.Entry<Class<? extends Annotation>, List<Annotation>> entry : annotationChains.entrySet()) {
Class<? extends Annotation> annotationType = entry.getKey();
List<Annotation> annotations = entry.getValue();
MethodAnnotationPostProcessor postProcessor = postProcessors.get(annotationType);
MethodAnnotationPostProcessor postProcessor =
MessagingAnnotationPostProcessor.this.postProcessors.get(annotationType);
if (postProcessor != null && postProcessor.shouldCreateEndpoint(method, annotations)) {
Method targetMethod = method;
if (AopUtils.isJdkDynamicProxy(bean)) {
@@ -171,7 +179,7 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
String autoStartup = MessagingAnnotationUtils.resolveAttribute(annotations, "autoStartup",
String.class);
if (StringUtils.hasText(autoStartup)) {
autoStartup = beanFactory.resolveEmbeddedValue(autoStartup);
autoStartup = getBeanFactory().resolveEmbeddedValue(autoStartup);
if (StringUtils.hasText(autoStartup)) {
endpoint.setAutoStartup(Boolean.parseBoolean(autoStartup));
}
@@ -179,7 +187,7 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
String phase = MessagingAnnotationUtils.resolveAttribute(annotations, "phase", String.class);
if (StringUtils.hasText(phase)) {
phase = beanFactory.resolveEmbeddedValue(phase);
phase = getBeanFactory().resolveEmbeddedValue(phase);
if (StringUtils.hasText(phase)) {
endpoint.setPhase(Integer.parseInt(phase));
}
@@ -187,12 +195,13 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean
String endpointBeanName = generateBeanName(beanName, method, annotationType);
endpoint.setBeanName(endpointBeanName);
beanFactory.registerSingleton(endpointBeanName, endpoint);
beanFactory.initializeBean(endpoint, endpointBeanName);
getBeanFactory().registerSingleton(endpointBeanName, endpoint);
getBeanFactory().initializeBean(endpoint, endpointBeanName);
Role role = AnnotationUtils.findAnnotation(method, Role.class);
if (role != null) {
lazyLifecycleRoles.add(role.value(), endpointBeanName);
MessagingAnnotationPostProcessor.this.lazyLifecycleRoles.add(role.value(),
endpointBeanName);
}
}
}

View File

@@ -66,7 +66,7 @@ public class ChainParser extends AbstractConsumerEndpointParser {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(MessageHandlerChain.class);
if (!StringUtils.hasText(element.getAttribute(ID_ATTRIBUTE))) {
logger.info("It is useful to provide an explicit 'id' attribute on 'chain' elements " +
this.logger.info("It is useful to provide an explicit 'id' attribute on 'chain' elements " +
"to simplify the identification of child elements in logs etc.");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -111,8 +111,8 @@ public abstract class HeaderEnricherParserSupport extends AbstractTransformerPar
headerName = headerElement.getAttribute(NAME_ATTRIBUTE);
}
else {
headerName = elementToNameMap.get(elementName);
headerType = elementToTypeMap.get(elementName);
headerName = this.elementToNameMap.get(elementName);
headerType = this.elementToTypeMap.get(elementName);
if (headerType != null && StringUtils.hasText(headerElement.getAttribute("type"))) {
parserContext.getReaderContext().error("The " + elementName
+ " header does not accept a 'type' attribute. The required type is ["

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -55,10 +55,10 @@ class ConverterRegistrar implements InitializingBean, BeanFactoryAware {
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(beanFactory, "BeanFactory is required");
ConversionService conversionService = IntegrationUtils.getConversionService(beanFactory);
Assert.notNull(this.beanFactory, "BeanFactory is required");
ConversionService conversionService = IntegrationUtils.getConversionService(this.beanFactory);
if (conversionService instanceof GenericConversionService) {
ConversionServiceFactory.registerConverters(converters, (GenericConversionService) conversionService);
ConversionServiceFactory.registerConverters(this.converters, (GenericConversionService) conversionService);
}
else {
Assert.notNull(conversionService, "Failed to locate '" + IntegrationUtils.INTEGRATION_CONVERSION_SERVICE_BEAN_NAME + "'");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -229,7 +229,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
* @return the applicationContext
*/
protected ApplicationContext getApplicationContext() {
return applicationContext;
return this.applicationContext;
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -68,7 +68,7 @@ public abstract class AbstractDispatcher implements MessageDispatcher {
* @return The message handlers.
*/
protected Set<MessageHandler> getHandlers() {
return handlers.asUnmodifiableSet();
return this.handlers.asUnmodifiableSet();
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2016 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.
@@ -51,7 +51,7 @@ public class AggregateMessageDeliveryException extends MessageDeliveryException
public String getMessage() {
String baseMessage = super.getMessage();
StringBuilder message = new StringBuilder(appendPeriodIfNecessary(baseMessage) + " Multiple causes:\n");
for (Exception exception : aggregatedExceptions) {
for (Exception exception : this.aggregatedExceptions) {
message.append(" " + exception.getMessage() + "\n");
}
message.append("See below for the stacktrace of the first cause.");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -186,7 +186,7 @@ public class BroadcastingDispatcher extends AbstractDispatcher implements BeanFa
logger.debug("No subscribers, default behavior is ignore");
}
}
return dispatched >= minSubscribers;
return dispatched >= this.minSubscribers;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -61,21 +61,21 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
private final ReadLock readLock = rwl.readLock();
private final ReadLock readLock = this.rwl.readLock();
private final WriteLock writeLock = rwl.writeLock();
private final WriteLock writeLock = this.rwl.writeLock();
private final CopyOnWriteArraySet<E> elements;
private final Set<E> unmodifiableElements;
OrderedAwareCopyOnWriteArraySet() {
elements = new CopyOnWriteArraySet<E>();
unmodifiableElements = Collections.unmodifiableSet(elements);
this.elements = new CopyOnWriteArraySet<E>();
this.unmodifiableElements = Collections.unmodifiableSet(this.elements);
}
public Set<E> asUnmodifiableSet() {
return unmodifiableElements;
return this.unmodifiableElements;
}
/**
@@ -86,19 +86,19 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
@Override
public boolean add(E o) {
Assert.notNull(o,"Can not add NULL object");
writeLock.lock();
this.writeLock.lock();
try {
boolean present = false;
if (o instanceof Ordered){
present = this.addOrderedElement((Ordered) o);
}
else {
present = elements.add(o);
present = this.elements.add(o);
}
return present;
}
finally {
writeLock.unlock();
this.writeLock.unlock();
}
}
@@ -108,7 +108,7 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
@Override
public boolean addAll(Collection<? extends E> c) {
Assert.notNull(c,"Can not merge with NULL set");
writeLock.lock();
this.writeLock.lock();
try {
for (E object : c) {
this.add(object);
@@ -116,7 +116,7 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
return true;
}
finally {
writeLock.unlock();
this.writeLock.unlock();
}
}
@@ -125,14 +125,14 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
*/
@Override
public boolean remove(Object o) {
writeLock.lock();
this.writeLock.lock();
try {
boolean removed = elements.remove(o);
boolean removed = this.elements.remove(o);
//unmodifiableElements = Collections.unmodifiableSet(this);
return removed;
}
finally {
writeLock.unlock();
this.writeLock.unlock();
}
}
@@ -144,59 +144,59 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
if (CollectionUtils.isEmpty(c)){
return false;
}
writeLock.lock();
this.writeLock.lock();
try {
return elements.removeAll(c);
return this.elements.removeAll(c);
}
finally {
writeLock.unlock();
this.writeLock.unlock();
}
}
@Override
public <T> T[] toArray(T[] a) {
readLock.lock();
this.readLock.lock();
try {
return elements.toArray(a);
return this.elements.toArray(a);
}
finally {
readLock.unlock();
this.readLock.unlock();
}
}
@Override
public String toString() {
readLock.lock();
this.readLock.lock();
try {
return StringUtils.collectionToCommaDelimitedString(elements);
return StringUtils.collectionToCommaDelimitedString(this.elements);
}
finally {
readLock.unlock();
this.readLock.unlock();
}
}
@SuppressWarnings("rawtypes")
private boolean addOrderedElement(Ordered adding) {
boolean added = false;
E[] tempUnorderedElements = (E[]) elements.toArray();
if (elements.contains(adding)) {
E[] tempUnorderedElements = (E[]) this.elements.toArray();
if (this.elements.contains(adding)) {
return false;
}
elements.clear();
this.elements.clear();
if (tempUnorderedElements.length == 0) {
added = elements.add((E) adding);
added = this.elements.add((E) adding);
}
else {
Set tempSet = new LinkedHashSet();
for (E current : tempUnorderedElements) {
if (current instanceof Ordered) {
if (this.comparator.compare(adding, current) < 0) {
added = elements.add((E) adding);
elements.add(current);
added = this.elements.add((E) adding);
this.elements.add(current);
}
else {
elements.add(current);
this.elements.add(current);
}
}
else {
@@ -204,10 +204,10 @@ class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
}
}
if (!added) {
added = elements.add((E) adding);
added = this.elements.add((E) adding);
}
for (Object object : tempSet) {
elements.add((E) object);
this.elements.add((E) object);
}
}
return added;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -86,7 +86,7 @@ public class RoundRobinLoadBalancingStrategy implements LoadBalancingStrategy {
*/
private int getNextHandlerStartIndex(int size) {
if (size > 0){
int indexTail = currentHandlerIndex.getAndIncrement() % size;
int indexTail = this.currentHandlerIndex.getAndIncrement() % size;
return indexTail < 0 ? indexTail + size : indexTail;
}
else {

View File

@@ -112,7 +112,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
}
protected ClassLoader getBeanClassLoader() {
return beanClassLoader;
return this.beanClassLoader;
}
/**
@@ -156,8 +156,8 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
@SuppressWarnings("unchecked")
private Runnable createPoller() throws Exception {
List<Advice> receiveOnlyAdviceChain = new ArrayList<Advice>();
if (!CollectionUtils.isEmpty(adviceChain)) {
for (Advice advice : adviceChain) {
if (!CollectionUtils.isEmpty(this.adviceChain)) {
for (Advice advice : this.adviceChain) {
if (isReceiveOnlyAdvice(advice)) {
receiveOnlyAdviceChain.add(advice);
}
@@ -165,6 +165,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
}
Callable<Boolean> pollingTask = new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return doPoll();
@@ -237,13 +238,13 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
}
boolean result;
if (message == null) {
if (this.logger.isDebugEnabled()){
if (this.logger.isDebugEnabled()) {
this.logger.debug("Received no Message during the poll, returning 'false'");
}
result = false;
}
else {
if (this.logger.isDebugEnabled()){
if (this.logger.isDebugEnabled()) {
this.logger.debug("Poll resulted in Message: " + message);
}
if (holder != null) {
@@ -315,20 +316,22 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
private final Callable<Boolean> pollingTask;
private Poller(Callable<Boolean> pollingTask) {
this.pollingTask = pollingTask;
}
@Override
public void run() {
taskExecutor.execute(new Runnable() {
AbstractPollingEndpoint.this.taskExecutor.execute(new Runnable() {
@Override
public void run() {
int count = 0;
while (initialized && (maxMessagesPerPoll <= 0 || count < maxMessagesPerPoll)) {
while (AbstractPollingEndpoint.this.initialized
&& (AbstractPollingEndpoint.this.maxMessagesPerPoll <= 0
|| count < AbstractPollingEndpoint.this.maxMessagesPerPoll)) {
try {
if (!pollingTask.call()) {
if (!Poller.this.pollingTask.call()) {
break;
}
count++;
@@ -343,6 +346,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
}
}
}
});
}

View File

@@ -77,8 +77,8 @@ public abstract class ExpressionMessageProducerSupport extends MessageProducerSu
protected Object evaluatePayloadExpression(Object payload){
Object evaluationResult = payload;
if (payloadExpression != null) {
evaluationResult = payloadExpression.getValue(this.evaluationContext, payload);
if (this.payloadExpression != null) {
evaluationResult = this.payloadExpression.getValue(this.evaluationContext, payload);
}
return evaluationResult;
}

View File

@@ -81,7 +81,7 @@ public abstract class MessageProducerSupport extends AbstractEndpoint implements
}
protected MessagingTemplate getMessagingTemplate() {
return messagingTemplate;
return this.messagingTemplate;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -62,7 +62,7 @@ public class PollingConsumer extends AbstractPollingEndpoint {
this.channelInterceptors = ((ExecutorChannelInterceptorAware) this.inputChannel).getChannelInterceptors();
}
else {
channelInterceptors = null;
this.channelInterceptors = null;
}
}

View File

@@ -45,7 +45,7 @@ public abstract class IntegrationEvent extends ApplicationEvent {
}
public Throwable getCause() {
return cause;
return this.cause;
}
@Override

View File

@@ -88,7 +88,7 @@ public final class ExpressionEvalMap extends AbstractMap<String, Object> {
*/
@Override
public Object get(Object key) {
Object value = original.get(key);
Object value = this.original.get(key);
if (value != null) {
Expression expression;
if (value instanceof Expression) {
@@ -114,32 +114,32 @@ public final class ExpressionEvalMap extends AbstractMap<String, Object> {
@Override
public boolean containsKey(Object key) {
return original.containsKey(key);
return this.original.containsKey(key);
}
@Override
public Set<String> keySet() {
return original.keySet();
return this.original.keySet();
}
@Override
public boolean isEmpty() {
return original.isEmpty();
return this.original.isEmpty();
}
@Override
public int size() {
return original.size();
return this.original.size();
}
@Override
public boolean equals(Object o) {
return original.equals(o);
return this.original.equals(o);
}
@Override
public int hashCode() {
return original.hashCode();
return this.original.hashCode();
}
@Override
@@ -238,7 +238,8 @@ public final class ExpressionEvalMap extends AbstractMap<String, Object> {
private Class<?> returnType;
private final ExpressionEvalMapComponentsBuilder evalMapComponentsBuilder = new ExpressionEvalMapComponentsBuilderImpl();
private final ExpressionEvalMapComponentsBuilder evalMapComponentsBuilder =
new ExpressionEvalMapComponentsBuilderImpl();
private final ExpressionEvalMapFinalBuilder finalBuilder = new ExpressionEvalMapFinalBuilderImpl();
@@ -248,7 +249,7 @@ public final class ExpressionEvalMap extends AbstractMap<String, Object> {
public ExpressionEvalMapFinalBuilder usingCallback(EvaluationCallback callback) {
this.evaluationCallback = callback;
return finalBuilder;
return this.finalBuilder;
}
public ExpressionEvalMapFinalBuilder usingSimpleCallback() {
@@ -277,10 +278,14 @@ public final class ExpressionEvalMap extends AbstractMap<String, Object> {
@Override
public ExpressionEvalMap build() {
if (evaluationCallback != null) {
return new ExpressionEvalMap(expressions, evaluationCallback);
if (ExpressionEvalMapBuilder.this.evaluationCallback != null) {
return new ExpressionEvalMap(ExpressionEvalMapBuilder.this.expressions,
ExpressionEvalMapBuilder.this.evaluationCallback);
}
return new ExpressionEvalMap(expressions, new ComponentsEvaluationCallback(context, root, returnType));
ComponentsEvaluationCallback evaluationCallback =
new ComponentsEvaluationCallback(ExpressionEvalMapBuilder.this.context,
ExpressionEvalMapBuilder.this.root, ExpressionEvalMapBuilder.this.returnType);
return new ExpressionEvalMap(ExpressionEvalMapBuilder.this.expressions, evaluationCallback);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -555,11 +555,11 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc
}
public Properties getProperties() {
return properties;
return this.properties;
}
public long getFileTimestamp() {
return fileTimestamp;
return this.fileTimestamp;
}
public void setRefreshTimestamp(long refreshTimestamp) {
@@ -567,7 +567,7 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc
}
public long getRefreshTimestamp() {
return refreshTimestamp;
return this.refreshTimestamp;
}
public String getProperty(String code) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -50,7 +50,7 @@ public class ExpressionEvaluatingSelector extends AbstractMessageProcessingSelec
}
public String getExpressionString() {
return expressionString;
return this.expressionString;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -153,7 +153,7 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
Assert.notNull(arguments, "cannot map null arguments to Message");
if (arguments.length != this.parameterList.size()) {
String prefix = (arguments.length < this.parameterList.size()) ? "Not enough" : "Too many";
throw new IllegalArgumentException(prefix + " parameters provided for method [" + method +
throw new IllegalArgumentException(prefix + " parameters provided for method [" + this.method +
"], expected " + this.parameterList.size() + " but received " + arguments.length + ".");
}
return this.mapArgumentsToMessage(arguments);
@@ -325,7 +325,7 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
}
else if (Map.class.isAssignableFrom(methodParameter.getParameterType())) {
if (messageOrPayload instanceof Map && !foundPayloadAnnotation) {
if (payloadExpression == null){
if (GatewayMethodInboundMessageMapper.this.payloadExpression == null){
throw new MessagingException("Ambiguous method parameters; found more than one " +
"Map-typed parameter and neither one contains a @Payload annotation");
}
@@ -337,7 +337,7 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
}
}
Assert.isTrue(messageOrPayload != null,
"unable to determine a Message or payload parameter on method [" + method + "]");
"unable to determine a Message or payload parameter on method [" + GatewayMethodInboundMessageMapper.this.method + "]");
AbstractIntegrationMessageBuilder<?> builder = (messageOrPayload instanceof Message)
? GatewayMethodInboundMessageMapper.this.messageBuilderFactory.fromMessage((Message<?>) messageOrPayload)
: GatewayMethodInboundMessageMapper.this.messageBuilderFactory.withPayload(messageOrPayload);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -48,7 +48,7 @@ public class GatewayMethodMetadata {
public String getPayloadExpression() {
return payloadExpression;
return this.payloadExpression;
}
public void setPayloadExpression(String payloadExpression) {
@@ -64,7 +64,7 @@ public class GatewayMethodMetadata {
}
public String getRequestChannelName() {
return requestChannelName;
return this.requestChannelName;
}
public void setRequestChannelName(String requestChannelName) {
@@ -72,7 +72,7 @@ public class GatewayMethodMetadata {
}
public String getReplyChannelName() {
return replyChannelName;
return this.replyChannelName;
}
public void setReplyChannelName(String replyChannelName) {
@@ -80,7 +80,7 @@ public class GatewayMethodMetadata {
}
public String getRequestTimeout() {
return requestTimeout;
return this.requestTimeout;
}
public void setRequestTimeout(String requestTimeout) {
@@ -88,7 +88,7 @@ public class GatewayMethodMetadata {
}
public String getReplyTimeout() {
return replyTimeout;
return this.replyTimeout;
}
public void setReplyTimeout(String replyTimeout) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -279,7 +279,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
}
protected AsyncTaskExecutor getAsyncExecutor() {
return asyncExecutor;
return this.asyncExecutor;
}
@Override
@@ -352,7 +352,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
if (returnType.isAssignableFrom(this.asyncSubmitType)) {
return this.asyncExecutor.submit(new AsyncInvocationTask(invocation));
}
else if (returnType.isAssignableFrom(asyncSubmitListenableType)) {
else if (returnType.isAssignableFrom(this.asyncSubmitListenableType)) {
return ((AsyncListenableTaskExecutor) this.asyncExecutor).submitListenable(new AsyncInvocationTask(invocation));
}
else if (Future.class.isAssignableFrom(returnType)) {
@@ -498,8 +498,8 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
}
}
else if (methodMetadataMap != null && methodMetadataMap.size() > 0) {
GatewayMethodMetadata methodMetadata = methodMetadataMap.get(method.getName());
else if (this.methodMetadataMap != null && this.methodMetadataMap.size() > 0) {
GatewayMethodMetadata methodMetadata = this.methodMetadataMap.get(method.getName());
if (methodMetadata != null) {
if (StringUtils.hasText(methodMetadata.getPayloadExpression())) {
payloadExpression = methodMetadata.getPayloadExpression();
@@ -593,7 +593,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
return this.getConversionService().convert(source, expectedReturnType);
}
else {
return typeConverter.convertIfNecessary(source, expectedReturnType);
return this.typeConverter.convertIfNecessary(source, expectedReturnType);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -523,7 +523,7 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint
@Override // guarded by super#lifecycleLock
protected void doStart() {
if (this.replyMessageCorrelator != null) {
replyMessageCorrelator.start();
this.replyMessageCorrelator.start();
}
}

View File

@@ -41,11 +41,11 @@ public final class MethodArgsHolder {
}
public Method getMethod() {
return method;
return this.method;
}
public Object[] getArgs() {
return args;//NOSONAR - direct access
return this.args;//NOSONAR - direct access
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -46,7 +46,7 @@ class RequestReplyMessageHandlerAdapter extends AbstractReplyProducingMessageHan
*/
@Override
protected Object handleRequestMessage(Message<?> requestMessage) {
return exchanger.exchange(requestMessage);
return this.exchanger.exchange(requestMessage);
}
}

View File

@@ -116,7 +116,7 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan
}
}
}
return outputChannel;
return this.outputChannel;
}
protected void sendOutputs(Object result, Message<?> requestMessage) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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,7 +58,7 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa
}
protected boolean getRequiresReply() {
return requiresReply;
return this.requiresReply;
}
public void setAdviceChain(List<Advice> adviceChain) {

View File

@@ -215,7 +215,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement
if (!CollectionUtils.isEmpty(this.delayedAdviceChain)) {
ProxyFactory proxyFactory = new ProxyFactory(releaseHandler);
for (Advice advice : delayedAdviceChain) {
for (Advice advice : this.delayedAdviceChain) {
proxyFactory.addAdvice(advice);
}
return (MessageHandler) proxyFactory.getProxy(getApplicationContext().getClassLoader());

View File

@@ -93,7 +93,7 @@ public class LoggingHandler extends AbstractMessageHandler {
* @return The current logging {@link Level}.
*/
public Level getLevel() {
return level;
return this.level;
}
/**
@@ -139,33 +139,33 @@ public class LoggingHandler extends AbstractMessageHandler {
protected void handleMessageInternal(Message<?> message) throws Exception {
switch (this.level) {
case FATAL:
if (messageLogger.isFatalEnabled()) {
messageLogger.fatal(createLogMessage(message));
if (this.messageLogger.isFatalEnabled()) {
this.messageLogger.fatal(createLogMessage(message));
}
break;
case ERROR:
if (messageLogger.isErrorEnabled()) {
messageLogger.error(createLogMessage(message));
if (this.messageLogger.isErrorEnabled()) {
this.messageLogger.error(createLogMessage(message));
}
break;
case WARN:
if (messageLogger.isWarnEnabled()) {
messageLogger.warn(createLogMessage(message));
if (this.messageLogger.isWarnEnabled()) {
this.messageLogger.warn(createLogMessage(message));
}
break;
case INFO:
if (messageLogger.isInfoEnabled()) {
messageLogger.info(createLogMessage(message));
if (this.messageLogger.isInfoEnabled()) {
this.messageLogger.info(createLogMessage(message));
}
break;
case DEBUG:
if (messageLogger.isDebugEnabled()) {
messageLogger.debug(createLogMessage(message));
if (this.messageLogger.isDebugEnabled()) {
this.messageLogger.debug(createLogMessage(message));
}
break;
case TRACE:
if (messageLogger.isTraceEnabled()) {
messageLogger.trace(createLogMessage(message));
if (this.messageLogger.isTraceEnabled()) {
this.messageLogger.trace(createLogMessage(message));
}
break;
default:

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -108,11 +108,11 @@ public class MessageHandlerChain extends AbstractMessageProducingHandler impleme
Assert.isTrue(this.handlers.size() == new HashSet<MessageHandler>(this.handlers).size(),
"duplicate handlers are not allowed in a chain");
for (int i = 0; i < this.handlers.size(); i++) {
MessageHandler handler = handlers.get(i);
if (i < handlers.size() - 1) { // not the last handler
MessageHandler handler = this.handlers.get(i);
if (i < this.handlers.size() - 1) { // not the last handler
Assert.isInstanceOf(MessageProducer.class, handler, "All handlers except for " +
"the last one in the chain must implement the MessageProducer interface.");
final MessageHandler nextHandler = handlers.get(i + 1);
final MessageHandler nextHandler = this.handlers.get(i + 1);
final MessageChannel nextChannel = new MessageChannel() {
@Override
public boolean send(Message<?> message, long timeout) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -41,11 +41,11 @@ public class MethodInvokingMessageHandler extends AbstractMessageHandler impleme
public MethodInvokingMessageHandler(Object object, Method method) {
Assert.isTrue(method.getReturnType().equals(void.class),
"MethodInvokingMessageHandler requires a void-returning method");
processor = new MethodInvokingMessageProcessor<Object>(object, method);
this.processor = new MethodInvokingMessageProcessor<Object>(object, method);
}
public MethodInvokingMessageHandler(Object object, String methodName) {
processor = new MethodInvokingMessageProcessor<Object>(object, methodName);
this.processor = new MethodInvokingMessageProcessor<Object>(object, methodName);
}
@Override
@@ -80,7 +80,7 @@ public class MethodInvokingMessageHandler extends AbstractMessageHandler impleme
@Override
protected void handleMessageInternal(Message<?> message) throws Exception {
Object result = processor.processMessage(message);
Object result = this.processor.processMessage(message);
if (result != null) {
throw new MessagingException(message, "the MethodInvokingMessageHandler method must "
+ "have a void return, but '" + this + "' received a value: [" + result + "]");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -45,31 +45,31 @@ public class MethodInvokingMessageProcessor<T> extends AbstractMessageProcessor<
private final MessagingMethodInvokerHelper<T> delegate;
public MethodInvokingMessageProcessor(Object targetObject, Method method) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, false);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, method, false);
}
public MethodInvokingMessageProcessor(Object targetObject, String methodName) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, false);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, false);
}
public MethodInvokingMessageProcessor(Object targetObject, String methodName, boolean canProcessMessageList) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, canProcessMessageList);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, methodName, canProcessMessageList);
}
public MethodInvokingMessageProcessor(Object targetObject, Class<? extends Annotation> annotationType) {
delegate = new MessagingMethodInvokerHelper<T>(targetObject, annotationType, false);
this.delegate = new MessagingMethodInvokerHelper<T>(targetObject, annotationType, false);
}
@Override
public void setConversionService(ConversionService conversionService) {
super.setConversionService(conversionService);
delegate.setConversionService(conversionService);
this.delegate.setConversionService(conversionService);
}
@Override
public void setBeanFactory(BeanFactory beanFactory) {
super.setBeanFactory(beanFactory);
delegate.setBeanFactory(beanFactory);
this.delegate.setBeanFactory(beanFactory);
}
@Override
@@ -90,7 +90,7 @@ public class MethodInvokingMessageProcessor<T> extends AbstractMessageProcessor<
@Override
public T processMessage(Message<?> message) {
try {
return delegate.process(message);
return this.delegate.process(message);
}
catch (Exception e) {
throw new MessageHandlingException(message, e);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -57,7 +57,7 @@ public class ServiceActivatingHandler extends AbstractReplyProducingMessageHandl
@Override
protected void doInit() {
if (processor instanceof AbstractMessageProcessor) {
if (this.processor instanceof AbstractMessageProcessor) {
((AbstractMessageProcessor<?>) this.processor).setConversionService(this.getConversionService());
}
if (this.processor instanceof BeanFactoryAware && this.getBeanFactory() != null) {

View File

@@ -56,9 +56,9 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
if (!isMessageMethod) {
boolean isMessageHandler = invocationThis != null
&& MessageHandler.class.isAssignableFrom(invocationThis.getClass());
if (!isMessageHandler && logger.isWarnEnabled()) {
if (!isMessageHandler && this.logger.isWarnEnabled()) {
String clazzName = invocationThis == null ? method.getDeclaringClass().getName() : invocationThis.getClass().getName();
logger.warn("This advice " + this.getClass().getName() +
this.logger.warn("This advice " + this.getClass().getName() +
" can only be used for MessageHandlers; an attempt to advise method '" + method.getName() +
"' in '" + clazzName + "' is ignored");
}

View File

@@ -80,7 +80,7 @@ public class ErrorMessageSendingRecoverer implements RecoveryCallback<Object>, B
String supplement = ":failedMessage:" + ((MessagingException) lastThrowable).getFailedMessage();
logger.debug("Sending ErrorMessage " + supplement, lastThrowable);
}
messagingTemplate.send(new ErrorMessage(lastThrowable));
this.messagingTemplate.send(new ErrorMessage(lastThrowable));
return null;
}

View File

@@ -228,7 +228,7 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan
}
public Object getEvaluationResult() {
return evaluationResult;
return this.evaluationResult;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2015 the original author or authors.
* Copyright 2014-2016 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.
@@ -150,11 +150,11 @@ public class IdempotentReceiverInterceptor implements MethodInterceptor, BeanFac
boolean isMessageMethod = method.getName().equals("handleMessage")
&& (arguments.length == 1 && arguments[0] instanceof Message);
if (!isMessageHandler || !isMessageMethod) {
if (logger.isWarnEnabled()) {
if (this.logger.isWarnEnabled()) {
String clazzName = invocationThis == null
? method.getDeclaringClass().getName()
: invocationThis.getClass().getName();
logger.warn("This advice " + this.getClass().getName() +
this.logger.warn("This advice " + this.getClass().getName() +
" can only be used for MessageHandlers; an attempt to advise method '"
+ method.getName() + "' in '" + clazzName + "' is ignored");
}

View File

@@ -80,7 +80,7 @@ public class RequestHandlerCircuitBreakerAdvice extends AbstractRequestHandlerAd
private volatile long lastFailure;
private long getLastFailure() {
return lastFailure;
return this.lastFailure;
}
private void setLastFailure(long lastFailure) {
@@ -88,7 +88,7 @@ public class RequestHandlerCircuitBreakerAdvice extends AbstractRequestHandlerAd
}
private AtomicInteger getFailures() {
return failures;
return this.failures;
}
}

View File

@@ -86,7 +86,7 @@ public class RequestHandlerRetryAdvice extends AbstractRequestHandlerAdvice
messageHolder.set(message);
try {
return retryTemplate.execute(new RetryCallback<Object, Exception>() {
return this.retryTemplate.execute(new RetryCallback<Object, Exception>() {
@Override
public Object doWithRetry(RetryContext context) throws Exception {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -168,7 +168,7 @@ public class MessageHistoryConfigurer implements SmartLifecycle, BeanFactoryAwar
public void start() {
synchronized (this.lifecycleMonitor) {
if (!this.running && this.beanFactory instanceof ListableBeanFactory) {
for (TrackableComponent component : getTrackableComponents((ListableBeanFactory) beanFactory)) {
for (TrackableComponent component : getTrackableComponents((ListableBeanFactory) this.beanFactory)) {
String componentName = component.getComponentName();
boolean shouldTrack = PatternMatchUtils.simpleMatch(this.componentNamePatterns, componentName);
component.setShouldTrack(shouldTrack);
@@ -189,7 +189,7 @@ public class MessageHistoryConfigurer implements SmartLifecycle, BeanFactoryAwar
public void stop() {
synchronized (this.lifecycleMonitor) {
if (this.running && this.beanFactory instanceof ListableBeanFactory) {
for (TrackableComponent component : getTrackableComponents((ListableBeanFactory) beanFactory)) {
for (TrackableComponent component : getTrackableComponents((ListableBeanFactory) this.beanFactory)) {
String componentName = component.getComponentName();
if (this.currentlyTrackedComponentNames.contains(componentName)) {
component.setShouldTrack(false);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2013-2016 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.
@@ -155,15 +155,15 @@ public class JsonPropertyAccessor implements PropertyAccessor {
@Override
public String toString() {
if (node == null) {
if (this.node == null) {
return "null";
}
if (node.isValueNode()) {
if (this.node.isValueNode()) {
// This is to avoid quotes around a TextNode for example
return node.asText();
return this.node.asText();
}
else {
return node.toString();
return this.node.toString();
}
}

View File

@@ -48,13 +48,13 @@ public class DefaultCandidate extends AbstractCandidate {
@Override
public void onGranted(Context ctx) {
logger.info("{} has been granted leadership; context: {}", this, ctx);
leaderContext = ctx;
this.logger.info("{} has been granted leadership; context: {}", this, ctx);
this.leaderContext = ctx;
}
@Override
public void onRevoked(Context ctx) {
logger.info("{} leadership has been revoked", this, ctx);
this.logger.info("{} leadership has been revoked", this, ctx);
}
/**
@@ -64,8 +64,8 @@ public class DefaultCandidate extends AbstractCandidate {
* leader initiator.
*/
public void yieldLeadership() {
if (leaderContext != null) {
leaderContext.yield();
if (this.leaderContext != null) {
this.leaderContext.yield();
}
}

View File

@@ -62,7 +62,7 @@ public abstract class AbstractLeaderEvent extends ApplicationEvent {
* @return the context
*/
public Context getContext() {
return context;
return this.context;
}
/**
@@ -71,12 +71,12 @@ public abstract class AbstractLeaderEvent extends ApplicationEvent {
* @return the role
*/
public String getRole() {
return role;
return this.role;
}
@Override
public String toString() {
return getClass().getSimpleName() + " [role=" + role + ", context=" + context + ", source=" + source
return getClass().getSimpleName() + " [role=" + this.role + ", context=" + this.context + ", source=" + source
+ "]";
}

View File

@@ -48,15 +48,15 @@ public class DefaultLeaderEventPublisher implements LeaderEventPublisher, Applic
@Override
public void publishOnGranted(Object source, Context context, String role) {
if (applicationEventPublisher != null) {
applicationEventPublisher.publishEvent(new OnGrantedEvent(source, context, role));
if (this.applicationEventPublisher != null) {
this.applicationEventPublisher.publishEvent(new OnGrantedEvent(source, context, role));
}
}
@Override
public void publishOnRevoked(Object source, Context context, String role) {
if (applicationEventPublisher != null) {
applicationEventPublisher.publishEvent(new OnRevokedEvent(source, context, role));
if (this.applicationEventPublisher != null) {
this.applicationEventPublisher.publishEvent(new OnRevokedEvent(source, context, role));
}
}

View File

@@ -205,8 +205,8 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
this.populateUserDefinedHeaders(subset, target);
}
catch (Exception e) {
if (logger.isWarnEnabled()) {
logger.warn("error occurred while mapping from MessageHeaders", e);
if (this.logger.isWarnEnabled()) {
this.logger.warn("error occurred while mapping from MessageHeaders", e);
}
}
}
@@ -223,8 +223,8 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
}
}
catch (Exception e) {
if (logger.isWarnEnabled()) {
logger.warn("failed to map from Message header '" + headerName + "' to target", e);
if (this.logger.isWarnEnabled()) {
this.logger.warn("failed to map from Message header '" + headerName + "' to target", e);
}
}
}
@@ -233,8 +233,8 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
private boolean isMessageChannel(String headerName, Object headerValue) {
if (headerValue instanceof MessageChannel) {
if (logger.isDebugEnabled()) {
logger.debug("Cannot map a MessageChannel instance in header " + headerName);
if (this.logger.isDebugEnabled()) {
this.logger.debug("Cannot map a MessageChannel instance in header " + headerName);
}
return true;
}
@@ -264,8 +264,8 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
}
}
catch (Exception e) {
if (logger.isWarnEnabled()) {
logger.warn("error occurred while mapping header '"
if (this.logger.isWarnEnabled()) {
this.logger.warn("error occurred while mapping header '"
+ entry.getKey() + "' to Message header", e);
}
}
@@ -285,8 +285,8 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
return null;
}
if (!type.isAssignableFrom(value.getClass())) {
if (logger.isWarnEnabled()) {
logger.warn("skipping header '" + name + "' since it is not of expected type [" + type + "], it is [" +
if (this.logger.isWarnEnabled()) {
this.logger.warn("skipping header '" + name + "' since it is not of expected type [" + type + "], it is [" +
value.getClass() + "]");
}
return null;
@@ -489,7 +489,7 @@ public abstract class AbstractHeaderMapper<T> implements RequestReplyHeaderMappe
if (PatternMatchUtils.simpleMatch(this.pattern, header)) {
if (logger.isDebugEnabled()) {
logger.debug(MessageFormat.format(
"headerName=[{0}] WILL be mapped, matched pattern={1}", headerName, pattern));
"headerName=[{0}] WILL be mapped, matched pattern={1}", headerName, this.pattern));
}
return true;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -48,7 +48,7 @@ public class AdviceMessage extends GenericMessage<Object> {
}
public Message<?> getInputMessage() {
return inputMessage;
return this.inputMessage;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -221,7 +221,7 @@ public class PropertiesPersistingMetadataStore implements ConcurrentMetadataStor
}
catch (IOException e) {
// not fatal for the functionality of the component
logger.warn("Failed to persist entry. This may result in a duplicate "
this.logger.warn("Failed to persist entry. This may result in a duplicate "
+ "entry after this component is restarted.", e);
}
finally {
@@ -232,7 +232,7 @@ public class PropertiesPersistingMetadataStore implements ConcurrentMetadataStor
}
catch (IOException e) {
// not fatal for the functionality of the component
logger.warn("Failed to close OutputStream to " + this.file.getAbsolutePath(), e);
this.logger.warn("Failed to close OutputStream to " + this.file.getAbsolutePath(), e);
}
}
}
@@ -245,7 +245,7 @@ public class PropertiesPersistingMetadataStore implements ConcurrentMetadataStor
}
catch (Exception e) {
// not fatal for the functionality of the component
logger.warn("Failed to load entry from the persistent store. This may result in a duplicate " +
this.logger.warn("Failed to load entry from the persistent store. This may result in a duplicate " +
"entry after this component is restarted", e);
}
finally {
@@ -256,7 +256,7 @@ public class PropertiesPersistingMetadataStore implements ConcurrentMetadataStor
}
catch (Exception e2) {
// non fatal
logger.warn("Failed to close InputStream for: " + this.file.getAbsolutePath());
this.logger.warn("Failed to close InputStream for: " + this.file.getAbsolutePath());
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -240,7 +240,7 @@ public class RecipientListRouter extends AbstractMessageRouter
}
private MessageSelector getSelector() {
return selector;
return this.selector;
}
public MessageChannel getChannel() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2015 the original author or authors.
* Copyright 2014-2016 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.
@@ -114,11 +114,11 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy
}
public Message<?> getRequest() {
return request;
return this.request;
}
public Object getReply() {
return reply;
return this.reply;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2015 the original author or authors.
* Copyright 2014-2016 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.
@@ -159,14 +159,14 @@ public class ScatterGatherHandler extends AbstractReplyProducingMessageHandler i
@Override
public void start() {
if (this.gatherEndpoint != null) {
gatherEndpoint.start();
this.gatherEndpoint.start();
}
}
@Override
public void stop() {
if (this.gatherEndpoint != null) {
gatherEndpoint.start();
this.gatherEndpoint.start();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -68,7 +68,7 @@ public class PollerMetadata {
}
public TransactionSynchronizationFactory getTransactionSynchronizationFactory() {
return transactionSynchronizationFactory;
return this.transactionSynchronizationFactory;
}
public void setTrigger(Trigger trigger) {
@@ -80,7 +80,7 @@ public class PollerMetadata {
}
public ErrorHandler getErrorHandler() {
return errorHandler;
return this.errorHandler;
}
public void setErrorHandler(ErrorHandler errorHandler) {
@@ -131,7 +131,7 @@ public class PollerMetadata {
}
public long getSendTimeout() {
return sendTimeout;
return this.sendTimeout;
}
public void setSendTimeout(long sendTimeout) {

View File

@@ -45,7 +45,7 @@ public abstract class AbstractBatchingMessageGroupStore implements BasicMessageG
}
public int getRemoveBatchSize() {
return removeBatchSize;
return this.removeBatchSize;
}
/**

View File

@@ -371,7 +371,7 @@ public abstract class AbstractKeyValueMessageStore extends AbstractMessageGroupS
@Override
public MessageGroup next() {
Object messageGroupId = idIterator.next();
Object messageGroupId = this.idIterator.next();
return getMessageGroup(messageGroupId);
}

View File

@@ -90,7 +90,7 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG
}
public boolean isTimeoutOnIdle() {
return timeoutOnIdle;
return this.timeoutOnIdle;
}
/**
@@ -183,14 +183,14 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG
RuntimeException exception = null;
for (MessageGroupCallback callback : expiryCallbacks) {
for (MessageGroupCallback callback : this.expiryCallbacks) {
try {
callback.execute(this, group);
} catch (RuntimeException e) {
if (exception == null) {
exception = e;
}
logger.error("Exception in expiry callback", e);
this.logger.error("Exception in expiry callback", e);
}
}

Some files were not shown because too many files have changed in this diff Show More