diff --git a/build.gradle b/build.gradle index beecaba219..57c1e4a784 100644 --- a/build.gradle +++ b/build.gradle @@ -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" -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d8d2..2c6137b878 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2580126796..0b173e22b7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew b/gradlew index 91a7e269e1..9d82f78915 100755 --- a/gradlew +++ b/gradlew @@ -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` diff --git a/gradlew.bat b/gradlew.bat index aec99730b4..72d362dafd 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -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 diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java index 883ef9278d..f1db82ee6c 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java @@ -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 { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java index 82c4c0e619..011b29c20d 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.java @@ -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 headers = headerMapper.toHeadersFromRequest(message.getMessageProperties()); - if (messageListenerContainer.getAcknowledgeMode() == AcknowledgeMode.MANUAL) { + Object payload = AmqpInboundChannelAdapter.this.messageConverter.fromMessage(message); + Map 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); } diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java index c31e8f6c36..d755f757a1 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java @@ -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 headers = headerMapper.toHeadersFromRequest(message.getMessageProperties()); - if (messageListenerContainer.getAcknowledgeMode() == AcknowledgeMode.MANUAL) { + Object payload = AmqpInboundGateway.this.amqpMessageConverter.fromMessage(message); + Map 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(); diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java index a015cd72be..376a211dfd 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java @@ -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(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) { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java index d7e75c1601..08d3e98822 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java @@ -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 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java index 8d1799f5c6..01deeb34e2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java @@ -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); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java index 475cc965f2..493d42c31c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java @@ -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> 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> 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> 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> 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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/BarrierMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/BarrierMessageHandler.java index a9bc9221fe..96d5464886 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/BarrierMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/BarrierMessageHandler.java @@ -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> 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); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java index bc6e41fb57..d75ec02920 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java @@ -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 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> 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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java index fc5f5889d2..7e0a6bd95f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingCorrelationStrategy.java @@ -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 { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java index d678a9c44f..c2eaf06741 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageGroupProcessor.java @@ -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 headers) { - return processor.process(group.getMessages()); + return this.processor.process(group.getMessages()); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageCountReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageCountReleaseStrategy.java index 099f6d60b4..ed25c39e37 100755 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageCountReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageCountReleaseStrategy.java @@ -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; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupExpiredEvent.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupExpiredEvent.java index 4aeed80bf7..23d2f4802b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupExpiredEvent.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupExpiredEvent.java @@ -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 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingCorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingCorrelationStrategy.java index 5372a1e0aa..f074a734ef 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingCorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingCorrelationStrategy.java @@ -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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessor.java index a27b5b116f..0d3fdc44a7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessor.java @@ -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 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageListProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageListProcessor.java index 4e6e2782b8..949efdb6d8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageListProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MethodInvokingMessageListProcessor.java @@ -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 extends AbstractExpressionEva private final MessagingMethodInvokerHelper delegate; public MethodInvokingMessageListProcessor(Object targetObject, Method method, Class expectedType) { - delegate = new MessagingMethodInvokerHelper(targetObject, method, expectedType, true); + this.delegate = new MessagingMethodInvokerHelper(targetObject, method, expectedType, true); } public MethodInvokingMessageListProcessor(Object targetObject, Method method) { - delegate = new MessagingMethodInvokerHelper(targetObject, method, true); + this.delegate = new MessagingMethodInvokerHelper(targetObject, method, true); } public MethodInvokingMessageListProcessor(Object targetObject, String methodName, Class expectedType) { - delegate = new MessagingMethodInvokerHelper(targetObject, methodName, + this.delegate = new MessagingMethodInvokerHelper(targetObject, methodName, expectedType, true); } public MethodInvokingMessageListProcessor(Object targetObject, String methodName) { - delegate = new MessagingMethodInvokerHelper(targetObject, methodName, true); + this.delegate = new MessagingMethodInvokerHelper(targetObject, methodName, true); } public MethodInvokingMessageListProcessor(Object targetObject, Class annotationType) { - delegate = new MessagingMethodInvokerHelper(targetObject, annotationType, Object.class, true); + this.delegate = new MessagingMethodInvokerHelper(targetObject, annotationType, Object.class, true); } @Override @@ -65,12 +65,12 @@ public class MethodInvokingMessageListProcessor extends AbstractExpressionEva } public String toString() { - return delegate.toString(); + return this.delegate.toString(); } public T process(Collection> messages, Map aggregateHeaders) { try { - return delegate.process(messages, aggregateHeaders); + return this.delegate.process(messages, aggregateHeaders); } catch (RuntimeException e) { throw e; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java index 29c01d37cf..0e9bcf06f9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java @@ -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> messages = messageGroup.getMessages(); - if (releasePartialSequences && !messages.isEmpty()) { + if (this.releasePartialSequences && !messages.isEmpty()) { if (logger.isTraceEnabled()) { logger.trace("Considering partial release of group [" + messageGroup + "]"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/TimeoutCountSequenceSizeReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/TimeoutCountSequenceSizeReleaseStrategy.java index 14af8f3df8..4f7766ed8b 100755 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/TimeoutCountSequenceSizeReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/TimeoutCountSequenceSizeReleaseStrategy.java @@ -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; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractExecutorChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractExecutorChannel.java index 2594d90489..ba726b6245 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractExecutorChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractExecutorChannel.java @@ -137,7 +137,7 @@ public abstract class AbstractExecutorChannel extends AbstractSubscribableChanne Assert.notNull(messageHandler, "'messageHandler' must not be null"); Deque interceptorStack = null; try { - if (executorInterceptorsSize > 0) { + if (AbstractExecutorChannel.this.executorInterceptorsSize > 0) { interceptorStack = new ArrayDeque(); message = applyBeforeHandle(message, interceptorStack); if (message == null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java index 4d4ba5505d..c3f1906c0c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java @@ -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 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); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractSubscribableChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractSubscribableChannel.java index 7bbb21b476..180a0be054 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractSubscribableChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractSubscribableChannel.java @@ -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)."); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java index 45f9778548..394743bf64 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java @@ -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; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/FixedSubscriberChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/FixedSubscriberChannel.java index f6778f35c6..e040009220 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/FixedSubscriberChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/FixedSubscriberChannel.java @@ -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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java index 9ae2b692ae..2a522528bb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessagePublishingErrorHandler.java @@ -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); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/NullChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/NullChannel.java index a0b3da8784..e4f69b846c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/NullChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/NullChannel.java @@ -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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java index 40ac2295a5..03548ce9f7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java @@ -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(){ diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java index 66871cdc11..e408adc1d7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/ThreadStatePropagationChannelInterceptor.java @@ -115,8 +115,8 @@ public abstract class ThreadStatePropagationChannelInterceptor @Override public String toString() { return "MessageWithThreadState{" + - "message=" + message + - ", state=" + state + + "message=" + this.message + + ", state=" + this.state + '}'; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/CodecMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/CodecMessageConverter.java index 324ddf0aef..8238d3190d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/CodecMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/CodecMessageConverter.java @@ -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); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoCodec.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoCodec.java index e26be2c2f4..f4a5991a14 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoCodec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoCodec.java @@ -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 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoRegistrar.java index 084002da2a..8cb755153a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/AbstractKryoRegistrar.java @@ -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())); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/CompositeKryoRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/CompositeKryoRegistrar.java index 53d73ef10e..f9fcadf7ce 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/CompositeKryoRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/CompositeKryoRegistrar.java @@ -45,7 +45,7 @@ public class CompositeKryoRegistrar extends AbstractKryoRegistrar { @Override public List getRegistrations() { List registrations = new ArrayList(); - for (KryoRegistrar registrar : delegates) { + for (KryoRegistrar registrar : this.delegates) { registrations.addAll(registrar.getRegistrations()); } return registrations; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java index 3416af4497..8868eda7c5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java @@ -179,12 +179,12 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean 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 getChannelNames() { - return channelNames; + return this.channelNames; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/ConsumerEndpointFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/ConsumerEndpointFactoryBean.java index 0ad79a473d..2b627f1ade 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/ConsumerEndpointFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/ConsumerEndpointFactoryBean.java @@ -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 { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java index cb062e6972..ab6a340099 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java @@ -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) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java index 27c9293f2f..44de23a474 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/FilterFactoryBean.java @@ -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); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/IdGeneratorConfigurer.java b/spring-integration-core/src/main/java/org/springframework/integration/config/IdGeneratorConfigurer.java index 2df11d8036..7feed854b0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/IdGeneratorConfigurer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/IdGeneratorConfigurer.java @@ -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 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 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); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/SpelFunctionFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/SpelFunctionFactoryBean.java index 8f533143f7..3e4d71c7aa 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/SpelFunctionFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/SpelFunctionFactoryBean.java @@ -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, Initializin } public String getFunctionName() { - return functionName; + return this.functionName; } @Override @@ -75,7 +75,7 @@ public class SpelFunctionFactoryBean implements FactoryBean, Initializin @Override public Method getObject() throws Exception { - return method; + return this.method; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/SpelPropertyAccessorRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/config/SpelPropertyAccessorRegistrar.java index fb7717cc5e..e792dd9e71 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/SpelPropertyAccessorRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/SpelPropertyAccessorRegistrar.java @@ -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 getPropertyAccessors() { - return propertyAccessors; + return this.propertyAccessors; } void addPropertyAccessor(String name, PropertyAccessor propertyAccessor) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/SplitterFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/SplitterFactoryBean.java index 950cac814f..a1ae4782f8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/SplitterFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/SplitterFactoryBean.java @@ -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); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java index 490c293b85..2c8b2b23de 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java @@ -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> 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, List> annotationChains = new HashMap, List>(); - for (Class annotationType : postProcessors.keySet()) { + for (Class annotationType : + MessagingAnnotationPostProcessor.this.postProcessors.keySet()) { if (AnnotatedElementUtils.isAnnotated(method, annotationType.getName())) { List annotationChain = getAnnotationChain(method, annotationType); if (annotationChain.size() > 0) { @@ -152,7 +159,8 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean for (Map.Entry, List> entry : annotationChains.entrySet()) { Class annotationType = entry.getKey(); List 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); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java index 3a36650a86..df057294f3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ChainParser.java @@ -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."); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java index 3ff0f0ba26..3cc94db414 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java @@ -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 [" diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/ConverterRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/context/ConverterRegistrar.java index 1737ee0551..a955854723 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/ConverterRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/ConverterRegistrar.java @@ -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 + "'"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java index 6e4a94f1f1..02c74a126d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java @@ -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; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java index 9ea30aa088..5aafb907da 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java @@ -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 getHandlers() { - return handlers.asUnmodifiableSet(); + return this.handlers.asUnmodifiableSet(); } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java index 548f425e74..9b2f24a092 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AggregateMessageDeliveryException.java @@ -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."); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java index 2626d24eec..d53516c13c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java @@ -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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySet.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySet.java index ab6525ebbf..d60c35b814 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySet.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySet.java @@ -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 implements Set { 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 elements; private final Set unmodifiableElements; OrderedAwareCopyOnWriteArraySet() { - elements = new CopyOnWriteArraySet(); - unmodifiableElements = Collections.unmodifiableSet(elements); + this.elements = new CopyOnWriteArraySet(); + this.unmodifiableElements = Collections.unmodifiableSet(this.elements); } public Set asUnmodifiableSet() { - return unmodifiableElements; + return this.unmodifiableElements; } /** @@ -86,19 +86,19 @@ class OrderedAwareCopyOnWriteArraySet implements Set { @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 implements Set { @Override public boolean addAll(Collection 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 implements Set { return true; } finally { - writeLock.unlock(); + this.writeLock.unlock(); } } @@ -125,14 +125,14 @@ class OrderedAwareCopyOnWriteArraySet implements Set { */ @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 implements Set { 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[] 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 implements Set { } } 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; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/RoundRobinLoadBalancingStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/RoundRobinLoadBalancingStrategy.java index 41e15d24c8..2901fcbc4e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/RoundRobinLoadBalancingStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/RoundRobinLoadBalancingStrategy.java @@ -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 { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractPollingEndpoint.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractPollingEndpoint.java index 6a0fbba5d6..5e84bef8ff 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractPollingEndpoint.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractPollingEndpoint.java @@ -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 receiveOnlyAdviceChain = new ArrayList(); - 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 pollingTask = new Callable() { + @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 pollingTask; - private Poller(Callable 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 } } } + }); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java index 0a8f3a8b7e..583378de92 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java @@ -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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MessageProducerSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MessageProducerSupport.java index 70ed970656..7f7c5fe258 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MessageProducerSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/MessageProducerSupport.java @@ -81,7 +81,7 @@ public abstract class MessageProducerSupport extends AbstractEndpoint implements } protected MessagingTemplate getMessagingTemplate() { - return messagingTemplate; + return this.messagingTemplate; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java index b24518afcc..82b2276f9e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java @@ -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; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/event/IntegrationEvent.java b/spring-integration-core/src/main/java/org/springframework/integration/event/IntegrationEvent.java index 7dae2b9790..cbf40c12fd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/event/IntegrationEvent.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/event/IntegrationEvent.java @@ -45,7 +45,7 @@ public abstract class IntegrationEvent extends ApplicationEvent { } public Throwable getCause() { - return cause; + return this.cause; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java index 139d81a0b5..81fe87b284 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java @@ -88,7 +88,7 @@ public final class ExpressionEvalMap extends AbstractMap { */ @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 { @Override public boolean containsKey(Object key) { - return original.containsKey(key); + return this.original.containsKey(key); } @Override public Set 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 { 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 { 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 { @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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java index 09f6cc56c4..ba81942e1e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java @@ -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) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/filter/ExpressionEvaluatingSelector.java b/spring-integration-core/src/main/java/org/springframework/integration/filter/ExpressionEvaluatingSelector.java index 0bc3a006cb..31ef2e739c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/filter/ExpressionEvaluatingSelector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/filter/ExpressionEvaluatingSelector.java @@ -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 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java index a2bfc00cdf..54d2f2fc0c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java @@ -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 builder = (messageOrPayload instanceof Message) ? GatewayMethodInboundMessageMapper.this.messageBuilderFactory.fromMessage((Message) messageOrPayload) : GatewayMethodInboundMessageMapper.this.messageBuilderFactory.withPayload(messageOrPayload); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodMetadata.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodMetadata.java index 71ebffcd9d..4d24c95973 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodMetadata.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodMetadata.java @@ -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) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index 61de7d3432..7e59b39aef 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java index f1ec9e3966..021a826ae7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java @@ -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(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java index d78d6ad184..bde5fa9c7f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java @@ -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 } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/RequestReplyMessageHandlerAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/RequestReplyMessageHandlerAdapter.java index 0fbca43934..90c2c685af 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/RequestReplyMessageHandlerAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/RequestReplyMessageHandlerAdapter.java @@ -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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java index ab9812c839..beaefede82 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java @@ -116,7 +116,7 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan } } } - return outputChannel; + return this.outputChannel; } protected void sendOutputs(Object result, Message requestMessage) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java index beb40f6aab..1d46e0c93c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java @@ -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 adviceChain) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java index 07341a501e..64eeaa6b28 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java @@ -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()); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java index 6796419bd7..7573c01d19 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java @@ -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: diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java index 0c6042f132..98736dd7cc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java @@ -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(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) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageHandler.java index 6a026dcd3e..20cbf61407 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageHandler.java @@ -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, method); + this.processor = new MethodInvokingMessageProcessor(object, method); } public MethodInvokingMessageHandler(Object object, String methodName) { - processor = new MethodInvokingMessageProcessor(object, methodName); + this.processor = new MethodInvokingMessageProcessor(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 + "]"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageProcessor.java index 610e1223ec..e01feb30c0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MethodInvokingMessageProcessor.java @@ -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 extends AbstractMessageProcessor< private final MessagingMethodInvokerHelper delegate; public MethodInvokingMessageProcessor(Object targetObject, Method method) { - delegate = new MessagingMethodInvokerHelper(targetObject, method, false); + this.delegate = new MessagingMethodInvokerHelper(targetObject, method, false); } public MethodInvokingMessageProcessor(Object targetObject, String methodName) { - delegate = new MessagingMethodInvokerHelper(targetObject, methodName, false); + this.delegate = new MessagingMethodInvokerHelper(targetObject, methodName, false); } public MethodInvokingMessageProcessor(Object targetObject, String methodName, boolean canProcessMessageList) { - delegate = new MessagingMethodInvokerHelper(targetObject, methodName, canProcessMessageList); + this.delegate = new MessagingMethodInvokerHelper(targetObject, methodName, canProcessMessageList); } public MethodInvokingMessageProcessor(Object targetObject, Class annotationType) { - delegate = new MessagingMethodInvokerHelper(targetObject, annotationType, false); + this.delegate = new MessagingMethodInvokerHelper(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 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); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java index db776c6ca4..e4b02b4bde 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ServiceActivatingHandler.java @@ -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) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java index 6054672abd..d1506566d8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java @@ -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"); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java index c29b423bf3..69c8a930e7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ErrorMessageSendingRecoverer.java @@ -80,7 +80,7 @@ public class ErrorMessageSendingRecoverer implements RecoveryCallback, 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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java index b72894a1dd..efadd99296 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java @@ -228,7 +228,7 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan } public Object getEvaluationResult() { - return evaluationResult; + return this.evaluationResult; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/IdempotentReceiverInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/IdempotentReceiverInterceptor.java index eafe0d8260..3d6416cdc7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/IdempotentReceiverInterceptor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/IdempotentReceiverInterceptor.java @@ -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"); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerCircuitBreakerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerCircuitBreakerAdvice.java index 549a0bcb11..0e364fdab0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerCircuitBreakerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerCircuitBreakerAdvice.java @@ -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; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java index 37555793d7..1656362d95 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java @@ -86,7 +86,7 @@ public class RequestHandlerRetryAdvice extends AbstractRequestHandlerAdvice messageHolder.set(message); try { - return retryTemplate.execute(new RetryCallback() { + return this.retryTemplate.execute(new RetryCallback() { @Override public Object doWithRetry(RetryContext context) throws Exception { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java index 4cc5774fc6..cbb8a57aba 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryConfigurer.java @@ -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); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java index 83bf6d0340..d44c7d8b49 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonPropertyAccessor.java @@ -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(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/leader/DefaultCandidate.java b/spring-integration-core/src/main/java/org/springframework/integration/leader/DefaultCandidate.java index 7b7391b9a7..16a7eeb540 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/leader/DefaultCandidate.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/leader/DefaultCandidate.java @@ -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(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java b/spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java index 89b4a3f0dc..3783cbcf72 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java @@ -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 + "]"; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/leader/event/DefaultLeaderEventPublisher.java b/spring-integration-core/src/main/java/org/springframework/integration/leader/event/DefaultLeaderEventPublisher.java index 7597356919..965f241f57 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/leader/event/DefaultLeaderEventPublisher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/leader/event/DefaultLeaderEventPublisher.java @@ -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)); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java index d967f563f9..402464f990 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java @@ -205,8 +205,8 @@ public abstract class AbstractHeaderMapper 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 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 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 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 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 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; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/AdviceMessage.java b/spring-integration-core/src/main/java/org/springframework/integration/message/AdviceMessage.java index 171fe741db..c442f9deac 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/AdviceMessage.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/message/AdviceMessage.java @@ -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 { } public Message getInputMessage() { - return inputMessage; + return this.inputMessage; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/PropertiesPersistingMetadataStore.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/PropertiesPersistingMetadataStore.java index f2c98e46d0..e22d8ad1d2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/PropertiesPersistingMetadataStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/PropertiesPersistingMetadataStore.java @@ -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()); } } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java index 9796820461..8c079b5b21 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java @@ -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() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java index e4c17914b9..70d54758ec 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/routingslip/ExpressionEvaluatingRoutingSlipRouteStrategy.java @@ -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; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java index 0741650741..e96acbb822 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java @@ -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(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java index 228e697dbc..58a79a143c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java @@ -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) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java index 66e834a5fa..18a1fd03db 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractBatchingMessageGroupStore.java @@ -45,7 +45,7 @@ public abstract class AbstractBatchingMessageGroupStore implements BasicMessageG } public int getRemoveBatchSize() { - return removeBatchSize; + return this.removeBatchSize; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java index f9da1a794a..987014e148 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java @@ -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); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java index 8e887df482..3d920903ba 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java @@ -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); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupMetadata.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupMetadata.java index 015e4ff053..9809551810 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupMetadata.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupMetadata.java @@ -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. @@ -117,7 +117,7 @@ public class MessageGroupMetadata implements Serializable { } public long getLastModified() { - return lastModified; + return this.lastModified; } public long getTimestamp() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupQueue.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupQueue.java index 9bb9726efd..dd6ba437a3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupQueue.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupQueue.java @@ -88,8 +88,8 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc this.messageGroupStore = messageGroupStore; this.groupId = groupId; this.capacity = capacity; - if (logger.isWarnEnabled() && !(messageGroupStore instanceof ChannelMessageStore)) { - logger.warn(messageGroupStore.getClass().getSimpleName() + " is not optimized for use " + if (this.logger.isWarnEnabled() && !(messageGroupStore instanceof ChannelMessageStore)) { + this.logger.warn(messageGroupStore.getClass().getSimpleName() + " is not optimized for use " + "in a 'MessageGroupQueue'; consider using a `ChannelMessageStore'"); } } @@ -106,9 +106,9 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc "When using priority, the 'PriorityCapableChannelMessageStore' must have priority enabled."); } else { - if (logger.isWarnEnabled() && this.messageGroupStore instanceof PriorityCapableChannelMessageStore + if (this.logger.isWarnEnabled() && this.messageGroupStore instanceof PriorityCapableChannelMessageStore && ((PriorityCapableChannelMessageStore) this.messageGroupStore).isPriorityEnabled()) { - logger.warn("It's not recommended to use a priority-based message store " + + this.logger.warn("It's not recommended to use a priority-based message store " + "when declaring a non-priority 'MessageGroupQueue'; message retrieval may not be FIFO; " + "set 'priority' to 'true' if that is your intent. If you are using the namespace to " + "define a channel, use ' instead."); @@ -123,7 +123,7 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc @Override public int size() { - return messageGroupStore.messageGroupSize(groupId); + return this.messageGroupStore.messageGroupSize(this.groupId); } @Override @@ -201,10 +201,10 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc try { storeLock.lockInterruptibly(); try { - Message message = this.messageGroupStore.pollMessageFromGroup(groupId); + Message message = this.messageGroupStore.pollMessageFromGroup(this.groupId); for (int i = 0; i < maxElements && message != null; i++) { list.add(message); - message = this.messageGroupStore.pollMessageFromGroup(groupId); + message = this.messageGroupStore.pollMessageFromGroup(this.groupId); } this.messageStoreNotFull.signal(); } @@ -213,7 +213,7 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc } } catch (InterruptedException e) { - logger.warn("Queue may not have drained completely since this operation was interrupted", e); + this.logger.warn("Queue may not have drained completely since this operation was interrupted", e); Thread.currentThread().interrupt(); } collection.addAll(list); @@ -247,8 +247,8 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc final Lock storeLock = this.storeLock; storeLock.lockInterruptibly(); try { - if (capacity != Integer.MAX_VALUE) { - while (this.size() == capacity && timeoutInNanos > 0){ + if (this.capacity != Integer.MAX_VALUE) { + while (this.size() == this.capacity && timeoutInNanos > 0){ timeoutInNanos = this.messageStoreNotFull.awaitNanos(timeoutInNanos); } } @@ -267,8 +267,8 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc final Lock storeLock = this.storeLock; storeLock.lockInterruptibly(); try { - if (capacity != Integer.MAX_VALUE) { - while (this.size() == capacity){ + if (this.capacity != Integer.MAX_VALUE) { + while (this.size() == this.capacity){ this.messageStoreNotFull.await(); } } @@ -281,10 +281,10 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc @Override public int remainingCapacity() { - if (capacity == Integer.MAX_VALUE) { + if (this.capacity == Integer.MAX_VALUE) { return Integer.MAX_VALUE; } - return capacity - this.size(); + return this.capacity - this.size(); } @Override @@ -307,7 +307,7 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc } private Collection> getMessages(){ - return messageGroupStore.getMessageGroup(groupId).getMessages(); + return this.messageGroupStore.getMessageGroup(this.groupId).getMessages(); } /** @@ -315,7 +315,7 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc * IllegalMonitorStateException may be thrown */ private Message doPoll() { - Message message = this.messageGroupStore.pollMessageFromGroup(groupId); + Message message = this.messageGroupStore.pollMessageFromGroup(this.groupId); this.messageStoreNotFull.signal(); return message; } @@ -326,8 +326,8 @@ public class MessageGroupQueue extends AbstractQueue> implements Bloc */ private boolean doOffer(Message message){ boolean offered = false; - if (capacity == Integer.MAX_VALUE || this.size() < capacity){ - messageGroupStore.addMessageToGroup(groupId, message); + if (this.capacity == Integer.MAX_VALUE || this.size() < this.capacity){ + this.messageGroupStore.addMessageToGroup(this.groupId, message); offered = true; this.messageStoreNotEmpty.signal(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java index d134f4b425..ffc75c2dce 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java @@ -87,7 +87,7 @@ public class SimpleMessageGroup implements MessageGroup { @Override public long getTimestamp() { - return timestamp; + return this.timestamp; } public void setLastModified(long lastModified){ @@ -96,7 +96,7 @@ public class SimpleMessageGroup implements MessageGroup { @Override public long getLastModified() { - return lastModified; + return this.lastModified; } @Override @@ -114,7 +114,7 @@ public class SimpleMessageGroup implements MessageGroup { @Override public int getLastReleasedMessageSequenceNumber() { - return lastReleasedMessageSequence; + return this.lastReleasedMessageSequence; } private boolean addMessage(Message message) { @@ -123,7 +123,7 @@ public class SimpleMessageGroup implements MessageGroup { @Override public Collection> getMessages() { - return Collections.unmodifiableCollection(messages); + return Collections.unmodifiableCollection(this.messages); } public void setLastReleasedMessageSequenceNumber(int sequenceNumber){ @@ -132,7 +132,7 @@ public class SimpleMessageGroup implements MessageGroup { @Override public Object getGroupId() { - return groupId; + return this.groupId; } @Override @@ -173,10 +173,10 @@ public class SimpleMessageGroup implements MessageGroup { @Override public String toString() { return "SimpleMessageGroup{" + - "groupId=" + groupId + - ", messages=" + messages + - ", timestamp=" + timestamp + - ", lastModified=" + lastModified + + "groupId=" + this.groupId + + ", messages=" + this.messages + + ", timestamp=" + this.timestamp + + ", lastModified=" + this.lastModified + '}'; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index ec5bed63c0..d03007c764 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -164,13 +164,13 @@ public class SimpleMessageStore extends AbstractMessageGroupStore @Override @ManagedAttribute public long getMessageCount() { - return idToMessage.size(); + return this.idToMessage.size(); } @Override public Message addMessage(Message message) { this.isUsed = true; - if (!individualUpperBound.tryAcquire(this.upperBoundTimeout)) { + if (!this.individualUpperBound.tryAcquire(this.upperBoundTimeout)) { throw new MessagingException(this.getClass().getSimpleName() + " was out of capacity (" + this.individualCapacity @@ -203,7 +203,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore public MessageGroup getMessageGroup(Object groupId) { Assert.notNull(groupId, "'groupId' must not be null"); - MessageGroup group = groupIdToMessageGroup.get(groupId); + MessageGroup group = this.groupIdToMessageGroup.get(groupId); if (group == null) { return getMessageGroupFactory().create(groupId); } @@ -370,7 +370,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore @Override public Iterator iterator() { - return new HashSet(groupIdToMessageGroup.values()).iterator(); + return new HashSet(this.groupIdToMessageGroup.values()).iterator(); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/PartialSuccessException.java b/spring-integration-core/src/main/java/org/springframework/integration/support/PartialSuccessException.java index 60a3fd2462..fbedf66833 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/PartialSuccessException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/PartialSuccessException.java @@ -96,7 +96,7 @@ public class PartialSuccessException extends MessagingException { @Override public String toString() { return "PartialSuccessException [" + getMessage() + ":" + getCause().getMessage() - + ", partialResults=" + partialResults + ", derivedInput=" + derivedInput + + ", partialResults=" + this.partialResults + ", derivedInput=" + this.derivedInput + ", failedMessage=" + getFailedMessage() + "]"; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java index f0f26c3ef0..bd819dc54f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java @@ -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. @@ -114,7 +114,7 @@ public class MapMessageConverter implements MessageConverter, BeanFactoryAware { Map map = new HashMap(); map.put("payload", message.getPayload()); Map headers = new HashMap(); - for (String headerName : headerNames) { + for (String headerName : this.headerNames) { Object header = message.getHeaders().get(headerName); if (header != null) { headers.put(headerName, header); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJacksonJsonMessageParser.java b/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJacksonJsonMessageParser.java index 2138fc978d..dac7f81e4b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJacksonJsonMessageParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJacksonJsonMessageParser.java @@ -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. @@ -83,11 +83,11 @@ abstract class AbstractJacksonJsonMessageParser

implements JsonInboundMessage protected Object readPayload(P parser, String jsonMessage) throws Exception { try { - return objectMapper.fromJson(parser, this.messageMapper.getPayloadType()); + return this.objectMapper.fromJson(parser, this.messageMapper.getPayloadType()); } catch (Exception e) { throw new IllegalArgumentException("Mapping of JSON message '" + jsonMessage + - "' to payload type '" + messageMapper.getPayloadType() + "' failed.", e); + "' to payload type '" + this.messageMapper.getPayloadType() + "' failed.", e); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java index 88b83d0d87..764c6b361b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java @@ -63,9 +63,9 @@ public final class DefaultLockRegistry implements LockRegistry { Assert.isTrue(bits.length() < 32 && (mask == 0 || bits.lastIndexOf('0') < bits.indexOf('1') ), "Mask must be a power of 2 - 1"); this.mask = mask; int arraySize = this.mask+1; - lockTable = new ReentrantLock[arraySize]; + this.lockTable = new ReentrantLock[arraySize]; for (int i = 0; i < arraySize; i++) { - lockTable[i] = new ReentrantLock(); + this.lockTable[i] = new ReentrantLock(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageChannelMetrics.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageChannelMetrics.java index de852fece5..16f1e54d7d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageChannelMetrics.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageChannelMetrics.java @@ -48,7 +48,7 @@ public abstract class AbstractMessageChannelMetrics implements ConfigurableMetri } protected boolean isFullStatsEnabled() { - return fullStatsEnabled; + return this.fullStatsEnabled; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageHandlerMetrics.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageHandlerMetrics.java index 311c483159..780c57bef9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageHandlerMetrics.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AbstractMessageHandlerMetrics.java @@ -48,7 +48,7 @@ public abstract class AbstractMessageHandlerMetrics implements ConfigurableMetri } protected boolean isFullStatsEnabled() { - return fullStatsEnabled; + return this.fullStatsEnabled; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AggregatingMessageChannelMetrics.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AggregatingMessageChannelMetrics.java index e139263240..4f30305d77 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/AggregatingMessageChannelMetrics.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/AggregatingMessageChannelMetrics.java @@ -70,7 +70,7 @@ public class AggregatingMessageChannelMetrics extends DefaultMessageChannelMetri long count = this.sendCount.getAndIncrement(); if (isFullStatsEnabled() && count % this.sampleSize == 0) { this.start = System.nanoTime(); - this.sendRate.increment(start); + this.sendRate.increment(this.start); } return new AggregatingChannelMetricsContext(this.start, count + 1); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/DefaultMessageChannelMetrics.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/DefaultMessageChannelMetrics.java index b3c30ae766..60927c5694 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/DefaultMessageChannelMetrics.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/DefaultMessageChannelMetrics.java @@ -92,7 +92,7 @@ public class DefaultMessageChannelMetrics extends AbstractMessageChannelMetrics public void destroy() { if (logger.isDebugEnabled()) { - logger.debug(sendDuration); + logger.debug(this.sendDuration); } } @@ -245,7 +245,7 @@ public class DefaultMessageChannelMetrics extends AbstractMessageChannelMetrics public String toString() { return String.format("MessageChannelMonitor: [name=%s, sends=%d" + (this.receiveCount.get() == 0 ? "" : this.receiveCount.get()) - + "]", name, sendCount.get()); + + "]", name, this.sendCount.get()); } protected static class DefaultChannelMetricsContext implements MetricsContext { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverage.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverage.java index d7df6003ea..216b887779 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverage.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverage.java @@ -78,10 +78,10 @@ public class ExponentialMovingAverage { } public synchronized void reset() { - count = 0; - min = Double.MAX_VALUE; - max = 0; - samples.clear(); + this.count = 0; + this.min = Double.MAX_VALUE; + this.max = 0; + this.samples.clear(); } /** @@ -92,8 +92,8 @@ public class ExponentialMovingAverage { if (this.samples.size() == this.retention) { this.samples.poll(); } - samples.add(value); - count++;//NOSONAR - false positive, we're synchronized + this.samples.add(value); + this.count++;//NOSONAR - false positive, we're synchronized } private Statistics calc() { @@ -139,14 +139,14 @@ public class ExponentialMovingAverage { * @return the number of measurements recorded */ public int getCount() { - return (int) count; + return (int) this.count; } /** * @return the number of measurements recorded */ public long getCountLong() { - return count; + return this.count; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRate.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRate.java index 0d6deaec91..6389defdc5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRate.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRate.java @@ -98,7 +98,7 @@ public class ExponentialMovingAverageRate { this.max = 0; this.count = 0; this.times.clear(); - t0 = System.nanoTime() / this.factor; + this.t0 = System.nanoTime() / this.factor; } /** @@ -127,7 +127,7 @@ public class ExponentialMovingAverageRate { copy = new ArrayList(this.times); count = this.count; } - ExponentialMovingAverage rates = new ExponentialMovingAverage(window); + ExponentialMovingAverage rates = new ExponentialMovingAverage(this.window); double t0 = 0; double sum = 0; double weight = 0; @@ -144,14 +144,14 @@ public class ExponentialMovingAverageRate { continue; } double delta = t - t0; - double value = delta > 0 ? delta / period : 0; + double value = delta > 0 ? delta / this.period : 0; if (value > max) { max = value; } if (value < min) { min = value; } - double alpha = Math.exp(-delta * lapse); + double alpha = Math.exp(-delta * this.lapse); t0 = t; sum = alpha * sum + value; weight = alpha * weight + 1; @@ -203,7 +203,7 @@ public class ExponentialMovingAverageRate { } double t0 = lastTime(); double t = System.nanoTime() / this.factor; - double value = t > t0 ? (t - t0) / period : 0; + double value = t > t0 ? (t - t0) / this.period : 0; return count / (count / calc().getMean() + value); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRatio.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRatio.java index f3816c4594..62b89b0be1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRatio.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/ExponentialMovingAverageRatio.java @@ -84,7 +84,7 @@ public class ExponentialMovingAverageRatio { this.window = window; this.retention = window * 5; this.factor = millis ? 1000000 : 1; - this.t0 = System.nanoTime() / factor; + this.t0 = System.nanoTime() / this.factor; } @@ -119,7 +119,7 @@ public class ExponentialMovingAverageRatio { } public synchronized void reset() { - t0 = System.nanoTime() / this.factor; + this.t0 = System.nanoTime() / this.factor; this.times.clear(); this.values.clear(); this.count = 0; @@ -146,7 +146,7 @@ public class ExponentialMovingAverageRatio { copyValues = new ArrayList(this.values); count = this.count; } - ExponentialMovingAverage cumulative = new ExponentialMovingAverage(window); + ExponentialMovingAverage cumulative = new ExponentialMovingAverage(this.window); double t0 = 0; double sum = 0; double weight = 0; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/IntegrationManagementConfigurer.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/IntegrationManagementConfigurer.java index d73151f1e2..e861dded70 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/IntegrationManagementConfigurer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/IntegrationManagementConfigurer.java @@ -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. @@ -141,7 +141,7 @@ public class IntegrationManagementConfigurer implements SmartInitializingSinglet } public Boolean getDefaultCountsEnabled() { - return defaultCountsEnabled; + return this.defaultCountsEnabled; } /** @@ -154,7 +154,7 @@ public class IntegrationManagementConfigurer implements SmartInitializingSinglet } public Boolean getDefaultStatsEnabled() { - return defaultStatsEnabled; + return this.defaultStatsEnabled; } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/management/LifecycleMessageSourceMetrics.java b/spring-integration-core/src/main/java/org/springframework/integration/support/management/LifecycleMessageSourceMetrics.java index 2744d88c72..6c45403798 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/management/LifecycleMessageSourceMetrics.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/management/LifecycleMessageSourceMetrics.java @@ -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. @@ -88,32 +88,32 @@ public class LifecycleMessageSourceMetrics implements MessageSourceMetrics, Life @Override public void setCountsEnabled(boolean countsEnabled) { - delegate.setCountsEnabled(countsEnabled); + this.delegate.setCountsEnabled(countsEnabled); } @Override public boolean isCountsEnabled() { - return delegate.isCountsEnabled(); + return this.delegate.isCountsEnabled(); } @Override public void setLoggingEnabled(boolean enabled) { - delegate.setLoggingEnabled(enabled); + this.delegate.setLoggingEnabled(enabled); } @Override public boolean isLoggingEnabled() { - return delegate.isLoggingEnabled(); + return this.delegate.isLoggingEnabled(); } @Override public void setManagedName(String name) { - delegate.setManagedName(name); + this.delegate.setManagedName(name); } @Override public void setManagedType(String source) { - delegate.setManagedType(source); + this.delegate.setManagedType(source); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/DefaultTransactionSynchronizationFactory.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/DefaultTransactionSynchronizationFactory.java index 2d98f62a78..845cd97543 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/DefaultTransactionSynchronizationFactory.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/DefaultTransactionSynchronizationFactory.java @@ -61,10 +61,10 @@ public class DefaultTransactionSynchronizationFactory implements TransactionSync @Override public void beforeCommit(boolean readOnly) { - if (logger.isTraceEnabled()) { - logger.trace("'pre-Committing' transactional resource"); + if (DefaultTransactionSynchronizationFactory.this.logger.isTraceEnabled()) { + DefaultTransactionSynchronizationFactory.this.logger.trace("'pre-Committing' transactional resource"); } - processor.processBeforeCommit(resourceHolder); + DefaultTransactionSynchronizationFactory.this.processor.processBeforeCommit(resourceHolder); } @Override @@ -75,22 +75,22 @@ public class DefaultTransactionSynchronizationFactory implements TransactionSync @Override protected void processResourceAfterCommit(IntegrationResourceHolder resourceHolder) { - if (logger.isTraceEnabled()) { - logger.trace("'Committing' transactional resource"); + if (DefaultTransactionSynchronizationFactory.this.logger.isTraceEnabled()) { + DefaultTransactionSynchronizationFactory.this.logger.trace("'Committing' transactional resource"); } - processor.processAfterCommit(resourceHolder); + DefaultTransactionSynchronizationFactory.this.processor.processAfterCommit(resourceHolder); } @Override public void afterCompletion(int status) { if (status != TransactionSynchronization.STATUS_COMMITTED) { - if (logger.isTraceEnabled()) { - logger.trace("'Rolling back' transactional resource"); + if (DefaultTransactionSynchronizationFactory.this.logger.isTraceEnabled()) { + DefaultTransactionSynchronizationFactory.this.logger.trace("'Rolling back' transactional resource"); } - processor.processAfterRollback(resourceHolder); + DefaultTransactionSynchronizationFactory.this.processor.processAfterRollback(resourceHolder); } super.afterCompletion(status); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java index 616b27ddca..d21ee18865 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java @@ -47,7 +47,7 @@ public class IntegrationResourceHolder implements ResourceHolder { } public Message getMessage() { - return message; + return this.message; } /** @@ -67,7 +67,7 @@ public class IntegrationResourceHolder implements ResourceHolder { * @return the immutable map. */ public Map getAttributes() { - return Collections.unmodifiableMap(attributes); + return Collections.unmodifiableMap(this.attributes); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolderSynchronization.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolderSynchronization.java index fcfa4fb964..a2ee9400a1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolderSynchronization.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolderSynchronization.java @@ -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. @@ -36,7 +36,7 @@ public abstract class IntegrationResourceHolderSynchronization } public IntegrationResourceHolder getResourceHolder() { - return resourceHolder; + return this.resourceHolder; } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java index 769b7f22db..54a19eb0a2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java @@ -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. @@ -168,13 +168,13 @@ public class TransactionSynchronizationFactoryBean implements FactoryBean entry : nullResultPropertyExpressions.entrySet()) { String key = entry.getKey(); Expression value = entry.getValue(); - localMap.put(parser.parseExpression(key), value); + localMap.put(this.parser.parseExpression(key), value); } this.nullResultPropertyExpressions = localMap; } @@ -121,7 +121,7 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler for (Map.Entry entry : propertyExpressions.entrySet()) { String key = entry.getKey(); Expression value = entry.getValue(); - localMap.put(parser.parseExpression(key), value); + localMap.put(this.parser.parseExpression(key), value); } this.propertyExpressions = localMap; } @@ -290,12 +290,12 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler this.gateway.setReplyTimeout(this.replyTimeout); } - this.gateway.setReplyChannel(replyChannel); + this.gateway.setReplyChannel(this.replyChannel); if (this.replyChannelName != null) { this.gateway.setReplyChannelName(this.replyChannelName); } - this.gateway.setErrorChannel(errorChannel); + this.gateway.setErrorChannel(this.errorChannel); if (this.errorChannelName != null) { this.gateway.setErrorChannelName(this.errorChannelName); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java index c1500e6d01..4420f71e3e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java @@ -82,7 +82,7 @@ public class DecodingTransformer extends AbstractTransformer { protected T doTransform(Message message) throws Exception { Assert.isTrue(message.getPayload() instanceof byte[], "Message payload must be byte[]"); byte[] bytes = (byte[]) message.getPayload(); - return codec.decode(bytes, this.type != null ? this.type : type(message)); + return this.codec.decode(bytes, this.type != null ? this.type : type(message)); } @SuppressWarnings("unchecked") diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/EncodingPayloadTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/EncodingPayloadTransformer.java index df5a2354e6..336b298341 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/EncodingPayloadTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/EncodingPayloadTransformer.java @@ -38,7 +38,7 @@ public class EncodingPayloadTransformer extends AbstractPayloadTransformer transform(Message message) { AbstractIntegrationMessageBuilder builder = this.getMessageBuilderFactory().fromMessage(message); if (this.patternMatch){ - builder.removeHeaders(headersToRemove); + builder.removeHeaders(this.headersToRemove); } else { - for (String headerToRemove : headersToRemove) { + for (String headerToRemove : this.headersToRemove) { builder.removeHeader(headerToRemove); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java index 54ea3233b4..54a7be5c87 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java @@ -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 MapToObjectTransformer extends AbstractPayloadTransformer protected void onInit() { if (StringUtils.hasText(this.targetBeanName)) { Assert.isTrue(this.getBeanFactory().isPrototype(this.targetBeanName), - "target bean [" + targetBeanName + "] must have 'prototype' scope"); + "target bean [" + this.targetBeanName + "] must have 'prototype' scope"); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java index a15b816bd2..65bb14f3fd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java @@ -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 MessageTransformingHandler extends AbstractReplyProducingMessageHan @Override protected Object handleRequestMessage(Message message) { try { - return transformer.transform(message); + return this.transformer.transform(message); } catch (Exception e) { if (e instanceof MessageTransformationException) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/SyslogToMapTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/SyslogToMapTransformer.java index 2457a2ee27..94d74b2a26 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/SyslogToMapTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/SyslogToMapTransformer.java @@ -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. @@ -89,7 +89,7 @@ public class SyslogToMapTransformer extends AbstractPayloadTransformer transform(String payload) { Map map = new LinkedHashMap(); - Matcher matcher = pattern.matcher(payload); + Matcher matcher = this.pattern.matcher(payload); SimpleDateFormat dateFormat = dateFormats.poll(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("MMM dd HH:mm:ss"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java b/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java index ba3215b001..e4edc34c41 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java @@ -74,7 +74,7 @@ public abstract class AbstractExpressionEvaluator implements BeanFactoryAware, I } protected BeanFactory getBeanFactory() { - return beanFactory; + return this.beanFactory; } public void setConversionService(ConversionService conversionService) { @@ -114,7 +114,7 @@ public abstract class AbstractExpressionEvaluator implements BeanFactoryAware, I } this.evaluationContext.setTypeConverter(this.typeConverter); if (this.beanFactory != null) { - ConversionService conversionService = IntegrationUtils.getConversionService(beanFactory); + ConversionService conversionService = IntegrationUtils.getConversionService(this.beanFactory); if (conversionService != null) { this.typeConverter.setConversionService(conversionService); } @@ -130,14 +130,14 @@ public abstract class AbstractExpressionEvaluator implements BeanFactoryAware, I catch (EvaluationException e) { Throwable cause = e.getCause(); if (this.logger.isDebugEnabled()) { - logger.debug("SpEL Expression evaluation failed with EvaluationException.", e); + this.logger.debug("SpEL Expression evaluation failed with EvaluationException.", e); } throw new MessageHandlingException(message, "Expression evaluation failed: " + expression.getExpressionString(), cause == null ? e : cause); } catch (Exception e) { if (this.logger.isDebugEnabled()) { - logger.debug("SpEL Expression evaluation failed with Exception." + e); + this.logger.debug("SpEL Expression evaluation failed with Exception." + e); } throw new MessageHandlingException(message, "Expression evaluation failed: " + expression.getExpressionString(), e); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java index 001c7e7c73..bdc30ba0db 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java @@ -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 BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware if (beanFactory instanceof ConfigurableBeanFactory) { Object typeConverter = ((ConfigurableBeanFactory) beanFactory).getTypeConverter(); if (typeConverter instanceof SimpleTypeConverter) { - delegate = (SimpleTypeConverter) typeConverter; + this.delegate = (SimpleTypeConverter) typeConverter; } } } public boolean canConvert(Class sourceType, Class targetType) { - if (conversionService.canConvert(sourceType, targetType)) { + if (this.conversionService.canConvert(sourceType, targetType)) { return true; } if (!String.class.isAssignableFrom(sourceType) && !String.class.isAssignableFrom(targetType)) { @@ -85,13 +85,13 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware return false; } if (!String.class.isAssignableFrom(sourceType)) { - return delegate.findCustomEditor(sourceType, null) != null || this.getDefaultEditor(sourceType) != null; + return this.delegate.findCustomEditor(sourceType, null) != null || this.getDefaultEditor(sourceType) != null; } - return delegate.findCustomEditor(targetType, null) != null || this.getDefaultEditor(targetType) != null; + return this.delegate.findCustomEditor(targetType, null) != null || this.getDefaultEditor(targetType) != null; } public boolean canConvert(TypeDescriptor sourceTypeDescriptor, TypeDescriptor targetTypeDescriptor) { - if (conversionService.canConvert(sourceTypeDescriptor, targetTypeDescriptor)) { + if (this.conversionService.canConvert(sourceTypeDescriptor, targetTypeDescriptor)) { return true; } // TODO: what does this mean? This method is not used in SpEL so probably ignorable? @@ -119,11 +119,11 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware return value; } } - if (conversionService.canConvert(sourceType, targetType)) { - return conversionService.convert(value, sourceType, targetType); + if (this.conversionService.canConvert(sourceType, targetType)) { + return this.conversionService.convert(value, sourceType, targetType); } if (!String.class.isAssignableFrom(sourceType.getType())) { - PropertyEditor editor = delegate.findCustomEditor(sourceType.getType(), null); + PropertyEditor editor = this.delegate.findCustomEditor(sourceType.getType(), null); if (editor==null) { editor = this.getDefaultEditor(sourceType.getType()); } @@ -140,19 +140,19 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware } } synchronized (this.delegate) { - return delegate.convertIfNecessary(value, targetType.getType()); + return this.delegate.convertIfNecessary(value, targetType.getType()); } } private PropertyEditor getDefaultEditor(Class sourceType) { PropertyEditor defaultEditor; if (this.haveCalledDelegateGetDefaultEditor) { - defaultEditor= delegate.getDefaultEditor(sourceType); + defaultEditor= this.delegate.getDefaultEditor(sourceType); } else { synchronized(this) { // not thread-safe - it builds the defaultEditors field in-place (SPR-10191) - defaultEditor= delegate.getDefaultEditor(sourceType); + defaultEditor= this.delegate.getDefaultEditor(sourceType); } this.haveCalledDelegateGetDefaultEditor = true; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java b/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java index ce024fe805..bf8cf145ee 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/DynamicPeriodicTrigger.java @@ -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. @@ -106,7 +106,7 @@ public class DynamicPeriodicTrigger implements Trigger { } public long getPeriod() { - return period; + return this.period; } /** @@ -121,7 +121,7 @@ public class DynamicPeriodicTrigger implements Trigger { } public TimeUnit getTimeUnit() { - return timeUnit; + return this.timeUnit; } public void setTimeUnit(TimeUnit timeUnit) { @@ -130,11 +130,11 @@ public class DynamicPeriodicTrigger implements Trigger { } public long getInitialDelay() { - return initialDelay; + return this.initialDelay; } public boolean isFixedRate() { - return fixedRate; + return this.fixedRate; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java b/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java index c66a05b0b6..c1848b2827 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/ErrorHandlingTaskExecutor.java @@ -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,7 +55,7 @@ public class ErrorHandlingTaskExecutor implements TaskExecutor { task.run(); } catch (Throwable t) {//NOSONAR - errorHandler.handleError(t); + ErrorHandlingTaskExecutor.this.errorHandler.handleError(t); } } }); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java index 9ca108ecb3..3b2801e848 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java @@ -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,13 +86,13 @@ import org.springframework.util.StringUtils; * * @since 2.0 */ -public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator implements Lifecycle { +public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator implements Lifecycle { private static final String CANDIDATE_METHODS = "CANDIDATE_METHODS"; private static final String CANDIDATE_MESSAGE_METHODS = "CANDIDATE_MESSAGE_METHODS"; - private final Log logger = LogFactory.getLog(this.getClass()); + private static final Log logger = LogFactory.getLog(MessagingMethodInvokerHelper.class); private final Object targetObject; @@ -223,7 +223,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator this.targetObject = targetObject; this.requiresReply = expectedType != null; Map, HandlerMethod>> handlerMethodsForTarget = - this.findHandlerMethodsForTarget(targetObject, annotationType, methodName, requiresReply); + this.findHandlerMethodsForTarget(targetObject, annotationType, methodName, this.requiresReply); Map, HandlerMethod> handlerMethods = handlerMethodsForTarget.get(CANDIDATE_METHODS); Map, HandlerMethod> handlerMessageMethods = handlerMethodsForTarget.get(CANDIDATE_MESSAGE_METHODS); if ((handlerMethods.size() == 1 && handlerMessageMethods.isEmpty()) || @@ -286,13 +286,13 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator private boolean canReturnExpectedType(AnnotatedMethodFilter filter, Class targetType, TypeConverter typeConverter) { - if (expectedType == null) { + if (this.expectedType == null) { return true; } List methods = filter.filter(Arrays.asList(ReflectionUtils.getAllDeclaredMethods(targetType))); for (Method method : methods) { if (typeConverter.canConvert(TypeDescriptor.valueOf(method.getReturnType()), - TypeDescriptor.valueOf(expectedType))) { + TypeDescriptor.valueOf(this.expectedType))) { return true; } } @@ -379,7 +379,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } HandlerMethod handlerMethod = null; try { - handlerMethod = new HandlerMethod(method, canProcessMessageList); + handlerMethod = new HandlerMethod(method, MessagingMethodInvokerHelper.this.canProcessMessageList); } catch (IneligibleMethodException e) { if (logger.isDebugEnabled()) { @@ -477,7 +477,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } } if (frameworkMethods.size() == 1) { - HandlerMethod handlerMethod = new HandlerMethod(frameworkMethods.get(0), canProcessMessageList); + HandlerMethod handlerMethod = new HandlerMethod(frameworkMethods.get(0), this.canProcessMessageList); handlerMethods.put(CANDIDATE_METHODS, Collections., HandlerMethod>singletonMap(Object.class, handlerMethod)); handlerMethods.put(CANDIDATE_MESSAGE_METHODS, candidateMessageMethods); return handlerMethods; @@ -612,7 +612,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } private HandlerMethod findClosestMatch(Class payloadType) { - for (Map, HandlerMethod> handlerMethods : handlerMethodsList) { + for (Map, HandlerMethod> handlerMethods : this.handlerMethodsList) { Set> candidates = handlerMethods.keySet(); Class match = null; if (!CollectionUtils.isEmpty(candidates)) { @@ -689,7 +689,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } private boolean isMessageMethod() { - return messageMethod; + return this.messageMethod; } @Override @@ -758,7 +758,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator this.setExclusiveTargetParameterType(parameterTypeDescriptor, methodParameter); } else if (Collection.class.isAssignableFrom(parameterType) || parameterType.isArray()) { - if (canProcessMessageList) { + if (this.canProcessMessageList) { sb.append("messages.![payload]"); } else { @@ -767,7 +767,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator this.setExclusiveTargetParameterType(parameterTypeDescriptor, methodParameter); } else if (Iterator.class.isAssignableFrom(parameterType)) { - if (canProcessMessageList) { + if (this.canProcessMessageList) { Type type = method.getGenericParameterTypes()[i]; Type parameterizedType = null; if (type instanceof ParameterizedType){ @@ -807,7 +807,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } } if (hasUnqualifiedMapParameter) { - if (targetParameterType != null && Map.class.isAssignableFrom(this.targetParameterType)) { + if (this.targetParameterType != null && Map.class.isAssignableFrom(this.targetParameterType)) { throw new IllegalArgumentException( "Unable to determine payload matching parameter due to ambiguous Map typed parameters. " + "Consider adding the @Payload and or @Headers annotations as appropriate."); @@ -895,26 +895,26 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator } public Object getPayload() { - Assert.state(payload != null, "Invalid method parameter for payload: was expecting collection."); - return payload; + Assert.state(this.payload != null, "Invalid method parameter for payload: was expecting collection."); + return this.payload; } public Collection> getMessages() { - Assert.state(messages != null, "Invalid method parameter for messages: was expecting a single payload."); - return messages; + Assert.state(this.messages != null, "Invalid method parameter for messages: was expecting a single payload."); + return this.messages; } public Map getHeaders() { - return headers; + return this.headers; } public Message getMessage() { - return message; + return this.message; } public Class getFirstParameterType() { - if (payload != null) { - return payload.getClass(); + if (this.payload != null) { + return this.payload.getClass(); } return this.messages.getClass(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java b/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java index a7d81b9fc1..120da1d333 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java @@ -90,8 +90,8 @@ public class SimplePool implements Pool { public synchronized void setPoolSize(int poolSize) { int delta = poolSize - this.poolSize.get(); this.targetPoolSize.addAndGet(delta); - if (logger.isDebugEnabled()) { - logger.debug(String.format("Target pool size changed by %d, now %d", delta, this.targetPoolSize.get())); + if (this.logger.isDebugEnabled()) { + this.logger.debug(String.format("Target pool size changed by %d, now %d", delta, this.targetPoolSize.get())); } if (delta > 0) { this.poolSize.addAndGet(delta); @@ -112,8 +112,8 @@ public class SimplePool implements Pool { delta++; } } - if (delta < 0 && logger.isDebugEnabled()) { - logger.debug(String.format("Pool is overcommitted by %d; items will be removed when returned", -delta)); + if (delta < 0 && this.logger.isDebugEnabled()) { + this.logger.debug(String.format("Pool is overcommitted by %d; items will be removed when returned", -delta)); } } @@ -181,19 +181,19 @@ public class SimplePool implements Pool { private T doGetItem() { T item = this.available.poll(); - if (item != null && logger.isDebugEnabled()) { - logger.debug("Obtained " + item + " from pool."); + if (item != null && this.logger.isDebugEnabled()) { + this.logger.debug("Obtained " + item + " from pool."); } if (item == null) { item = this.callback.createForPool(); - if (logger.isDebugEnabled()) { - logger.debug("Obtained new " + item + "."); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Obtained new " + item + "."); } - allocated.add(item); + this.allocated.add(item); } else if (this.callback.isStale(item)) { - if (logger.isDebugEnabled()) { - logger.debug("Received a stale item " + item + ", will attempt to get a new one."); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Received a stale item " + item + ", will attempt to get a new one."); } doRemoveItem(item); item = doGetItem(); @@ -210,26 +210,26 @@ public class SimplePool implements Pool { Assert.isTrue(this.allocated.contains(item), "You can only release items that were obtained from the pool"); if (this.inUse.contains(item)) { - if (this.poolSize.get() > targetPoolSize.get()) { - poolSize.decrementAndGet(); + if (this.poolSize.get() > this.targetPoolSize.get()) { + this.poolSize.decrementAndGet(); if (item != null) { doRemoveItem(item); } } else { - if (logger.isDebugEnabled()){ - logger.debug("Releasing " + item + " back to the pool"); + if (this.logger.isDebugEnabled()){ + this.logger.debug("Releasing " + item + " back to the pool"); } if (item != null) { this.available.add(item); this.inUse.remove(item); } - permits.release(); + this.permits.release(); } } else { - if (logger.isDebugEnabled()){ - logger.debug("Ignoring release of " + item + " back to the pool - not in use"); + if (this.logger.isDebugEnabled()){ + this.logger.debug("Ignoring release of " + item + " back to the pool - not in use"); } } } @@ -242,8 +242,8 @@ public class SimplePool implements Pool { } private void doRemoveItem(T item) { - if (logger.isDebugEnabled()){ - logger.debug("Removing " + item + " from the pool"); + if (this.logger.isDebugEnabled()){ + this.logger.debug("Removing " + item + " from the pool"); } this.allocated.remove(item); this.inUse.remove(item); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java index baabffa390..718079d3b4 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java @@ -45,7 +45,7 @@ public final class UpperBound { } public int availablePermits(){ - if (semaphore == null){ + if (this.semaphore == null){ return Integer.MAX_VALUE; } return this.semaphore.availablePermits(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java index 585db6604d..f3e448dbb2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java @@ -42,7 +42,7 @@ public abstract class WhileLockedProcessor { this.lockRegistry = lockRegistry; } public final void doWhileLocked() throws IOException{ - Lock lock = lockRegistry.obtain(key); + Lock lock = this.lockRegistry.obtain(this.key); try { lock.lockInterruptibly(); try { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java index 071ed547cb..a4529e72a9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java @@ -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. @@ -233,7 +233,7 @@ public class ApplicationContextMessageBusTests { private CountDownLatch latch; - public FailingSource(CountDownLatch latch) { + FailingSource(CountDownLatch latch) { this.latch = latch; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java index 2f63e80c8c..753b569565 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/DispatchingChannelErrorHandlingTests.java @@ -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. @@ -148,7 +148,7 @@ public class DispatchingChannelErrorHandlingTests { @SuppressWarnings("serial") private static class TestTimedOutException extends RuntimeException { - public TestTimedOutException() { + TestTimedOutException() { super("timed out while waiting for latch"); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java index 2c845cd513..669bff6d68 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/ExecutorChannelTests.java @@ -222,7 +222,7 @@ public class ExecutorChannelTests { private volatile boolean shouldFail; - public TestHandler(CountDownLatch latch) { + TestHandler(CountDownLatch latch) { this.latch = latch; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java index e21f9b4cde..5350fc29eb 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/MessageSelectingInterceptorTests.java @@ -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. @@ -94,7 +94,7 @@ public class MessageSelectingInterceptorTests { private final AtomicInteger counter; - public TestMessageSelector(boolean shouldAccept, AtomicInteger counter) { + TestMessageSelector(boolean shouldAccept, AtomicInteger counter) { this.shouldAccept = shouldAccept; this.counter = counter; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java index 2730bca30a..07a02a595a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/WireTapTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 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. @@ -121,7 +121,7 @@ public class WireTapTests { private boolean shouldAccept; - public TestSelector(boolean shouldAccept) { + TestSelector(boolean shouldAccept) { this.shouldAccept = shouldAccept; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java index 5c30cf8789..25af8d052c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/CompositeCodecTests.java @@ -58,7 +58,7 @@ public class CompositeCodecTests { private int val2; - public SomeClassWithNoDefaultConstructors(String val1, int val2) { + SomeClassWithNoDefaultConstructors(String val1, int val2) { this.val1 = val1; this.val2 = val2; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/KryoCodecTests.java b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/KryoCodecTests.java index a4fc514d7f..eac302d37b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/KryoCodecTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/codec/kryo/KryoCodecTests.java @@ -130,7 +130,7 @@ public class KryoCodecTests { private int val2; - public SomeClassWithNoDefaultConstructors(String val1, int val2) { + SomeClassWithNoDefaultConstructors(String val1, int val2) { this.val1 = val1; this.val2 = val2; } @@ -157,7 +157,7 @@ public class KryoCodecTests { private Map map; - public Foo() { + Foo() { map = new HashMap(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java index 9654190e2d..8c041e5af5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java @@ -325,7 +325,7 @@ public class MessagingAnnotationPostProcessorTests { private final CountDownLatch latch; - public OutboundOnlyTestBean(CountDownLatch latch) { + OutboundOnlyTestBean(CountDownLatch latch) { this.latch = latch; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java index 016b4af821..78b59d6a59 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserTests.java @@ -35,16 +35,16 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Oleg Zhurakousky - * + * @author Artem Bilan */ @ContextConfiguration @RunWith(SpringJUnit4ClassRunner.class) public class ConverterParserTests { - + @Autowired @Qualifier("serviceActivatorChannel") private MessageChannel serviceActivatorChannel; - + @Autowired @Qualifier("serviceActivatorChannel3") private MessageChannel serviceActivatorChannel3; @@ -78,7 +78,7 @@ public class ConverterParserTests { assertEquals(TestBean2.class, result.getPayload().getClass()); assertEquals("SERVICE-TEST", ((TestBean2) result.getPayload()).text); } - + @Test public void serviceActivatorUsingInnerConverterDefinition() { QueueChannel replyChannel = new QueueChannel(); @@ -141,15 +141,15 @@ public class ConverterParserTests { assertEquals(TestBean1.class, result.getPayload().getClass()); assertEquals("router-test", ((TestBean1) result.getPayload()).text); } - + @SuppressWarnings("unused") - private static class TestService { + public static class TestService { public Object test(TestBean2 bean) { return bean; } - + public Object test3(TestBean3 bean) { return bean; } @@ -157,19 +157,21 @@ public class ConverterParserTests { public boolean filter(TestBean2 bean) { return true; } + } - - private static class TestBean1 { + + public static class TestBean1 { private String text; public TestBean1(String text) { this.text = text; } + } - private static class TestBean2 { + public static class TestBean2 { private String text; @@ -181,12 +183,14 @@ public class ConverterParserTests { public String toString() { return this.text.replace("-TEST", "_TARGET_CHANNEL"); } + } + private static class TestBean3 { private String text; - public TestBean3(String text) { + TestBean3(String text) { this.text = text; } @@ -194,20 +198,25 @@ public class ConverterParserTests { public String toString() { return this.text.replace("-TEST", "_TARGET_CHANNEL"); } + } - + @SuppressWarnings("unused") private static class TestConverter implements Converter { public TestBean2 convert(TestBean1 source) { return new TestBean2(source.text.toUpperCase()); } + } + @SuppressWarnings("unused") private static class TestConverter3 implements Converter { public TestBean3 convert(TestBean1 source) { return new TestBean3(source.text.toUpperCase()); } + } + } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java index 42fcec4348..6d6648734a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java @@ -77,7 +77,7 @@ public class ConverterParserWithExistingConversionServiceTests { private final String text; @SuppressWarnings("unused") - public TestBean1(String text) { + TestBean1(String text) { this.text = text; } } @@ -87,7 +87,7 @@ public class ConverterParserWithExistingConversionServiceTests { private final String text; - public TestBean2(String text) { + TestBean2(String text) { this.text = text; } @@ -101,7 +101,7 @@ public class ConverterParserWithExistingConversionServiceTests { private final String text; - public TestBean3(String text) { + TestBean3(String text) { this.text = text; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests.java index 7709143796..a3327ffe18 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests.java @@ -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. @@ -255,7 +255,7 @@ public class EnricherParserTests { } - public static enum Gender { + public enum Gender { MALE, FEMALE } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java index b6f7a4cd20..553e90390c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/EnricherParserTests4.java @@ -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. @@ -141,7 +141,7 @@ public class EnricherParserTests4 { } } - public static enum Gender { + public enum Gender { MALE, FEMALE } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java index 346f8fecf4..21f0a1bbe0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/GatewayParserTests.java @@ -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. @@ -392,7 +392,7 @@ public class GatewayParserTests { private volatile String beanName; - public TestExecutor() { + TestExecutor() { setThreadNamePrefix("testExec-"); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java index 85a44a5c13..9b757c5d1d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ServiceActivatorParserTests.java @@ -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. @@ -237,7 +237,7 @@ public class ServiceActivatorParserTests { private final String lastName; - public TestPerson(String firstName, String lastName) { + TestPerson(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySetTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySetTests.java index cf2fd8f592..fa138e7b52 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySetTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/OrderedAwareCopyOnWriteArraySetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 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. @@ -277,7 +277,7 @@ public class OrderedAwareCopyOnWriteArraySetTests { } private static class Foo implements Ordered { private final int order; - public Foo(int order){ + Foo(int order){ this.order = order; } public int getOrder() { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java index 3158af9c6a..a4c546e8bd 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollerAdviceTests.java @@ -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. @@ -131,7 +131,7 @@ public class PollerAdviceTests { private final CountDownLatch latch; - public LocalSource(CountDownLatch latch) { + LocalSource(CountDownLatch latch) { this.latch = latch; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestService.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestService.java index 1fe220a421..017effb432 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestService.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/TestService.java @@ -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. @@ -60,11 +60,11 @@ public interface TestService { MyCompletableMessageFuture customCompletableReturnsMessage(String s); - public class MyCompletableFuture extends CompletableFuture { + class MyCompletableFuture extends CompletableFuture { } - public class MyCompletableMessageFuture extends CompletableFuture> { + class MyCompletableMessageFuture extends CompletableFuture> { } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java index 9e916d20ca..538b33804c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/CustomConverterMessageProcessingTests.java @@ -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. @@ -126,16 +126,17 @@ public class CustomConverterMessageProcessingTests { @SuppressWarnings("unused") - private static class TestConverter implements Converter { + public static class TestConverter implements Converter { public TestBean2 convert(TestBean1 source) { return new TestBean2(source.text.toUpperCase()); } + } @SuppressWarnings("unused") - private static class TestService { + public static class TestService { public Object test(TestBean2 bean) { return bean; @@ -144,20 +145,22 @@ public class CustomConverterMessageProcessingTests { public boolean filter(TestBean2 bean) { return true; } + } - private static class TestBean1 { + public static class TestBean1 { private String text; public TestBean1(String text) { this.text = text; } + } - private static class TestBean2 { + public static class TestBean2 { private String text; @@ -169,6 +172,7 @@ public class CustomConverterMessageProcessingTests { public String toString() { return this.text.replace("-TEST", "_TARGET_CHANNEL"); } + } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java index 6493e9bd0f..f6f6a4b436 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java @@ -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. @@ -543,7 +543,7 @@ public class DelayHandlerTests { @SuppressWarnings("serial") private static class TestTimedOutException extends RuntimeException { - public TestTimedOutException() { + TestTimedOutException() { super("timed out while waiting for latch"); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java index 5ca5e4f14d..8d783a955b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessorTests.java @@ -285,7 +285,7 @@ public class ExpressionEvaluatingMessageProcessorTests { @SuppressWarnings("serial") private static final class CheckedException extends Exception { - public CheckedException(String string) { + CheckedException(String string) { super(string); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java index eca818cde5..6f986e2fd6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java @@ -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. @@ -170,7 +170,7 @@ public class MessageHandlerChainTests { private final MessageHandler messageHandler; - public ProducingHandlerStub(MessageHandler handler) { + ProducingHandlerStub(MessageHandler handler) { this.messageHandler = handler; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java index 4538223245..b785181e94 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorTests.java @@ -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,7 +555,7 @@ public class MethodInvokingMessageProcessorTests { private final Class type; - public ExceptionCauseMatcher(Class type) { + ExceptionCauseMatcher(Class type) { this.type = type; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java index f034fb14da..b8c17d1dc2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java @@ -1066,7 +1066,7 @@ public class AdvisedMessageHandlerTests { public final Throwable throwable; - public Foo(Throwable throwable) { + Foo(Throwable throwable) { this.throwable = throwable; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java b/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java index e2bc09468c..3e5de15cb9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/json/TestAddress.java @@ -29,7 +29,7 @@ class TestAddress { TestAddress() { } - public TestAddress(int number, String street) { + TestAddress(int number, String street) { this.number = number; this.street = street; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java index 37d66ba683..e32e45ea44 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java @@ -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. @@ -97,7 +97,7 @@ public class MethodInvokingMessageHandlerTests { private final BlockingQueue queue; - public TestBean(BlockingQueue queue) { + TestBean(BlockingQueue queue) { this.queue = queue; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java index 7e7b7028bd..0e9c48e287 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/DynamicExpressionRouterIntegrationTests.java @@ -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. @@ -73,7 +73,7 @@ public class DynamicExpressionRouterIntegrationTests { private final int number; - public TestBean(int number) { + TestBean(int number) { this.number = number; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java index 03b5d5ae33..be01720a43 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterWithMappingTests.java @@ -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. @@ -132,7 +132,7 @@ public class RouterWithMappingTests { private final String name; - public TestBean(String name) { + TestBean(String name) { this.name = name; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java index c940fef76f..1f6d6b2d9c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SpelRouterIntegrationTests.java @@ -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. @@ -101,7 +101,7 @@ public class SpelRouterIntegrationTests { private final QueueChannel remainders = new QueueChannel(); - public TestBean(int number) { + TestBean(int number) { this.number = number; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java index 98a08557a3..916a2dab41 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DynamicExpressionSplitterIntegrationTests.java @@ -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. @@ -71,7 +71,7 @@ public class DynamicExpressionSplitterIntegrationTests { private final List numbers = new ArrayList(); - public TestBean() { + TestBean() { for (int i = 1; i <= 10; i++) { this.numbers.add(i); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java index d370631a9f..8954b70972 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java @@ -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. @@ -157,7 +157,7 @@ public class SpelSplitterIntegrationTests { private final List numbers = new ArrayList(); - public TestBean() { + TestBean() { for (int i = 1; i <= 10; i++) { this.numbers.add(i); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java index 576662876b..dcc70401a9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/StreamingSplitterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 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. @@ -188,7 +188,7 @@ public class StreamingSplitterTests { AtomicInteger counter = new AtomicInteger(0); - public IteratorTestBean(int max) { + IteratorTestBean(int max) { this.max = max; } @@ -222,7 +222,7 @@ public class StreamingSplitterTests { AtomicInteger counter = new AtomicInteger(0); - public IterableTestBean(int max) { + IterableTestBean(int max) { this.max = max; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadDeserializingTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadDeserializingTransformerTests.java index e00047a8cc..2f97c29faf 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadDeserializingTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadDeserializingTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 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. @@ -88,7 +88,7 @@ public class PayloadDeserializingTransformerTests { private String name; - public TestBean(String name) { + TestBean(String name) { this.name = name; } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java index b89ae45bd2..8546b032ae 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/PayloadSerializingTransformerTests.java @@ -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. @@ -88,7 +88,7 @@ public class PayloadSerializingTransformerTests { private String name; - public TestBean(String name) { + TestBean(String name) { this.name = name; } } diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java index 741421fcc9..5859691c9c 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducerTests.java @@ -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. @@ -315,7 +315,7 @@ public class ApplicationEventListeningMessageProducerTests { @SuppressWarnings("serial") private static class TestApplicationEvent1 extends ApplicationEvent { - public TestApplicationEvent1() { + TestApplicationEvent1() { super("event1"); } @@ -324,7 +324,7 @@ public class ApplicationEventListeningMessageProducerTests { @SuppressWarnings("serial") private static class TestApplicationEvent2 extends ApplicationEvent { - public TestApplicationEvent2() { + TestApplicationEvent2() { super("event2"); } @@ -333,7 +333,7 @@ public class ApplicationEventListeningMessageProducerTests { @SuppressWarnings("serial") private static class TestMessagingEvent extends ApplicationEvent { - public TestMessagingEvent(Message message) { + TestMessagingEvent(Message message) { super(message); } diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java index 55b2d7dade..d90a767e07 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/outbound/ApplicationEventPublishingMessageHandlerTests.java @@ -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. @@ -83,7 +83,7 @@ public class ApplicationEventPublishingMessageHandlerTests { @SuppressWarnings("serial") private static class TestEvent extends ApplicationEvent { - public TestEvent(String text) { + TestEvent(String text) { super(text); } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java index e5fb8a3e80..d8f7736319 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java @@ -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. @@ -169,7 +169,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement * @since 4.2 */ public DirectoryScanner getScanner() { - return scanner; + return this.scanner; } /** @@ -243,12 +243,12 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement @Override protected void onInit() { - Assert.notNull(directory, "'directory' must not be null"); + Assert.notNull(this.directory, "'directory' must not be null"); if (!this.directory.exists() && this.autoCreateDirectory) { this.directory.mkdirs(); } Assert.isTrue(this.directory.exists(), - "Source directory [" + directory + "] does not exist."); + "Source directory [" + this.directory + "] does not exist."); Assert.isTrue(this.directory.isDirectory(), "Source path [" + this.directory + "] does not point to a directory."); Assert.isTrue(this.directory.canRead(), @@ -268,16 +268,16 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement Message message = null; // rescan only if needed or explicitly configured - if (scanEachPoll || toBeReceived.isEmpty()) { + if (this.scanEachPoll || this.toBeReceived.isEmpty()) { scanInputDirectory(); } - File file = toBeReceived.poll(); + File file = this.toBeReceived.poll(); // file == null means the queue was empty // we can't rely on isEmpty for concurrency reasons - while ((file != null) && !scanner.tryClaim(file)) { - file = toBeReceived.poll(); + while ((file != null) && !this.scanner.tryClaim(file)) { + file = this.toBeReceived.poll(); } if (file != null) { @@ -290,10 +290,10 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement } private void scanInputDirectory() { - List filteredFiles = scanner.listFiles(directory); + List filteredFiles = this.scanner.listFiles(this.directory); Set freshFiles = new LinkedHashSet(filteredFiles); if (!freshFiles.isEmpty()) { - toBeReceived.addAll(freshFiles); + this.toBeReceived.addAll(freshFiles); if (logger.isDebugEnabled()) { logger.debug("Added to queue: " + freshFiles); } @@ -310,7 +310,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement if (logger.isWarnEnabled()) { logger.warn("Failed to send: " + failedMessage); } - toBeReceived.offer(failedMessage.getPayload()); + this.toBeReceived.offer(failedMessage.getPayload()); } /** diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java index b3f829caff..5a914d8f6a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java @@ -251,7 +251,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand } protected String getTemporaryFileSuffix() { - return temporaryFileSuffix; + return this.temporaryFileSuffix; } /** @@ -473,8 +473,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand if (rename(sourceFile, resultFile)) { return resultFile; } - if (logger.isInfoEnabled()) { - logger.info(String.format("Failed to move file '%s'. Using copy and delete fallback.", + if (this.logger.isInfoEnabled()) { + this.logger.info(String.format("Failed to move file '%s'. Using copy and delete fallback.", sourceFile.getAbsolutePath())); } } @@ -835,7 +835,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand private synchronized void clearState(final File fileToWriteTo, final FileState state) { if (state != null) { - fileStates.remove(fileToWriteTo.getAbsolutePath()); + this.fileStates.remove(fileToWriteTo.getAbsolutePath()); } } @@ -896,8 +896,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand if (state.lastWrite < expired) { iterator.remove(); state.close(); - if (logger.isDebugEnabled()) { - logger.debug("Flushed: " + entry.getKey()); + if (FileWritingMessageHandler.this.logger.isDebugEnabled()) { + FileWritingMessageHandler.this.logger.debug("Flushed: " + entry.getKey()); } } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java b/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java index 32e9b40d4b..4fce558a50 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/HeadDirectoryScanner.java @@ -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. @@ -67,7 +67,7 @@ public class HeadDirectoryScanner extends DefaultDirectoryScanner { @Override public List filterFiles(File[] files) { - return Arrays.asList(files).subList(0, Math.min(files.length, maxNumberOfFiles)); + return Arrays.asList(files).subList(0, Math.min(files.length, this.maxNumberOfFiles)); } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java b/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java index 272f6c0f16..da05fdd46c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java @@ -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. @@ -174,7 +174,7 @@ public class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implem } private Set filesFromEvents() { - WatchKey key = watcher.poll(); + WatchKey key = this.watcher.poll(); Set files = new LinkedHashSet(); while (key != null) { for (WatchEvent event : key.pollEvents()) { @@ -209,7 +209,7 @@ public class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implem } } key.reset(); - key = watcher.poll(); + key = this.watcher.poll(); } return files; } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java index a4c4d5d14e..08d4a67136 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileReadingMessageSourceFactoryBean.java @@ -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. @@ -137,7 +137,7 @@ public class FileReadingMessageSourceFactoryBean implements FactoryBean extends Abst @Override protected boolean accept(F file) { String key = buildKey(file); - synchronized(monitor) { + synchronized(this.monitor) { String newValue = value(file); String oldValue = this.store.putIfAbsent(key, newValue); if (oldValue == null) { // not in store diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/LastModifiedFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/LastModifiedFileListFilter.java index 8326cc95d0..130c8bcbc0 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/LastModifiedFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/LastModifiedFileListFilter.java @@ -39,7 +39,7 @@ public class LastModifiedFileListFilter implements FileListFilter { private volatile long age = DEFAULT_AGE; public long getAge() { - return age; + return this.age; } /** diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/locking/NioFileLocker.java b/spring-integration-file/src/main/java/org/springframework/integration/file/locking/NioFileLocker.java index 7e85537232..2ffc133e21 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/locking/NioFileLocker.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/locking/NioFileLocker.java @@ -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. @@ -45,7 +45,7 @@ public class NioFileLocker extends AbstractFileLockerFilter { * {@inheritDoc} */ public boolean lock(File fileToLock) { - FileLock lock = lockCache.get(fileToLock); + FileLock lock = this.lockCache.get(fileToLock); if (lock == null) { FileLock newLock = null; try { @@ -55,7 +55,7 @@ public class NioFileLocker extends AbstractFileLockerFilter { + fileToLock, e); } if (newLock != null) { - FileLock original = lockCache.putIfAbsent(fileToLock, newLock); + FileLock original = this.lockCache.putIfAbsent(fileToLock, newLock); lock = original != null ? original : newLock; } } @@ -63,11 +63,11 @@ public class NioFileLocker extends AbstractFileLockerFilter { } public boolean isLockable(File file) { - return lockCache.containsKey(file) || !FileChannelCache.isLocked(file); + return this.lockCache.containsKey(file) || !FileChannelCache.isLocked(file); } public void unlock(File fileToUnlock) { - FileLock fileLock = lockCache.get(fileToUnlock); + FileLock fileLock = this.lockCache.get(fileToUnlock); try { if (fileLock != null) { fileLock.release(); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractFileInfo.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractFileInfo.java index 96e94862ea..741fd6d827 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractFileInfo.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractFileInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 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. @@ -37,7 +37,7 @@ public abstract class AbstractFileInfo implements FileInfo, Comparable implements RemoteFileOperations, Initializ * @since 4.2 */ public SessionFactory getSessionFactory() { - return sessionFactory; + return this.sessionFactory; } /** @@ -129,7 +129,7 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ * @return the remote file separator. */ public final String getRemoteFileSeparator() { - return remoteFileSeparator; + return this.remoteFileSeparator; } /** @@ -176,7 +176,7 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ * system. */ public boolean isUseTemporaryFileName() { - return useTemporaryFileName; + return this.useTemporaryFileName; } /** @@ -245,7 +245,7 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ if (this.autoCreateDirectory){ Assert.hasText(this.remoteFileSeparator, "'remoteFileSeparator' must not be empty when 'autoCreateDirectory' is set to 'true'"); } - if (hasExplicitlySetSuffix && !useTemporaryFileName){ + if (this.hasExplicitlySetSuffix && !this.useTemporaryFileName){ this.logger.warn("Since 'use-temporary-file-name' is set to 'false' the value of 'temporary-file-suffix' has no effect"); } } @@ -333,8 +333,8 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ } else { // A null holder means a File payload that does not exist. - if (logger.isWarnEnabled()) { - logger.warn("File " + message.getPayload() + " does not exist"); + if (this.logger.isWarnEnabled()) { + this.logger.warn("File " + message.getPayload() + " does not exist"); } return null; } @@ -425,8 +425,8 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ session.close(); } catch (Exception ignored) { - if (logger.isDebugEnabled()) { - logger.debug("failed to close Session", ignored); + if (this.logger.isDebugEnabled()) { + this.logger.debug("failed to close Session", ignored); } } } @@ -488,7 +488,7 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ String tempRemoteFilePath = temporaryRemoteDirectory + fileName; // write remote file first with temporary file extension if enabled - String tempFilePath = tempRemoteFilePath + (useTemporaryFileName ? this.temporaryFileSuffix : ""); + String tempFilePath = tempRemoteFilePath + (this.useTemporaryFileName ? this.temporaryFileSuffix : ""); if (this.autoCreateDirectory) { try { @@ -515,8 +515,8 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ "The destination file already exists at '" + remoteFilePath + "'."); } else { - if (logger.isDebugEnabled()) { - logger.debug("File not transferred to '" + remoteFilePath + "'; already exists."); + if (this.logger.isDebugEnabled()) { + this.logger.debug("File not transferred to '" + remoteFilePath + "'; already exists."); } } rename = false; @@ -560,11 +560,11 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ } public InputStream getStream() { - return stream; + return this.stream; } public String getName() { - return name; + return this.name; } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java index 29d5761c13..2bd9070a97 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java @@ -438,7 +438,7 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply Command.GET.equals(this.command)) { Assert.isNull(this.filter, "Filters are not supported with the rm and get commands"); } - if ((Command.GET.equals(this.command) && !options.contains(Option.STREAM)) + if ((Command.GET.equals(this.command) && !this.options.contains(Option.STREAM)) || Command.MGET.equals(this.command)) { Assert.notNull(this.localDirectoryExpression, "localDirectory must not be null"); if (this.localDirectoryExpression instanceof LiteralExpression) { @@ -503,7 +503,8 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply @Override public Object doInSession(Session session) throws IOException { - return messageSessionCallback.doInSession(session, requestMessage); + return AbstractRemoteFileOutboundGateway.this.messageSessionCallback.doInSession(session, + requestMessage); } }); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java index 3c1c7971c2..7a49e07be0 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java @@ -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. @@ -177,18 +177,18 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe @Override public synchronized void close() { - if (released) { + if (this.released) { if (logger.isDebugEnabled()){ - logger.debug("Session " + targetSession + " already released."); + logger.debug("Session " + this.targetSession + " already released."); } } else { if (logger.isDebugEnabled()){ - logger.debug("Releasing Session " + targetSession + " back to the pool."); + logger.debug("Releasing Session " + this.targetSession + " back to the pool."); } if (this.sharedSessionEpoch != CachingSessionFactory.this.sharedSessionEpoch) { if (logger.isDebugEnabled()){ - logger.debug("Closing session " + targetSession + " after reset."); + logger.debug("Closing session " + this.targetSession + " after reset."); } this.targetSession.close(); } @@ -203,8 +203,8 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe //No-op in this context } } - pool.releaseItem(this.targetSession); - released = true; + CachingSessionFactory.this.pool.releaseItem(this.targetSession); + this.released = true; } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DelegatingSessionFactory.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DelegatingSessionFactory.java index 752d3132b4..4315475e22 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DelegatingSessionFactory.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DelegatingSessionFactory.java @@ -59,7 +59,7 @@ public class DelegatingSessionFactory implements SessionFactory { * @return the locator. */ public SessionFactoryLocator getFactoryLocator() { - return factoryLocator; + return this.factoryLocator; } /** diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java index 68899c66ef..76803420a2 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java @@ -215,7 +215,7 @@ public abstract class AbstractInboundFileSynchronizer } protected String getTemporaryFileSuffix() { - return temporaryFileSuffix; + return this.temporaryFileSuffix; } @Override @@ -227,12 +227,12 @@ public abstract class AbstractInboundFileSynchronizer @Override public void synchronizeToLocalDirectory(final File localDirectory) { + final String remoteDirectory = this.remoteDirectoryExpression.getValue(this.evaluationContext, String.class); try { int transferred = this.remoteFileTemplate.execute(new SessionCallback() { @Override public Integer doInSession(Session session) throws IOException { - String remoteDirectory = remoteDirectoryExpression.getValue(evaluationContext, String.class); F[] files = session.list(remoteDirectory); if (!ObjectUtils.isEmpty(files)) { List filteredFiles = filterFiles(files); @@ -266,8 +266,8 @@ public abstract class AbstractInboundFileSynchronizer } } }); - if (logger.isDebugEnabled()) { - logger.debug(transferred + " files transferred"); + if (this.logger.isDebugEnabled()) { + this.logger.debug(transferred + " files transferred"); } } catch (Exception e) { @@ -280,11 +280,11 @@ public abstract class AbstractInboundFileSynchronizer String remoteFileName = this.getFilename(remoteFile); String localFileName = this.generateLocalFileName(remoteFileName); String remoteFilePath = remoteDirectoryPath != null - ? (remoteDirectoryPath + remoteFileSeparator + remoteFileName) + ? (remoteDirectoryPath + this.remoteFileSeparator + remoteFileName) : remoteFileName; if (!this.isFile(remoteFile)) { - if (logger.isDebugEnabled()) { - logger.debug("cannot copy, not a file: " + remoteFilePath); + if (this.logger.isDebugEnabled()) { + this.logger.debug("cannot copy, not a file: " + remoteFilePath); } return; } @@ -316,8 +316,8 @@ public abstract class AbstractInboundFileSynchronizer if (tempFile.renameTo(localFile)) { if (this.deleteRemoteFiles) { session.remove(remoteFilePath); - if (logger.isDebugEnabled()) { - logger.debug("deleted " + remoteFilePath); + if (this.logger.isDebugEnabled()) { + this.logger.debug("deleted " + remoteFilePath); } } } @@ -329,7 +329,7 @@ public abstract class AbstractInboundFileSynchronizer private String generateLocalFileName(String remoteFileName){ if (this.localFilenameGeneratorExpression != null){ - return this.localFilenameGeneratorExpression.getValue(evaluationContext, remoteFileName, String.class); + return this.localFilenameGeneratorExpression.getValue(this.evaluationContext, remoteFileName, String.class); } return remoteFileName; } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/splitter/FileSplitter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/splitter/FileSplitter.java index 938c7e912b..e10b4cb447 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/splitter/FileSplitter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/splitter/FileSplitter.java @@ -301,24 +301,24 @@ public class FileSplitter extends AbstractMessageSplitter { } public String getFilePath() { - return filePath; + return this.filePath; } public Mark getMark() { - return mark; + return this.mark; } public long getLineCount() { - return lineCount; + return this.lineCount; } @Override public String toString() { if (this.mark.equals(Mark.START)) { - return "FileMarker [filePath=" + filePath + ", mark=" + mark + "]"; + return "FileMarker [filePath=" + this.filePath + ", mark=" + this.mark + "]"; } else { - return "FileMarker [filePath=" + filePath + ", mark=" + mark + ", lineCount=" + lineCount + "]"; + return "FileMarker [filePath=" + this.filePath + ", mark=" + this.mark + ", lineCount=" + this.lineCount + "]"; } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java index 492081a7d9..90647f2eea 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java @@ -87,7 +87,7 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS } protected long getMissingFileDelay() { - return tailAttemptsDelay; + return this.tailAttemptsDelay; } protected TaskExecutor getTaskExecutor() { @@ -131,11 +131,11 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS } protected String getMessage() { - return message; + return this.message; } public File getFile() { - return file; + return this.file; } @Override diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java index 8e42a25c1a..5b8525356a 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/remote/gateway/RemoteFileOutboundGatewayTests.java @@ -1100,13 +1100,13 @@ public class RemoteFileOutboundGatewayTests { static class TestRemoteFileOutboundGateway extends AbstractRemoteFileOutboundGateway { @SuppressWarnings({"rawtypes", "unchecked"}) - public TestRemoteFileOutboundGateway(SessionFactory sessionFactory, + TestRemoteFileOutboundGateway(SessionFactory sessionFactory, String command, String expression) { super(sessionFactory, Command.toCommand(command), expression); this.setBeanFactory(mock(BeanFactory.class)); } - public TestRemoteFileOutboundGateway(RemoteFileTemplate remoteFileTemplate, String command, + TestRemoteFileOutboundGateway(RemoteFileTemplate remoteFileTemplate, String command, String expression) { super(remoteFileTemplate, command, expression); this.setBeanFactory(mock(BeanFactory.class)); @@ -1161,7 +1161,7 @@ public class RemoteFileOutboundGatewayTests { private final long modified; private final String permissions; - public TestLsEntry(String filename, long size, boolean dir, boolean link, + TestLsEntry(String filename, long size, boolean dir, boolean link, long modified, String permissions) { this.filename = filename; this.size = size; @@ -1214,7 +1214,7 @@ public class RemoteFileOutboundGatewayTests { static class TestPatternFilter extends AbstractSimplePatternFileListFilter { - public TestPatternFilter(String path) { + TestPatternFilter(String path) { super(path); } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java index 5361f5dc1f..01561009af 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java @@ -192,12 +192,12 @@ public abstract class AbstractFtpSessionFactory implements if (!FTPReply.isPositiveCompletion(client.getReplyCode())) { throw new MessagingException("Connecting to server [" + - host + ":" + port + "] failed. Please check the connection."); + this.host + ":" + this.port + "] failed. Please check the connection."); } - logger.debug("Connected to server [" + host + ":" + port + "]"); + this.logger.debug("Connected to server [" + this.host + ":" + this.port + "]"); // Login - if (!client.login(username, password)) { + if (!client.login(this.username, this.password)) { throw new IllegalStateException("Login failed. The response from the server is: " + client.getReplyString()); } @@ -205,9 +205,9 @@ public abstract class AbstractFtpSessionFactory implements this.postProcessClientAfterConnect(client); this.updateClientMode(client); - client.setFileType(fileType); - client.setBufferSize(bufferSize); - client.setControlEncoding(controlEncoding); + client.setFileType(this.fileType); + client.setBufferSize(this.bufferSize); + client.setControlEncoding(this.controlEncoding); return client; } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java index bebbf0ad87..8c262cd090 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java @@ -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. @@ -143,7 +143,7 @@ public class DefaultFtpsSessionFactory extends AbstractFtpSessionFactory { public boolean remove(String path) throws IOException { Assert.hasText(path, "path must not be null"); if (!this.client.deleteFile(path)) { - throw new IOException("Failed to delete '" + path + "'. Server replied with: " + client.getReplyString()); + throw new IOException("Failed to delete '" + path + "'. Server replied with: " + this.client.getReplyString()); } else { return true; @@ -83,7 +83,7 @@ public class FtpSession implements Session { throw new IOException("Failed to copy '" + path + "'. Server replied with: " + this.client.getReplyString()); } - logger.info("File has been successfully transferred from: " + path); + this.logger.info("File has been successfully transferred from: " + path); } @Override @@ -106,8 +106,8 @@ public class FtpSession implements Session { } if (this.client.completePendingCommand()) { int replyCode = this.client.getReplyCode(); - if (logger.isDebugEnabled()) { - logger.debug(this + " finalizeRaw - reply code: " + replyCode); + if (this.logger.isDebugEnabled()) { + this.logger.debug(this + " finalizeRaw - reply code: " + replyCode); } return FTPReply.isPositiveCompletion(replyCode); } @@ -123,8 +123,8 @@ public class FtpSession implements Session { throw new IOException("Failed to write to '" + path + "'. Server replied with: " + this.client.getReplyString()); } - if (logger.isInfoEnabled()) { - logger.info("File has been successfully transferred to: " + path); + if (this.logger.isInfoEnabled()) { + this.logger.info("File has been successfully transferred to: " + path); } } @@ -137,8 +137,8 @@ public class FtpSession implements Session { throw new IOException("Failed to append to '" + path + "'. Server replied with: " + this.client.getReplyString()); } - if (logger.isInfoEnabled()) { - logger.info("File has been successfully appended to: " + path); + if (this.logger.isInfoEnabled()) { + this.logger.info("File has been successfully appended to: " + path); } } @@ -151,8 +151,8 @@ public class FtpSession implements Session { this.client.disconnect(); } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn("failed to disconnect FTPClient", e); + if (this.logger.isWarnEnabled()) { + this.logger.warn("failed to disconnect FTPClient", e); } } } @@ -176,8 +176,8 @@ public class FtpSession implements Session { throw new IOException("Failed to rename '" + pathFrom + "' to " + pathTo + "'. Server replied with: " + this.client.getReplyString()); } - if (logger.isInfoEnabled()) { - logger.info("File has been successfully renamed from: " + pathFrom + " to " + pathTo); + if (this.logger.isInfoEnabled()) { + this.logger.info("File has been successfully renamed from: " + pathFrom + " to " + pathTo); } } diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java index a2daae8fa2..2dd67337e2 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java @@ -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. @@ -77,22 +77,22 @@ public class CacheListeningMessageProducer extends ExpressionMessageProducerSupp @Override protected void doStart() { - if (logger.isInfoEnabled()) { - logger.info("adding MessageProducingCacheListener to GemFire Region '" + this.region.getName() + "'"); + if (this.logger.isInfoEnabled()) { + this.logger.info("adding MessageProducingCacheListener to GemFire Region '" + this.region.getName() + "'"); } this.region.getAttributesMutator().addCacheListener(this.listener); } @Override protected void doStop() { - if (logger.isInfoEnabled()) { - logger.info("removing MessageProducingCacheListener from GemFire Region '" + this.region.getName() + "'"); + if (this.logger.isInfoEnabled()) { + this.logger.info("removing MessageProducingCacheListener from GemFire Region '" + this.region.getName() + "'"); } try { this.region.getAttributesMutator().removeCacheListener(this.listener); } catch (CacheClosedException e) { - if (logger.isDebugEnabled()){ - logger.debug(e.getMessage(),e); + if (this.logger.isDebugEnabled()){ + this.logger.debug(e.getMessage(),e); } } @@ -102,28 +102,28 @@ public class CacheListeningMessageProducer extends ExpressionMessageProducerSupp @Override public void afterCreate(EntryEvent event) { - if (supportedEventTypes.contains(EventType.CREATED)) { + if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.CREATED)) { this.processEvent(event); } } @Override public void afterUpdate(EntryEvent event) { - if (supportedEventTypes.contains(EventType.UPDATED)) { + if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.UPDATED)) { this.processEvent(event); } } @Override public void afterInvalidate(EntryEvent event) { - if (supportedEventTypes.contains(EventType.INVALIDATED)) { + if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.INVALIDATED)) { this.processEvent(event); } } @Override public void afterDestroy(EntryEvent event) { - if (supportedEventTypes.contains(EventType.DESTROYED)) { + if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.DESTROYED)) { this.processEvent(event); } } diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java index 53ed8eaff5..bb31062d24 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java @@ -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. @@ -98,11 +98,11 @@ public class ContinuousQueryMessageProducer extends ExpressionMessageProducerSup @Override protected void onInit() { super.onInit(); - if (queryName == null) { - queryListenerContainer.addListener(new ContinuousQueryDefinition(this.query, this, this.durable)); + if (this.queryName == null) { + this.queryListenerContainer.addListener(new ContinuousQueryDefinition(this.query, this, this.durable)); } else { - queryListenerContainer.addListener(new ContinuousQueryDefinition(this.queryName, this.query, this, + this.queryListenerContainer.addListener(new ContinuousQueryDefinition(this.queryName, this.query, this, this.durable)); } } @@ -135,7 +135,7 @@ public class ContinuousQueryMessageProducer extends ExpressionMessageProducerSup String eventName = event.getQueryOperation().toString() + (event.getQueryOperation().toString().endsWith("Y") ? "ED" : "D"); CqEventType eventType = CqEventType.valueOf(eventName); - return supportedEventTypes.contains(eventType); + return this.supportedEventTypes.contains(eventType); } } diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java index 6627c2b9be..4abd15d3c4 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java @@ -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. @@ -59,7 +59,7 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements * @param messageStoreRegion The region. */ public GemfireMessageStore(Region messageStoreRegion) { - cache = null; + this.cache = null; this.messageStoreRegion = messageStoreRegion; } /** @@ -98,7 +98,7 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements RegionFactoryBean messageRegionFactoryBean = new RegionFactoryBean() {}; messageRegionFactoryBean.setBeanName(MESSAGE_STORE_REGION_NAME); messageRegionFactoryBean.setAttributes(attributesFactoryBean.getObject()); - messageRegionFactoryBean.setCache(cache); + messageRegionFactoryBean.setCache(this.cache); messageRegionFactoryBean.afterPropertiesSet(); this.messageStoreRegion = messageRegionFactoryBean.getObject(); } diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyControlBusFactoryBean.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyControlBusFactoryBean.java index adb7cc99d5..eb379ea0a5 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyControlBusFactoryBean.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/config/GroovyControlBusFactoryBean.java @@ -89,7 +89,7 @@ public class GroovyControlBusFactoryBean extends AbstractSimpleMessageHandlerFac processor.setCustomizer(this.customizer); } if (this.beanClassLoader != null) { - processor.setBeanClassLoader(beanClassLoader); + processor.setBeanClassLoader(this.beanClassLoader); } if (getBeanFactory() != null) { processor.setBeanFactory(getBeanFactory()); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/CrossOrigin.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/CrossOrigin.java index cf39ae886b..2f86803353 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/CrossOrigin.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/CrossOrigin.java @@ -47,7 +47,7 @@ public class CrossOrigin { } public String[] getOrigin() { - return origin; + return this.origin; } public void setAllowedHeaders(String... allowedHeaders) { @@ -55,7 +55,7 @@ public class CrossOrigin { } public String[] getAllowedHeaders() { - return allowedHeaders; + return this.allowedHeaders; } public void setExposedHeaders(String... exposedHeaders) { @@ -63,7 +63,7 @@ public class CrossOrigin { } public String[] getExposedHeaders() { - return exposedHeaders; + return this.exposedHeaders; } public void setMethod(RequestMethod... method) { @@ -71,7 +71,7 @@ public class CrossOrigin { } public RequestMethod[] getMethod() { - return method; + return this.method; } public void setAllowCredentials(Boolean allowCredentials) { @@ -79,7 +79,7 @@ public class CrossOrigin { } public Boolean getAllowCredentials() { - return allowCredentials; + return this.allowCredentials; } public void setMaxAge(long maxAge) { @@ -87,7 +87,7 @@ public class CrossOrigin { } public long getMaxAge() { - return maxAge; + return this.maxAge; } } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java index e8234bf342..7e81d19a0d 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java @@ -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. @@ -182,10 +182,10 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu MapBindingResult errors = new MapBindingResult(new HashMap(), "dummy"); PrintWriter stackTrace = new PrintWriter(new StringWriter()); e.printStackTrace(stackTrace); - errors.reject(errorCode, new Object[] { e, e.getMessage(), stackTrace.toString() }, + errors.reject(this.errorCode, new Object[] { e, e.getMessage(), stackTrace.toString() }, "A Spring Integration handler raised an exception while handling an HTTP request. The exception is of type " + e.getClass() + " and it has a message: (" + e.getMessage() + ")"); - modelAndView.addObject(errorsKey, errors); + modelAndView.addObject(this.errorsKey, errors); } return modelAndView; } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java index a354f227b8..3487fcc25d 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java @@ -195,7 +195,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa * @return Whether to expect a reply. */ protected boolean isExpectReply() { - return expectReply; + return this.expectReply; } /** @@ -283,7 +283,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa } public final RequestMapping getRequestMapping() { - return requestMapping; + return this.requestMapping; } @@ -297,7 +297,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa } public CrossOrigin getCrossOrigin() { - return crossOrigin; + return this.crossOrigin; } /** diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/RequestMapping.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/RequestMapping.java index c5220654e3..d5f25bda3f 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/RequestMapping.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/RequestMapping.java @@ -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. @@ -51,7 +51,7 @@ public class RequestMapping { } public String[] getPathPatterns() { - return pathPatterns; + return this.pathPatterns; } public void setMethods(HttpMethod... supportedMethods) { @@ -60,7 +60,7 @@ public class RequestMapping { } public HttpMethod[] getMethods() { - return methods; + return this.methods; } public void setParams(String... params) { @@ -69,7 +69,7 @@ public class RequestMapping { } public String[] getParams() { - return params; + return this.params; } public void setHeaders(String... headers) { @@ -78,7 +78,7 @@ public class RequestMapping { } public String[] getHeaders() { - return headers; + return this.headers; } public void setConsumes(String... consumes) { @@ -87,7 +87,7 @@ public class RequestMapping { } public String[] getConsumes() { - return consumes; + return this.consumes; } public void setProduces(String... produces) { @@ -96,7 +96,7 @@ public class RequestMapping { } public String[] getProduces() { - return produces; + return this.produces; } public RequestMethod[] getRequestMethods() { diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java index bf39eae86b..587e6ea9f1 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java @@ -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. @@ -53,7 +53,7 @@ public class SimpleMultipartFileReader implements MultipartFileReader { MediaType contentType = MediaType.parseMediaType(multipartFile.getContentType()); Charset charset = contentType.getCharSet(); if (charset == null) { - charset = defaultCharset; + charset = this.defaultCharset; } return new String(multipartFile.getBytes(), charset.name()); } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java b/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java index 19a68c5b3c..4d1a8b6ac7 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java @@ -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. @@ -400,7 +400,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF public void fromHeaders(MessageHeaders headers, HttpHeaders target) { if (logger.isDebugEnabled()) { logger.debug(MessageFormat.format("outboundHeaderNames={0}", - CollectionUtils.arrayToList(outboundHeaderNames))); + CollectionUtils.arrayToList(this.outboundHeaderNames))); } for (Entry entry : headers.entrySet()) { String name = entry.getKey(); @@ -434,7 +434,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF public Map toHeaders(HttpHeaders source) { if (logger.isDebugEnabled()) { logger.debug(MessageFormat.format("inboundHeaderNames={0}", - CollectionUtils.arrayToList(inboundHeaderNames))); + CollectionUtils.arrayToList(this.inboundHeaderNames))); } Map target = new HashMap(); Set headerNames = source.keySet(); diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java index d9adc4e9ed..4e6be6e0bb 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java @@ -427,7 +427,7 @@ public class HttpRequestHandlingMessagingGatewayTests extends AbstractHttpInboun private static class TestHttpMessageConverter extends AbstractHttpMessageConverter { - public TestHttpMessageConverter() { + TestHttpMessageConverter() { setSupportedMediaTypes(Arrays.asList(MediaType.ALL)); } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java index 938a655e71..8e36dda230 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java @@ -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. @@ -65,7 +65,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter * @return The port on which this receiver is listening. */ public int getPort() { - return port; + return this.port; } @Override @@ -77,7 +77,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter * @return the soTimeout */ public int getSoTimeout() { - return soTimeout; + return this.soTimeout; } @Override @@ -89,7 +89,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter * @return the soReceiveBufferSize */ public int getSoReceiveBufferSize() { - return soReceiveBufferSize; + return this.soReceiveBufferSize; } public void setReceiveBufferSize(int receiveBufferSize) { @@ -100,7 +100,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter * @return the receiveBufferSize */ public int getReceiveBufferSize() { - return receiveBufferSize; + return this.receiveBufferSize; } /** @@ -146,7 +146,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter } public boolean isListening() { - return listening; + return this.listening; } /** @@ -157,7 +157,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter } public String getLocalAddress() { - return localAddress; + return this.localAddress; } @Override @@ -179,14 +179,14 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter * @return the taskExecutor */ public Executor getTaskExecutor() { - return taskExecutor; + return this.taskExecutor; } /** * @return the active */ public boolean isActive() { - return active; + return this.active; } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java index 13369a3b2a..57230521e2 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java @@ -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. @@ -87,7 +87,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst * @return the host */ public String getHost() { - return host; + return this.host; } @@ -95,7 +95,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst * @return the port */ public int getPort() { - return port; + return this.port; } @@ -103,7 +103,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst * @return the destinationAddress */ public SocketAddress getDestinationAddress() { - return destinationAddress; + return this.destinationAddress; } @@ -111,7 +111,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst * @return the soTimeout */ public int getSoTimeout() { - return soTimeout; + return this.soTimeout; } @@ -119,7 +119,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst * @return the soSendBufferSize */ public int getSoSendBufferSize() { - return soSendBufferSize; + return this.soSendBufferSize; } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java index 7016579a4a..af898448c5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java @@ -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. @@ -135,7 +135,7 @@ public class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean requestMessage) { - Assert.notNull(connectionFactory, this.getClass().getName() + + Assert.notNull(this.connectionFactory, this.getClass().getName() + " requires a client connection factory"); boolean haveSemaphore = false; TcpConnection connection = null; @@ -131,7 +131,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler AsyncReply reply = new AsyncReply(this.remoteTimeoutExpression.getValue(this.evaluationContext, requestMessage, Long.class)); connectionId = connection.getConnectionId(); - pendingReplies.put(connectionId, reply); + this.pendingReplies.put(connectionId, reply); if (logger.isDebugEnabled()) { logger.debug("Added pending reply " + connectionId); } @@ -159,7 +159,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler } finally { if (connectionId != null) { - pendingReplies.remove(connectionId); + this.pendingReplies.remove(connectionId); if (logger.isDebugEnabled()) { logger.debug("Removed pending reply " + connectionId); } @@ -187,7 +187,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler if (logger.isTraceEnabled()) { logger.trace("onMessage: " + connectionId + "(" + message + ")"); } - AsyncReply reply = pendingReplies.get(connectionId); + AsyncReply reply = this.pendingReplies.get(connectionId); if (reply == null) { if (message instanceof ErrorMessage) { /* @@ -265,7 +265,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler * @return the connectionFactory */ protected AbstractConnectionFactory getConnectionFactory() { - return connectionFactory; + return this.connectionFactory; } /** @@ -305,7 +305,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler Thread.currentThread().interrupt(); } boolean waitForMessageAfterError = true; - while (reply instanceof ErrorMessage) { + while (this.reply instanceof ErrorMessage) { if (waitForMessageAfterError) { /* * Possible race condition with NIO; we might have received the close @@ -315,11 +315,11 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler this.secondChanceLatch.await(2, TimeUnit.SECONDS); waitForMessageAfterError = false; } - else if (reply.getPayload() instanceof MessagingException) { - throw (MessagingException) reply.getPayload(); + else if (this.reply.getPayload() instanceof MessagingException) { + throw (MessagingException) this.reply.getPayload(); } else { - throw new MessagingException("Exception while awaiting reply", (Throwable) reply.getPayload()); + throw new MessagingException("Exception while awaiting reply", (Throwable) this.reply.getPayload()); } } return this.reply; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapter.java index 3bb9eabc28..445097b65d 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpReceivingChannelAdapter.java @@ -198,14 +198,14 @@ public class TcpReceivingChannelAdapter * @return the clientConnectionFactory */ protected ConnectionFactory getClientConnectionFactory() { - return clientConnectionFactory; + return this.clientConnectionFactory; } /** * @return the serverConnectionFactory */ protected ConnectionFactory getServerConnectionFactory() { - return serverConnectionFactory; + return this.serverConnectionFactory; } /** diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java index ef9acd9a14..e3860184f5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java @@ -96,7 +96,7 @@ public class TcpSendingMessageHandler extends AbstractMessageHandler implements Object connectionId = message.getHeaders().get(IpHeaders.CONNECTION_ID); TcpConnection connection = null; if (connectionId != null) { - connection = connections.get(connectionId); + connection = this.connections.get(connectionId); } if (connection != null) { try { @@ -213,12 +213,12 @@ public class TcpSendingMessageHandler extends AbstractMessageHandler implements @Override public void addNewConnection(TcpConnection connection) { - connections.put(connection.getConnectionId(), connection); + this.connections.put(connection.getConnectionId(), connection); } @Override public void removeDeadConnection(TcpConnection connection) { - connections.remove(connection.getConnectionId()); + this.connections.remove(connection.getConnectionId()); } @Override @@ -304,21 +304,21 @@ public class TcpSendingMessageHandler extends AbstractMessageHandler implements * @return the clientConnectionFactory */ protected ConnectionFactory getClientConnectionFactory() { - return clientConnectionFactory; + return this.clientConnectionFactory; } /** * @return the serverConnectionFactory */ protected ConnectionFactory getServerConnectionFactory() { - return serverConnectionFactory; + return this.serverConnectionFactory; } /** * @return the connections */ protected Map getConnections() { - return connections; + return this.connections; } /** diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java index 4d035ad3fa..ea4cb1003d 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java @@ -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 abstract class AbstractClientConnectionFactory extends AbstractConnection * @return the theConnection */ protected TcpConnectionSupport getTheConnection() { - return theConnection; + return this.theConnection; } /** diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java index fd25bccc17..4c5d4e6090 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java @@ -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. @@ -148,7 +148,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } public ApplicationEventPublisher getApplicationEventPublisher() { - return applicationEventPublisher; + return this.applicationEventPublisher; } /** @@ -181,7 +181,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soTimeout */ public int getSoTimeout() { - return soTimeout; + return this.soTimeout; } /** @@ -195,7 +195,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soReceiveBufferSize */ public int getSoReceiveBufferSize() { - return soReceiveBufferSize; + return this.soReceiveBufferSize; } /** @@ -209,7 +209,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soSendBufferSize */ public int getSoSendBufferSize() { - return soSendBufferSize; + return this.soSendBufferSize; } /** @@ -223,7 +223,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soTcpNoDelay */ public boolean isSoTcpNoDelay() { - return soTcpNoDelay; + return this.soTcpNoDelay; } /** @@ -237,7 +237,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soLinger */ public int getSoLinger() { - return soLinger; + return this.soLinger; } /** @@ -251,7 +251,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soKeepAlive */ public boolean isSoKeepAlive() { - return soKeepAlive; + return this.soKeepAlive; } /** @@ -265,7 +265,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the soTrafficClass */ public int getSoTrafficClass() { - return soTrafficClass; + return this.soTrafficClass; } /** @@ -279,49 +279,49 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the host */ public String getHost() { - return host; + return this.host; } /** * @return the port */ public int getPort() { - return port; + return this.port; } /** * @return the listener */ public TcpListener getListener() { - return listener; + return this.listener; } /** * @return the sender */ public TcpSender getSender() { - return sender; + return this.sender; } /** * @return the serializer */ public Serializer getSerializer() { - return serializer; + return this.serializer; } /** * @return the deserializer */ public Deserializer getDeserializer() { - return deserializer; + return this.deserializer; } /** * @return the mapper */ public TcpMessageMapper getMapper() { - return mapper; + return this.mapper; } /** @@ -384,7 +384,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the singleUse */ public boolean isSingleUse() { - return singleUse; + return this.singleUse; } /** @@ -413,7 +413,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the lookupHost */ public boolean isLookupHost() { - return lookupHost; + return this.lookupHost; } /** @@ -429,11 +429,11 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } protected BlockingQueue getDelayedReads() { - return delayedReads; + return this.delayedReads; } protected long getReadDelay() { - return readDelay; + return this.readDelay; } /** @@ -574,7 +574,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport logger.debug("Removing closed channel"); it.remove(); } - else if (soTimeout > 0) { + else if (this.soTimeout > 0) { TcpNioConnection connection = connections.get(channel); if (now - connection.getLastRead() >= this.soTimeout) { /* @@ -606,7 +606,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } this.harvestClosedConnections(); if (logger.isTraceEnabled()) { - if (host == null) { + if (this.host == null) { logger.trace("Port " + this.port + " SelectionCount: " + selectionCount); } else { logger.trace("Host " + this.host + " port " + this.port + " SelectionCount: " + selectionCount); @@ -829,7 +829,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * @return the active */ protected boolean isActive() { - return active; + return this.active; } /** @@ -846,7 +846,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } protected TcpSocketSupport getTcpSocketSupport() { - return tcpSocketSupport; + return this.tcpSocketSupport; } public void setTcpSocketSupport(TcpSocketSupport tcpSocketSupport) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java index e216c8bc8b..cece7f1a6b 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2015 the original author or authors. + * Copyright 2001-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. @@ -104,11 +104,11 @@ public abstract class AbstractServerConnectionFactory extends AbstractConnection * @return true if the server is listening on the port. */ public boolean isListening() { - return listening; + return this.listening; } protected boolean isShuttingDown() { - return shuttingDown; + return this.shuttingDown; } /** @@ -153,7 +153,7 @@ public abstract class AbstractServerConnectionFactory extends AbstractConnection * @return the localAddress */ public String getLocalAddress() { - return localAddress; + return this.localAddress; } /** diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java index e42903ec00..589a77431b 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java @@ -63,7 +63,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact @Override public TcpConnectionSupport createForPool() { try { - return targetConnectionFactory.getConnection(); + return CachingClientConnectionFactory.this.targetConnectionFactory.getConnection(); } catch (Exception e) { throw new MessagingException("Failed to obtain connection", e); @@ -163,7 +163,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact } super.close(); } - pool.releaseItem(getTheConnection()); + CachingClientConnectionFactory.this.pool.releaseItem(getTheConnection()); } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java index 13db3579b1..3878dd0062 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java @@ -53,18 +53,18 @@ public class ClientModeConnectionManager implements Runnable { synchronized (this.clientConnectionFactory) { try { TcpConnection connection = this.clientConnectionFactory.getConnection(); - if (connection != lastConnection) { - if (logger.isDebugEnabled()) { - logger.debug("Connection " + connection.getConnectionId() + " established"); + if (connection != this.lastConnection) { + if (this.logger.isDebugEnabled()) { + this.logger.debug("Connection " + connection.getConnectionId() + " established"); } - lastConnection = connection; + this.lastConnection = connection; } else { - if (logger.isTraceEnabled()) { - logger.trace("Connection " + connection.getConnectionId() + " still OK"); + if (this.logger.isTraceEnabled()) { + this.logger.trace("Connection " + connection.getConnectionId() + " still OK"); } } } catch (Exception e) { - logger.error("Could not establish connection using " + this.clientConnectionFactory, e); + this.logger.error("Could not establish connection using " + this.clientConnectionFactory, e); } } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpSSLContextSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpSSLContextSupport.java index 113b4958ba..7dfe4a7374 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpSSLContextSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/DefaultTcpSSLContextSupport.java @@ -73,16 +73,16 @@ public class DefaultTcpSSLContextSupport implements TcpSSLContextSupport { KeyStore ks = KeyStore.getInstance("JKS"); KeyStore ts = KeyStore.getInstance("JKS"); - ks.load(keyStore.getInputStream(), keyStorePassword); - ts.load(trustStore.getInputStream(), trustStorePassword); + ks.load(this.keyStore.getInputStream(), this.keyStorePassword); + ts.load(this.trustStore.getInputStream(), this.trustStorePassword); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, keyStorePassword); + kmf.init(ks, this.keyStorePassword); TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); - SSLContext sslContext = SSLContext.getInstance(protocol); + SSLContext sslContext = SSLContext.getInstance(this.protocol); sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java index 8c517b5ac3..c2316040fd 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java @@ -51,7 +51,7 @@ public class FailoverClientConnectionFactory extends AbstractClientConnectionFac @Override protected void onInit() throws Exception { super.onInit(); - for (AbstractClientConnectionFactory factory : factories) { + for (AbstractClientConnectionFactory factory : this.factories) { Assert.state(!(this.isSingleUse() ^ factory.isSingleUse()), "Inconsistent singleUse - delegate factories must match this one"); factory.enableManualListenerRegistration(); @@ -304,7 +304,7 @@ public class FailoverClientConnectionFactory extends AbstractClientConnectionFac @Override public String getConnectionId() { - return this.connectionId + ":" + epoch; + return this.connectionId + ":" + this.epoch; } @Override diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java index f30fcfde80..d8fa0adfd1 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionFailedCorrelationEvent.java @@ -41,7 +41,7 @@ public class TcpConnectionFailedCorrelationEvent extends IpIntegrationEvent { } public String getConnectionId() { - return connectionId; + return this.connectionId; } @Override diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactoryChain.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactoryChain.java index e4ddd6d10d..92cf0cc8f1 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactoryChain.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactoryChain.java @@ -28,7 +28,7 @@ public class TcpConnectionInterceptorFactoryChain { private TcpConnectionInterceptorFactory[] interceptorFactories; public TcpConnectionInterceptorFactory[] getInterceptorFactories() { - return interceptorFactories;//NOSONAR + return this.interceptorFactories;//NOSONAR } public void setInterceptors(TcpConnectionInterceptorFactory[] interceptorFactories) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java index ff22493ef2..7ebede2ef1 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java @@ -185,7 +185,7 @@ public abstract class TcpConnectionInterceptorSupport extends TcpConnectionSuppo */ @Override public TcpListener getListener() { - return tcpListener; + return this.tcpListener; } @Override diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionServerListeningEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionServerListeningEvent.java index 24d1473e50..df3c7effa1 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionServerListeningEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionServerListeningEvent.java @@ -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. @@ -40,7 +40,7 @@ public class TcpConnectionServerListeningEvent extends IpIntegrationEvent { } public int getPort() { - return port; + return this.port; } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java index 2cb919c66e..b17a8ffbb8 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java @@ -134,8 +134,8 @@ public abstract class TcpConnectionSupport implements TcpConnection { if (connectionFactoryName != null) { this.connectionFactoryName = connectionFactoryName; } - if (logger.isDebugEnabled()) { - logger.debug("New connection " + this.getConnectionId()); + if (this.logger.isDebugEnabled()) { + this.logger.debug("New connection " + this.getConnectionId()); } } @@ -181,7 +181,7 @@ public abstract class TcpConnectionSupport implements TcpConnection { * @return the mapper */ public TcpMessageMapper getMapper() { - return mapper; + return this.mapper; } /** @@ -277,8 +277,8 @@ public abstract class TcpConnectionSupport implements TcpConnection { @Override public TcpListener getListener() { if (this.manualListenerRegistration) { - if (logger.isDebugEnabled()) { - logger.debug(getConnectionId() + " Waiting for listener registration"); + if (this.logger.isDebugEnabled()) { + this.logger.debug(getConnectionId() + " Waiting for listener registration"); } waitForListenerRegistration(); } @@ -287,8 +287,8 @@ public abstract class TcpConnectionSupport implements TcpConnection { private void waitForListenerRegistration() { try { - Assert.state(listenerRegisteredLatch.await(1, TimeUnit.MINUTES), "TcpListener not registered"); - manualListenerRegistration = false; + Assert.state(this.listenerRegisteredLatch.await(1, TimeUnit.MINUTES), "TcpListener not registered"); + this.manualListenerRegistration = false; } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -300,12 +300,12 @@ public abstract class TcpConnectionSupport implements TcpConnection { * @return the sender */ public TcpSender getSender() { - return sender; + return this.sender; } @Override public boolean isServer() { - return server; + return this.server; } @Override @@ -337,7 +337,7 @@ public abstract class TcpConnectionSupport implements TcpConnection { } protected boolean isNoReadErrorOnClose() { - return noReadErrorOnClose; + return this.noReadErrorOnClose; } protected void setNoReadErrorOnClose(boolean noReadErrorOnClose) { @@ -384,21 +384,21 @@ public abstract class TcpConnectionSupport implements TcpConnection { private void doPublish(TcpConnectionEvent event) { try { if (this.applicationEventPublisher == null) { - logger.warn("No publisher available to publish " + event); + this.logger.warn("No publisher available to publish " + event); } else { this.applicationEventPublisher.publishEvent(event); - if (logger.isTraceEnabled()) { - logger.trace("Published: " + event); + if (this.logger.isTraceEnabled()) { + this.logger.trace("Published: " + event); } } } catch (Exception e) { - if (logger.isDebugEnabled()) { - logger.debug("Failed to publish " + event, e); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Failed to publish " + event, e); } - else if (logger.isWarnEnabled()) { - logger.warn("Failed to publish " + event + ":" + e.getMessage()); + else if (this.logger.isWarnEnabled()) { + this.logger.warn("Failed to publish " + event + ":" + e.getMessage()); } } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java index 23819faab2..e961579d7e 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java @@ -119,8 +119,8 @@ public class TcpMessageMapper implements message = messageBuilder.build(); } else { - if (logger.isWarnEnabled()) { - logger.warn("Null payload from connection " + connection.getConnectionId()); + if (this.logger.isWarnEnabled()) { + this.logger.warn("Null payload from connection " + connection.getConnectionId()); } } return message; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java index 3836babfad..d76e9268db 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java @@ -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. @@ -77,7 +77,7 @@ public class TcpNetClientConnectionFactory extends } protected TcpSocketFactorySupport getTcpSocketFactorySupport() { - return tcpSocketFactorySupport; + return this.tcpSocketFactorySupport; } public void setTcpSocketFactorySupport( diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java index db73960502..fc65e155cf 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2015 the original author or authors. + * Copyright 2001-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,7 +96,7 @@ public class TcpNetConnection extends TcpConnectionSupport implements Scheduling public synchronized void send(Message message) throws Exception { if (this.socketOutputStream == null) { int writeBufferSize = this.socket.getSendBufferSize(); - this.socketOutputStream = new BufferedOutputStream(socket.getOutputStream(), + this.socketOutputStream = new BufferedOutputStream(this.socket.getOutputStream(), writeBufferSize > 0 ? writeBufferSize : 8192); } Object object = this.getMapper().fromMessage(message); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java index 332f2de64e..c2fb1dc2e2 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java @@ -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. @@ -200,11 +200,11 @@ public class TcpNetServerConnectionFactory extends AbstractServerConnectionFacto * @return the serverSocket */ protected ServerSocket getServerSocket() { - return serverSocket; + return this.serverSocket; } protected TcpSocketFactorySupport getTcpSocketFactorySupport() { - return tcpSocketFactorySupport; + return this.tcpSocketFactorySupport; } public void setTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java index ac8e026d41..e88ba99dac 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java @@ -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. @@ -94,8 +94,8 @@ public class TcpNioClientConnectionFactory extends connection.setLastRead(System.currentTimeMillis()); } this.channelMap.put(socketChannel, connection); - newChannels.add(socketChannel); - selector.wakeup(); + this.newChannels.add(socketChannel); + this.selector.wakeup(); return wrappedConnection; } @@ -159,16 +159,16 @@ public class TcpNioClientConnectionFactory extends if (getDelayedReads().size() > 0 && (timeout == 0 || getReadDelay() < timeout)) { timeout = getReadDelay(); } - selectionCount = selector.select(timeout); + selectionCount = this.selector.select(timeout); } catch (CancelledKeyException cke) { if (logger.isDebugEnabled()) { logger.debug("CancelledKeyException during Selector.select()"); } } - while ((newChannel = newChannels.poll()) != null) { + while ((newChannel = this.newChannels.poll()) != null) { try { - newChannel.register(this.selector, SelectionKey.OP_READ, channelMap.get(newChannel)); + newChannel.register(this.selector, SelectionKey.OP_READ, this.channelMap.get(newChannel)); } catch (ClosedChannelException cce) { if (logger.isDebugEnabled()) { @@ -176,7 +176,7 @@ public class TcpNioClientConnectionFactory extends } } } - this.processNioSelections(selectionCount, selector, null, this.channelMap); + this.processNioSelections(selectionCount, this.selector, null, this.channelMap); } } catch (ClosedSelectorException cse) { @@ -197,21 +197,21 @@ public class TcpNioClientConnectionFactory extends * @return the usingDirectBuffers */ protected boolean isUsingDirectBuffers() { - return usingDirectBuffers; + return this.usingDirectBuffers; } /** * @return the connections */ protected Map getConnections() { - return channelMap; + return this.channelMap; } /** * @return the newChannels */ protected BlockingQueue getNewChannels() { - return newChannels; + return this.newChannels; } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java index 8a2bee94d2..34e9c6742a 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java @@ -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. @@ -122,7 +122,7 @@ public class TcpNioConnection extends TcpConnectionSupport { private void doClose() { try { - channelInputStream.close(); + this.channelInputStream.close(); } catch (IOException e) {} try { @@ -309,7 +309,7 @@ public class TcpNioConnection extends TcpConnectionSupport { logger.trace(getConnectionId() + " checking data avail: " + this.channelInputStream.available() + " pending: " + (this.writingToPipe)); } - return writingToPipe || this.channelInputStream.available() > 0; + return this.writingToPipe || this.channelInputStream.available() > 0; } /** @@ -387,7 +387,7 @@ public class TcpNioConnection extends TcpConnectionSupport { private void doRead() throws Exception { if (this.rawBuffer == null) { - this.rawBuffer = allocate(maxMessageSize); + this.rawBuffer = allocate(this.maxMessageSize); } this.writingLatch = new CountDownLatch(1); @@ -416,9 +416,9 @@ public class TcpNioConnection extends TcpConnectionSupport { logger.trace("After flip:" + this.rawBuffer.position() + "/" + this.rawBuffer.limit()); } if (logger.isDebugEnabled()) { - logger.debug("Read " + rawBuffer.limit() + " into raw buffer"); + logger.debug("Read " + this.rawBuffer.limit() + " into raw buffer"); } - this.sendToPipe(rawBuffer); + this.sendToPipe(this.rawBuffer); } catch (RejectedExecutionException e) { throw e; @@ -526,11 +526,11 @@ public class TcpNioConnection extends TcpConnectionSupport { } protected boolean isUsingDirectBuffers() { - return usingDirectBuffers; + return this.usingDirectBuffers; } protected ChannelOutputStream getChannelOutputStream() { - return channelOutputStream; + return this.channelOutputStream; } /** @@ -538,7 +538,7 @@ public class TcpNioConnection extends TcpConnectionSupport { * @return Time of last read. */ public long getLastRead() { - return lastRead; + return this.lastRead; } /** @@ -553,7 +553,7 @@ public class TcpNioConnection extends TcpConnectionSupport { * @return the time of the last send */ public long getLastSend() { - return lastSend; + return this.lastSend; } /** @@ -599,23 +599,23 @@ public class TcpNioConnection extends TcpConnectionSupport { if (logger.isDebugEnabled()) { logger.debug(getConnectionId() + " writing " + buffer.remaining()); } - socketChannel.write(buffer); + TcpNioConnection.this.socketChannel.write(buffer); int remaining = buffer.remaining(); if (remaining == 0) { return; } if (this.selector == null) { this.selector = Selector.open(); - this.soTimeout = socketChannel.socket().getSoTimeout(); + this.soTimeout = TcpNioConnection.this.socketChannel.socket().getSoTimeout(); } - socketChannel.register(selector, SelectionKey.OP_WRITE); + TcpNioConnection.this.socketChannel.register(this.selector, SelectionKey.OP_WRITE); while (remaining > 0) { int selectionCount = this.selector.select(this.soTimeout); if (selectionCount == 0) { throw new SocketTimeoutException("Timeout on write"); } - selector.selectedKeys().clear(); - socketChannel.write(buffer); + this.selector.selectedKeys().clear(); + TcpNioConnection.this.socketChannel.write(buffer); remaining = buffer.remaining(); } } @@ -672,7 +672,7 @@ public class TcpNioConnection extends TcpConnectionSupport { @Override public synchronized int read() throws IOException { - if (this.isClosed && available.get() == 0) { + if (this.isClosed && this.available.get() == 0) { if (TcpNioConnection.this.timedOut) { throw new SocketTimeoutException("Connection has timed out"); } @@ -701,7 +701,7 @@ public class TcpNioConnection extends TcpConnectionSupport { byte[] buffer = null; while (buffer == null) { try { - buffer = buffers.poll(1, TimeUnit.SECONDS); + buffer = this.buffers.poll(1, TimeUnit.SECONDS); if (buffer == null && this.isClosed) { return null; } @@ -729,7 +729,7 @@ public class TcpNioConnection extends TcpConnectionSupport { TcpNioConnection.this.writingLatch.countDown(); } try { - if (!this.buffers.offer(buffer, pipeTimeout, TimeUnit.MILLISECONDS)) { + if (!this.buffers.offer(buffer, TcpNioConnection.this.pipeTimeout, TimeUnit.MILLISECONDS)) { throw new IOException("Timed out waiting for buffer space"); } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java index 3c9a82b910..d7b494f1ab 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java @@ -93,7 +93,7 @@ public class TcpNioSSLConnection extends TcpNioConnection { protected void sendToPipe(final ByteBuffer networkBuffer) throws IOException { Assert.notNull(networkBuffer, "rawBuffer cannot be null"); if (logger.isDebugEnabled()) { - logger.debug("sendToPipe " + sslEngine.getHandshakeStatus() + ", remaining:" + networkBuffer.remaining()); + logger.debug("sendToPipe " + this.sslEngine.getHandshakeStatus() + ", remaining:" + networkBuffer.remaining()); } SSLEngineResult result = null; while (!this.needMoreNetworkData) { @@ -215,7 +215,7 @@ public class TcpNioSSLConnection extends TcpNioConnection { runTasks(); } } - HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); + HandshakeStatus handshakeStatus = this.sslEngine.getHandshakeStatus(); if (logger.isDebugEnabled()) { logger.debug("New handshake status " + handshakeStatus); } @@ -367,7 +367,7 @@ public class TcpNioSSLConnection extends TcpNioConnection { if (logger.isTraceEnabled()) { logger.trace("Writer waiting for handshake"); } - if (!semaphore.tryAcquire(30, TimeUnit.SECONDS)) { + if (!TcpNioSSLConnection.this.semaphore.tryAcquire(30, TimeUnit.SECONDS)) { throw new MessagingException("SSL Handshaking taking too long"); } if (logger.isTraceEnabled()) { @@ -392,7 +392,7 @@ public class TcpNioSSLConnection extends TcpNioConnection { logger.debug("After wrap:" + resultToString(result) + " Plaintext buffer @" + plainText.position() + "/" + plainText.limit()); } if (result.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) { - TcpNioSSLConnection.this.encoded = allocateEncryptionBuffer(sslEngine.getSession().getPacketBufferSize()); + TcpNioSSLConnection.this.encoded = allocateEncryptionBuffer(TcpNioSSLConnection.this.sslEngine.getSession().getPacketBufferSize()); result = TcpNioSSLConnection.this.sslEngine.wrap(plainText, TcpNioSSLConnection.this.encoded); } return result; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java index 1c142d7d6a..665dd113c6 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java @@ -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. @@ -284,21 +284,21 @@ public class TcpNioServerConnectionFactory extends AbstractServerConnectionFacto * @return the serverChannel */ protected ServerSocketChannel getServerChannel() { - return serverChannel; + return this.serverChannel; } /** * @return the usingDirectBuffers */ protected boolean isUsingDirectBuffers() { - return usingDirectBuffers; + return this.usingDirectBuffers; } /** * @return the connections */ protected Map getConnections() { - return channelMap; + return this.channelMap; } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/AbstractByteArraySerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/AbstractByteArraySerializer.java index c91ae4339a..cb006d0d70 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/AbstractByteArraySerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/AbstractByteArraySerializer.java @@ -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. @@ -51,7 +51,7 @@ public abstract class AbstractByteArraySerializer implements * @return The max message size. */ public int getMaxMessageSize() { - return maxMessageSize; + return this.maxMessageSize; } /** @@ -70,7 +70,7 @@ public abstract class AbstractByteArraySerializer implements protected void checkClosure(int bite) throws IOException { if (bite < 0) { - logger.debug("Socket closed during message assembly"); + this.logger.debug("Socket closed during message assembly"); throw new IOException("Socket closed during message assembly"); } } @@ -96,8 +96,8 @@ public abstract class AbstractByteArraySerializer implements if (this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(event); } - else if (logger.isTraceEnabled()) { - logger.trace("No event publisher for " + event); + else if (this.logger.isTraceEnabled()) { + this.logger.trace("No event publisher for " + event); } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java index 2e51bfa473..8bbabead71 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java @@ -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. @@ -99,8 +99,8 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer @Override public byte[] deserialize(InputStream inputStream) throws IOException { int messageLength = this.readHeader(inputStream); - if (logger.isDebugEnabled()) { - logger.debug("Message length is " + messageLength); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Message length is " + messageLength); } byte[] messagePart = null; try { @@ -160,8 +160,8 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer throw new IOException("Stream closed after " + lengthRead + " of " + needed); } lengthRead += len; - if (logger.isDebugEnabled()) { - logger.debug("Read " + len + " bytes, buffer is now at " + + if (this.logger.isDebugEnabled()) { + this.logger.debug("Read " + len + " bytes, buffer is now at " + lengthRead + " of " + needed); } @@ -184,7 +184,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer case HEADER_SIZE_UNSIGNED_BYTE: if (length > 0xff) { throw new IllegalArgumentException("Length header:" - + headerSize + + this.headerSize + " too short to accommodate message length:" + length); } lengthPart.put((byte) length); @@ -192,13 +192,13 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer case HEADER_SIZE_UNSIGNED_SHORT: if (length > 0xffff) { throw new IllegalArgumentException("Length header:" - + headerSize + + this.headerSize + " too short to accommodate message length:" + length); } lengthPart.putShort((short) length); break; default: - throw new IllegalArgumentException("Bad header size:" + headerSize); + throw new IllegalArgumentException("Bad header size:" + this.headerSize); } outputStream.write(lengthPart.array()); } @@ -236,7 +236,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer messageLength = ByteBuffer.wrap(lengthPart).getShort() & 0xffff; break; default: - throw new IllegalArgumentException("Bad header size:" + headerSize); + throw new IllegalArgumentException("Bad header size:" + this.headerSize); } return messageLength; } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArraySingleTerminatorSerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArraySingleTerminatorSerializer.java index a0c400c915..b6a8f4f89b 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArraySingleTerminatorSerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArraySingleTerminatorSerializer.java @@ -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,12 +57,12 @@ public class ByteArraySingleTerminatorSerializer extends AbstractByteArraySerial throw new SoftEndOfStreamException("Stream closed between payloads"); } checkClosure(bite); - if (bite == terminator) { + if (bite == this.terminator) { break; } buffer[n++] = (byte) bite; if (n >= this.maxMessageSize) { - throw new IOException("Terminator '0x" + Integer.toHexString(terminator & 0xff) + throw new IOException("Terminator '0x" + Integer.toHexString(this.terminator & 0xff) + "' not found before max message length: " + this.maxMessageSize); } @@ -90,7 +90,7 @@ public class ByteArraySingleTerminatorSerializer extends AbstractByteArraySerial @Override public void serialize(byte[] bytes, OutputStream outputStream) throws IOException { outputStream.write(bytes); - outputStream.write(terminator); + outputStream.write(this.terminator); } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/TcpDeserializationExceptionEvent.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/TcpDeserializationExceptionEvent.java index 5dd730dc13..53cb36cf25 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/TcpDeserializationExceptionEvent.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/TcpDeserializationExceptionEvent.java @@ -43,11 +43,11 @@ public class TcpDeserializationExceptionEvent extends IpIntegrationEvent { } public byte[] getBuffer() { - return buffer;//NOSONAR - direct access + return this.buffer;//NOSONAR - direct access } public int getOffset() { - return offset; + return this.offset; } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java index d4132ff076..b07633d4c5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java @@ -114,7 +114,7 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler MulticastSocket socket; if (this.isAcknowledge()) { int ackPort = this.getAckPort(); - if (localAddress == null) { + if (this.localAddress == null) { socket = ackPort == 0 ? new MulticastSocket() : new MulticastSocket(ackPort); } else { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java index 8c3f989af7..c5d3d9ec05 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java @@ -183,7 +183,7 @@ public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolRece protected void doSend(final DatagramPacket packet) { Message message = null; try { - message = mapper.toMessage(packet); + message = this.mapper.toMessage(packet); if (logger.isDebugEnabled()) { logger.debug("Received:" + message); } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java index 4f79ba3f74..7fb635073e 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java @@ -261,7 +261,7 @@ public class UnicastSendingMessageHandler extends try { boolean waitForAck = this.waitForAck; if (waitForAck) { - countdownLatch = new CountDownLatch(ackCounter); + countdownLatch = new CountDownLatch(this.ackCounter); this.ackControl.put(messageId, countdownLatch); } convertAndSend(message); @@ -282,10 +282,10 @@ public class UnicastSendingMessageHandler extends } catch (Exception e) { try{ - socket.close(); + this.socket.close(); } catch (Exception e1) { } - socket = null; + this.socket = null; throw new MessageHandlingException(message, "failed to send UDP packet", e); } finally { @@ -305,10 +305,10 @@ public class UnicastSendingMessageHandler extends catch (IOException e) { logger.error("Error creating socket", e); } - ackLatch = new CountDownLatch(1); + this.ackLatch = new CountDownLatch(1); this.taskExecutor.execute(this); try { - ackLatch.await(10000, TimeUnit.MILLISECONDS); + this.ackLatch.await(10000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -365,8 +365,8 @@ public class UnicastSendingMessageHandler extends protected synchronized DatagramSocket getSocket() throws IOException { if (this.socket == null) { - if (acknowledge) { - if (localAddress == null) { + if (this.acknowledge) { + if (this.localAddress == null) { this.socket = this.ackPort == 0 ? new DatagramSocket() : new DatagramSocket(this.ackPort); } else { @@ -374,7 +374,7 @@ public class UnicastSendingMessageHandler extends this.socket = new DatagramSocket(new InetSocketAddress(whichNic, this.ackPort)); } if (this.soReceiveBufferSize > 0) { - socket.setReceiveBufferSize(this.soReceiveBufferSize); + this.socket.setReceiveBufferSize(this.soReceiveBufferSize); } if (logger.isDebugEnabled()) { logger.debug("Listening for acks on port: " + getAckPort()); @@ -445,7 +445,7 @@ public class UnicastSendingMessageHandler extends * @return the acknowledge */ public boolean isAcknowledge() { - return acknowledge; + return this.acknowledge; } /** @@ -465,7 +465,7 @@ public class UnicastSendingMessageHandler extends * @return the soReceiveBufferSize */ public int getSoReceiveBufferSize() { - return soReceiveBufferSize; + return this.soReceiveBufferSize; } @Override @@ -494,7 +494,7 @@ public class UnicastSendingMessageHandler extends public void run() { try { this.ackThreadRunning = true; - ackLatch.countDown(); + this.ackLatch.countDown(); DatagramPacket ackPack = new DatagramPacket(new byte[100], 100); while(true) { this.getSocket().receive(ackPack); @@ -527,9 +527,9 @@ public class UnicastSendingMessageHandler extends } private void closeSocketIfNeeded() { - if (socket != null) { - socket.close(); - socket = null; + if (this.socket != null) { + this.socket.close(); + this.socket = null; } } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionFactoryTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionFactoryTests.java index 4c58f19e53..945a29ba49 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionFactoryTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionFactoryTests.java @@ -261,7 +261,7 @@ public class ConnectionFactoryTests extends LogAdjustingTestSupport { @SuppressWarnings("serial") private class FooEvent extends TcpConnectionOpenEvent { - public FooEvent(TcpConnectionSupport connection, String connectionFactoryName) { + FooEvent(TcpConnectionSupport connection, String connectionFactoryName) { super(connection, connectionFactoryName); } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java index cdf1d5e95b..7bbf96c8b5 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java @@ -95,7 +95,7 @@ public class TcpConnectionEventListenerTests { @SuppressWarnings("serial") private class FooEvent extends TcpConnectionOpenEvent { - public FooEvent(TcpConnectionSupport connection, String connectionFactoryName) { + FooEvent(TcpConnectionSupport connection, String connectionFactoryName) { super(connection, connectionFactoryName); } @@ -104,7 +104,7 @@ public class TcpConnectionEventListenerTests { @SuppressWarnings("serial") private class BarEvent extends TcpConnectionOpenEvent { - public BarEvent(TcpConnectionSupport connection, String connectionFactoryName) { + BarEvent(TcpConnectionSupport connection, String connectionFactoryName) { super(connection, connectionFactoryName); } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/BeanPropertySqlParameterSourceFactory.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/BeanPropertySqlParameterSourceFactory.java index 7e54b88b97..01ce4210ea 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/BeanPropertySqlParameterSourceFactory.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/BeanPropertySqlParameterSourceFactory.java @@ -51,7 +51,7 @@ public class BeanPropertySqlParameterSourceFactory implements SqlParameterSource @Override public SqlParameterSource createParameterSource(Object input) { - SqlParameterSource toReturn = new StaticBeanPropertySqlParameterSource(input, staticParameters); + SqlParameterSource toReturn = new StaticBeanPropertySqlParameterSource(input, this.staticParameters); return toReturn; } @@ -69,13 +69,13 @@ public class BeanPropertySqlParameterSourceFactory implements SqlParameterSource @Override public Object getValue(String paramName) throws IllegalArgumentException { - return staticParameters.containsKey(paramName) ? staticParameters.get(paramName) : input + return this.staticParameters.containsKey(paramName) ? this.staticParameters.get(paramName) : this.input .getValue(paramName); } @Override public boolean hasValue(String paramName) { - return staticParameters.containsKey(paramName) || input.hasValue(paramName); + return this.staticParameters.containsKey(paramName) || this.input.hasValue(paramName); } } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java index b1d607a547..4241c2d183 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java @@ -172,15 +172,15 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre } public Object doGetValue(String paramName, boolean calledFromHasValue) throws IllegalArgumentException { - if (values.containsKey(paramName)) { - Object cachedByHasValue = values.get(paramName); + if (this.values.containsKey(paramName)) { + Object cachedByHasValue = this.values.get(paramName); if (!this.cache) { - values.remove(paramName); + this.values.remove(paramName); } return cachedByHasValue; } - if (!parameterExpressions.containsKey(paramName)) { + if (!this.parameterExpressions.containsKey(paramName)) { Expression[] expressions = new Expression[] { PARSER.parseExpression(paramName), PARSER.parseExpression("#root.![" + paramName + "]") @@ -191,16 +191,16 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre Expression expression = null; - if (input instanceof Collection) { - expression = parameterExpressions.get(paramName)[1]; + if (this.input instanceof Collection) { + expression = this.parameterExpressions.get(paramName)[1]; } else { - expression = parameterExpressions.get(paramName)[0]; + expression = this.parameterExpressions.get(paramName)[0]; } - Object value = evaluateExpression(expression, input); + Object value = evaluateExpression(expression, this.input); if (this.cache || calledFromHasValue) { - values.put(paramName, value); + this.values.put(paramName, value); } if (logger.isDebugEnabled()) { logger.debug("Resolved expression " + expression + " to " + value); @@ -221,7 +221,7 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre logger.debug("Could not evaluate expression", e); } if (this.cache) { - values.put(paramName, ERROR); + this.values.put(paramName, ERROR); } return false; } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java index bebe4f2836..b1fd44530d 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java @@ -159,7 +159,7 @@ public class JdbcMessageHandler extends AbstractMessageHandler { */ @Override protected void handleMessageInternal(Message message) throws Exception { - List> keys = executeUpdateQuery(message, keysGenerated); + List> keys = executeUpdateQuery(message, this.keysGenerated); if (!keys.isEmpty() && logger.isDebugEnabled()) { logger.debug("Generated keys: " + keys); } @@ -180,13 +180,13 @@ public class JdbcMessageHandler extends AbstractMessageHandler { @Override public List> doInPreparedStatement(PreparedStatement ps) throws SQLException { - preparedStatementSetter.setValues(ps, message); + JdbcMessageHandler.this.preparedStatementSetter.setValues(ps, message); ps.executeUpdate(); ResultSet keys = ps.getGeneratedKeys(); if (keys != null) { try { - return generatedKeysResultSetExtractor.extractData(keys); + return JdbcMessageHandler.this.generatedKeysResultSetExtractor.extractData(keys); } finally { JdbcUtils.closeResultSet(keys); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java index d6490b141d..91dd92c902 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java @@ -168,7 +168,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } public String getSql() { - return sql; + return this.sql; } } @@ -203,8 +203,8 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa * Convenient constructor for configuration use. */ public JdbcMessageStore() { - deserializer = new DeserializingConverter(); - serializer = new SerializingConverter(); + this.deserializer = new DeserializingConverter(); + this.serializer = new SerializingConverter(); } /** @@ -214,7 +214,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa */ public JdbcMessageStore(DataSource dataSource) { this(); - jdbcTemplate = new JdbcTemplate(dataSource); + this.jdbcTemplate = new JdbcTemplate(dataSource); } /** @@ -245,7 +245,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa * @param dataSource a {@link DataSource} */ public void setDataSource(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); + this.jdbcTemplate = new JdbcTemplate(dataSource); } /** @@ -290,7 +290,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa @Override public void afterPropertiesSet() throws Exception { - Assert.state(jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided"); + Assert.state(this.jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided"); } @Override @@ -299,7 +299,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa if (message == null) { return null; } - int updated = jdbcTemplate.update(getQuery(Query.DELETE_MESSAGE), new Object[] { getKey(id), region }, new int[] { + int updated = this.jdbcTemplate.update(getQuery(Query.DELETE_MESSAGE), new Object[] { getKey(id), this.region }, new int[] { Types.VARCHAR, Types.VARCHAR }); if (updated != 0) { return message; @@ -310,12 +310,12 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa @Override @ManagedAttribute public long getMessageCount() { - return jdbcTemplate.queryForObject(getQuery(Query.GET_MESSAGE_COUNT), Long.class, region); + return this.jdbcTemplate.queryForObject(getQuery(Query.GET_MESSAGE_COUNT), Long.class, this.region); } @Override public Message getMessage(UUID id) { - List> list = jdbcTemplate.query(getQuery(Query.GET_MESSAGE), new Object[] { getKey(id), region }, mapper); + List> list = this.jdbcTemplate.query(getQuery(Query.GET_MESSAGE), new Object[] { getKey(id), this.region }, this.mapper); if (list.isEmpty()) { return null; } @@ -343,18 +343,18 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa innerMap.put(MessageHeaders.ID, message.getHeaders().get(MessageHeaders.ID)); final String messageId = getKey(result.getHeaders().getId()); - final byte[] messageBytes = serializer.convert(result); + final byte[] messageBytes = this.serializer.convert(result); - jdbcTemplate.update(getQuery(Query.CREATE_MESSAGE), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.CREATE_MESSAGE), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ logger.debug("Inserting message with id key=" + messageId); } ps.setString(1, messageId); - ps.setString(2, region); + ps.setString(2, JdbcMessageStore.this.region); ps.setTimestamp(3, new Timestamp(createdDate)); - lobHandler.getLobCreator().setBlobAsBytes(ps, 4, messageBytes); + JdbcMessageStore.this.lobHandler.getLobCreator().setBlobAsBytes(ps, 4, messageBytes); } }); return result; @@ -364,13 +364,13 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa public MessageGroup addMessageToGroup(Object groupId, Message message) { final String groupKey = getKey(groupId); final String messageId = getKey(message.getHeaders().getId()); - boolean groupNotExist = jdbcTemplate.queryForObject(this.getQuery(Query.GROUP_EXISTS), Integer.class, groupKey, region) < 1; + boolean groupNotExist = this.jdbcTemplate.queryForObject(this.getQuery(Query.GROUP_EXISTS), Integer.class, groupKey, this.region) < 1; final Timestamp updatedDate = new Timestamp(System.currentTimeMillis()); final Timestamp createdDate = groupNotExist ? updatedDate : - jdbcTemplate.queryForObject(getQuery(Query.GET_GROUP_CREATED_DATE), new Object[] { groupKey, region}, Timestamp.class); + this.jdbcTemplate.queryForObject(getQuery(Query.GET_GROUP_CREATED_DATE), new Object[] { groupKey, this.region}, Timestamp.class); if (groupNotExist){ try { @@ -386,7 +386,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa this.addMessage(message); - jdbcTemplate.update(getQuery(Query.CREATE_GROUP_TO_MESSAGE), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.CREATE_GROUP_TO_MESSAGE), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -394,7 +394,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } ps.setString(1, groupKey); ps.setString(2, messageId); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); return getMessageGroup(groupId); @@ -404,20 +404,20 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa @Override @ManagedAttribute public int getMessageGroupCount() { - return jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_GROUPS), Integer.class, region); + return this.jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_GROUPS), Integer.class, this.region); } @Override @ManagedAttribute public int getMessageCountForAllMessageGroups() { - return jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_MESSAGES_IN_GROUPS), Integer.class, region); + return this.jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_MESSAGES_IN_GROUPS), Integer.class, this.region); } @Override @ManagedAttribute public int messageGroupSize(Object groupId) { String key = getKey(groupId); - return jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_MESSAGES_IN_GROUP), Integer.class, key, region); + return this.jdbcTemplate.queryForObject(getQuery(Query.COUNT_ALL_MESSAGES_IN_GROUP), Integer.class, key, this.region); } @Override @@ -428,10 +428,10 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa final AtomicReference completeFlag = new AtomicReference(); final AtomicReference lastReleasedSequenceRef = new AtomicReference(); - List> messages = jdbcTemplate.query(getQuery(Query.LIST_MESSAGES_BY_GROUP_KEY), - new Object[] { key, region }, mapper); + List> messages = this.jdbcTemplate.query(getQuery(Query.LIST_MESSAGES_BY_GROUP_KEY), + new Object[] { key, this.region }, this.mapper); - jdbcTemplate.query(getQuery(Query.GET_GROUP_INFO), new Object[] { key, region}, + this.jdbcTemplate.query(getQuery(Query.GET_GROUP_INFO), new Object[] { key, this.region}, new RowCallbackHandler() { @Override @@ -474,7 +474,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa final String groupKey = getKey(groupId); final String messageId = getKey(messageToRemove.getHeaders().getId()); - jdbcTemplate.update(getQuery(Query.REMOVE_MESSAGE_FROM_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.REMOVE_MESSAGE_FROM_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -482,7 +482,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } ps.setString(1, groupKey); ps.setString(2, messageId); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); this.removeMessage(messageToRemove.getHeaders().getId()); @@ -500,7 +500,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa if (logger.isDebugEnabled()){ logger.debug("Removing messages from group with group key=" + groupKey); } - jdbcTemplate.batchUpdate(getQuery(Query.REMOVE_MESSAGE_FROM_GROUP), + this.jdbcTemplate.batchUpdate(getQuery(Query.REMOVE_MESSAGE_FROM_GROUP), messages, getRemoveBatchSize(), new ParameterizedPreparedStatementSetter>() { @@ -508,17 +508,17 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa public void setValues(PreparedStatement ps, Message messageToRemove) throws SQLException { ps.setString(1, groupKey); ps.setString(2, getKey(messageToRemove.getHeaders().getId())); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); - jdbcTemplate.batchUpdate(getQuery(Query.DELETE_MESSAGE), + this.jdbcTemplate.batchUpdate(getQuery(Query.DELETE_MESSAGE), messages, getRemoveBatchSize(), new ParameterizedPreparedStatementSetter>() { @Override public void setValues(PreparedStatement ps, Message messageToRemove) throws SQLException { ps.setString(1, getKey(messageToRemove.getHeaders().getId())); - ps.setString(2, region); + ps.setString(2, JdbcMessageStore.this.region); } }); this.updateMessageGroup(groupKey); @@ -533,25 +533,25 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa this.removeMessage(messageIds); } - jdbcTemplate.update(getQuery(Query.REMOVE_GROUP_TO_MESSAGE_JOIN), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.REMOVE_GROUP_TO_MESSAGE_JOIN), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ logger.debug("Removing relationships for the group with group key=" + groupKey); } ps.setString(1, groupKey); - ps.setString(2, region); + ps.setString(2, JdbcMessageStore.this.region); } }); - jdbcTemplate.update(getQuery(Query.DELETE_MESSAGE_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.DELETE_MESSAGE_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ logger.debug("Marking messages with group key=" + groupKey); } ps.setString(1, groupKey); - ps.setString(2, region); + ps.setString(2, JdbcMessageStore.this.region); } }); } @@ -561,7 +561,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa final long updatedDate = System.currentTimeMillis(); final String groupKey = getKey(groupId); - jdbcTemplate.update(getQuery(Query.COMPLETE_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.COMPLETE_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -569,7 +569,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } ps.setTimestamp(1, new Timestamp(updatedDate)); ps.setString(2, groupKey); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); } @@ -580,7 +580,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa final long updatedDate = System.currentTimeMillis(); final String groupKey = getKey(groupId); - jdbcTemplate.update(getQuery(Query.UPDATE_LAST_RELEASED_SEQUENCE), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.UPDATE_LAST_RELEASED_SEQUENCE), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -589,7 +589,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa ps.setTimestamp(1, new Timestamp(updatedDate)); ps.setInt(2, sequenceNumber); ps.setString(3, groupKey); - ps.setString(4, region); + ps.setString(4, JdbcMessageStore.this.region); } }); this.updateMessageGroup(groupKey); @@ -609,7 +609,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa @Override public Iterator iterator() { - final Iterator iterator = jdbcTemplate.query(getQuery(Query.LIST_GROUP_KEYS), new Object[] { region }, + final Iterator iterator = this.jdbcTemplate.query(getQuery(Query.LIST_GROUP_KEYS), new Object[] { this.region }, new SingleColumnRowMapper()).iterator(); return new Iterator() { @@ -640,11 +640,11 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa * @return a transformed query with replacements */ protected String getQuery(Query base) { - String query = queryCache.get(base); + String query = this.queryCache.get(base); if (query == null) { - query = StringUtils.replace(base.getSql(), "%PREFIX%", tablePrefix); - queryCache.put(base, query); + query = StringUtils.replace(base.getSql(), "%PREFIX%", this.tablePrefix); + this.queryCache.put(base, query); } return query; @@ -668,7 +668,8 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa * @return a message; could be null if query produced no Messages */ protected Message doPollForMessage(String groupIdKey) { - List> messages = jdbcTemplate.query(getQuery(Query.POLL_FROM_GROUP), new Object[] { groupIdKey, region, groupIdKey, region }, mapper); + List> messages = this.jdbcTemplate.query(getQuery(Query.POLL_FROM_GROUP), + new Object[] { groupIdKey, this.region, groupIdKey, this.region }, this.mapper); Assert.isTrue(messages.size() == 0 || messages.size() == 1); if (messages.size() > 0){ return messages.get(0); @@ -677,14 +678,14 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } private void doCreateMessageGroup(final String groupKey, final Timestamp createdDate){ - jdbcTemplate.update(getQuery(Query.CREATE_MESSAGE_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.CREATE_MESSAGE_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ logger.debug("Creating message group with id key=" + groupKey + " and created date=" + createdDate); } ps.setString(1, groupKey); - ps.setString(2, region); + ps.setString(2, JdbcMessageStore.this.region); ps.setTimestamp(3, createdDate); ps.setTimestamp(4, createdDate); } @@ -692,7 +693,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } private void doUpdateMessageGroup(final String groupKey, final Timestamp updatedDate){ - jdbcTemplate.update(getQuery(Query.UPDATE_MESSAGE_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.UPDATE_MESSAGE_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -700,13 +701,13 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } ps.setTimestamp(1, updatedDate); ps.setString(2, groupKey); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); } private void updateMessageGroup(final String groupId){ - jdbcTemplate.update(getQuery(Query.UPDATE_GROUP), new PreparedStatementSetter() { + this.jdbcTemplate.update(getQuery(Query.UPDATE_GROUP), new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { if (logger.isDebugEnabled()){ @@ -714,7 +715,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa } ps.setTimestamp(1, new Timestamp(System.currentTimeMillis())); ps.setString(2, groupId); - ps.setString(3, region); + ps.setString(3, JdbcMessageStore.this.region); } }); } @@ -724,7 +725,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa final List messageIds = new ArrayList(); - jdbcTemplate.query(getQuery(Query.LIST_MESSAGEIDS_BY_GROUP_KEY), new Object[] { key, region }, + this.jdbcTemplate.query(getQuery(Query.LIST_MESSAGEIDS_BY_GROUP_KEY), new Object[] { key, this.region }, new RowCallbackHandler() { @Override @@ -750,7 +751,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa @Override public Message mapRow(ResultSet rs, int rowNum) throws SQLException { - return (Message) deserializer.convert(lobHandler.getBlobAsBytes(rs, "MESSAGE_BYTES")); + return (Message) JdbcMessageStore.this.deserializer.convert(JdbcMessageStore.this.lobHandler.getBlobAsBytes(rs, "MESSAGE_BYTES")); } } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcOutboundGateway.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcOutboundGateway.java index 06609814d3..9c6a2e674c 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcOutboundGateway.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcOutboundGateway.java @@ -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. @@ -73,18 +73,18 @@ public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler im } if (StringUtils.hasText(selectQuery)) { - poller = new JdbcPollingChannelAdapter(jdbcOperations, selectQuery); - poller.setMaxRowsPerPoll(1); + this.poller = new JdbcPollingChannelAdapter(jdbcOperations, selectQuery); + this.poller.setMaxRowsPerPoll(1); } else { - poller = null; + this.poller = null; } if (StringUtils.hasText(updateQuery)) { - handler = new JdbcMessageHandler(jdbcOperations, updateQuery); + this.handler = new JdbcMessageHandler(jdbcOperations, updateQuery); } else { - handler = null; + this.handler = null; } } @@ -115,13 +115,13 @@ public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler im @Override protected void doInit() { if (this.maxRowsPerPoll != null) { - Assert.notNull(poller, "If you want to set 'maxRowsPerPoll', then you must provide a 'selectQuery'."); - poller.setMaxRowsPerPoll(this.maxRowsPerPoll); + Assert.notNull(this.poller, "If you want to set 'maxRowsPerPoll', then you must provide a 'selectQuery'."); + this.poller.setMaxRowsPerPoll(this.maxRowsPerPoll); } if (this.handler!= null) { - handler.setBeanFactory(this.getBeanFactory()); - handler.afterPropertiesSet(); + this.handler.setBeanFactory(this.getBeanFactory()); + this.handler.afterPropertiesSet(); } if (!this.sqlParameterSourceFactorySet && this.getBeanFactory() != null) { @@ -136,26 +136,26 @@ public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler im List list; if (this.handler != null) { - list = handler.executeUpdateQuery(requestMessage, keysGenerated); + list = this.handler.executeUpdateQuery(requestMessage, this.keysGenerated); } else { list = Collections.emptyList(); } - if (poller != null) { - SqlParameterSource sqlQueryParameterSource = sqlParameterSourceFactory + if (this.poller != null) { + SqlParameterSource sqlQueryParameterSource = this.sqlParameterSourceFactory .createParameterSource(requestMessage); - if (keysGenerated) { + if (this.keysGenerated) { if (!list.isEmpty()) { if (list.size() == 1) { - sqlQueryParameterSource = sqlParameterSourceFactory.createParameterSource(list.get(0)); + sqlQueryParameterSource = this.sqlParameterSourceFactory.createParameterSource(list.get(0)); } else { - sqlQueryParameterSource = sqlParameterSourceFactory.createParameterSource(list); + sqlQueryParameterSource = this.sqlParameterSourceFactory.createParameterSource(list); } } } - list = poller.doPoll(sqlQueryParameterSource); + list = this.poller.doPoll(sqlQueryParameterSource); if (list.isEmpty()) { return null; } @@ -194,7 +194,7 @@ public class JdbcOutboundGateway extends AbstractReplyProducingMessageHandler im } public void setRowMapper(RowMapper rowMapper) { - poller.setRowMapper(rowMapper); + this.poller.setRowMapper(rowMapper); } } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcPollingChannelAdapter.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcPollingChannelAdapter.java index 16e1b42cd0..81e877b7dd 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcPollingChannelAdapter.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcPollingChannelAdapter.java @@ -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. @@ -159,7 +159,7 @@ public class JdbcPollingChannelAdapter extends IntegrationObjectSupport implemen if (payload.size() < 1) { payload = null; } - if (payload != null && updateSql != null) { + if (payload != null && this.updateSql != null) { if (this.updatePerRow) { for (Object row : payload) { executeUpdateQuery(row); @@ -183,12 +183,12 @@ public class JdbcPollingChannelAdapter extends IntegrationObjectSupport implemen final RowMapper rowMapper = this.rowMapper == null ? new ColumnMapRowMapper() : this.rowMapper; ResultSetExtractor> resultSetExtractor; - if (maxRowsPerPoll > 0) { + if (this.maxRowsPerPoll > 0) { resultSetExtractor = new ResultSetExtractor>() { public List extractData(ResultSet rs) throws SQLException, DataAccessException { - List results = new ArrayList(maxRowsPerPoll); + List results = new ArrayList(JdbcPollingChannelAdapter.this.maxRowsPerPoll); int rowNum = 0; - while (rs.next() && rowNum < maxRowsPerPoll) { + while (rs.next() && rowNum < JdbcPollingChannelAdapter.this.maxRowsPerPoll) { results.add(rowMapper.mapRow(rs, rowNum++)); } return results; diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java index 26107054ee..07a1e73700 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java @@ -188,8 +188,8 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { new ExpressionEvaluatingSqlParameterSourceFactory(); expressionSourceFactory.setBeanFactory(this.beanFactory); - expressionSourceFactory.setStaticParameters(ProcedureParameter.convertStaticParameters(procedureParameters)); - expressionSourceFactory.setParameterExpressions(ProcedureParameter.convertExpressions(procedureParameters)); + expressionSourceFactory.setStaticParameters(ProcedureParameter.convertStaticParameters(this.procedureParameters)); + expressionSourceFactory.setParameterExpressions(ProcedureParameter.convertExpressions(this.procedureParameters)); this.sqlParameterSourceFactory = expressionSourceFactory; @@ -234,7 +234,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { @Override protected boolean removeEldestEntry(Entry eldest) { - return size() > jdbcCallOperationsCacheSize; + return size() > StoredProcExecutor.this.jdbcCallOperationsCacheSize; } }; @@ -297,12 +297,12 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { public Map executeStoredProcedure(Message message) { Assert.notNull(message, "The message parameter must not be null."); - Assert.notNull(usePayloadAsParameterSource, "Property usePayloadAsParameterSource " + Assert.notNull(this.usePayloadAsParameterSource, "Property usePayloadAsParameterSource " + "was Null. Did you call afterPropertiesSet()?"); final Object input; - if (usePayloadAsParameterSource) { + if (this.usePayloadAsParameterSource) { input = message.getPayload(); } else { @@ -332,13 +332,13 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { */ private Map executeStoredProcedureInternal(Object input, String storedProcedureName) { - Assert.notNull(sqlParameterSourceFactory, "Property sqlParameterSourceFactory " + Assert.notNull(this.sqlParameterSourceFactory, "Property sqlParameterSourceFactory " + "was Null. Did you call afterPropertiesSet()?"); SimpleJdbcCallOperations localSimpleJdbcCall = obtainSimpleJdbcCall(storedProcedureName); SqlParameterSource storedProcedureParameterSource = - sqlParameterSourceFactory.createParameterSource(input); + this.sqlParameterSourceFactory.createParameterSource(input); return localSimpleJdbcCall.execute(storedProcedureParameterSource); @@ -435,7 +435,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { @ManagedAttribute(defaultValue="Null if not Set.") public String getStoredProcedureName() { return this.storedProcedureNameExpression instanceof LiteralExpression ? - storedProcedureNameExpression.getValue(String.class) : null; + this.storedProcedureNameExpression.getValue(String.class) : null; } /** @@ -443,7 +443,9 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * */ @ManagedAttribute(defaultValue="Null if not Set.") public String getStoredProcedureNameExpressionAsString() { - return this.storedProcedureNameExpression != null ? this.storedProcedureNameExpression.getExpressionString() : null; + return this.storedProcedureNameExpression != null + ? this.storedProcedureNameExpression.getExpressionString() + : null; } /** diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java index 032781ac10..414000f7d0 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java @@ -78,13 +78,14 @@ public class StoredProcMessageHandler extends AbstractMessageHandler implements @Override protected void handleMessageInternal(Message message) { - Map resultMap = executor.executeStoredProcedure(message); + Map resultMap = this.executor.executeStoredProcedure(message); if (logger.isDebugEnabled()) { if (resultMap != null && !resultMap.isEmpty()) { logger.debug(String.format("The StoredProcMessageHandler ignores return " - + "values, but the called Stored Procedure '%s' returned data: '%s'", executor.getStoredProcedureName(), resultMap)); + + "values, but the called Stored Procedure '%s' returned data: '%s'", + this.executor.getStoredProcedureName(), resultMap)); } } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java index bc9797e765..5e3fa6ef5f 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java @@ -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. @@ -57,7 +57,7 @@ public class StoredProcOutboundGateway extends AbstractReplyProducingMessageHand @Override protected Object handleRequestMessage(Message requestMessage) { - Map resultMap = executor.executeStoredProcedure(requestMessage); + Map resultMap = this.executor.executeStoredProcedure(requestMessage); final Object payload; diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java index 0c687f8ec8..458b11663b 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java @@ -28,6 +28,7 @@ import java.util.UUID; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; + import javax.sql.DataSource; import org.apache.commons.logging.Log; @@ -107,9 +108,9 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto private final ReadWriteLock idCacheLock = new ReentrantReadWriteLock(); - private final Lock idCacheReadLock = idCacheLock.readLock(); + private final Lock idCacheReadLock = this.idCacheLock.readLock(); - private final Lock idCacheWriteLock = idCacheLock.writeLock(); + private final Lock idCacheWriteLock = this.idCacheLock.writeLock(); /** * Default value for the table prefix property. @@ -166,8 +167,8 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto * Convenient constructor for configuration use. */ public JdbcChannelMessageStore() { - deserializer = new DeserializingConverter(); - serializer = new SerializingConverter(); + this.deserializer = new DeserializingConverter(); + this.serializer = new SerializingConverter(); } /** @@ -181,7 +182,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto */ public JdbcChannelMessageStore(DataSource dataSource) { this(); - jdbcTemplate = new JdbcTemplate(dataSource); + this.jdbcTemplate = new JdbcTemplate(dataSource); this.jdbcTemplate.setFetchSize(1); this.jdbcTemplate.setMaxRows(1); @@ -196,7 +197,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto * @param dataSource a {@link DataSource} */ public void setDataSource(DataSource dataSource) { - jdbcTemplate = new JdbcTemplate(dataSource); + this.jdbcTemplate = new JdbcTemplate(dataSource); this.jdbcTemplate.setFetchSize(1); this.jdbcTemplate.setMaxRows(1); @@ -402,7 +403,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto */ @Override public void afterPropertiesSet() throws Exception { - Assert.state(jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided"); + Assert.state(this.jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided"); Assert.notNull(this.channelMessageStoreQueryProvider, "A channelMessageStoreQueryProvider must be provided."); if (this.messageRowMapper == null) { @@ -444,31 +445,34 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto innerMap.put(MessageHeaders.ID, message.getHeaders().get(MessageHeaders.ID)); final String messageId = getKey(result.getHeaders().getId()); - final byte[] messageBytes = serializer.convert(result); + final byte[] messageBytes = this.serializer.convert(result); - jdbcTemplate.update(getQuery(channelMessageStoreQueryProvider.getCreateMessageQuery()), new PreparedStatementSetter() { - @Override - public void setValues(PreparedStatement ps) throws SQLException { - if (logger.isDebugEnabled()) { - logger.debug("Inserting message with id key=" + messageId); - } - ps.setString(1, messageId); - ps.setString(2, groupKey); - ps.setString(3, region); - ps.setLong(4, createdDate); + this.jdbcTemplate.update(getQuery(this.channelMessageStoreQueryProvider.getCreateMessageQuery()), + new PreparedStatementSetter() { - Integer priority = new IntegrationMessageHeaderAccessor(message).getPriority(); + @Override + public void setValues(PreparedStatement ps) throws SQLException { + if (logger.isDebugEnabled()) { + logger.debug("Inserting message with id key=" + messageId); + } + ps.setString(1, messageId); + ps.setString(2, groupKey); + ps.setString(3, JdbcChannelMessageStore.this.region); + ps.setLong(4, createdDate); - if (JdbcChannelMessageStore.this.priorityEnabled && priority != null) { - ps.setInt(5, priority); - } - else { - ps.setNull(5, Types.NUMERIC); - } + Integer priority = new IntegrationMessageHeaderAccessor(message).getPriority(); - lobHandler.getLobCreator().setBlobAsBytes(ps, 6, messageBytes); - } - }); + if (JdbcChannelMessageStore.this.priorityEnabled && priority != null) { + ps.setInt(5, priority); + } + else { + ps.setNull(5, Types.NUMERIC); + } + + JdbcChannelMessageStore.this.lobHandler.getLobCreator().setBlobAsBytes(ps, 6, messageBytes); + } + + }); return getMessageGroup(groupId); } @@ -513,11 +517,11 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto * @return A transformed query with replacements. */ protected String getQuery(String sqlQuery) { - String query = queryCache.get(sqlQuery); + String query = this.queryCache.get(sqlQuery); if (query == null) { - query = StringUtils.replace(sqlQuery, "%PREFIX%", tablePrefix); - queryCache.put(sqlQuery, query); + query = StringUtils.replace(sqlQuery, "%PREFIX%", this.tablePrefix); + this.queryCache.put(sqlQuery, query); } return query; @@ -533,7 +537,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto @ManagedAttribute public int messageGroupSize(Object groupId) { final String key = getKey(groupId); - return jdbcTemplate.queryForObject(getQuery(channelMessageStoreQueryProvider.getCountAllMessagesInGroupQuery()), + return this.jdbcTemplate.queryForObject(getQuery(this.channelMessageStoreQueryProvider.getCountAllMessagesInGroupQuery()), Integer.class, key, this.region); } @@ -572,10 +576,10 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto */ protected Message doPollForMessage(String groupIdKey) { - final NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate); + final NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(this.jdbcTemplate); final MapSqlParameterSource parameters = new MapSqlParameterSource(); - parameters.addValue("region", region); + parameters.addValue("region", this.region); parameters.addValue("group_key", groupIdKey); String query; @@ -591,7 +595,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto else { query = getQuery(this.channelMessageStoreQueryProvider.getPollFromGroupExcludeIdsQuery()); } - parameters.addValue("message_ids", idCache); + parameters.addValue("message_ids", this.idCache); } else { if (this.priorityEnabled) { @@ -601,7 +605,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto query = getQuery(this.channelMessageStoreQueryProvider.getPollFromGroupQuery()); } } - messages = namedParameterJdbcTemplate.query(query, parameters, messageRowMapper); + messages = namedParameterJdbcTemplate.query(query, parameters, this.messageRowMapper); } finally { this.idCacheReadLock.unlock(); @@ -636,8 +640,8 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto private boolean doRemoveMessageFromGroup(Object groupId, Message messageToRemove) { final UUID id = messageToRemove.getHeaders().getId(); - int updated = jdbcTemplate.update(getQuery(channelMessageStoreQueryProvider.getDeleteMessageQuery()), - new Object[] {getKey(id), getKey(groupId), region}, new int[] {Types.VARCHAR, Types.VARCHAR, Types.VARCHAR}); + int updated = this.jdbcTemplate.update(getQuery(this.channelMessageStoreQueryProvider.getDeleteMessageQuery()), + new Object[]{getKey(id), getKey(groupId), this.region}, new int[]{Types.VARCHAR, Types.VARCHAR, Types.VARCHAR}); boolean result = updated != 0; if (result) { diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/channel/MessageRowMapper.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/channel/MessageRowMapper.java index 3b0b5519f8..c3e4b83046 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/channel/MessageRowMapper.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/channel/MessageRowMapper.java @@ -44,7 +44,7 @@ public class MessageRowMapper implements RowMapper> { } public Message mapRow(ResultSet rs, int rowNum) throws SQLException { - return (Message) deserializer.convert(lobHandler.getBlobAsBytes(rs, "MESSAGE_BYTES")); + return (Message) this.deserializer.convert(this.lobHandler.getBlobAsBytes(rs, "MESSAGE_BYTES")); } } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java index eae6028b0c..ab19aad2cd 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java @@ -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. @@ -114,7 +114,7 @@ public class ChannelPublishingJmsMessageListener } public void setRequestChannelName(String requestChannelName) { - gatewayDelegate.setRequestChannelName(requestChannelName); + this.gatewayDelegate.setRequestChannelName(requestChannelName); } public void setReplyChannel(MessageChannel replyChannel) { @@ -122,7 +122,7 @@ public class ChannelPublishingJmsMessageListener } public void setReplyChannelName(String replyChannelName) { - gatewayDelegate.setReplyChannelName(replyChannelName); + this.gatewayDelegate.setReplyChannelName(replyChannelName); } public void setErrorChannel(MessageChannel errorChannel) { @@ -130,7 +130,7 @@ public class ChannelPublishingJmsMessageListener } public void setErrorChannelName(String errorChannelName) { - gatewayDelegate.setErrorChannelName(errorChannelName); + this.gatewayDelegate.setErrorChannelName(errorChannelName); } public void setRequestTimeout(long requestTimeout) { @@ -314,13 +314,13 @@ public class ChannelPublishingJmsMessageListener try { if (this.extractRequestPayload) { result = this.messageConverter.fromMessage(jmsMessage); - if (logger.isDebugEnabled()) { - logger.debug("converted JMS Message [" + jmsMessage + "] to integration Message payload [" + if (this.logger.isDebugEnabled()) { + this.logger.debug("converted JMS Message [" + jmsMessage + "] to integration Message payload [" + result + "]"); } } - Map headers = headerMapper.toHeaders(jmsMessage); + Map headers = this.headerMapper.toHeaders(jmsMessage); requestMessage = (result instanceof Message) ? this.messageBuilderFactory.fromMessage((Message) result).copyHeaders(headers).build() : this.messageBuilderFactory.withPayload(result).copyHeaders(headers).build(); @@ -341,8 +341,8 @@ public class ChannelPublishingJmsMessageListener Message replyMessage = this.gatewayDelegate.sendAndReceiveMessage(requestMessage); if (replyMessage != null) { Destination destination = this.getReplyDestination(jmsMessage, session); - if (logger.isDebugEnabled()) { - logger.debug("Reply destination: " + destination); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Reply destination: " + destination); } if (destination != null) { // convert SI Message to JMS Message @@ -353,18 +353,18 @@ public class ChannelPublishingJmsMessageListener try { javax.jms.Message jmsReply = this.messageConverter.toMessage(replyResult, session); // map SI Message Headers to JMS Message Properties/Headers - headerMapper.fromHeaders(replyMessage.getHeaders(), jmsReply); + this.headerMapper.fromHeaders(replyMessage.getHeaders(), jmsReply); this.copyCorrelationIdFromRequestToReply(jmsMessage, jmsReply); this.sendReply(jmsReply, destination, session); } catch (RuntimeException e) { - logger.error("Failed to generate JMS Reply Message from: " + replyResult, e); + this.logger.error("Failed to generate JMS Reply Message from: " + replyResult, e); throw e; } } } - else if (logger.isDebugEnabled()) { - logger.debug("expected a reply but none was received"); + else if (this.logger.isDebugEnabled()) { + this.logger.debug("expected a reply but none was received"); } } } @@ -398,8 +398,8 @@ public class ChannelPublishingJmsMessageListener if (value != null) { replyMessage.setStringProperty(this.correlationKey, value); } - else if (logger.isWarnEnabled()) { - logger.warn("No property value available on request Message for correlationKey '" + else if (this.logger.isWarnEnabled()) { + this.logger.warn("No property value available on request Message for correlationKey '" + this.correlationKey + "'"); } } @@ -511,7 +511,7 @@ public class ChannelPublishingJmsMessageListener @Override public String getComponentType() { - if (expectReply) { + if (ChannelPublishingJmsMessageListener.this.expectReply) { return "jms:inbound-gateway"; } else { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java index 0d675c37e9..6ad9bfa4d6 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java @@ -119,7 +119,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { jmsMessage.setJMSCorrelationID((String) jmsCorrelationId); } catch (Exception e) { - logger.info("failed to set JMSCorrelationID, skipping", e); + this.logger.info("failed to set JMSCorrelationID, skipping", e); } } Object jmsReplyTo = headers.get(JmsHeaders.REPLY_TO); @@ -128,7 +128,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { jmsMessage.setJMSReplyTo((Destination) jmsReplyTo); } catch (Exception e) { - logger.info("failed to set JMSReplyTo, skipping", e); + this.logger.info("failed to set JMSReplyTo, skipping", e); } } Object jmsType = headers.get(JmsHeaders.TYPE); @@ -137,7 +137,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { jmsMessage.setJMSType((String) jmsType); } catch (Exception e) { - logger.info("failed to set JMSType, skipping", e); + this.logger.info("failed to set JMSType, skipping", e); } } for (Entry entry : headers.entrySet()) { @@ -154,13 +154,13 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { catch (Exception e) { if (headerName.startsWith("JMSX") || headerName.equals(IntegrationMessageHeaderAccessor.PRIORITY)) { - if (logger.isTraceEnabled()) { - logger.trace("skipping reserved header, it cannot be set by client: " + if (this.logger.isTraceEnabled()) { + this.logger.trace("skipping reserved header, it cannot be set by client: " + headerName); } } - else if (logger.isWarnEnabled()) { - logger.warn("failed to map Message header '" + headerName + "' to JMS property", e); + else if (this.logger.isWarnEnabled()) { + this.logger.warn("failed to map Message header '" + headerName + "' to JMS property", e); } } } @@ -173,8 +173,8 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn("error occurred while mapping from MessageHeaders to JMS properties", e); + if (this.logger.isWarnEnabled()) { + this.logger.warn("error occurred while mapping from MessageHeaders to JMS properties", e); } } } @@ -190,7 +190,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception e) { - logger.info("failed to read JMSMessageID property, skipping", e); + this.logger.info("failed to read JMSMessageID property, skipping", e); } try { Destination destination = jmsMessage.getJMSDestination(); @@ -199,7 +199,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception ex) { - logger.info("failed to read JMSDestination property, skipping", ex); + this.logger.info("failed to read JMSDestination property, skipping", ex); } try { String correlationId = jmsMessage.getJMSCorrelationID(); @@ -208,7 +208,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception e) { - logger.info("failed to read JMSCorrelationID property, skipping", e); + this.logger.info("failed to read JMSCorrelationID property, skipping", e); } try { Destination replyTo = jmsMessage.getJMSReplyTo(); @@ -217,13 +217,13 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception e) { - logger.info("failed to read JMSReplyTo property, skipping", e); + this.logger.info("failed to read JMSReplyTo property, skipping", e); } try { headers.put(JmsHeaders.REDELIVERED, jmsMessage.getJMSRedelivered()); } catch (Exception e) { - logger.info("failed to read JMSRedelivered property, skipping", e); + this.logger.info("failed to read JMSRedelivered property, skipping", e); } try { String type = jmsMessage.getJMSType(); @@ -232,20 +232,20 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (Exception e) { - logger.info("failed to read JMSType property, skipping", e); + this.logger.info("failed to read JMSType property, skipping", e); } try { headers.put(JmsHeaders.TIMESTAMP, jmsMessage.getJMSTimestamp()); } catch (Exception e) { - logger.info("failed to read JMSTimestamp property, skipping", e); + this.logger.info("failed to read JMSTimestamp property, skipping", e); } if (this.mapInboundPriority) { try { headers.put(IntegrationMessageHeaderAccessor.PRIORITY, jmsMessage.getJMSPriority()); } catch (Exception e) { - logger.info("failed to read JMSPriority property, skipping", e); + this.logger.info("failed to read JMSPriority property, skipping", e); } } Enumeration jmsPropertyNames = jmsMessage.getPropertyNames(); @@ -257,8 +257,8 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { headers.put(headerName, jmsMessage.getObjectProperty(propertyName)); } catch (Exception e) { - if (logger.isWarnEnabled()) { - logger.warn("error occurred while mapping JMS property '" + if (this.logger.isWarnEnabled()) { + this.logger.warn("error occurred while mapping JMS property '" + propertyName + "' to Message header", e); } } @@ -266,8 +266,8 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } catch (JMSException e) { - if (logger.isWarnEnabled()) { - logger.warn("error occurred while mapping from JMS properties to MessageHeaders", e); + if (this.logger.isWarnEnabled()) { + this.logger.warn("error occurred while mapping from JMS properties to MessageHeaders", e); } } return headers; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsMessageDrivenEndpoint.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsMessageDrivenEndpoint.java index 54813058cc..584a339877 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsMessageDrivenEndpoint.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsMessageDrivenEndpoint.java @@ -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. @@ -112,7 +112,7 @@ public class JmsMessageDrivenEndpoint extends AbstractEndpoint implements Dispos this.listenerContainer.setSessionAcknowledgeMode(acknowledgeMode); } } - listener.setComponentName(this.getComponentName()); + this.listener.setComponentName(this.getComponentName()); } @Override diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java index adfe7bcfaf..10b194c572 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java @@ -768,7 +768,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp javax.jms.Message jmsRequest = this.messageConverter.toMessage(objectToSend, session); // map headers - headerMapper.fromHeaders(requestMessage.getHeaders(), jmsRequest); + this.headerMapper.fromHeaders(requestMessage.getHeaders(), jmsRequest); jmsRequest.setJMSReplyTo(replyTo); connection.start(); @@ -824,7 +824,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp javax.jms.Message jmsRequest = this.messageConverter.toMessage(objectToSend, session); // map headers - headerMapper.fromHeaders(requestMessage.getHeaders(), jmsRequest); + this.headerMapper.fromHeaders(requestMessage.getHeaders(), jmsRequest); replyTo = this.determineReplyDestination(requestMessage, session); jmsRequest.setJMSReplyTo(replyTo); @@ -1122,7 +1122,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } private javax.jms.Message receiveReplyMessage(MessageConsumer messageConsumer) throws JMSException { - return (this.receiveTimeout >= 0) ? messageConsumer.receive(receiveTimeout) : messageConsumer.receive(); + return (this.receiveTimeout >= 0) ? messageConsumer.receive(this.receiveTimeout) : messageConsumer.receive(); } /** @@ -1315,11 +1315,11 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } private long getTimeStamp() { - return timeStamp; + return this.timeStamp; } private javax.jms.Message getReply() { - return reply; + return this.reply; } } @@ -1330,7 +1330,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp if (logger.isTraceEnabled()) { logger.trace("Running late reply reaper"); } - Iterator> lateReplyIterator = earlyOrLateReplies.entrySet().iterator(); + Iterator> lateReplyIterator = JmsOutboundGateway.this.earlyOrLateReplies.entrySet().iterator(); long now = System.currentTimeMillis(); long expired = now - (JmsOutboundGateway.this.receiveTimeout * 2); while (lateReplyIterator.hasNext()) { @@ -1355,15 +1355,15 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp @Override public void run() { synchronized(JmsOutboundGateway.this.lifeCycleMonitor) { - if (System.currentTimeMillis() - lastSend > idleReplyContainerTimeout - && replies.size() == 0) { - if (replyContainer.isRunning()) { + if (System.currentTimeMillis() - JmsOutboundGateway.this.lastSend > JmsOutboundGateway.this.idleReplyContainerTimeout + && JmsOutboundGateway.this.replies.size() == 0) { + if (JmsOutboundGateway.this.replyContainer.isRunning()) { if (logger.isDebugEnabled()) { logger.debug(getComponentName() + ": Stopping idle reply container."); } - replyContainer.stop(); - idleTask.cancel(false); - idleTask = null; + JmsOutboundGateway.this.replyContainer.stop(); + JmsOutboundGateway.this.idleTask.cancel(false); + JmsOutboundGateway.this.idleTask = null; } } } @@ -1398,7 +1398,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp private volatile Executor taskExecutor; public String getSessionAcknowledgeModeName() { - return sessionAcknowledgeModeName; + return this.sessionAcknowledgeModeName; } public void setSessionAcknowledgeModeName(String sessionAcknowledgeModeName) { @@ -1406,7 +1406,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Boolean isSessionTransacted() { - return sessionTransacted; + return this.sessionTransacted; } public void setSessionTransacted(Boolean sessionTransacted) { @@ -1414,7 +1414,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getSessionAcknowledgeMode() { - return sessionAcknowledgeMode; + return this.sessionAcknowledgeMode; } public void setSessionAcknowledgeMode(Integer sessionAcknowledgeMode) { @@ -1422,7 +1422,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Long getReceiveTimeout() { - return receiveTimeout; + return this.receiveTimeout; } public void setReceiveTimeout(Long receiveTimeout) { @@ -1430,7 +1430,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Long getRecoveryInterval() { - return recoveryInterval; + return this.recoveryInterval; } public void setRecoveryInterval(Long recoveryInterval) { @@ -1438,7 +1438,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getCacheLevel() { - return cacheLevel; + return this.cacheLevel; } public void setCacheLevel(Integer cacheLevel) { @@ -1446,7 +1446,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getConcurrentConsumers() { - return concurrentConsumers; + return this.concurrentConsumers; } public void setConcurrentConsumers(Integer concurrentConsumers) { @@ -1454,7 +1454,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getMaxConcurrentConsumers() { - return maxConcurrentConsumers; + return this.maxConcurrentConsumers; } public void setMaxConcurrentConsumers(Integer maxConcurrentConsumers) { @@ -1462,7 +1462,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getMaxMessagesPerTask() { - return maxMessagesPerTask; + return this.maxMessagesPerTask; } public void setMaxMessagesPerTask(Integer maxMessagesPerTask) { @@ -1470,7 +1470,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getIdleConsumerLimit() { - return idleConsumerLimit; + return this.idleConsumerLimit; } public void setIdleConsumerLimit(Integer idleConsumerLimit) { @@ -1478,7 +1478,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Integer getIdleTaskExecutionLimit() { - return idleTaskExecutionLimit; + return this.idleTaskExecutionLimit; } public void setIdleTaskExecutionLimit(Integer idleTaskExecutionLimit) { @@ -1490,7 +1490,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } public Executor getTaskExecutor() { - return taskExecutor; + return this.taskExecutor; } } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java index e479fa0180..cf7ac9b6a8 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java @@ -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. @@ -158,7 +158,7 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr 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) { @@ -166,8 +166,8 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr + 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 { diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java index 6a49a63c7e..b3aed9b8f0 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/InboundOneWayErrorTests.java @@ -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. @@ -96,7 +96,7 @@ public class InboundOneWayErrorTests { @SuppressWarnings("serial") private static class TestException extends RuntimeException { - public TestException(String message) { + TestException(String message) { super(message); } } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultMBeanObjectConverter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultMBeanObjectConverter.java index 95bf8c9152..52eb8012a4 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultMBeanObjectConverter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/DefaultMBeanObjectConverter.java @@ -69,7 +69,7 @@ public class DefaultMBeanObjectConverter implements MBeanObjectConverter { for (MBeanAttributeInfo attrInfo : attributeInfos) { // we don't need to repeat name of this as an attribute - if ("ObjectName".equals(attrInfo.getName()) || !filter.accept(objName, attrInfo.getName())) { + if ("ObjectName".equals(attrInfo.getName()) || !this.filter.accept(objName, attrInfo.getName())) { continue; } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java index 0629dad55b..1c9f2ad13a 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java @@ -70,10 +70,10 @@ public class MBeanTreePollingMessageSource extends AbstractMessageSource try { Map beans = new HashMap(); - Set results = server.queryMBeans(queryName, queryExpression); + Set results = this.server.queryMBeans(this.queryName, this.queryExpression); for (ObjectInstance instance : results) { - Object result = converter.convert(server, instance); + Object result = this.converter.convert(this.server, instance); beans.put(instance.getObjectName().getCanonicalName(), result); } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java index ecce28f9e7..d927790b34 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java @@ -38,7 +38,7 @@ public class NamedFieldsMBeanAttributeFilter implements MBeanAttributeFilter { @Override public boolean accept(ObjectName objectName, String attributeName) { - for (String namedField : namedFields) { + for (String namedField : this.namedFields) { if (namedField.equals(attributeName)) { return true; } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java index 90034c53a7..1482f5da83 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java @@ -38,7 +38,7 @@ public class NotNamedFieldsMBeanAttributeFilter implements MBeanAttributeFilter @Override public boolean accept(ObjectName objectName, String attributeName) { - for (String namedField : namedFields) { + for (String namedField : this.namedFields) { if (namedField.equals(attributeName)) { return false; } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java index 696695e2e5..2b4f8e7863 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java @@ -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. @@ -119,8 +119,8 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport */ @Override public void handleNotification(Notification notification, Object handback) { - if (logger.isInfoEnabled()) { - logger.info("received notification: " + notification + ", and handback: " + handback); + if (this.logger.isInfoEnabled()) { + this.logger.info("received notification: " + notification + ", and handback: " + handback); } AbstractIntegrationMessageBuilder builder = this.getMessageBuilderFactory().withPayload(notification); if (handback != null) { @@ -155,13 +155,13 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport if (!this.listenerRegisteredOnStartup.get()) { return; } - logger.debug("Registering to receive notifications"); + this.logger.debug("Registering to receive notifications"); try { Assert.notNull(this.server, "MBeanServer is required."); Assert.notNull(this.objectNames, "An ObjectName is required."); Collection objectNames = this.retrieveMBeanNames(); if (objectNames.size() < 1) { - logger.error("No MBeans found matching ObjectName pattern(s): " + + this.logger.error("No MBeans found matching ObjectName pattern(s): " + Arrays.asList(this.objectNames)); } for (ObjectName objectName : objectNames) { @@ -181,7 +181,7 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport */ @Override protected void doStop() { - logger.debug("Unregistering notifications"); + this.logger.debug("Unregistering notifications"); if (this.server != null && this.objectNames != null) { Collection objectNames = this.retrieveMBeanNames(); for (ObjectName objectName : objectNames) { @@ -189,13 +189,13 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport this.server.removeNotificationListener(objectName, this, this.filter, this.handback); } catch (InstanceNotFoundException e) { - logger.error("Failed to find MBean instance.", e); + this.logger.error("Failed to find MBean instance.", e); } catch (ListenerNotFoundException e) { - logger.error("Failed to find NotificationListener.", e); + this.logger.error("Failed to find NotificationListener.", e); } catch (IOException e) { - logger.error("IOException on MBeanServerConnection.", e); + this.logger.error("IOException on MBeanServerConnection.", e); } } } @@ -211,12 +211,12 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport catch (IOException e) { throw new IllegalStateException("IOException on MBeanServerConnection.", e); } - if (mBeanInfos.size() == 0 && logger.isDebugEnabled()) { - logger.debug("No MBeans found matching pattern:" + pattern); + if (mBeanInfos.size() == 0 && this.logger.isDebugEnabled()) { + this.logger.debug("No MBeans found matching pattern:" + pattern); } for (ObjectInstance instance : mBeanInfos) { - if (logger.isDebugEnabled()) { - logger.debug("Found MBean:" + instance.getObjectName().toString()); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Found MBean:" + instance.getObjectName().toString()); } objectNames.add(instance.getObjectName()); } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java index e6a5d01751..ee5fe2cb66 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java @@ -162,9 +162,9 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati private final Properties objectNameStaticProperties = new Properties(); - private final MetadataMBeanInfoAssembler assembler = new IntegrationMetadataMBeanInfoAssembler(attributeSource); + private final MetadataMBeanInfoAssembler assembler = new IntegrationMetadataMBeanInfoAssembler(this.attributeSource); - private final MetadataNamingStrategy defaultNamingStrategy = new IntegrationMetadataNamingStrategy(attributeSource); + private final MetadataNamingStrategy defaultNamingStrategy = new IntegrationMetadataNamingStrategy(this.attributeSource); private String[] componentNamePatterns = { "*" }; @@ -177,8 +177,8 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati super(); // Shouldn't be necessary, but to be on the safe side... setAutodetect(false); - setNamingStrategy(defaultNamingStrategy); - setAssembler(assembler); + setNamingStrategy(this.defaultNamingStrategy); + setAssembler(this.assembler); } /** @@ -383,13 +383,13 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @Override public void destroy() { super.destroy(); - channelsByName.clear(); - handlersByName.clear(); - sourcesByName.clear(); - for (MessageChannelMetrics monitor : channels) { + this.channelsByName.clear(); + this.handlersByName.clear(); + this.sourcesByName.clear(); + for (MessageChannelMetrics monitor : this.channels) { logger.info("Summary on shutdown: " + monitor); } - for (MessageHandlerMetrics monitor : handlers) { + for (MessageHandlerMetrics monitor : this.handlers) { logger.info("Summary on shutdown: " + monitor); } } @@ -427,7 +427,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati stopMessageSources(); stopInboundMessageProducers(); // Wait any remaining time for messages to quiesce - long timeLeft = shutdownDeadline - System.currentTimeMillis(); + long timeLeft = this.shutdownDeadline - System.currentTimeMillis(); if (timeLeft > 0) { try { Thread.sleep(timeLeft); @@ -440,7 +440,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati orderlyShutdownCapableComponentsAfter(); } finally { - shuttingDown.set(false); + this.shuttingDown.set(false); } } @@ -526,17 +526,17 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @ManagedMetric(metricType = MetricType.COUNTER, displayName = "MessageChannel Channel Count") public int getChannelCount() { - return channelsByName.size(); + return this.channelsByName.size(); } @ManagedMetric(metricType = MetricType.COUNTER, displayName = "MessageHandler Handler Count") public int getHandlerCount() { - return handlersByName.size(); + return this.handlersByName.size(); } @ManagedAttribute public String[] getHandlerNames() { - return handlersByName.keySet().toArray(new String[handlersByName.size()]); + return this.handlersByName.keySet().toArray(new String[this.handlersByName.size()]); } @ManagedMetric(metricType = MetricType.GAUGE, displayName = "Active Handler Count") @@ -547,7 +547,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @ManagedMetric(metricType = MetricType.GAUGE, displayName = "Active Handler Count") public long getActiveHandlerCountLong() { int count = 0; - for (MessageHandlerMetrics monitor : handlers) { + for (MessageHandlerMetrics monitor : this.handlers) { count += monitor.getActiveCountLong(); } return count; @@ -556,7 +556,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @ManagedMetric(metricType = MetricType.GAUGE, displayName = "Queued Message Count") public int getQueuedMessageCount() { int count = 0; - for (MessageChannelMetrics monitor : channels) { + for (MessageChannelMetrics monitor : this.channels) { if (monitor instanceof QueueChannel) { count += ((QueueChannel) monitor).getQueueSize(); } @@ -566,28 +566,28 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @ManagedAttribute public String[] getChannelNames() { - return channelsByName.keySet().toArray(new String[channelsByName.size()]); + return this.channelsByName.keySet().toArray(new String[this.channelsByName.size()]); } public MessageHandlerMetrics getHandlerMetrics(String name) { - if (handlersByName.containsKey(name)) { - return handlersByName.get(name); + if (this.handlersByName.containsKey(name)) { + return this.handlersByName.get(name); } logger.debug("No handler found for (" + name + ")"); return null; } public Statistics getHandlerDuration(String name) { - if (handlersByName.containsKey(name)) { - return handlersByName.get(name).getDuration(); + if (this.handlersByName.containsKey(name)) { + return this.handlersByName.get(name).getDuration(); } logger.debug("No handler found for (" + name + ")"); return null; } public MessageSourceMetrics getSourceMetrics(String name) { - if (sourcesByName.containsKey(name)) { - return sourcesByName.get(name); + if (this.sourcesByName.containsKey(name)) { + return this.sourcesByName.get(name); } logger.debug("No source found for (" + name + ")"); return null; @@ -598,16 +598,16 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } public long getSourceMessageCountLong(String name) { - if (sourcesByName.containsKey(name)) { - return sourcesByName.get(name).getMessageCountLong(); + if (this.sourcesByName.containsKey(name)) { + return this.sourcesByName.get(name).getMessageCountLong(); } logger.debug("No source found for (" + name + ")"); return -1; } public MessageChannelMetrics getChannelMetrics(String name) { - if (channelsByName.containsKey(name)) { - return channelsByName.get(name); + if (this.channelsByName.containsKey(name)) { + return this.channelsByName.get(name); } logger.debug("No channel found for (" + name + ")"); return null; @@ -618,8 +618,8 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } public long getChannelSendCountLong(String name) { - if (channelsByName.containsKey(name)) { - return channelsByName.get(name).getSendCountLong(); + if (this.channelsByName.containsKey(name)) { + return this.channelsByName.get(name).getSendCountLong(); } logger.debug("No channel found for (" + name + ")"); return -1; @@ -630,8 +630,8 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } public long getChannelSendErrorCountLong(String name) { - if (channelsByName.containsKey(name)) { - return channelsByName.get(name).getSendErrorCountLong(); + if (this.channelsByName.containsKey(name)) { + return this.channelsByName.get(name).getSendErrorCountLong(); } logger.debug("No channel found for (" + name + ")"); return -1; @@ -642,9 +642,9 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } public long getChannelReceiveCountLong(String name) { - if (channelsByName.containsKey(name)) { - if (channelsByName.get(name) instanceof PollableChannelManagement) { - return ((PollableChannelManagement) channelsByName.get(name)).getReceiveCountLong(); + if (this.channelsByName.containsKey(name)) { + if (this.channelsByName.get(name) instanceof PollableChannelManagement) { + return ((PollableChannelManagement) this.channelsByName.get(name)).getReceiveCountLong(); } } logger.debug("No channel found for (" + name + ")"); @@ -653,34 +653,34 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati @ManagedOperation public Statistics getChannelSendRate(String name) { - if (channelsByName.containsKey(name)) { - return channelsByName.get(name).getSendRate(); + if (this.channelsByName.containsKey(name)) { + return this.channelsByName.get(name).getSendRate(); } logger.debug("No channel found for (" + name + ")"); return null; } public Statistics getChannelErrorRate(String name) { - if (channelsByName.containsKey(name)) { - return channelsByName.get(name).getErrorRate(); + if (this.channelsByName.containsKey(name)) { + return this.channelsByName.get(name).getErrorRate(); } logger.debug("No channel found for (" + name + ")"); return null; } private void registerChannels() { - for (MessageChannelMetrics monitor : channels) { + for (MessageChannelMetrics monitor : this.channels) { String name = ((NamedComponent) monitor).getComponentName(); this.allChannelsByName.put(name, monitor); if (!matches(this.componentNamePatterns, name)) { continue; } // Only register once... - if (!channelsByName.containsKey(name)) { + if (!this.channelsByName.containsKey(name)) { String beanKey = getChannelBeanKey(name); logger.info("Registering MessageChannel " + name); if (name != null) { - channelsByName.put(name, monitor); + this.channelsByName.put(name, monitor); } registerBeanNameOrInstance(monitor, beanKey); } @@ -688,7 +688,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } private void registerHandlers() { - for (MessageHandlerMetrics handler : handlers) { + for (MessageHandlerMetrics handler : this.handlers) { MessageHandlerMetrics monitor = enhanceHandlerMonitor(handler); String name = monitor.getManagedName(); this.allHandlersByName.put(name, monitor); @@ -696,10 +696,10 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati continue; } // Only register once... - if (!handlersByName.containsKey(name)) { + if (!this.handlersByName.containsKey(name)) { String beanKey = getHandlerBeanKey(monitor); if (name != null) { - handlersByName.put(name, monitor); + this.handlersByName.put(name, monitor); } registerBeanNameOrInstance(monitor, beanKey); } @@ -707,7 +707,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } private void registerSources() { - for (MessageSourceMetrics source : sources) { + for (MessageSourceMetrics source : this.sources) { MessageSourceMetrics monitor = enhanceSourceMonitor(source); String name = monitor.getManagedName(); this.allSourcesByName.put(name, monitor); @@ -715,10 +715,10 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati continue; } // Only register once... - if (!sourcesByName.containsKey(name)) { + if (!this.sourcesByName.containsKey(name)) { String beanKey = getSourceBeanKey(monitor); if (name != null) { - sourcesByName.put(name, monitor); + this.sourcesByName.put(name, monitor); } registerBeanNameOrInstance(monitor, beanKey); } @@ -729,7 +729,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati String[] names = this.applicationContext.getBeanNamesForType(AbstractEndpoint.class); Set endpointNames = new HashSet(); for (String name : names) { - if (!beansByEndpointName.values().contains(name)) { + if (!this.beansByEndpointName.values().contains(name)) { AbstractEndpoint endpoint = this.applicationContext.getBean(name, AbstractEndpoint.class); String beanKey; name = endpoint.getComponentName(); @@ -822,28 +822,28 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati if (name.startsWith("org.springframework.integration")) { name = name + ",source=anonymous"; } - return String.format(domain + ":type=MessageChannel,name=%s" + getStaticNames(), name); + return String.format(this.domain + ":type=MessageChannel,name=%s" + getStaticNames(), name); } private String getHandlerBeanKey(MessageHandlerMetrics handler) { // This ordering of keys seems to work with default settings of JConsole - return String.format(domain + ":type=MessageHandler,name=%s,bean=%s" + getStaticNames(), + return String.format(this.domain + ":type=MessageHandler,name=%s,bean=%s" + getStaticNames(), handler.getManagedName(), handler.getManagedType()); } private String getSourceBeanKey(MessageSourceMetrics source) { // This ordering of keys seems to work with default settings of JConsole - return String.format(domain + ":type=MessageSource,name=%s,bean=%s" + getStaticNames(), + return String.format(this.domain + ":type=MessageSource,name=%s,bean=%s" + getStaticNames(), source.getManagedName(), source.getManagedType()); } private String getEndpointBeanKey(AbstractEndpoint endpoint, String name, String source) { // This ordering of keys seems to work with default settings of JConsole - return String.format(domain + ":type=ManagedEndpoint,name=%s,bean=%s" + getStaticNames(), name, source); + return String.format(this.domain + ":type=ManagedEndpoint,name=%s,bean=%s" + getStaticNames(), name, source); } private String getStaticNames() { - if (objectNameStaticProperties.isEmpty()) { + if (this.objectNameStaticProperties.isEmpty()) { return ""; } StringBuilder builder = new StringBuilder(); @@ -904,10 +904,10 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } Object field = getField(target, "inputChannel"); if (field != null) { - if (!anonymousHandlerCounters.containsKey(field)) { - anonymousHandlerCounters.put(field, new AtomicLong()); + if (!this.anonymousHandlerCounters.containsKey(field)) { + this.anonymousHandlerCounters.put(field, new AtomicLong()); } - AtomicLong count = anonymousHandlerCounters.get(field); + AtomicLong count = this.anonymousHandlerCounters.get(field); long total = count.incrementAndGet(); String suffix = ""; /* @@ -952,7 +952,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } if (endpointName != null) { - beansByEndpointName.put(name, endpointName); + this.beansByEndpointName.put(name, endpointName); } monitor.setManagedType(source); @@ -1030,10 +1030,10 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } if (outputChannel != null) { - if (!anonymousSourceCounters.containsKey(outputChannel)) { - anonymousSourceCounters.put(outputChannel, new AtomicLong()); + if (!this.anonymousSourceCounters.containsKey(outputChannel)) { + this.anonymousSourceCounters.put(outputChannel, new AtomicLong()); } - AtomicLong count = anonymousSourceCounters.get(outputChannel); + AtomicLong count = this.anonymousSourceCounters.get(outputChannel); long total = count.incrementAndGet(); String suffix = ""; /* @@ -1063,7 +1063,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati } if (endpointName != null) { - beansByEndpointName.put(name, endpointName); + this.beansByEndpointName.put(name, endpointName); } monitor.setManagedType(source); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java index c87c212ad4..0b4c5d961b 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java @@ -41,19 +41,19 @@ public class ManagedEndpoint implements Lifecycle { @Override @ManagedAttribute public final boolean isRunning() { - return delegate.isRunning(); + return this.delegate.isRunning(); } @Override @ManagedOperation public final void start() { - delegate.start(); + this.delegate.start(); } @Override @ManagedOperation public final void stop() { - delegate.stop(); + this.delegate.stop(); } } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java index d150ff28b5..72e4baa1bf 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/AbstractJpaOperations.java @@ -59,10 +59,10 @@ abstract class AbstractJpaOperations implements JpaOperations, InitializingBean protected void onInit() { if (this.entityManager == null && this.entityManagerFactory != null) { - this.entityManager = SharedEntityManagerCreator.createSharedEntityManager(entityManagerFactory); + this.entityManager = SharedEntityManagerCreator.createSharedEntityManager(this.entityManagerFactory); } - Assert.notNull(entityManager, "The entitymanager is null. Please set " + + Assert.notNull(this.entityManager, "The entitymanager is null. Please set " + "either the entityManager or the entityManagerFactory."); } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java index 2dc54c0637..fc35a0e7cb 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java @@ -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. @@ -299,7 +299,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware { } else { int firstResult = 0; - if (firstResultExpression != null) { + if (this.firstResultExpression != null) { firstResult = this.getFirstResult(requestMessage); } ParameterSource parameterSource = this.determineParameterSource(requestMessage); @@ -381,7 +381,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware { private ParameterSource determineParameterSource(final Message requestMessage) { ParameterSource parameterSource; - if (usePayloadAsParameterSource) { + if (this.usePayloadAsParameterSource) { parameterSource = this.parameterSourceFactory.createParameterSource(requestMessage.getPayload()); } else { diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java index 44759b27d9..39b2e62f91 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java @@ -60,7 +60,7 @@ public class JpaOperationFailedException extends RuntimeException { } public String getOffendingJPAQl() { - return offendingJPAQl; + return this.offendingJPAQl; } public void setOffendingJPAQl(String offendingJPAQl) { diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/inbound/JpaPollingChannelAdapter.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/inbound/JpaPollingChannelAdapter.java index ce1f9bcfa3..4ce3077d5f 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/inbound/JpaPollingChannelAdapter.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/inbound/JpaPollingChannelAdapter.java @@ -81,7 +81,7 @@ public class JpaPollingChannelAdapter extends IntegrationObjectSupport implement */ public Message receive() { - final Object payload = jpaExecutor.poll(); + final Object payload = this.jpaExecutor.poll(); if (payload == null) { return null; diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java index 3ef0083891..5f722ac433 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java @@ -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. @@ -82,7 +82,7 @@ public class JpaOutboundGateway extends AbstractReplyProducingMessageHandler { throw new IllegalArgumentException(String.format("GatewayType '%s' is not supported.", this.gatewayType)); } - if (result == null || !producesReply) { + if (result == null || !this.producesReply) { return null; } diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java index 17690f4746..2a056e6111 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java @@ -153,7 +153,7 @@ public class JpaOutboundGatewayFactoryBean extends AbstractFactoryBean= 0, "The position must be be non-negative."); - if (position <= parameters.size()) { + if (position <= this.parameters.size()) { - final JpaParameter parameter = parameters.get(position); + final JpaParameter parameter = this.parameters.get(position); if (parameter.getValue() != null) { return parameter.getValue(); @@ -123,16 +123,16 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour if (parameter.getExpression() != null) { Expression expression; - if (input instanceof Collection) { + if (this.input instanceof Collection) { expression = parameter.getProjectionExpression(); } else { expression = parameter.getSpelExpression(); } - final Object value = this.expressionEvaluator.evaluateExpression(expression, input); + final Object value = this.expressionEvaluator.evaluateExpression(expression, this.input); if (parameter.getName() != null) { - values.put(parameter.getName(), value); + this.values.put(parameter.getName(), value); } if (logger.isDebugEnabled()) { logger.debug("Resolved expression " + expression + " to " + value); @@ -148,8 +148,8 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour } public Object getValue(String paramName) { - if (values.containsKey(paramName)) { - return values.get(paramName); + if (this.values.containsKey(paramName)) { + return this.values.get(paramName); } if (!this.parametersMap.containsKey(paramName)) { @@ -162,15 +162,15 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour Expression expression = null; - if (input instanceof Collection) { + if (this.input instanceof Collection) { expression = jpaParameter.getProjectionExpression(); } else { expression = jpaParameter.getSpelExpression(); } - final Object value = this.expressionEvaluator.evaluateExpression(expression, input); - values.put(paramName, value); + final Object value = this.expressionEvaluator.evaluateExpression(expression, this.input); + this.values.put(paramName, value); if (logger.isDebugEnabled()) { logger.debug("Resolved expression " + expression + " to " + value); } @@ -188,7 +188,7 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour if (logger.isDebugEnabled()) { logger.debug("Could not evaluate expression", e); } - values.put(paramName, ERROR); + this.values.put(paramName, ERROR); return false; } return true; diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/Gender.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/Gender.java index 3fd34143e8..0132b1e6d7 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/Gender.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/test/entity/Gender.java @@ -33,7 +33,7 @@ public enum Gender { private String identifier; private static Map identifierMap; - private Gender(String identifier) { + Gender(String identifier) { this.identifier = identifier; } diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java index ad24522c33..672be1ba25 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java @@ -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. @@ -241,8 +241,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl } } if (!this.store.isConnected()) { - if (logger.isDebugEnabled()) { - logger.debug("connecting to store [" + MailTransportUtils.toPasswordProtectedString(this.url) + "]"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("connecting to store [" + MailTransportUtils.toPasswordProtectedString(this.url) + "]"); } this.store.connect(); } @@ -263,8 +263,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl if (this.folder.isOpen()) { return; } - if (logger.isDebugEnabled()) { - logger.debug("opening folder [" + MailTransportUtils.toPasswordProtectedString(this.url) + "]"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("opening folder [" + MailTransportUtils.toPasswordProtectedString(this.url) + "]"); } this.folder.open(this.folderOpenMode); } @@ -278,8 +278,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl synchronized (this.folderMonitor) { try { this.openFolder(); - if (logger.isInfoEnabled()) { - logger.info("attempting to receive mail from folder [" + this.getFolder().getFullName() + "]"); + if (this.logger.isInfoEnabled()) { + this.logger.info("attempting to receive mail from folder [" + this.getFolder().getFullName() + "]"); } Message[] messages = searchForNewMessages(); if (this.maxFetchSize > 0 && messages.length > this.maxFetchSize) { @@ -287,15 +287,15 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl System.arraycopy(messages, 0, reducedMessages, 0, this.maxFetchSize); messages = reducedMessages; } - if (logger.isDebugEnabled()) { - logger.debug("found " + messages.length + " new messages"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("found " + messages.length + " new messages"); } if (messages.length > 0) { fetchMessages(messages); } - if (logger.isDebugEnabled()) { - logger.debug("Received " + messages.length + " messages"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Received " + messages.length + " messages"); } Message[] filteredMessages = filterMessagesThruSelector(messages); @@ -334,8 +334,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl for (Message message : filteredMessages) { if (!recentFlagSupported){ if (flags != null && flags.contains(Flags.Flag.USER)){ - if (logger.isDebugEnabled()){ - logger.debug("USER flags are supported by this mail server. Flagging message with '" + if (this.logger.isDebugEnabled()){ + this.logger.debug("USER flags are supported by this mail server. Flagging message with '" + this.userFlag + "' user flag"); } Flags siFlags = new Flags(); @@ -343,8 +343,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl message.setFlags(siFlags, true); } else { - if (logger.isDebugEnabled()){ - logger.debug("USER flags are not supported by this mail server. " + if (this.logger.isDebugEnabled()){ + this.logger.debug("USER flags are not supported by this mail server. " + "Flagging message with system flag"); } message.setFlag(Flags.Flag.FLAGGED, true); @@ -367,8 +367,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl filteredMessages.add(message); } else { - if (logger.isDebugEnabled()){ - logger.debug("Fetched email with subject '" + message.getSubject() + "' will be discarded by the matching filter" + + if (this.logger.isDebugEnabled()){ + this.logger.debug("Fetched email with subject '" + message.getSubject() + "' will be discarded by the matching filter" + " and will not be flagged as SEEN."); } } diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java index 73c1b90f21..9ec2bef98c 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java @@ -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. @@ -171,13 +171,13 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be } catch (Exception e) { throw new IllegalStateException( - "Failure during the destruction of Mail receiver: " + mailReceiver, e); + "Failure during the destruction of Mail receiver: " + this.mailReceiver, e); } /* * If we're running with the default executor, shut it down. */ if (!this.sendingTaskExecutorSet && this.sendingTaskExecutor != null) { - ((ExecutorService) sendingTaskExecutor).shutdown(); + ((ExecutorService) this.sendingTaskExecutor).shutdown(); this.sendingTaskExecutor = null; } } @@ -187,14 +187,14 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be @Override public void run() { try { - idleTask.run(); + ImapIdleChannelAdapter.this.idleTask.run(); if (logger.isDebugEnabled()) { logger.debug("Task completed successfully. Re-scheduling it again right away."); } } catch (Exception e) { //run again after a delay - logger.warn("Failed to execute IDLE task. Will attempt to resubmit in " + reconnectDelay + " milliseconds.", e); - receivingTaskTrigger.delayNextExecution(); + logger.warn("Failed to execute IDLE task. Will attempt to resubmit in " + ImapIdleChannelAdapter.this.reconnectDelay + " milliseconds.", e); + ImapIdleChannelAdapter.this.receivingTaskTrigger.delayNextExecution(); ImapIdleChannelAdapter.this.publishException(e); } } @@ -211,15 +211,15 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be * The following shouldn't be necessary because doStart() will have ensured we have * one. But, just in case... */ - Assert.state(sendingTaskExecutor != null, "'sendingTaskExecutor' must not be null"); + Assert.state(ImapIdleChannelAdapter.this.sendingTaskExecutor != null, "'sendingTaskExecutor' must not be null"); try { if (logger.isDebugEnabled()) { logger.debug("waiting for mail"); } - mailReceiver.waitForNewMessages(); - if (mailReceiver.getFolder().isOpen()) { - Message[] mailMessages = mailReceiver.receive(); + ImapIdleChannelAdapter.this.mailReceiver.waitForNewMessages(); + if (ImapIdleChannelAdapter.this.mailReceiver.getFolder().isOpen()) { + Message[] mailMessages = ImapIdleChannelAdapter.this.mailReceiver.receive(); if (logger.isDebugEnabled()) { logger.debug("received " + mailMessages.length + " mail messages"); } @@ -227,7 +227,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be Runnable messageSendingTask = createMessageSendingTask(mailMessage); - sendingTaskExecutor.execute(messageSendingTask); + ImapIdleChannelAdapter.this.sendingTaskExecutor.execute(messageSendingTask); } } } @@ -235,7 +235,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be if (logger.isWarnEnabled()) { logger.warn("error occurred in idle task", e); } - if (shouldReconnectAutomatically) { + if (ImapIdleChannelAdapter.this.shouldReconnectAutomatically) { throw new IllegalStateException( "Failure in 'idle' task. Will resubmit.", e); } @@ -255,9 +255,10 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be ImapIdleChannelAdapter.this.getMessageBuilderFactory().withPayload(mailMessage).build(); if (TransactionSynchronizationManager.isActualTransactionActive()) { - if (transactionSynchronizationFactory != null){ + if (ImapIdleChannelAdapter.this.transactionSynchronizationFactory != null){ TransactionSynchronization synchronization = - transactionSynchronizationFactory.create(ImapIdleChannelAdapter.this); + ImapIdleChannelAdapter.this.transactionSynchronizationFactory + .create(ImapIdleChannelAdapter.this); TransactionSynchronizationManager.registerSynchronization(synchronization); if (synchronization instanceof IntegrationResourceHolderSynchronization) { IntegrationResourceHolder holder = @@ -271,14 +272,14 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be }; // wrap in the TX proxy if necessary - if (!CollectionUtils.isEmpty(adviceChain)) { + if (!CollectionUtils.isEmpty(this.adviceChain)) { ProxyFactory proxyFactory = new ProxyFactory(sendingTask); - if (!CollectionUtils.isEmpty(adviceChain)) { - for (Advice advice : adviceChain) { + if (!CollectionUtils.isEmpty(this.adviceChain)) { + for (Advice advice : this.adviceChain) { proxyFactory.addAdvice(advice); } } - sendingTask = (Runnable) proxyFactory.getProxy(classLoader); + sendingTask = (Runnable) proxyFactory.getProxy(this.classLoader); } return sendingTask; } @@ -301,9 +302,9 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be @Override public Date nextExecutionTime(TriggerContext triggerContext) { - if (delayNextExecution){ - delayNextExecution = false; - return new Date(System.currentTimeMillis() + reconnectDelay); + if (this.delayNextExecution){ + this.delayNextExecution = false; + return new Date(System.currentTimeMillis() + ImapIdleChannelAdapter.this.reconnectDelay); } else { return new Date(System.currentTimeMillis()); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java index 125c8166bc..8a7b8123b4 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java @@ -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. @@ -96,7 +96,7 @@ public class ImapMailReceiver extends AbstractMailReceiver { * @return true if messages should be marked as read. */ public Boolean isShouldMarkMessagesAsRead() { - return shouldMarkMessagesAsRead; + return this.shouldMarkMessagesAsRead; } /** diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceiver.java index 17b712149f..f2dae17b84 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceiver.java @@ -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. @@ -43,7 +43,7 @@ public interface MailReceiver { } Message[] getMessages() { - return messages; + return this.messages; } void setMessages(Message[] messages) { @@ -52,7 +52,7 @@ public interface MailReceiver { } Folder getFolder() { - return folder; + return this.folder; } } diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java index ce8382f71c..bb41a16ccc 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailReceivingMessageSource.java @@ -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. @@ -75,7 +75,7 @@ public class MailReceivingMessageSource implements MessageSource, Dispo } public Boolean isShouldMarkMessagesAsRead() { - return shouldMarkMessagesAsRead != null && shouldMarkMessagesAsRead; + return this.shouldMarkMessagesAsRead != null && this.shouldMarkMessagesAsRead; } public void setMaxFetchSize(int maxFetchSize) { @@ -194,14 +194,14 @@ public class MailReceiverFactoryBean implements FactoryBean, Dispo receiver.setShouldDeleteMessages(this.shouldDeleteMessages); } receiver.setMaxFetchSize(this.maxFetchSize); - receiver.setSelectorExpression(selectorExpression); + receiver.setSelectorExpression(this.selectorExpression); if (StringUtils.hasText(this.userFlag)) { receiver.setUserFlag(this.userFlag); } if (isPop3) { if (this.isShouldMarkMessagesAsRead() && this.logger.isWarnEnabled()) { - logger.warn("Setting 'should-mark-messages-as-read' to 'true' while using POP3 has no effect"); + this.logger.warn("Setting 'should-mark-messages-as-read' to 'true' while using POP3 has no effect"); } } else if (isImap) { diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java index 374a917b46..9db5d93922 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/ImapMailReceiverTests.java @@ -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. @@ -893,7 +893,7 @@ public class ImapMailReceiverTests { private boolean firstDone; - public TestReceiver() { + TestReceiver() { setSearchTermStrategy(searchTermStrategy); } diff --git a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MessageWithContentTypeTests.java b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MessageWithContentTypeTests.java index c87992c548..770c151695 100644 --- a/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MessageWithContentTypeTests.java +++ b/spring-integration-mail/src/test/java/org/springframework/integration/mail/config/MessageWithContentTypeTests.java @@ -94,7 +94,7 @@ public class MessageWithContentTypeTests { } private static class TestMimeMessage extends MimeMessage{ - public TestMimeMessage() { + TestMimeMessage() { super(Session.getDefaultInstance(new Properties())); } } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java index dbeb764179..470ee4b692 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java @@ -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. @@ -201,7 +201,7 @@ public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractBa ? System.currentTimeMillis() : document.getCreatedTime(); - Message result = messageBuilderFactory.fromMessage(message).setHeader(SAVED_KEY, Boolean.TRUE) + Message result = this.messageBuilderFactory.fromMessage(message).setHeader(SAVED_KEY, Boolean.TRUE) .setHeader(CREATED_DATE_KEY, createdDate).build(); @SuppressWarnings("unchecked") @@ -212,7 +212,7 @@ public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractBa innerMap.put(MessageHeaders.TIMESTAMP, message.getHeaders().get(MessageHeaders.TIMESTAMP)); document.setCreatedTime(createdDate); - mongoTemplate.insert(document, collectionName); + this.mongoTemplate.insert(document, this.collectionName); } protected static Query groupIdQuery(Object groupId) { @@ -241,10 +241,10 @@ public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractBa @Override public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (Message.class.isAssignableFrom(sourceType.getObjectType())) { - return serializingConverter.convert(source); + return this.serializingConverter.convert(source); } else { - return deserializingConverter.convert((byte[]) source); + return this.deserializingConverter.convert((byte[]) source); } } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java index 5a1578be3d..df2e3f1def 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java @@ -99,7 +99,7 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb } public boolean isTimeoutOnIdle() { - return timeoutOnIdle; + return this.timeoutOnIdle; } /** @@ -286,7 +286,7 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb @Override public void registerMessageGroupExpiryCallback(MessageGroupCallback callback) { - expiryCallbacks.add(callback); + this.expiryCallbacks.add(callback); } @Override @@ -342,7 +342,7 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb RuntimeException exception = null; - for (MessageGroupCallback callback : expiryCallbacks) { + for (MessageGroupCallback callback : this.expiryCallbacks) { try { callback.execute(this, group); } diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java index 9cc3e092de..93be26aa41 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MessageDocument.java @@ -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. @@ -70,7 +70,7 @@ public class MessageDocument { } public Message getMessage() { - return message; + return this.message; } public void setGroupId(Object groupId) { @@ -82,7 +82,7 @@ public class MessageDocument { } public Long getLastModifiedTime() { - return lastModifiedTime; + return this.lastModifiedTime; } public void setLastModifiedTime(long lastModifiedTime) { @@ -90,7 +90,7 @@ public class MessageDocument { } public Long getCreatedTime() { - return createdTime; + return this.createdTime; } public void setCreatedTime(long createdTime) { @@ -98,7 +98,7 @@ public class MessageDocument { } public Boolean isComplete() { - return complete; + return this.complete; } public void setComplete(boolean complete) { @@ -106,7 +106,7 @@ public class MessageDocument { } public Integer getLastReleasedSequence() { - return lastReleasedSequence; + return this.lastReleasedSequence; } public void setLastReleasedSequence(int lastReleasedSequence) { diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java index d04fcab033..0dd6f16d01 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java @@ -216,7 +216,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore innerMap.put(MessageHeaders.TIMESTAMP, message.getHeaders().get(MessageHeaders.TIMESTAMP)); document.set_Group_timestamp(createdDate); - template.insert(document, collectionName); + this.template.insert(document, this.collectionName); } @Override @@ -277,7 +277,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(message, "'message' must not be null"); Query query = whereGroupIdOrder(groupId); - MessageWrapper messageDocument = template.findOne(query, MessageWrapper.class, collectionName); + MessageWrapper messageDocument = this.template.findOne(query, MessageWrapper.class, this.collectionName); long createdTime = 0; int lastReleasedSequence = 0; @@ -309,8 +309,8 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messageToRemove, "'messageToRemove' must not be null"); - template.findAndRemove(whereMessageIdIsAndGroupIdIs(messageToRemove.getHeaders().getId(), groupId), - MessageWrapper.class, collectionName); + this.template.findAndRemove(whereMessageIdIsAndGroupIdIs(messageToRemove.getHeaders().getId(), groupId), + MessageWrapper.class, this.collectionName); updateGroup(groupId, lastModifiedUpdate()); return getMessageGroup(groupId); } @@ -356,7 +356,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore Query query = Query.query(Criteria.where(GROUP_ID_KEY).exists(true)); @SuppressWarnings("rawtypes") - List groupIds = template.getCollection(collectionName) + List groupIds = this.template.getCollection(this.collectionName) .distinct(GROUP_ID_KEY, query.getQueryObject()); for (Object groupId : groupIds) { @@ -370,7 +370,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore public Message pollMessageFromGroup(final Object groupId) { Assert.notNull(groupId, "'groupId' must not be null"); Query query = whereGroupIdIs(groupId).with(new Sort(GROUP_UPDATE_TIMESTAMP_KEY, SEQUENCE)); - MessageWrapper messageWrapper = template.findAndRemove(query, MessageWrapper.class, collectionName); + MessageWrapper messageWrapper = this.template.findAndRemove(query, MessageWrapper.class, this.collectionName); Message message = null; if (messageWrapper != null) { message = messageWrapper.getMessage(); @@ -501,7 +501,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore messageType = GenericMessage.class.getName(); } try { - message = (Message) this.read(ClassUtils.forName(messageType.toString(), classLoader), source); + message = (Message) this.read(ClassUtils.forName(messageType.toString(), MongoDbMessageStore.this.classLoader), source); } catch (ClassNotFoundException e) { throw new IllegalStateException("failed to load class: " + messageType, e); @@ -547,7 +547,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore Class typeClass = null; if (source.containsField("_class")) { Object type = source.get("_class"); - typeClass = ClassUtils.forName(type.toString(), classLoader); + typeClass = ClassUtils.forName(type.toString(), MongoDbMessageStore.this.classLoader); } else if (source instanceof BasicDBList) { typeClass = List.class; @@ -574,7 +574,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore DBObject payloadObject = (DBObject) payload; Object payloadType = payloadObject.get("_class"); try { - Class payloadClass = ClassUtils.forName(payloadType.toString(), classLoader); + Class payloadClass = ClassUtils.forName(payloadType.toString(), MongoDbMessageStore.this.classLoader); payload = this.read(payloadClass, payloadObject); } catch (Exception e) { @@ -698,7 +698,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore DBObject inputMessageObject = (DBObject) source.get("inputMessage"); Object inputMessageType = inputMessageObject.get("_class"); try { - Class messageClass = ClassUtils.forName(inputMessageType.toString(), classLoader); + Class messageClass = ClassUtils.forName(inputMessageType.toString(), MongoDbMessageStore.this.classLoader); inputMessage = (Message) MongoDbMessageStore.this.converter.read(messageClass, inputMessageObject); } catch (Exception e) { @@ -741,7 +741,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore @Override public byte[] convert(Throwable source) { - return serializingConverter.convert(source); + return this.serializingConverter.convert(source); } } @@ -804,23 +804,23 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore } public int get_LastReleasedSequenceNumber() { - return _last_released_sequence; + return this._last_released_sequence; } public long get_Group_timestamp() { - return _group_timestamp; + return this._group_timestamp; } public boolean get_Group_complete() { - return _group_complete; + return this._group_complete; } public Object get_GroupId() { - return _groupId; + return this._groupId; } public Message getMessage() { - return message; + return this.message; } public void set_GroupId(Object groupId) { @@ -832,7 +832,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore } public long get_Group_update_timestamp() { - return _group_update_timestamp; + return this._group_update_timestamp; } public void set_Group_update_timestamp(long lastModified) { diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java index 353c70a9dc..85f6ef13cd 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/core/DefaultMqttPahoClientFactory.java @@ -122,7 +122,7 @@ public class DefaultMqttPahoClientFactory implements MqttPahoClientFactory { */ @Override public ConsumerStopAction getConsumerStopAction() { - return consumerStopAction; + return this.consumerStopAction; } /** @@ -198,19 +198,19 @@ public class DefaultMqttPahoClientFactory implements MqttPahoClientFactory { } protected String getTopic() { - return topic; + return this.topic; } protected byte[] getPayload() { - return payload;//NOSONAR + return this.payload;//NOSONAR } protected int getQos() { - return qos; + return this.qos; } protected boolean isRetained() { - return retained; + return this.retained; } } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java index b237362c16..89ef6f98fc 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageDeliveryEvent.java @@ -42,15 +42,15 @@ public abstract class MqttMessageDeliveryEvent extends MqttIntegrationEvent { } public int getMessageId() { - return messageId; + return this.messageId; } public String getClientId() { - return clientId; + return this.clientId; } public int getClientInstance() { - return clientInstance; + return this.clientInstance; } } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageSentEvent.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageSentEvent.java index 97d5132634..61ce570c39 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageSentEvent.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttMessageSentEvent.java @@ -41,17 +41,17 @@ public class MqttMessageSentEvent extends MqttMessageDeliveryEvent { } public Message getMessage() { - return message; + return this.message; } public String getTopic() { - return topic; + return this.topic; } @Override public String toString() { - return "MqttMessageSentEvent [message=" + message - + ", topic=" + topic + return "MqttMessageSentEvent [message=" + this.message + + ", topic=" + this.topic + ", clientId=" + getClientId() + ", clientInstance=" + getClientInstance() + ", messageId=" + getMessageId() diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttSubscribedEvent.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttSubscribedEvent.java index cb87b27d12..1226f76f61 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttSubscribedEvent.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/event/MqttSubscribedEvent.java @@ -32,12 +32,12 @@ public class MqttSubscribedEvent extends MqttIntegrationEvent { } public String getMessage() { - return message; + return this.message; } @Override public String toString() { - return "MqttSubscribedEvent [message=" + message + ", source=" + source + "]"; + return "MqttSubscribedEvent [message=" + this.message + ", source=" + source + "]"; } } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java index ede2df8d90..11938084b1 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/AbstractMqttMessageDrivenChannelAdapter.java @@ -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. @@ -109,15 +109,15 @@ public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessagePro } protected String getUrl() { - return url; + return this.url; } protected String getClientId() { - return clientId; + return this.clientId; } protected MqttMessageConverter getConverter() { - return converter; + return this.converter; } @ManagedAttribute @@ -264,7 +264,7 @@ public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessagePro } private int getQos() { - return qos; + return this.qos; } private void setQos(int qos) { @@ -272,12 +272,12 @@ public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessagePro } private String getTopic() { - return topic; + return this.topic; } @Override public int hashCode() { - return topic.hashCode(); + return this.topic.hashCode(); } @Override @@ -292,12 +292,12 @@ public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessagePro return false; } Topic other = (Topic) obj; - if (topic == null) { + if (this.topic == null) { if (other.topic != null) { return false; } } - else if (!topic.equals(other.topic)) { + else if (!this.topic.equals(other.topic)) { return false; } return true; @@ -305,7 +305,7 @@ public abstract class AbstractMqttMessageDrivenChannelAdapter extends MessagePro @Override public String toString() { - return "Topic [topic=" + topic + ", qos=" + qos + "]"; + return "Topic [topic=" + this.topic + ", qos=" + this.qos + "]"; } } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java index 5147f1807c..b297f4f09e 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/inbound/MqttPahoMessageDrivenChannelAdapter.java @@ -283,7 +283,7 @@ public class MqttPahoMessageDrivenChannelAdapter extends AbstractMqttMessageDriv if (logger.isDebugEnabled()) { logger.debug("Attempting reconnect"); } - if (!connected) { + if (!MqttPahoMessageDrivenChannelAdapter.this.connected) { connectAndSubscribe(); } } diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java index af1cb21b43..06c5185c65 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java @@ -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. @@ -74,15 +74,15 @@ public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler } protected MessageConverter getConverter() { - return converter; + return this.converter; } protected String getUrl() { - return url; + return this.url; } public String getClientId() { - return clientId; + return this.clientId; } /** @@ -91,7 +91,7 @@ public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler * @since 4.1 */ public int getClientInstance() { - return clientInstance; + return this.clientInstance; } @Override diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java index fbe95410e8..7dbf05f7a3 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/support/DefaultPahoMessageConverter.java @@ -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. @@ -104,7 +104,7 @@ public class DefaultPahoMessageConverter implements MqttMessageConverter, BeanFa } protected BeanFactory getBeanFactory() { - return beanFactory; + return this.beanFactory; } protected MessageBuilderFactory getMessageBuilderFactory() { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java index 0966f71d25..d25b033d26 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java @@ -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. @@ -139,7 +139,7 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements if (this.messageConverter instanceof BeanFactoryAware) { ((BeanFactoryAware) this.messageConverter).setBeanFactory(this.getBeanFactory()); } - this.container.setConnectionFactory(connectionFactory); + this.container.setConnectionFactory(this.connectionFactory); if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) { ErrorHandler errorHandler = new MessagePublishingErrorHandler( new BeanFactoryChannelResolver(this.getBeanFactory())); @@ -147,9 +147,9 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements } this.container.setTaskExecutor(this.taskExecutor); MessageListenerAdapter adapter = new MessageListenerAdapter(new MessageListenerDelegate()); - adapter.setSerializer(serializer); + adapter.setSerializer(this.serializer); adapter.afterPropertiesSet(); - this.container.addMessageListener(adapter, new ChannelTopic(topicName)); + this.container.addMessageListener(adapter, new ChannelTopic(this.topicName)); this.container.afterPropertiesSet(); this.dispatcher.setBeanFactory(this.getBeanFactory()); this.initialized = true; @@ -206,9 +206,9 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements @SuppressWarnings({ "unused", "unchecked" }) public void handleMessage(String s) { - Message siMessage = messageConverter.toMessage(s, null); + Message siMessage = SubscribableRedisChannel.this.messageConverter.toMessage(s, null); try { - dispatcher.dispatch(siMessage); + SubscribableRedisChannel.this.dispatcher.dispatch(siMessage); } catch (MessageDispatchingException e) { String topicName = SubscribableRedisChannel.this.topicName; diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java index 08c53598b7..217135f5ed 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java @@ -197,7 +197,7 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements } String uuid = null; if (value != null) { - if (!active) { + if (!this.active) { this.boundListOperations.rightPush(value); return; } @@ -211,7 +211,7 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements } Message requestMessage = null; if (value != null) { - if (!active) { + if (!this.active) { this.template.boundListOps(uuid).rightPush(value); this.boundListOperations.rightPush(stringSerializer.serialize(uuid)); return; @@ -235,11 +235,11 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements if (replyMessage != null) { if (this.extractPayload) { if (!(replyMessage.getPayload() instanceof byte[])) { - if (replyMessage.getPayload() instanceof String && !serializerExplicitlySet) { + if (replyMessage.getPayload() instanceof String && !this.serializerExplicitlySet) { value = stringSerializer.serialize((String) replyMessage.getPayload()); } else { - value = ((RedisSerializer) serializer).serialize(replyMessage.getPayload()); + value = ((RedisSerializer) this.serializer).serialize(replyMessage.getPayload()); } } else { @@ -248,7 +248,7 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements } else { if (this.serializer != null) { - value = ((RedisSerializer) serializer).serialize(replyMessage); + value = ((RedisSerializer) this.serializer).serialize(replyMessage); } } this.template.boundListOps(uuid + QUEUE_NAME_SUFFIX).leftPush(value); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java index 35f3701dd3..118e6ef04d 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java @@ -306,7 +306,7 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl } public boolean isListening() { - return listening; + return this.listening; } /** diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java index a0e525e87c..d9ee9e27b7 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java @@ -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. @@ -152,7 +152,7 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport } public RedisStore getResource() { - return resourceHolder.get(); + return this.resourceHolder.get(); } public void afterCommit(Object object) { diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java index 84e03be804..feced7b238 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java @@ -87,7 +87,7 @@ public class RedisPublishingMessageHandler extends AbstractMessageHandler { @Override protected void onInit() throws Exception { - Assert.notNull(topicExpression, "'topicExpression' must not be null."); + Assert.notNull(this.topicExpression, "'topicExpression' must not be null."); if (this.messageConverter instanceof BeanFactoryAware) { ((BeanFactoryAware) this.messageConverter).setBeanFactory(getBeanFactory()); } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundGateway.java index b75a7057ca..ff6ada413a 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundGateway.java @@ -96,11 +96,11 @@ public class RedisQueueOutboundGateway extends AbstractReplyProducingMessageHand value = message.getPayload(); } if (!(value instanceof byte[])) { - if (value instanceof String && !serializerExplicitlySet) { + if (value instanceof String && !this.serializerExplicitlySet) { value = stringSerializer.serialize((String) value); } else { - value = ((RedisSerializer) serializer).serialize(value); + value = ((RedisSerializer) this.serializer).serialize(value); } } String uuid = defaultIdGenerator.generateId().toString(); @@ -109,7 +109,7 @@ public class RedisQueueOutboundGateway extends AbstractReplyProducingMessageHand this.boundListOps.leftPush(uuidByte); this.template.boundListOps(uuid).leftPush(value); - BoundListOperations boundListOperations = template.boundListOps(uuid + QUEUE_NAME_SUFFIX); + BoundListOperations boundListOperations = this.template.boundListOps(uuid + QUEUE_NAME_SUFFIX); byte[] reply = (byte[]) boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); if (reply != null && reply.length > 0) { Object replyMessage = this.serializer.deserialize(reply); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java index 1207d7d63f..6db3b2607e 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java @@ -258,19 +258,19 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { Assert.state(this.initialized, "handler not initialized - afterPropertiesSet() must be called before the first use"); try { - if (collectionType == CollectionType.ZSET) { + if (this.collectionType == CollectionType.ZSET) { this.writeToZset((RedisZSet) store, message); } - else if (collectionType == CollectionType.SET) { + else if (this.collectionType == CollectionType.SET) { this.writeToSet((RedisSet) store, message); } - else if (collectionType == CollectionType.LIST) { + else if (this.collectionType == CollectionType.LIST) { this.writeToList((RedisList) store, message); } - else if (collectionType == CollectionType.MAP) { + else if (this.collectionType == CollectionType.MAP) { this.writeToMap((RedisMap) store, message); } - else if (collectionType == CollectionType.PROPERTIES) { + else if (this.collectionType == CollectionType.PROPERTIES) { this.writeToProperties((RedisProperties) store, message); } } @@ -400,14 +400,14 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { private void processInPipeline(PipelineCallback callback) { RedisConnection connection = - RedisConnectionUtils.bindConnection(redisTemplate.getConnectionFactory()); + RedisConnectionUtils.bindConnection(this.redisTemplate.getConnectionFactory()); try { connection.openPipeline(); callback.process(); } finally { connection.closePipeline(); - RedisConnectionUtils.unbindConnection(redisTemplate.getConnectionFactory()); + RedisConnectionUtils.unbindConnection(this.redisTemplate.getConnectionFactory()); } } @@ -430,7 +430,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { this.doIncrementOrOverwrite(ops, object, score, zsetIncrementScore); } else { - logger.debug("Zset Score could not be determined. Using default score of 1"); + this.logger.debug("Zset Score could not be determined. Using default score of 1"); this.doIncrementOrOverwrite(ops, object, Double.valueOf(1), zsetIncrementScore); } } @@ -448,8 +448,8 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { private boolean verifyAllMapValuesOfTypeNumber(Map map) { for (Object value : map.values()) { if (!(value instanceof Number)) { - if (logger.isWarnEnabled()) { - logger.warn("failed to extract payload elements because '" + + if (this.logger.isWarnEnabled()) { + this.logger.warn("failed to extract payload elements because '" + value + "' is not of type Number"); } return false; diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java index db8110f63d..f97cdc69d5 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/store/RedisMessageStore.java @@ -58,7 +58,7 @@ public class RedisMessageStore extends AbstractKeyValueMessageStore { @Override protected Object doRetrieve(Object id){ Assert.notNull(id, "'id' must not be null"); - BoundValueOperations ops = redisTemplate.boundValueOps(id); + BoundValueOperations ops = this.redisTemplate.boundValueOps(id); return ops.get(); } @@ -67,7 +67,7 @@ public class RedisMessageStore extends AbstractKeyValueMessageStore { protected void doStore(Object id, Object objectToStore) { Assert.notNull(id, "'id' must not be null"); Assert.notNull(objectToStore, "'objectToStore' must not be null"); - BoundValueOperations ops = redisTemplate.boundValueOps(id); + BoundValueOperations ops = this.redisTemplate.boundValueOps(id); try { ops.set(objectToStore); } @@ -84,7 +84,7 @@ public class RedisMessageStore extends AbstractKeyValueMessageStore { Assert.notNull(id, "'id' must not be null"); Object removedObject = this.doRetrieve(id); if (removedObject != null){ - redisTemplate.delete(id); + this.redisTemplate.delete(id); } return removedObject; } @@ -93,7 +93,7 @@ public class RedisMessageStore extends AbstractKeyValueMessageStore { @Override protected Collection doListKeys(String keyPattern) { Assert.hasText(keyPattern, "'keyPattern' must not be empty"); - Set keys = redisTemplate.keys(keyPattern); + Set keys = this.redisTemplate.keys(keyPattern); return keys; } } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java index aa45c567ef..7da30275db 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/util/RedisLockRegistry.java @@ -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. @@ -283,12 +283,12 @@ public final class RedisLockRegistry implements LockRegistry { @Override public Collection doInRedis(RedisConnection connection) throws DataAccessException { - Set keys = connection.keys((registryKey + ":*").getBytes()); + Set keys = connection.keys((RedisLockRegistry.this.registryKey + ":*").getBytes()); ArrayList list = new ArrayList(keys.size()); if (keys.size() > 0) { List locks = connection.mGet(keys.toArray(new byte[keys.size()][])); for (byte[] lock : locks) { - list.add(lockSerializer.deserialize(lock)); + list.add(RedisLockRegistry.this.lockSerializer.deserialize(lock)); } } return list; @@ -316,12 +316,12 @@ public final class RedisLockRegistry implements LockRegistry { } private String getLockKey() { - return lockKey; + return this.lockKey; } @Override public void lock() { - Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); + Lock localLock = RedisLockRegistry.this.localRegistry.obtain(this.lockKey); localLock.lock(); try { while (true) { @@ -348,7 +348,7 @@ public final class RedisLockRegistry implements LockRegistry { @Override public void lockInterruptibly() throws InterruptedException { - Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); + Lock localLock = RedisLockRegistry.this.localRegistry.obtain(this.lockKey); localLock.lockInterruptibly(); try { while (!this.obtainLock()) { @@ -367,7 +367,7 @@ public final class RedisLockRegistry implements LockRegistry { @Override public boolean tryLock() { - Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); + Lock localLock = RedisLockRegistry.this.localRegistry.obtain(this.lockKey); try { if (!localLock.tryLock()) { return false; @@ -448,7 +448,7 @@ public final class RedisLockRegistry implements LockRegistry { @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { - Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); + Lock localLock = RedisLockRegistry.this.localRegistry.obtain(this.lockKey); if (!localLock.tryLock(time, unit)) { return false; } @@ -494,7 +494,7 @@ public final class RedisLockRegistry implements LockRegistry { } } finally { - Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); + Lock localLock = RedisLockRegistry.this.localRegistry.obtain(this.lockKey); localLock.unlock(); } } @@ -532,10 +532,10 @@ public final class RedisLockRegistry implements LockRegistry { final int prime = 31; int result = 1; result = prime * result + getOuterType().hashCode(); - result = prime * result + Arrays.hashCode(lockHost); - result = prime * result + ((lockKey == null) ? 0 : lockKey.hashCode()); - result = prime * result + (int) (lockedAt ^ (lockedAt >>> 32)); - result = prime * result + ((threadName == null) ? 0 : threadName.hashCode()); + result = prime * result + Arrays.hashCode(this.lockHost); + result = prime * result + ((this.lockKey == null) ? 0 : this.lockKey.hashCode()); + result = prime * result + (int) (this.lockedAt ^ (this.lockedAt >>> 32)); + result = prime * result + ((this.threadName == null) ? 0 : this.threadName.hashCode()); return result; } @@ -554,21 +554,21 @@ public final class RedisLockRegistry implements LockRegistry { if (!getOuterType().equals(other.getOuterType())) { return false; } - if (!Arrays.equals(lockHost, other.lockHost)) { + if (!Arrays.equals(this.lockHost, other.lockHost)) { return false; } - if (!lockKey.equals(other.lockKey)) { + if (!this.lockKey.equals(other.lockKey)) { return false; } - if (lockedAt != other.lockedAt) { + if (this.lockedAt != other.lockedAt) { return false; } - if (threadName == null) { + if (this.threadName == null) { if (other.threadName != null) { return false; } } - else if (!threadName.equals(other.threadName)) { + else if (!this.threadName.equals(other.threadName)) { return false; } return true; diff --git a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java index 5bd662b8b6..0d4846cbca 100644 --- a/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java +++ b/spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java @@ -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. @@ -562,7 +562,7 @@ public class RedisStoreWritingMessageHandlerTests extends RedisAvailableTests{ private static final long serialVersionUID = 1L; private String name; - public President(String name) { + President(String name) { this.name = name; } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java index 9d89f7f4cf..2308767478 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/RefreshableResourceScriptSource.java @@ -54,7 +54,7 @@ public class RefreshableResourceScriptSource implements ScriptSource { public String getScriptAsString() throws IOException { if (this.script == null || this.isModified()) { this.lastModifiedChecked.set(System.currentTimeMillis()); - this.script = source.getScriptAsString(); + this.script = this.source.getScriptAsString(); } return this.script; } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java index a52bd2781b..709a917f23 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutingMessageSource.java @@ -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. @@ -42,6 +42,6 @@ public class ScriptExecutingMessageSource extends AbstractMessageSource @Override protected Object doReceive() { - return scriptMessageProcessor.processMessage(null); + return this.scriptMessageProcessor.processMessage(null); } } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/AbstractScriptExecutor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/AbstractScriptExecutor.java index 4b085ae51f..470765f545 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/AbstractScriptExecutor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/AbstractScriptExecutor.java @@ -55,8 +55,8 @@ public abstract class AbstractScriptExecutor implements ScriptExecutor { this.scriptEngine = new ScriptEngineManager().getEngineByName(this.language); Assert.notNull(this.scriptEngine, invalidLanguageMessage(this.language)); - if (logger.isDebugEnabled()) { - logger.debug("Using script engine : " + scriptEngine.getFactory().getEngineName()); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Using script engine : " + this.scriptEngine.getFactory().getEngineName()); } } @@ -72,23 +72,23 @@ public abstract class AbstractScriptExecutor implements ScriptExecutor { try { String script = scriptSource.getScriptAsString(); Date start = new Date(); - if (logger.isDebugEnabled()) { - logger.debug("executing script: " + script); + if (this.logger.isDebugEnabled()) { + this.logger.debug("executing script: " + script); } Bindings bindings = null; if (variables != null && variables.size() > 0) { bindings = new SimpleBindings(variables); - result = scriptEngine.eval(script, bindings); + result = this.scriptEngine.eval(script, bindings); } else { - result = scriptEngine.eval(script); + result = this.scriptEngine.eval(script); } - result = postProcess(result, scriptEngine, script, bindings); + result = postProcess(result, this.scriptEngine, script, bindings); - if (logger.isDebugEnabled()) { - logger.debug("script executed in " + (new Date().getTime() - start.getTime()) + " ms"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("script executed in " + (new Date().getTime() - start.getTime()) + " ms"); } } diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelSecurityMetadataSource.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelSecurityMetadataSource.java index 3e18b91a7b..a09e17367f 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelSecurityMetadataSource.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelSecurityMetadataSource.java @@ -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. @@ -90,7 +90,7 @@ public class ChannelSecurityMetadataSource implements SecurityMetadataSource { public Collection getAllConfigAttributes() { Set allAttributes = new HashSet(); - for (ChannelAccessPolicy policy : patternMappings.values()) { + for (ChannelAccessPolicy policy : this.patternMappings.values()) { Collection receiveAttributes = policy.getConfigAttributesForReceive(); allAttributes.addAll(receiveAttributes); Collection sendAttributes = policy.getConfigAttributesForSend(); diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java index 4ef227cee0..30b2a9e8f9 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java @@ -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. @@ -56,23 +56,23 @@ public class DefaultChannelAccessPolicy implements ChannelAccessPolicy { "At least one of 'sendAccess' and 'receiveAccess' must not be null and have at least one entry."); if (sendAccessDefined) { String[] sendAccessValues = StringUtils.commaDelimitedListToStringArray(sendAccess); - configAttributeDefinitionForSend = new HashSet(); + this.configAttributeDefinitionForSend = new HashSet(); for (String sendAccessValue : sendAccessValues) { - configAttributeDefinitionForSend.add(new SecurityConfig(StringUtils.trimAllWhitespace(sendAccessValue))); + this.configAttributeDefinitionForSend.add(new SecurityConfig(StringUtils.trimAllWhitespace(sendAccessValue))); } } else { - configAttributeDefinitionForSend = Collections.emptySet(); + this.configAttributeDefinitionForSend = Collections.emptySet(); } if (receiveAccessDefined) { String[] receiveAccessValues = StringUtils.commaDelimitedListToStringArray(receiveAccess); - configAttributeDefinitionForReceive = new HashSet(); + this.configAttributeDefinitionForReceive = new HashSet(); for (String receiveAccessValue : receiveAccessValues) { - configAttributeDefinitionForReceive.add(new SecurityConfig(StringUtils.trimAllWhitespace(receiveAccessValue))); + this.configAttributeDefinitionForReceive.add(new SecurityConfig(StringUtils.trimAllWhitespace(receiveAccessValue))); } } else { - configAttributeDefinitionForReceive = Collections.emptySet(); + this.configAttributeDefinitionForReceive = Collections.emptySet(); } } @@ -90,22 +90,22 @@ public class DefaultChannelAccessPolicy implements ChannelAccessPolicy { Assert.isTrue(sendAccessDefined || receiveAccessDefined, "At least one of 'sendAccess' and 'receiveAccess' must not be null."); if (sendAccessDefined) { - configAttributeDefinitionForSend = new HashSet(); + this.configAttributeDefinitionForSend = new HashSet(); for (String sendAccessValue : sendAccess) { - configAttributeDefinitionForSend.add(new SecurityConfig(sendAccessValue)); + this.configAttributeDefinitionForSend.add(new SecurityConfig(sendAccessValue)); } } else { - configAttributeDefinitionForSend = Collections.emptySet(); + this.configAttributeDefinitionForSend = Collections.emptySet(); } if (receiveAccessDefined) { - configAttributeDefinitionForReceive = new HashSet(); + this.configAttributeDefinitionForReceive = new HashSet(); for (String receiveAccessValue : receiveAccess) { - configAttributeDefinitionForReceive.add(new SecurityConfig(receiveAccessValue)); + this.configAttributeDefinitionForReceive.add(new SecurityConfig(receiveAccessValue)); } } else { - configAttributeDefinitionForReceive = Collections.emptySet(); + this.configAttributeDefinitionForReceive = Collections.emptySet(); } } diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/config/ChannelSecurityInterceptorBeanPostProcessor.java b/spring-integration-security/src/main/java/org/springframework/integration/security/config/ChannelSecurityInterceptorBeanPostProcessor.java index 2d77084777..9f8fa15c5c 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/config/ChannelSecurityInterceptorBeanPostProcessor.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/config/ChannelSecurityInterceptorBeanPostProcessor.java @@ -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,7 +61,7 @@ public class ChannelSecurityInterceptorBeanPostProcessor extends AbstractAutoPro public Object postProcessBeforeInitialization(Object bean, String beanName) { if (this.accessPolicyMapping != null && bean instanceof ChannelSecurityInterceptor - && accessPolicyMapping.containsKey(beanName)) { + && this.accessPolicyMapping.containsKey(beanName)) { Map accessPolicies = this.accessPolicyMapping.get(beanName); ChannelSecurityMetadataSource securityMetadataSource = (ChannelSecurityMetadataSource) ((ChannelSecurityInterceptor) bean).obtainSecurityMetadataSource(); diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java index bdee7ac3f3..54292151ea 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java @@ -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. @@ -415,29 +415,29 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share jschSession.setUserInfo(this.userInfoWrapper); try { - if (proxy != null) { - jschSession.setProxy(proxy); + if (this.proxy != null) { + jschSession.setProxy(this.proxy); } - if (socketFactory != null) { - jschSession.setSocketFactory(socketFactory); + if (this.socketFactory != null) { + jschSession.setSocketFactory(this.socketFactory); } - if (timeout != null) { - jschSession.setTimeout(timeout); + if (this.timeout != null) { + jschSession.setTimeout(this.timeout); } - if (StringUtils.hasText(clientVersion)) { - jschSession.setClientVersion(clientVersion); + if (StringUtils.hasText(this.clientVersion)) { + jschSession.setClientVersion(this.clientVersion); } - if (StringUtils.hasText(hostKeyAlias)) { - jschSession.setHostKeyAlias(hostKeyAlias); + if (StringUtils.hasText(this.hostKeyAlias)) { + jschSession.setHostKeyAlias(this.hostKeyAlias); } - if (serverAliveInterval != null) { - jschSession.setServerAliveInterval(serverAliveInterval); + if (this.serverAliveInterval != null) { + jschSession.setServerAliveInterval(this.serverAliveInterval); } - if (serverAliveCountMax != null) { - jschSession.setServerAliveCountMax(serverAliveCountMax); + if (this.serverAliveCountMax != null) { + jschSession.setServerAliveCountMax(this.serverAliveCountMax); } - if (enableDaemonThread != null) { - jschSession.setDaemonThread(enableDaemonThread); + if (this.enableDaemonThread != null) { + jschSession.setDaemonThread(this.enableDaemonThread); } } catch (Exception e) { diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/JSchSessionWrapper.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/JSchSessionWrapper.java index e7dd58435a..06cc8e46e8 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/JSchSessionWrapper.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/JSchSessionWrapper.java @@ -43,17 +43,17 @@ class JSchSessionWrapper { } public void close() { - if (channels.decrementAndGet() <= 0) { + if (this.channels.decrementAndGet() <= 0) { this.session.disconnect(); } } public final Session getSession() { - return session; + return this.session; } public boolean isConnected() { - return session.isConnected(); + return this.session.isConnected(); } } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java index 7f69034c06..df66424998 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java @@ -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. @@ -198,14 +198,14 @@ public class SftpSession implements Session { this.channel.rename(pathFrom, pathTo); } catch (SftpException sftpex) { - if (logger.isDebugEnabled()){ - logger.debug("Initial File rename failed, possibly because file already exists. Will attempt to delete file: " + if (this.logger.isDebugEnabled()){ + this.logger.debug("Initial File rename failed, possibly because file already exists. Will attempt to delete file: " + pathTo + " and execute rename again."); } try { this.remove(pathTo); - if (logger.isDebugEnabled()) { - logger.debug("Delete file: " + pathTo + " succeeded. Will attempt rename again"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Delete file: " + pathTo + " succeeded. Will attempt rename again"); } } catch (IOException ioex) { @@ -219,8 +219,8 @@ public class SftpSession implements Session { throw new NestedIOException("failed to rename from " + pathFrom + " to " + pathTo, sftpex2); } } - if (logger.isDebugEnabled()) { - logger.debug("File: " + pathFrom + " was successfully renamed to " + pathTo); + if (this.logger.isDebugEnabled()) { + this.logger.debug("File: " + pathFrom + " was successfully renamed to " + pathTo); } } diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java index f4e0f16b8e..4f3c751690 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java @@ -155,7 +155,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager } public long getRecoveryInterval() { - return recoveryInterval; + return this.recoveryInterval; } @Override @@ -175,29 +175,29 @@ public abstract class AbstractStompSessionManager implements StompSessionManager private synchronized void connect() { if (this.connecting || this.connected) { - if (logger.isDebugEnabled()) { - logger.debug("Aborting connect; another thread is connecting."); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Aborting connect; another thread is connecting."); } return; } final int epoch = this.epoch.get(); this.connecting = true; - if (logger.isDebugEnabled()) { - logger.debug("Connecting " + this); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Connecting " + this); } try { this.stompSessionListenableFuture = doConnect(this.compositeStompSessionHandler); } catch (Exception e) { - logger.error("doConnect() error for " + this, e); + this.logger.error("doConnect() error for " + this, e); } final CountDownLatch latch = new CountDownLatch(1); this.stompSessionListenableFuture.addCallback(new ListenableFutureCallback() { @Override public void onFailure(Throwable e) { - if (logger.isDebugEnabled()) { - logger.debug("onFailure", e); + if (AbstractStompSessionManager.this.logger.isDebugEnabled()) { + AbstractStompSessionManager.this.logger.debug("onFailure", e); } latch.countDown(); if (epoch == AbstractStompSessionManager.this.epoch.get()) { @@ -207,8 +207,8 @@ public abstract class AbstractStompSessionManager implements StompSessionManager @Override public void onSuccess(StompSession stompSession) { - if (logger.isDebugEnabled()) { - logger.debug("onSuccess"); + if (AbstractStompSessionManager.this.logger.isDebugEnabled()) { + AbstractStompSessionManager.this.logger.debug("onSuccess"); } AbstractStompSessionManager.this.connected = true; AbstractStompSessionManager.this.connecting = false; @@ -224,14 +224,14 @@ public abstract class AbstractStompSessionManager implements StompSessionManager }); try { if (!latch.await(10, TimeUnit.SECONDS)) { - logger.error("No response to connection attempt"); + this.logger.error("No response to connection attempt"); if (epoch == this.epoch.get()) { scheduleReconnect(null); } } } catch (InterruptedException e1) { - logger.error("Interrupted while waiting for connection attempt"); + this.logger.error("Interrupted while waiting for connection attempt"); Thread.currentThread().interrupt(); } } @@ -239,7 +239,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager private void scheduleReconnect(Throwable e) { this.epoch.incrementAndGet(); this.connecting = this.connected = false; - logger.error("STOMP connect error for " + this, e); + this.logger.error("STOMP connect error for " + this, e); if (this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent( new StompConnectionFailedEvent(this, e)); @@ -290,8 +290,8 @@ public abstract class AbstractStompSessionManager implements StompSessionManager public void start() { synchronized (this.lifecycleMonitor) { if (!isRunning()) { - if (logger.isInfoEnabled()) { - logger.info("Starting " + getClass().getSimpleName()); + if (this.logger.isInfoEnabled()) { + this.logger.info("Starting " + getClass().getSimpleName()); } connect(); this.running = true; @@ -314,8 +314,8 @@ public abstract class AbstractStompSessionManager implements StompSessionManager synchronized (this.lifecycleMonitor) { if (isRunning()) { this.running = false; - if (logger.isInfoEnabled()) { - logger.info("Stopping " + getClass().getSimpleName()); + if (this.logger.isInfoEnabled()) { + this.logger.info("Stopping " + getClass().getSimpleName()); } destroy(); } @@ -340,15 +340,15 @@ public abstract class AbstractStompSessionManager implements StompSessionManager } protected StompHeaders getConnectHeaders() { - return connectHeaders; + return this.connectHeaders; } @Override public String toString() { return ObjectUtils.identityToString(this) + - " {connecting=" + connecting + - ", connected=" + connected + - ", name='" + name + '\'' + + " {connecting=" + this.connecting + + ", connected=" + this.connected + + ", name='" + this.name + '\'' + '}'; } @@ -395,7 +395,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager @Override public void handleTransportError(StompSession session, Throwable exception) { - logger.error("STOMP transport error for session: [" + session + "]", exception); + AbstractStompSessionManager.this.logger.error("STOMP transport error for session: [" + session + "]", exception); this.session = null; scheduleReconnect(exception); synchronized (this.delegates) { diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/event/StompReceiptEvent.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/event/StompReceiptEvent.java index 6d1d80c59d..98574b9206 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/event/StompReceiptEvent.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/event/StompReceiptEvent.java @@ -51,23 +51,23 @@ public class StompReceiptEvent extends StompIntegrationEvent { } public String getDestination() { - return destination; + return this.destination; } public String getReceiptId() { - return receiptId; + return this.receiptId; } public StompCommand getStompCommand() { - return stompCommand; + return this.stompCommand; } public boolean isLost() { - return lost; + return this.lost; } public Message getMessage() { - return message; + return this.message; } public void setMessage(Message message) { @@ -76,8 +76,8 @@ public class StompReceiptEvent extends StompIntegrationEvent { @Override public String toString() { - return "StompReceiptEvent [destination=" + destination + ", receiptId=" + receiptId + ", stompCommand=" - + stompCommand + ", lost=" + lost + ", message=" + message + "]"; + return "StompReceiptEvent [destination=" + this.destination + ", receiptId=" + this.receiptId + ", stompCommand=" + + this.stompCommand + ", lost=" + this.lost + ", message=" + this.message + "]"; } } diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java index 6b6ea0e133..2506981cd2 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/inbound/StompInboundChannelAdapter.java @@ -218,7 +218,7 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement @Override public Type getPayloadType(StompHeaders headers) { - return payloadType; + return StompInboundChannelAdapter.this.payloadType; } @Override @@ -229,7 +229,7 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement } else { message = getMessageBuilderFactory().withPayload(body) - .copyHeaders(headerMapper.toHeaders(headers)) + .copyHeaders(StompInboundChannelAdapter.this.headerMapper.toHeaders(headers)) .build(); } sendMessage(message); @@ -238,7 +238,8 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement }); if (this.stompSessionManager.isAutoReceiptEnabled()) { - if (this.applicationEventPublisher != null) { + final ApplicationEventPublisher applicationEventPublisher = this.applicationEventPublisher; + if (applicationEventPublisher != null) { subscription.addReceiptTask(new Runnable() { @Override @@ -280,7 +281,7 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement @Override public void afterConnected(StompSession session, StompHeaders connectedHeaders) { StompInboundChannelAdapter.this.stompSession = session; - for (String destination : destinations) { + for (String destination : StompInboundChannelAdapter.this.destinations) { subscribeDestination(destination); } } @@ -288,12 +289,12 @@ public class StompInboundChannelAdapter extends MessageProducerSupport implement @Override public void handleException(StompSession session, StompCommand command, StompHeaders headers, byte[] payload, Throwable exception) { - if (errorChannel != null) { + if (StompInboundChannelAdapter.this.errorChannel != null) { StompHeaderAccessor headerAccessor = StompHeaderAccessor.create(command); - headerAccessor.copyHeaders(headerMapper.toHeaders(headers)); + headerAccessor.copyHeaders(StompInboundChannelAdapter.this.headerMapper.toHeaders(headers)); Message failedMessage = MessageBuilder.createMessage(payload, headerAccessor.getMessageHeaders()); - getMessagingTemplate().send(errorChannel, + getMessagingTemplate().send(StompInboundChannelAdapter.this.errorChannel, new ErrorMessage(new MessageHandlingException(failedMessage, exception))); } else { diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java index df90cae428..3181dd4b8c 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java @@ -147,7 +147,8 @@ public class StompMessageHandler extends AbstractMessageHandler implements Appli final StompSession.Receiptable receiptable = stompSession.send(stompHeaders, message.getPayload()); if (receiptable.getReceiptId() != null) { final String destination = stompHeaders.getDestination(); - if (this.applicationEventPublisher != null) { + final ApplicationEventPublisher applicationEventPublisher = this.applicationEventPublisher; + if (applicationEventPublisher != null) { receiptable.addReceiptTask(new Runnable() { @Override @@ -238,13 +239,13 @@ public class StompMessageHandler extends AbstractMessageHandler implements Appli } if (thePayload != null) { Message failedMessage = getMessageBuilderFactory().withPayload(thePayload) - .copyHeaders(headerMapper.toHeaders(headers)) + .copyHeaders(StompMessageHandler.this.headerMapper.toHeaders(headers)) .build(); MessagingException exception = new MessageDeliveryException(failedMessage, "STOMP frame handling error."); logger.error("STOMP frame handling error.", exception); - if (applicationEventPublisher != null) { - applicationEventPublisher.publishEvent( + if (StompMessageHandler.this.applicationEventPublisher != null) { + StompMessageHandler.this.applicationEventPublisher.publishEvent( new StompExceptionEvent(StompMessageHandler.this, exception)); } } diff --git a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java index b76b2831d8..bd4b8ecc39 100644 --- a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java +++ b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamReadingMessageSource.java @@ -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. @@ -79,11 +79,11 @@ public class ByteStreamReadingMessageSource extends IntegrationObjectSupport imp byte[] bytes; int bytesRead = 0; synchronized (this.streamMonitor) { - if (stream.available() == 0) { + if (this.stream.available() == 0) { return null; } - bytes = new byte[bytesPerMessage]; - bytesRead = stream.read(bytes, 0, bytes.length); + bytes = new byte[this.bytesPerMessage]; + bytesRead = this.stream.read(bytes, 0, bytes.length); } if (bytesRead <= 0) { return null; diff --git a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamWritingMessageHandler.java b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamWritingMessageHandler.java index b61d3a822d..5cded4fbb9 100644 --- a/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamWritingMessageHandler.java +++ b/spring-integration-stream/src/main/java/org/springframework/integration/stream/ByteStreamWritingMessageHandler.java @@ -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. @@ -62,8 +62,8 @@ public class ByteStreamWritingMessageHandler extends AbstractMessageHandler { protected void handleMessageInternal(Message message) { Object payload = message.getPayload(); if (payload == null) { - if (logger.isWarnEnabled()) { - logger.warn(this.getClass().getSimpleName() + " received null object"); + if (this.logger.isWarnEnabled()) { + this.logger.warn(this.getClass().getSimpleName() + " received null object"); } return; } diff --git a/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java b/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java index 9bbd855cd4..f6f5f5b8b9 100644 --- a/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java +++ b/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java @@ -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. @@ -137,14 +137,14 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler protected void handleMessageInternal(Message message) { Object payload = message.getPayload(); if (payload == null) { - if (logger.isWarnEnabled()) { - logger.warn("target received null payload"); + if (this.logger.isWarnEnabled()) { + this.logger.warn("target received null payload"); } return; } try { if (payload instanceof String) { - writer.write((String) payload); + this.writer.write((String) payload); } else if (payload instanceof char[]) { this.writer.write((char[]) payload); @@ -157,12 +157,12 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler ((Exception) payload).printStackTrace(printWriter); } else { - writer.write(payload.toString()); + this.writer.write(payload.toString()); } if (this.shouldAppendNewLine) { - writer.newLine(); + this.writer.newLine(); } - writer.flush(); + this.writer.flush(); } catch (IOException e) { throw new MessagingException("IO failure occurred in target", e); diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/DefaultMessageConverter.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/DefaultMessageConverter.java index 54f64dc312..0ea13a382e 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/DefaultMessageConverter.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/DefaultMessageConverter.java @@ -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. @@ -64,7 +64,7 @@ public class DefaultMessageConverter implements MessageConverter, BeanFactoryAwa } protected boolean asMap() { - return asMap; + return this.asMap; } @Override diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java index 7d76c7730f..85e50056cc 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java @@ -205,7 +205,7 @@ public class RFC5424SyslogParser { private int mark; public Reader(String l) { - line = l; + this.line = l; } public void mark() { @@ -214,23 +214,23 @@ public class RFC5424SyslogParser { public String getMarkedSegment() { Assert.state(this.mark <= this.idx, "mark is greater than this.idx"); - return this.line.substring(mark, this.idx); + return this.line.substring(this.mark, this.idx); } public int current() { - return line.charAt(this.idx); + return this.line.charAt(this.idx); } public int prev() { - return line.charAt(this.idx - 1); + return this.line.charAt(this.idx - 1); } public int getc() { - return line.charAt(this.idx++); + return this.line.charAt(this.idx++); } public int peek() { - return line.charAt(this.idx + 1); + return this.line.charAt(this.idx + 1); } public void ungetc() { @@ -271,19 +271,19 @@ public class RFC5424SyslogParser { } public boolean is(char c) { - return line.charAt(this.idx) == c; + return this.line.charAt(this.idx) == c; } public boolean was(char c) { - return line.charAt(this.idx - 1) == c; + return this.line.charAt(this.idx - 1) == c; } public boolean isDigit() { - return Character.isDigit(line.charAt(this.idx)); + return Character.isDigit(this.line.charAt(this.idx)); } public void expect(char c) { - if (line.charAt(this.idx++) != c) { + if (this.line.charAt(this.idx++) != c) { throw new IllegalStateException("Expected '" + c + "' @" + this.idx); } } @@ -296,7 +296,7 @@ public class RFC5424SyslogParser { } public String rest() { - return line.substring(this.idx); + return this.line.substring(this.idx); } public String getIdentifier() { @@ -346,11 +346,11 @@ public class RFC5424SyslogParser { } public int level() { - return level; + return this.level; } public String label() { - return label; + return this.label; } public static Severity parseInt(int syslogSeverity) { diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/RFC6587SyslogDeserializer.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/RFC6587SyslogDeserializer.java index 09c138dde5..2e2f12bb03 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/RFC6587SyslogDeserializer.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/RFC6587SyslogDeserializer.java @@ -97,7 +97,7 @@ public class RFC6587SyslogDeserializer implements Deserializer> { else { throw new IllegalStateException("Expected a digit or '<', got 0x" + Integer.toHexString(peek)); } - return parser.parse(line, octetCount, shortRead); + return this.parser.parse(line, octetCount, shortRead); } private boolean isDigit(int peek) { diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/SyslogReceivingChannelAdapterSupport.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/SyslogReceivingChannelAdapterSupport.java index 15f4c9428a..4df72f2768 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/SyslogReceivingChannelAdapterSupport.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/SyslogReceivingChannelAdapterSupport.java @@ -77,7 +77,7 @@ public abstract class SyslogReceivingChannelAdapterSupport extends MessageProduc @Override protected void onInit() { super.onInit(); - if (!converterSet) { + if (!this.converterSet) { ((DefaultMessageConverter) this.converter).setBeanFactory(this.getBeanFactory()); } } @@ -85,8 +85,8 @@ public abstract class SyslogReceivingChannelAdapterSupport extends MessageProduc protected void convertAndSend(Message message) { try { if (message instanceof ErrorMessage) { - if (logger.isDebugEnabled()) { - logger.debug("Error on syslog socket:" + ((ErrorMessage) message).getPayload().getMessage()); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Error on syslog socket:" + ((ErrorMessage) message).getPayload().getMessage()); } } else { diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java index 927554275d..980e4342ee 100644 --- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java +++ b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java @@ -179,8 +179,8 @@ abstract class AbstractTwitterMessageSource extends IntegrationObjectSupport private void refreshTweetQueueIfNecessary() { try { - if (tweets.size() <= prefetchThreshold) { - List tweets = pollForTweets(lastEnqueuedId); + if (this.tweets.size() <= this.prefetchThreshold) { + List tweets = pollForTweets(this.lastEnqueuedId); if (!CollectionUtils.isEmpty(tweets)) { enqueueAll(tweets); } diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSource.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSource.java index 5b52dfd98d..ca1094900e 100644 --- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSource.java +++ b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSource.java @@ -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. @@ -53,7 +53,7 @@ public class SearchReceivingMessageSource extends AbstractTwitterMessageSource pollForTweets(long sinceId) { - SearchParameters searchParameters = new SearchParameters(query).count(this.getPageSize()).sinceId(sinceId); + SearchParameters searchParameters = new SearchParameters(this.query).count(this.getPageSize()).sinceId(sinceId); SearchResults results = this.getTwitter().searchOperations().search(searchParameters); return (results != null) ? results.getTweets() : Collections.emptyList(); } diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java index e7630a66c8..012a1a6053 100644 --- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java +++ b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java @@ -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. @@ -86,7 +86,7 @@ public class TwitterSearchOutboundGateway extends AbstractReplyProducingMessageH } protected Twitter getTwitter() { - return twitter; + return this.twitter; } @Override diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/IntegrationWebSocketContainer.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/IntegrationWebSocketContainer.java index 5fbf0e14f6..51c4c8c584 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/IntegrationWebSocketContainer.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/IntegrationWebSocketContainer.java @@ -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. @@ -130,7 +130,7 @@ public abstract class IntegrationWebSocketContainer implements DisposableBean { session.close(CloseStatus.GOING_AWAY); } catch (Exception e) { - logger.error("Failed to close session id '" + session.getId() + "': " + e.getMessage()); + this.logger.error("Failed to close session id '" + session.getId() + "': " + e.getMessage()); } } } @@ -160,8 +160,8 @@ public abstract class IntegrationWebSocketContainer implements DisposableBean { IntegrationWebSocketContainer.this.sendBufferSizeLimit); IntegrationWebSocketContainer.this.sessions.put(session.getId(), session); - if (logger.isDebugEnabled()) { - logger.debug("Started WebSocket session = " + session.getId() + ", number of sessions = " + if (IntegrationWebSocketContainer.this.logger.isDebugEnabled()) { + IntegrationWebSocketContainer.this.logger.debug("Started WebSocket session = " + session.getId() + ", number of sessions = " + IntegrationWebSocketContainer.this.sessions.size()); } if (IntegrationWebSocketContainer.this.messageListener != null) { @@ -190,8 +190,8 @@ public abstract class IntegrationWebSocketContainer implements DisposableBean { if (IntegrationWebSocketContainer.this.messageListener != null) { IntegrationWebSocketContainer.this.messageListener.onMessage(session, message); } - else if (logger.isInfoEnabled()) { - logger.info("This 'WebSocketHandlerContainer' isn't configured with 'WebSocketMessageListener'." + else if (IntegrationWebSocketContainer.this.logger.isInfoEnabled()) { + IntegrationWebSocketContainer.this.logger.info("This 'WebSocketHandlerContainer' isn't configured with 'WebSocketMessageListener'." + " Received messages are ignored. Current message is: " + message); } } diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/support/PassThruSubProtocolHandler.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/support/PassThruSubProtocolHandler.java index 54072082cb..af125d1b15 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/support/PassThruSubProtocolHandler.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/support/PassThruSubProtocolHandler.java @@ -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. @@ -54,7 +54,7 @@ public class PassThruSubProtocolHandler implements SubProtocolHandler { @Override public List getSupportedProtocols() { - return supportedProtocols; + return this.supportedProtocols; } @Override diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/server/WebSocketServerTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/server/WebSocketServerTests.java index 11e05ee360..abcf4580ec 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/server/WebSocketServerTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/server/WebSocketServerTests.java @@ -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. @@ -326,7 +326,7 @@ public class WebSocketServerTests { private class TestWebSocketHandler extends WebSocketHandlerDecorator { - public TestWebSocketHandler(WebSocketHandler delegate) { + TestWebSocketHandler(WebSocketHandler delegate) { super(delegate); } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java index 8f8fe63cca..66056eaf52 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java @@ -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. @@ -206,7 +206,7 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro .withRoot(requestMessage) .build(); - UriComponents uriComponents = UriComponentsBuilder.fromUriString(uri).buildAndExpand(uriVariables); + UriComponents uriComponents = UriComponentsBuilder.fromUriString(this.uri).buildAndExpand(uriVariables); return this.encodeUri ? uriComponents.toUri() : new URI(uriComponents.toUriString()); } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java index 6ba5f9b541..653c9bec63 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java @@ -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. @@ -89,15 +89,15 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou @Override protected void onInit() throws Exception { super.onInit(); - Assert.notNull(marshaller, "This implementation requires Marshaller"); - Assert.notNull(unmarshaller, "This implementation requires Unmarshaller"); + Assert.notNull(this.marshaller, "This implementation requires Marshaller"); + Assert.notNull(this.unmarshaller, "This implementation requires Unmarshaller"); } @Override protected void doInvoke(MessageContext messageContext) throws Exception{ WebServiceMessage request = messageContext.getRequest(); Assert.notNull(request, "Invalid message context: request was null."); - Object requestObject = MarshallingUtils.unmarshal(unmarshaller, request); + Object requestObject = MarshallingUtils.unmarshal(this.unmarshaller, request); AbstractIntegrationMessageBuilder builder = this.getMessageBuilderFactory().withPayload(requestObject); this.fromSoapHeaders(messageContext, builder); @@ -108,7 +108,7 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou WebServiceMessage response = messageContext.getResponse(); this.toSoapHeaders(response, replyMessage); - MarshallingUtils.marshal(marshaller, replyMessage.getPayload(), response); + MarshallingUtils.marshal(this.marshaller, replyMessage.getPayload(), response); } } } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java index dfd5e71117..3afb322fe8 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java @@ -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. @@ -126,7 +126,7 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb @Override public void doWithMessageInternal(WebServiceMessage message, Object payload) throws IOException { - MarshallingUtils.marshal(marshaller, payload, message); + MarshallingUtils.marshal(MarshallingWebServiceOutboundGateway.this.marshaller, payload, message); } } @@ -134,7 +134,7 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb @Override public Object doExtractData(WebServiceMessage message) throws IOException { - return MarshallingUtils.unmarshal(unmarshaller, message); + return MarshallingUtils.unmarshal(MarshallingWebServiceOutboundGateway.this.unmarshaller, message); } } } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java index 1dac80b1d5..03ed3a417a 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceOutboundGateway.java @@ -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. @@ -118,7 +118,7 @@ public class SimpleWebServiceOutboundGateway extends AbstractWebServiceOutboundG if (requestPayload instanceof Source) { source = (Source) requestPayload; - Object o = sourceExtractor.extractData(source); + Object o = SimpleWebServiceOutboundGateway.this.sourceExtractor.extractData(source); Assert.isInstanceOf(Source.class, o); source = (Source) o; } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java index f92c8dbcc0..e839761264 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceInboundGatewayParser.java @@ -67,7 +67,7 @@ public class WebServiceInboundGatewayParser extends AbstractInboundGatewayParser if (StringUtils.hasText(marshallerRef) || StringUtils.hasText(unmarshallerRef)){ String extractPayload = element.getAttribute("extract-payload"); if (StringUtils.hasText(extractPayload)) { - logger.warn("Setting 'extract-payload' attribute has no effect when used with a marshalling Web Service Inbound Gateway."); + this.logger.warn("Setting 'extract-payload' attribute has no effect when used with a marshalling Web Service Inbound Gateway."); } } } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java index 35f1969355..446256ad7f 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java @@ -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. @@ -44,7 +44,7 @@ public class AggregatedXmlMessageValidationException extends RuntimeException { } public List getExceptions() { - return Collections.unmodifiableList(exceptions); + return Collections.unmodifiableList(this.exceptions); } } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java index c9720a8585..d09cd0e42b 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/config/XPathFilterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 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. @@ -78,7 +78,7 @@ public class XPathFilterParser extends AbstractConsumerEndpointParser { Assert.isTrue(xPathExpressionChildPresent ^ xPathReferencePresent, "Exactly one of 'xpath-expression' or 'xpath-expression-ref' is required."); if (xPathExpressionChildPresent) { - BeanDefinition beanDefinition = xpathParser.parse((Element) xPathExpressionNodes.item(0), parserContext); + BeanDefinition beanDefinition = this.xpathParser.parse((Element) xPathExpressionNodes.item(0), parserContext); selectorBuilder.addConstructorArgValue(beanDefinition); } else { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java index ad14bff029..e27837375f 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java @@ -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. @@ -85,7 +85,7 @@ public abstract class AbstractXPathMessageSelector implements MessageSelector { } protected XPathExpression getXPathExpresion() { - return xPathExpresion; + return this.xPathExpresion; } } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java index 92fb1a1c2e..f296048a6a 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java @@ -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. @@ -133,8 +133,8 @@ public class XmlValidatingMessageSelector implements MessageSelector { new AggregatedXmlMessageValidationException( Arrays.asList(validationExceptions))); } - if (logger.isDebugEnabled()) { - logger.debug("Message was rejected due to XML Validation errors"); + if (this.logger.isDebugEnabled()) { + this.logger.debug("Message was rejected due to XML Validation errors"); } } return validationSuccess; diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java index 9ad7c8b72d..e642f4bbce 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/DomSourceFactory.java @@ -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. @@ -97,7 +97,7 @@ public class DomSourceFactory implements SourceFactory { private DocumentBuilder getNewDocumentBuilder() throws ParserConfigurationException { synchronized (this.documentBuilderFactory) { - return documentBuilderFactory.newDocumentBuilder(); + return this.documentBuilderFactory.newDocumentBuilder(); } } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java index 88378fdecb..d9da489802 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/StringSourceFactory.java @@ -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. @@ -94,7 +94,7 @@ public class StringSourceFactory implements SourceFactory { private synchronized Transformer getTransformer() { try { - return transformerFactory.newTransformer(); + return this.transformerFactory.newTransformer(); } catch (Exception e) { throw new MessagingException("Exception creating transformer", e); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/splitter/XPathMessageSplitter.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/splitter/XPathMessageSplitter.java index b1d6188778..12ed4d3cb9 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/splitter/XPathMessageSplitter.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/splitter/XPathMessageSplitter.java @@ -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. @@ -289,7 +289,7 @@ public class XPathMessageSplitter extends AbstractMessageSplitter { @Override public boolean hasNext() { - return index < nodeList.getLength(); + return this.index < this.nodeList.getLength(); } @Override @@ -298,7 +298,7 @@ public class XPathMessageSplitter extends AbstractMessageSplitter { return null; } - Node node = nodeList.item(index++); + Node node = this.nodeList.item(this.index++); if (this.documentBuilder != null) { node = convertNodeToDocument(this.documentBuilder, node); } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java index c2bd771460..f2cc7b97aa 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java @@ -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. @@ -58,23 +58,23 @@ public abstract class AbstractXmlTransformer extends AbstractTransformer { } public String getResultType() { - return resultType; + return this.resultType; } public String getResultFactoryName() { - return resultFactoryName; + return this.resultFactoryName; } public ResultFactory getResultFactory() { - return resultFactory; + return this.resultFactory; } @Override protected void onInit() throws Exception { super.onInit(); - ResultFactory generatedResultFactory = configureResultFactory(resultType, resultFactoryName, this.getBeanFactory()); + ResultFactory generatedResultFactory = configureResultFactory(this.resultType, this.resultFactoryName, this.getBeanFactory()); if (generatedResultFactory != null) { - resultFactory = generatedResultFactory; + this.resultFactory = generatedResultFactory; } } diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java index 1b0be4c05c..ac5ee40e8a 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java @@ -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. @@ -233,7 +233,7 @@ public class XsltPayloadTransformer extends AbstractXmlTransformer implements Be Transformer transformer = buildTransformer(message); Object payload; if (this.alwaysUseSourceFactory) { - payload = sourceFactory.createSource(message.getPayload()); + payload = this.sourceFactory.createSource(message.getPayload()); } else { payload = message.getPayload(); diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java index 5fd1e06666..6808574663 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java @@ -135,7 +135,7 @@ public class ChatMessageListeningEndpoint extends AbstractXmppConnectionAwareEnd public void processPacket(final Stanza packet) { if (packet instanceof org.jivesoftware.smack.packet.Message) { org.jivesoftware.smack.packet.Message xmppMessage = (org.jivesoftware.smack.packet.Message) packet; - Map mappedHeaders = headerMapper.toHeadersFromRequest(xmppMessage); + Map mappedHeaders = ChatMessageListeningEndpoint.this.headerMapper.toHeadersFromRequest(xmppMessage); Object messageBody = xmppMessage.getBody(); diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java index 09d67702bc..ffa313fa90 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/leader/LeaderInitiator.java @@ -112,7 +112,7 @@ public class LeaderInitiator implements SmartLifecycle { */ @Override public boolean isRunning() { - return running; + return this.running; } @Override @@ -148,12 +148,12 @@ public class LeaderInitiator implements SmartLifecycle { public void start() { synchronized(this.lifecycleMonitor) { if (!this.running) { - if (client.getState() != CuratorFrameworkState.STARTED) { + if (this.client.getState() != CuratorFrameworkState.STARTED) { // we want to do curator start here because it needs to // be started before leader selector and it gets a little // complicated to control ordering via beans so that // curator is fully started. - client.start(); + this.client.start(); } this.leaderSelector = new LeaderSelector(this.client, buildLeaderPath(), new LeaderListener()); this.leaderSelector.setId(this.candidate.getId()); @@ -201,14 +201,14 @@ public class LeaderInitiator implements SmartLifecycle { */ private String buildLeaderPath() { - String ns = StringUtils.hasText(namespace) ? namespace : DEFAULT_NAMESPACE; + String ns = StringUtils.hasText(this.namespace) ? this.namespace : DEFAULT_NAMESPACE; if (!ns.startsWith("/")) { ns = "/" + ns; } if (!ns.endsWith("/")) { ns = ns + "/"; } - return String.format(ns + "%s", candidate.getRole()); + return String.format(ns + "%s", this.candidate.getRole()); } /** @@ -221,9 +221,9 @@ public class LeaderInitiator implements SmartLifecycle { CuratorContext context = new CuratorContext(); try { - candidate.onGranted(context); - if (leaderEventPublisher != null) { - leaderEventPublisher.publishOnGranted(LeaderInitiator.this, context, candidate.getRole()); + LeaderInitiator.this.candidate.onGranted(context); + if (LeaderInitiator.this.leaderEventPublisher != null) { + LeaderInitiator.this.leaderEventPublisher.publishOnGranted(LeaderInitiator.this, context, LeaderInitiator.this.candidate.getRole()); } // when this method exits, the leadership will be revoked; @@ -237,9 +237,9 @@ public class LeaderInitiator implements SmartLifecycle { // reset the interrupt flag as the interrupt is handled. } finally { - candidate.onRevoked(context); - if (leaderEventPublisher != null) { - leaderEventPublisher.publishOnRevoked(LeaderInitiator.this, context, candidate.getRole()); + LeaderInitiator.this.candidate.onRevoked(context); + if (LeaderInitiator.this.leaderEventPublisher != null) { + LeaderInitiator.this.leaderEventPublisher.publishOnRevoked(LeaderInitiator.this, context, LeaderInitiator.this.candidate.getRole()); } } } @@ -252,18 +252,18 @@ public class LeaderInitiator implements SmartLifecycle { @Override public boolean isLeader() { - return leaderSelector.hasLeadership(); + return LeaderInitiator.this.leaderSelector.hasLeadership(); } @Override public void yield() { - leaderSelector.interruptLeadership(); + LeaderInitiator.this.leaderSelector.interruptLeadership(); } @Override public String toString() { return String.format("CuratorContext{role=%s, id=%s, isLeader=%s}", - candidate.getRole(), candidate.getId(), isLeader()); + LeaderInitiator.this.candidate.getRole(), LeaderInitiator.this.candidate.getId(), isLeader()); } } diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/lock/ZookeeperLockRegistry.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/lock/ZookeeperLockRegistry.java index 8c8ce37564..0c03f7f15e 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/lock/ZookeeperLockRegistry.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/lock/ZookeeperLockRegistry.java @@ -167,7 +167,7 @@ public class ZookeeperLockRegistry implements ExpirableLockRegistry { @Override public String pathFor(String key) { - return root + key; + return this.root + key; } @Override diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java index 574dfce6c1..bd5c5a7562 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java @@ -123,7 +123,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif // so the data actually exists, we can read it try { byte[] bytes = this.client.getData().forPath(getPath(key)); - return IntegrationUtils.bytesToString(bytes, encoding); + return IntegrationUtils.bytesToString(bytes, this.encoding); } catch (Exception exceptionDuringGet) { throw new ZookeeperMetadataStoreException("Exception while reading node with key '" + key + "':", e); @@ -144,7 +144,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif Stat currentStat = new Stat(); try { byte[] bytes = this.client.getData().storingStatIn(currentStat).forPath(getPath(key)); - if (oldValue.equals(IntegrationUtils.bytesToString(bytes, encoding))) { + if (oldValue.equals(IntegrationUtils.bytesToString(bytes, this.encoding))) { updateNode(key, newValue, currentStat.getVersion()); } return true; @@ -221,7 +221,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif return this.updateMap.get(key).getValue(); } } - return IntegrationUtils.bytesToString(currentData.getData(), encoding); + return IntegrationUtils.bytesToString(currentData.getData(), this.encoding); } } } @@ -235,7 +235,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif this.client.delete().forPath(getPath(key)); // we guarantee that the deletion will supersede the existing data this.updateMap.put(key, new LocalChildData(null, Integer.MAX_VALUE)); - return IntegrationUtils.bytesToString(bytes, encoding); + return IntegrationUtils.bytesToString(bytes, this.encoding); } catch (KeeperException.NoNodeException e) { // ignore - the node doesn't exist @@ -265,7 +265,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif @Override public boolean isAutoStartup() { - return autoStartup; + return this.autoStartup; } @Override @@ -274,12 +274,12 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif synchronized (this.lifecycleMonitor) { if (!this.running) { try { - EnsurePath ensurePath = new EnsurePath(root); - ensurePath.ensure(client.getZookeeperClient()); + EnsurePath ensurePath = new EnsurePath(this.root); + ensurePath.ensure(this.client.getZookeeperClient()); this.cache = new PathChildrenCache(this.client, this.root, true); this.cache.getListenable().addListener(new MetadataStoreListenerInvokingPathChildrenCacheListener()); this.cache.start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE); - running = true; + this.running = true; } catch (Exception e) { throw new ZookeeperMetadataStoreException("Exception while starting bean", e); @@ -312,12 +312,12 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif @Override public boolean isRunning() { - return running; + return this.running; } @Override public int getPhase() { - return phase; + return this.phase; } private static class LocalChildData { @@ -358,7 +358,7 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif } } for (MetadataStoreListener listener : ZookeeperMetadataStore.this.listeners) { - listener.onAdd(eventKey, IntegrationUtils.bytesToString(eventData, encoding)); + listener.onAdd(eventKey, IntegrationUtils.bytesToString(eventData, ZookeeperMetadataStore.this.encoding)); } break; case CHILD_UPDATED: @@ -369,13 +369,13 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif } } for (MetadataStoreListener listener : ZookeeperMetadataStore.this.listeners) { - listener.onUpdate(eventKey, IntegrationUtils.bytesToString(eventData, encoding)); + listener.onUpdate(eventKey, IntegrationUtils.bytesToString(eventData, ZookeeperMetadataStore.this.encoding)); } break; case CHILD_REMOVED: ZookeeperMetadataStore.this.updateMap.remove(eventKey); for (MetadataStoreListener listener : ZookeeperMetadataStore.this.listeners) { - listener.onRemove(eventKey, IntegrationUtils.bytesToString(eventData, encoding)); + listener.onRemove(eventKey, IntegrationUtils.bytesToString(eventData, ZookeeperMetadataStore.this.encoding)); } break; default: @@ -387,6 +387,6 @@ public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLif } private String getKey(String path) { - return path.replace(root + "/", ""); + return path.replace(this.root + "/", ""); } } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 71fefe5ccd..f646b0622b 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -67,10 +67,10 @@ - - - - + + + + diff --git a/src/checkstyle/fixModifiers.gradle b/src/checkstyle/fixModifiers.gradle index d9005d2404..095f549fc9 100644 --- a/src/checkstyle/fixModifiers.gradle +++ b/src/checkstyle/fixModifiers.gradle @@ -18,12 +18,13 @@ task fixModifiers << { def outSource = '' file.eachLine { line, ln -> if (!headerFixed) { - def matcher = line =~ /Copyright (20\d\d)(?:-20\d\d)?/ + def matcher = line =~ /Copyright (20\d\d)(?:-(20\d\d))?/ if (matcher.count) { - def years = matcher[0][1] - if (years != now) { - years = years + "-$now" - line = line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, years) + def year1 = matcher[0][1] + if (now != year1) { + if (now != matcher[0][2]) { + line = line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, year1 + "-$now") + } } headerFixed = true } diff --git a/src/checkstyle/fixThis.gradle b/src/checkstyle/fixThis.gradle index 9e61cbb18c..47f8d417f1 100644 --- a/src/checkstyle/fixThis.gradle +++ b/src/checkstyle/fixThis.gradle @@ -1,64 +1,65 @@ task fixThis << { fileTree("${buildDir}/reports/checkstyle").include('*.xml').each { report -> - println "processing $report" def xml = new XmlParser(false, false).parse(report) xml.file.each { f -> - // println "processing $f" def errors = f.error - def hasThisError = false def thisErrors = [] errors.each { error -> if (error.@source == 'com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck') { thisErrors.add(error) - hasThisError = true } } - // println hasThisError - // println f.@name - if (hasThisError) { + if (thisErrors) { def errorInx = 0 def error = thisErrors[errorInx++] - def lx = Integer.valueOf(error.@line) - println error def file = new File(f.@name) + println "Fixing file $file ..." + boolean headerFixed def outSource = '' - def ln = 0 - file.eachLine { line -> - // println line - ln++ - def matcher = line =~ /Copyright (20\d\d)(?:-20\d\d)?/ - if (matcher.count) { - def years = matcher[0][1] - if (years != now) { - years = years + "-$now" + file.eachLine { line, ln -> + if (!headerFixed) { + def matcher = line =~ /Copyright (20\d\d)(?:-(20\d\d))?/ + if (matcher.count) { + def year1 = matcher[0][1] + if (now != year1) { + if (now != matcher[0][2]) { + line = line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, year1 + "-$now") + } + } + headerFixed = true } - line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, years) } - if (error && ln == lx) { - // println line - def beforeIndex = Integer.valueOf(error.@column) - 1 + + if (error && ln == (error.@line as int)) { + def message = error.@message + def property = message.substring(message.indexOf('\'') + 1, message.lastIndexOf('\'')) + def thisPrefix = message.substring(message.indexOf('"') + 1, message.lastIndexOf('"')) + + + def index = (error.@column as int) - 1 def chars = line.toCharArray() - for (int i = 0; i < beforeIndex; i++) { + for (int i = 0; i < index; i++) { if (chars[i] == '\t') { // tabs before code == 8 - beforeIndex -= 7; + index -= 7; } else if (chars[i] != ' ') { // tabs after code start are only counted as 1 break; } } - line = line.substring(0, beforeIndex) + "this." + line.substring(beforeIndex) - // println line - error = thisErrors[errorInx++] - while (error && lx == Integer.valueOf(error.@line)) { + + line = line.substring(0, index) + thisPrefix + property + line.substring(index + property.length()) + + println "Fixed line $line" + + while (error && ln == (error.@line as int)) { error = thisErrors[errorInx++] } - if (error) { - lx = Integer.valueOf(error.@line) - } } - outSource += line + '\n' + + outSource += line + System.lineSeparator() } file.write(outSource) + println() } } }