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

@@ -102,8 +102,8 @@ public class DefaultMethodReference implements MethodReference {
TypeName argumentType = argumentTypes[i];
CodeBlock argumentCode = argumentCodeGenerator.generateCode(argumentType);
if (argumentCode == null) {
throw new IllegalArgumentException("Could not generate code for " + this
+ ": parameter " + i + " of type " + argumentType + " is not supported");
throw new IllegalArgumentException("Could not generate code for " + this +
": parameter " + i + " of type " + argumentType + " is not supported");
}
arguments.add(argumentCode);
}

View File

@@ -192,9 +192,9 @@ public interface GeneratedFiles {
private static void validatePackage(String packageName, String className) {
if (!StringUtils.hasLength(packageName)) {
throw new IllegalArgumentException("Could not add '" + className + "', "
+ "processing classes in the default package is not supported. "
+ "Did you forget to add a package statement?");
throw new IllegalArgumentException("Could not add '" + className + "', " +
"processing classes in the default package is not supported. " +
"Did you forget to add a package statement?");
}
}

View File

@@ -240,8 +240,8 @@ public abstract class ValueCodeGeneratorDelegates {
if (escaped != null) {
return escaped;
}
return (!Character.isISOControl(ch)) ? Character.toString(ch)
: String.format("\\u%04x", (int) ch);
return (!Character.isISOControl(ch)) ? Character.toString(ch) :
String.format("\\u%04x", (int) ch);
}
}

View File

@@ -108,8 +108,8 @@ public class BindingReflectionHintsRegistrar {
registerPropertyHints(hints, seen, method, 0);
}
else if ((methodName.startsWith("get") && method.getParameterCount() == 0 && method.getReturnType() != void.class) ||
(methodName.startsWith("is") && method.getParameterCount() == 0
&& ClassUtils.resolvePrimitiveIfNecessary(method.getReturnType()) == Boolean.class)) {
(methodName.startsWith("is") && method.getParameterCount() == 0 &&
ClassUtils.resolvePrimitiveIfNecessary(method.getReturnType()) == Boolean.class)) {
registerPropertyHints(hints, seen, method, -1);
}
}

View File

@@ -375,8 +375,8 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
private Object getRequiredValue(int attributeIndex, String attributeName) {
Object value = getValue(attributeIndex, Object.class);
if (value == null) {
throw new NoSuchElementException("No element at attribute index "
+ attributeIndex + " for name " + attributeName);
throw new NoSuchElementException("No element at attribute index " +
attributeIndex + " for name " + attributeName);
}
return value;
}

View File

@@ -71,8 +71,8 @@ public class ResourceRegionEncoder extends AbstractEncoder<ResourceRegion> {
@Override
public boolean canEncode(ResolvableType elementType, @Nullable MimeType mimeType) {
return super.canEncode(elementType, mimeType)
&& ResourceRegion.class.isAssignableFrom(elementType.toClass());
return super.canEncode(elementType, mimeType) &&
ResourceRegion.class.isAssignableFrom(elementType.toClass());
}
@Override

View File

@@ -472,8 +472,8 @@ public class SpringFactoriesLoader {
private static <T> void makeAccessible(Constructor<T> constructor,
KFunction<T> kotlinConstructor) {
if ((!Modifier.isPublic(constructor.getModifiers())
|| !Modifier.isPublic(constructor.getDeclaringClass().getModifiers()))) {
if ((!Modifier.isPublic(constructor.getModifiers()) ||
!Modifier.isPublic(constructor.getDeclaringClass().getModifiers()))) {
KCallablesJvm.setAccessible(kotlinConstructor, true);
}
}

View File

@@ -275,8 +275,8 @@ public class AntPathMatcher implements PathMatcher {
if (!matchStrings(pattDir, pathDirs[pathIdxEnd], uriTemplateVariables)) {
return false;
}
if (pattIdxEnd == (pattDirs.length - 1)
&& pattern.endsWith(this.pathSeparator) != path.endsWith(this.pathSeparator)) {
if (pattIdxEnd == (pattDirs.length - 1) &&
pattern.endsWith(this.pathSeparator) != path.endsWith(this.pathSeparator)) {
return false;
}
pattIdxEnd--;

View File

@@ -557,9 +557,7 @@ public final class ConcurrentLruCache<K, V> {
}
private boolean contains(Node<K, V> e) {
return (e.getPrevious() != null)
|| (e.getNext() != null)
|| (e == this.first);
return (e.getPrevious() != null) || (e.getNext() != null) || (e == this.first);
}
private void linkLast(final Node<K, V> e) {