Skip to content

Commit

Permalink
checkstyle FinalClassCheck
Browse files Browse the repository at this point in the history
fixes

fixModifiers after fixFinal

Revert CachingSessionFactory

Class is spied in tests.

checkstyle - Import Rules

checkstyle InterfaceIsType

checkstyle InnerTypeLast

checkstyle OneStatementPerLine

CovariantEquals
OneTopLevelClass

* Revert `'\n'` -> `System.lineSeparator()` in the Gradle scripts to meet Git `autocrlf = true` on Windows
* Fix timing issue with the `LastModifiedFileListFilterTests`, when the `age = 1` might not be enough for the file object when we have some delay before checking
  • Loading branch information
garyrussell authored and artembilan committed Apr 4, 2016
1 parent 43af472 commit 4ac3a79
Show file tree
Hide file tree
Showing 105 changed files with 738 additions and 525 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ subprojects { subproject ->
apply plugin: 'jacoco'
apply plugin: 'checkstyle'

apply from: "${rootDir}/src/checkstyle/fixFinal.gradle"
apply from: "${rootDir}/src/checkstyle/fixHeaders.gradle"
apply from: "${rootDir}/src/checkstyle/fixModifiers.gradle"
apply from: "${rootDir}/src/checkstyle/fixThis.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,59 @@ public void onInit() throws Exception {
}
}

/*
* SmartLifecycle implementation (delegates to the MessageListener container)
*/

@Override
public boolean isAutoStartup() {
return (this.container != null) && this.container.isAutoStartup();
}

@Override
public int getPhase() {
return (this.container != null) ? this.container.getPhase() : 0;
}

@Override
public boolean isRunning() {
return (this.container != null) && this.container.isRunning();
}

@Override
public void start() {
if (this.container != null) {
this.container.start();
}
}

@Override
public void stop() {
if (this.container != null) {
this.container.stop();
}
}

@Override
public void stop(Runnable callback) {
if (this.container != null) {
this.container.stop(callback);
}
}

@Override
public void destroy() throws Exception {
if (this.container != null) {
this.container.destroy();
}
}

protected abstract AbstractDispatcher createDispatcher();

protected abstract String obtainQueueName(AmqpAdmin admin, String channelName);


private static class DispatchingMessageListener implements MessageListener {
private static final class DispatchingMessageListener implements MessageListener {

private final Log logger = LogFactory.getLog(this.getClass());

Expand Down Expand Up @@ -283,52 +330,4 @@ protected Message<Object> buildMessage(org.springframework.amqp.core.Message mes

}


/*
* SmartLifecycle implementation (delegates to the MessageListener container)
*/

@Override
public boolean isAutoStartup() {
return (this.container != null) && this.container.isAutoStartup();
}

@Override
public int getPhase() {
return (this.container != null) ? this.container.getPhase() : 0;
}

@Override
public boolean isRunning() {
return (this.container != null) && this.container.isRunning();
}

@Override
public void start() {
if (this.container != null) {
this.container.start();
}
}

@Override
public void stop() {
if (this.container != null) {
this.container.stop();
}
}

@Override
public void stop(Runnable callback) {
if (this.container != null) {
this.container.stop(callback);
}
}

@Override
public void destroy() throws Exception {
if (this.container != null) {
this.container.destroy();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ else if (!ack && this.confirmNackChannel != null) {
}
}

protected static class CorrelationDataWrapper extends CorrelationData {
protected static final class CorrelationDataWrapper extends CorrelationData {

private final Object userData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @since 4.3
*
*/
public class MappingUtils {
public final class MappingUtils {

private MappingUtils() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

package org.springframework.integration.annotation;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
Expand All @@ -28,7 +27,7 @@
* @since 4.0
*/
@Target({ })
@Retention(RUNTIME)
@Retention(RetentionPolicy.RUNTIME)
public @interface GatewayHeader {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -16,9 +16,8 @@

package org.springframework.integration.annotation;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.integration.scheduling.PollerMetadata;
Expand All @@ -43,7 +42,7 @@
* @since 4.0
*/
@Target({})
@Retention(RUNTIME)
@Retention(RetentionPolicy.RUNTIME)
public @interface Poller {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -108,7 +108,7 @@ private Pointcut buildPointcut() {
}


private static class MetaAnnotationMatchingPointcut implements Pointcut {
private static final class MetaAnnotationMatchingPointcut implements Pointcut {

private final ClassFilter classFilter;

Expand Down Expand Up @@ -168,7 +168,7 @@ public MethodMatcher getMethodMatcher() {
}


private static class MetaAnnotationMethodMatcher extends AnnotationMethodMatcher {
private static final class MetaAnnotationMethodMatcher extends AnnotationMethodMatcher {

private final Class<? extends Annotation> annotationType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public synchronized void run() {
}


private class MessageChannelWrapper {
private final class MessageChannelWrapper {

private final MessageChannel channel;

Expand All @@ -237,11 +237,11 @@ private MessageChannelWrapper(MessageChannel channel, long expireAt) {
this.expireAt = expireAt;
}

public final long getExpireAt() {
public long getExpireAt() {
return this.expireAt;
}

public final MessageChannel getChannel() {
public MessageChannel getChannel() {
return this.channel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected Message<?> doReceive(long timeout) {
return message;
}

private static class SequenceFallbackComparator implements Comparator<Message<?>> {
private static final class SequenceFallbackComparator implements Comparator<Message<?>> {

private final Comparator<Message<?>> targetComparator;

Expand Down Expand Up @@ -136,7 +136,7 @@ public int compare(Message<?> message1, Message<?> message2) {
}

//we need this because of INT-2508
private class MessageWrapper implements Message<Object> {
private final class MessageWrapper implements Message<Object> {
private final Message<?> rootMessage;
private final long sequence;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void afterMessageHandled(Message<?> message, MessageChannel channel, Mess
protected abstract void populatePropagatedContext(S state, Message<?> message, MessageChannel channel);


private static class MessageWithThreadState<S> implements Message<Object> {
private static final class MessageWithThreadState<S> implements Message<Object> {

private final Message<?> message;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @since 4.0
*
*/
public class FixedSubscriberChannelBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
public final class FixedSubscriberChannelBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

private final Map<String, String> candidateFixedChannelHandlerMap;

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -84,7 +84,7 @@ protected MessageHandler createHandler(Object bean, Method method, List<Annotati
return serviceActivator;
}

private class ReplyProducingMessageHandlerWrapper extends AbstractReplyProducingMessageHandler
private final class ReplyProducingMessageHandlerWrapper extends AbstractReplyProducingMessageHandler
implements Lifecycle {

private final MessageHandler target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package org.springframework.integration.config.xml;

import static org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.ID_ATTRIBUTE;

import java.util.List;
import java.util.Map;

Expand All @@ -39,6 +37,7 @@
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.support.ManagedMap;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.core.Conventions;
Expand Down Expand Up @@ -407,7 +406,7 @@ public static BeanDefinition configureTransactionDefinition(Element txElement) {

public static String[] generateAlias(Element element) {
String[] handlerAlias = null;
String id = element.getAttribute(ID_ATTRIBUTE);
String id = element.getAttribute(AbstractBeanDefinitionParser.ID_ATTRIBUTE);
if (StringUtils.hasText(id)) {
handlerAlias = new String[] {id + IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX};
}
Expand Down Expand Up @@ -517,7 +516,7 @@ public static BeanDefinition createExpressionDefIfAttributeDefined(String expres
}

public static String createDirectChannel(Element element, ParserContext parserContext) {
String channelId = element.getAttribute(ID_ATTRIBUTE);
String channelId = element.getAttribute(AbstractBeanDefinitionParser.ID_ATTRIBUTE);
if (!StringUtils.hasText(channelId)) {
parserContext.getReaderContext().error("The channel-adapter's 'id' attribute is required when no 'channel' "
+ "reference has been provided, because that 'id' would be used for the created channel.", element);
Expand Down
Loading

0 comments on commit 4ac3a79

Please sign in to comment.