Add EmptyLineSeparator Checkstyle rule

* Support "blank lines around" via `spring-framework.xml` IDEA config
* Fix all the Checkstyle violations
This commit is contained in:
Artem Bilan
2024-03-27 16:54:25 -04:00
parent f71a2234d8
commit c155d5d418
932 changed files with 1341 additions and 2485 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 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.
@@ -33,4 +33,5 @@ public class MongoDbNamespaceHandler extends AbstractIntegrationNamespaceHandler
registerBeanDefinitionParser("outbound-channel-adapter", new MongoDbOutboundChannelAdapterParser());
registerBeanDefinitionParser("outbound-gateway", new MongoDbOutboundGatewayParser());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2022 the original author or authors.
* Copyright 2007-2024 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,4 +43,5 @@ public class MongoDbOutboundChannelAdapterParser extends AbstractOutboundChannel
return builder.getBeanDefinition();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2024 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,6 @@ final class MongoParserUtils {
IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("collection-name",
"collection-name-expression", parserContext, element, false);
if (collectionNameExpressionDef != null) {
builder.addPropertyValue("collectionNameExpression", collectionNameExpressionDef);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 the original author or authors.
* Copyright 2013-2024 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,6 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb
public static final String DEFAULT_COLLECTION_NAME = "configurableStoreMessages";
public ConfigurableMongoDbMessageStore(MongoTemplate mongoTemplate) {
this(mongoTemplate, DEFAULT_COLLECTION_NAME);
}
@@ -115,7 +114,6 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb
return getMongoTemplate().getCollection(this.collectionName).countDocuments(query.getQueryObject());
}
@Override
public MessageGroup getMessageGroup(Object groupId) {
Assert.notNull(groupId, GROUP_ID_MUST_NOT_BE_NULL);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 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,6 @@ public class MessageDocument {
this.messageId = messageId;
}
public Message<?> getMessage() {
return this.message;
}

View File

@@ -86,7 +86,6 @@ import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
* An implementation of both the {@link MessageStore} and
* {@link org.springframework.integration.store.MessageGroupStore}
@@ -128,7 +127,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
private static final String SEQUENCE = "sequence";
private final MongoTemplate template;
private final MessageReadingMongoConverter converter;
@@ -161,7 +159,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
this.collectionName = (StringUtils.hasText(collectionName)) ? collectionName : DEFAULT_COLLECTION_NAME;
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
Assert.notNull(classLoader, "classLoader must not be null");
@@ -550,7 +547,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
String.format("Cannot read %s. as map. Given Bson must be a Document or DBObject!", bson.getClass()));
}
/**
* Custom implementation of the {@link MappingMongoConverter} strategy.
*/
@@ -720,7 +716,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
}
@WritingConverter
private static final class MessageHistoryToDocumentConverter implements Converter<MessageHistory, Document> {
@@ -884,7 +879,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
}
/**
* Wrapper class used for storing Messages in MongoDB along with their "group" metadata.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2022 the original author or authors.
* Copyright 2007-2024 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.
@@ -140,7 +140,6 @@ class MongoDbStoringMessageHandlerTests implements MongoDbContainerTest {
converter = spy(converter);
MongoTemplate writingTemplate = new MongoTemplate(MONGO_DATABASE_FACTORY, converter);
MongoDbStoringMessageHandler handler = new MongoDbStoringMessageHandler(writingTemplate);
handler.setCollectionNameExpression(new LiteralExpression("foo"));
handler.setBeanFactory(mock(BeanFactory.class));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@@ -459,7 +459,6 @@ public abstract class AbstractMongoDbMessageGroupStoreTests implements MongoDbCo
// assertTrue(failures.size() == 0);
// }
protected void testWithAggregatorWithShutdown(String config) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config, this.getClass());
context.refresh();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 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.
@@ -347,7 +347,6 @@ public abstract class AbstractMongoDbMessageStoreTests implements MongoDbContain
this.name = name;
}
public String getName() {
return name;
}
@@ -372,7 +371,6 @@ public abstract class AbstractMongoDbMessageStoreTests implements MongoDbContain
}
public static class Person implements Serializable {
/**

View File

@@ -212,7 +212,6 @@ class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMessageGr
context.close();
}
public interface TestGateway {
String service(String payload);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 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.
@@ -16,7 +16,6 @@
package org.springframework.integration.mongodb.store;
import org.springframework.integration.store.MessageStore;
/**