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

@@ -338,8 +338,8 @@ public abstract class InstrumentedBridgeMethods {
Object result = null;
boolean accessibilityChanged = false;
try {
if (!Modifier.isPublic(method.getModifiers())
|| !Modifier.isPublic(method.getDeclaringClass().getModifiers())) {
if (!Modifier.isPublic(method.getModifiers()) ||
!Modifier.isPublic(method.getDeclaringClass().getModifiers())) {
method.setAccessible(true);
accessibilityChanged = true;
}

View File

@@ -78,8 +78,8 @@ class InvocationsRecorderClassVisitor extends ClassVisitor implements Opcodes {
static {
for (InstrumentedMethod method : InstrumentedMethod.values()) {
MethodReference methodReference = method.methodReference();
instrumentedMethods.add(methodReference.getClassName().replace('.', '/')
+ "#" + methodReference.getMethodName());
instrumentedMethods.add(methodReference.getClassName().replace('.', '/') +
"#" + methodReference.getMethodName());
}
}

View File

@@ -108,8 +108,8 @@ public class RuntimeHintsInvocationsAssert extends AbstractAssert<RuntimeHintsIn
private String formatStackTrace(Stream<StackWalker.StackFrame> stackTraceElements) {
return stackTraceElements
.map(f -> f.getClassName() + "#" + f.getMethodName()
+ ", Line " + f.getLineNumber()).collect(Collectors.joining(System.lineSeparator()));
.map(f -> f.getClassName() + "#" + f.getMethodName() + ", Line " +
f.getLineNumber()).collect(Collectors.joining(System.lineSeparator()));
}
/**

View File

@@ -122,8 +122,8 @@ public class MockSpringFactoriesLoader extends SpringFactoriesLoader {
public <T> void addInstance(String factoryType, T... factoryInstance) {
List<String> implementations = this.factories.computeIfAbsent(factoryType, key -> new ArrayList<>());
for (T factoryImplementation : factoryInstance) {
String reference = "!" + factoryType + ":" + factoryImplementation.getClass().getName()
+ this.sequence.getAndIncrement();
String reference = "!" + factoryType + ":" + factoryImplementation.getClass().getName() +
this.sequence.getAndIncrement();
implementations.add(reference);
this.implementations.put(reference, factoryImplementation);
}

View File

@@ -299,8 +299,8 @@ public final class TestCompiler {
}
private DynamicClassLoader compile() {
ClassLoader classLoaderToUse = (this.classLoader != null ? this.classLoader
: Thread.currentThread().getContextClassLoader());
ClassLoader classLoaderToUse = (this.classLoader != null ? this.classLoader :
Thread.currentThread().getContextClassLoader());
List<DynamicJavaFileObject> compilationUnits = this.sourceFiles.stream().map(
DynamicJavaFileObject::new).toList();
StandardJavaFileManager standardFileManager = this.compiler.getStandardFileManager(