Apply SingleSpaceSeparator Checkstyle module

This commit also fixes its violations.

Closes gh-31469
This commit is contained in:
Johnny Lim
2023-10-22 00:10:45 +09:00
committed by Sam Brannen
parent 8a05661707
commit 64e9fcad53
164 changed files with 229 additions and 226 deletions

View File

@@ -73,7 +73,7 @@ public abstract class AbstractCacheResolver implements CacheResolver, Initializi
}
@Override
public void afterPropertiesSet() {
public void afterPropertiesSet() {
Assert.notNull(this.cacheManager, "CacheManager is required");
}

View File

@@ -84,7 +84,7 @@ public class CacheInterceptor extends CacheAspectSupport implements MethodInterc
private static class KotlinDelegate {
public static Publisher<?> invokeSuspendingFunction(Method method, Object target, Object... args) {
Continuation<?> continuation = (Continuation<?>) args[args.length - 1];
Continuation<?> continuation = (Continuation<?>) args[args.length - 1];
CoroutineContext coroutineContext = continuation.getContext().minusKey(Job.Key);
return CoroutinesUtils.invokeSuspendingFunction(coroutineContext, method, target, args);
}

View File

@@ -37,7 +37,7 @@ import org.springframework.util.StringUtils;
* @author Sam Brannen
* @since 3.2
*/
public class DateTimeFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport
public class DateTimeFormatAnnotationFormatterFactory extends EmbeddedValueResolutionSupport
implements AnnotationFormatterFactory<DateTimeFormat> {
private static final Set<Class<?>> FIELD_TYPES = Set.of(Date.class, Calendar.class, Long.class);

View File

@@ -158,7 +158,7 @@ public class ThreadPoolExecutorFactoryBean extends ExecutorConfigurationSupport
ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) {
BlockingQueue<Runnable> queue = createQueue(this.queueCapacity);
ThreadPoolExecutor executor = createExecutor(this.corePoolSize, this.maxPoolSize,
ThreadPoolExecutor executor = createExecutor(this.corePoolSize, this.maxPoolSize,
this.keepAliveSeconds, queue, threadFactory, rejectedExecutionHandler);
if (this.allowCoreThreadTimeOut) {
executor.allowCoreThreadTimeOut(true);

View File

@@ -247,7 +247,7 @@ final class BitsCronField extends CronField {
}
private void clearBit(int index) {
this.bits &= ~(1L << index);
this.bits &= ~(1L << index);
}
@Override

View File

@@ -949,7 +949,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
if (value == null && !BeanUtils.isSimpleValueType(param.nestedIfOptional().getNestedParameterType())) {
ResolvableType type = ResolvableType.forMethodParameter(param);
args[i] = createObject(type, paramPath + ".", valueResolver);
args[i] = createObject(type, paramPath + ".", valueResolver);
}
else {
try {

View File

@@ -345,7 +345,7 @@ public class MethodValidationAdapter implements MethodValidator {
}
private MethodParameter initMethodParameter(Method method, int index) {
MethodParameter parameter = new MethodParameter(method, index);
MethodParameter parameter = new MethodParameter(method, index);
parameter.initParameterNameDiscovery(this.parameterNameDiscoverer);
return parameter;
}

View File

@@ -39,7 +39,7 @@ class SPR3064Tests {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(getClass().getSimpleName() + ".xml", getClass());
Service service = ctx.getBean(Service.class);
Service service = ctx.getBean(Service.class);
assertThatRuntimeException()
.isThrownBy(service::serveMe)
.withMessage("advice invoked");

View File

@@ -166,7 +166,7 @@ class BeanNameAutoProxyCreatorTests {
}
private void jdkAssertions(ITestBean tb, int nopInterceptorCount) {
private void jdkAssertions(ITestBean tb, int nopInterceptorCount) {
NopInterceptor nop = (NopInterceptor) beanFactory.getBean("nopInterceptor");
assertThat(nop.getCount()).isEqualTo(0);
assertThat(AopUtils.isJdkDynamicProxy(tb)).isTrue();

View File

@@ -418,7 +418,7 @@ abstract class OverrideOneMethod extends MethodReplaceCandidate implements Overr
@Override
public String replaceMe(String someParam) {
return "replaceMe:" + someParam;
return "replaceMe:" + someParam;
}
}

View File

@@ -121,7 +121,7 @@ public class ExpressionEvaluatorTests {
EvaluationContext context = createEvaluationContext(CacheOperationExpressionEvaluator.RESULT_UNAVAILABLE);
assertThatExceptionOfType(VariableNotAvailableException.class).isThrownBy(() ->
new SpelExpressionParser().parseExpression("#result").getValue(context))
.satisfies(ex -> assertThat(ex.getName()).isEqualTo("result"));
.satisfies(ex -> assertThat(ex.getName()).isEqualTo("result"));
}
@Test

View File

@@ -122,7 +122,7 @@ public class Spr10744Tests {
static class MyTestConfiguration extends MyConfiguration {
@Bean
@Scope(value = "myTestScope", proxyMode = ScopedProxyMode.TARGET_CLASS)
@Scope(value = "myTestScope", proxyMode = ScopedProxyMode.TARGET_CLASS)
@Override
public Foo foo() {
return new Foo();

View File

@@ -69,7 +69,7 @@ class Spr12334Tests {
private static AtomicInteger scanned = new AtomicInteger();
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
if (scanned.get() > 0) {
throw new IllegalStateException("Already scanned");
}

View File

@@ -37,7 +37,7 @@ public class FactoryMethodComponent {
private int i;
public static TestBean nullInstance() {
public static TestBean nullInstance() {
return null;
}

View File

@@ -677,7 +677,7 @@ class DefaultLifecycleProcessorTests {
return new TestLifecycleBean(null, stoppedBeans);
}
private TestLifecycleBean(CopyOnWriteArrayList<Lifecycle> startedBeans, CopyOnWriteArrayList<Lifecycle> stoppedBeans) {
private TestLifecycleBean(CopyOnWriteArrayList<Lifecycle> startedBeans, CopyOnWriteArrayList<Lifecycle> stoppedBeans) {
this.startedBeans = startedBeans;
this.stoppedBeans = stoppedBeans;
}

View File

@@ -652,7 +652,7 @@ class GenericApplicationContextTests {
}
}
static class BeanB implements ApplicationContextAware {
static class BeanB implements ApplicationContextAware {
ApplicationContext applicationContext;

View File

@@ -58,7 +58,7 @@ class JmxUtilsTests {
}
@Test
void isMBeanWithDynamicMBean() {
void isMBeanWithDynamicMBean() {
DynamicMBean mbean = new TestDynamicMBean();
assertThat(JmxUtils.isMBean(mbean.getClass())).as("Dynamic MBean not detected correctly").isTrue();
}
@@ -76,24 +76,24 @@ class JmxUtilsTests {
}
@Test
void notAnMBean() {
void notAnMBean() {
assertThat(JmxUtils.isMBean(Object.class)).as("Object incorrectly identified as an MBean").isFalse();
}
@Test
void simpleMBean() {
void simpleMBean() {
Foo foo = new Foo();
assertThat(JmxUtils.isMBean(foo.getClass())).as("Simple MBean not detected correctly").isTrue();
}
@Test
void simpleMXBean() {
void simpleMXBean() {
FooX foo = new FooX();
assertThat(JmxUtils.isMBean(foo.getClass())).as("Simple MXBean not detected correctly").isTrue();
}
@Test
void simpleMBeanThroughInheritance() {
void simpleMBeanThroughInheritance() {
Bar bar = new Bar();
Abc abc = new Abc();
assertThat(JmxUtils.isMBean(bar.getClass())).as("Simple MBean (through inheritance) not detected correctly").isTrue();

View File

@@ -1357,7 +1357,7 @@ class CronExpressionTests {
@Test
public void various() {
CronExpression cronExpression = CronExpression.parse("3-57 13-28 17,18 1,15 3-12 6#1");
LocalDateTime last = LocalDateTime.of(2022, 9, 15, 17, 44, 11);
LocalDateTime last = LocalDateTime.of(2022, 9, 15, 17, 44, 11);
LocalDateTime expected = LocalDateTime.of(2022, 10, 1, 17, 13, 3);
LocalDateTime actual = cronExpression.next(last);
assertThat(actual).isNotNull();

View File

@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* @author Stephane Nicoll
*/
public abstract class AbstractValueAdaptingCacheTests<T extends AbstractValueAdaptingCache>
extends AbstractCacheTests<T> {
extends AbstractCacheTests<T> {
protected static final String CACHE_NAME_NO_NULL = "testCacheNoNull";

View File

@@ -205,7 +205,7 @@ public class AnnotatedClassCacheableService implements CacheableService<Object>
}
@Override
@Caching(evict = { @CacheEvict("primary"), @CacheEvict(cacheNames = "secondary", key = "#a0"), @CacheEvict(cacheNames = "primary", key = "#p0 + 'A'") })
@Caching(evict = { @CacheEvict("primary"), @CacheEvict(cacheNames = "secondary", key = "#a0"), @CacheEvict(cacheNames = "primary", key = "#p0 + 'A'") })
public Object multiEvict(Object arg1) {
return this.counter.getAndIncrement();
}