Introduce Checkstyle rule for separator symbol location

This commit is contained in:
Sam Brannen
2025-03-19 15:35:35 +01:00
parent 18c3b637e4
commit 208d52d852
97 changed files with 378 additions and 403 deletions

View File

@@ -79,8 +79,8 @@ abstract class AbstractJCacheKeyOperation<A extends Annotation> extends Abstract
for (CacheParameterDetail keyParameterDetail : this.keyParameterDetails) {
int parameterPosition = keyParameterDetail.getParameterPosition();
if (parameterPosition >= values.length) {
throw new IllegalStateException("Values mismatch, key parameter at position "
+ parameterPosition + " cannot be matched against " + values.length + " value(s)");
throw new IllegalStateException("Values mismatch, key parameter at position " +
parameterPosition + " cannot be matched against " + values.length + " value(s)");
}
result.add(keyParameterDetail.toCacheInvocationParameter(values[parameterPosition]));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 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.
@@ -17,7 +17,6 @@
package org.springframework.cache.jcache.interceptor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;
import javax.cache.annotation.CacheDefaults;
@@ -150,9 +149,9 @@ class JCacheKeyGeneratorTests {
@Override
public Object generate(Object target, Method method, Object... params) {
assertThat(Arrays.equals(expectedParams, params)).as("Unexpected parameters: expected: "
+ Arrays.toString(this.expectedParams) + " but got: " + Arrays.toString(params)).isTrue();
assertThat(params).as("Unexpected parameters").isEqualTo(expectedParams);
return new SimpleKey(params);
}
}
}