Apply Checkstyle MethodParamPadCheck module

This commit also fixes its violations.

Closes gh-34173
This commit is contained in:
Johnny Lim 2024-12-29 01:11:53 +09:00 committed by Sébastien Deleuze
parent 0f38c28e91
commit 6d86b23fbe
7 changed files with 9 additions and 8 deletions

View File

@ -213,8 +213,8 @@ class ApplicationListenerMethodAdapterTests extends AbstractApplicationEventList
@Test
void invokeListenerWithWrongGenericPayload() {
Method method = ReflectionUtils.findMethod
(SampleEvents.class, "handleGenericStringPayload", EntityWrapper.class);
Method method = ReflectionUtils.findMethod(
SampleEvents.class, "handleGenericStringPayload", EntityWrapper.class);
EntityWrapper<Integer> payload = new EntityWrapper<>(123);
invokeListener(method, new PayloadApplicationEvent<>(this, payload));
verify(this.sampleEvents, times(0)).handleGenericStringPayload(any());

View File

@ -67,7 +67,7 @@ class ConversionServiceFactoryBeanTests {
converters.add(new ConverterFactory<String, Bar>() {
@Override
public <T extends Bar> Converter<String, T> getConverter(Class<T> targetType) {
return new Converter<> () {
return new Converter<>() {
@SuppressWarnings("unchecked")
@Override
public T convert(String source) {

View File

@ -148,8 +148,8 @@ class GeneratedClassesTests {
"one", TestComponent.class, emptyTypeCustomizer);
GeneratedClass generatedClass2 = this.generatedClasses.getOrAddForFeatureComponent(
"one", TestComponent.class, emptyTypeCustomizer);
GeneratedClass generatedClass3 = prefixed.getOrAddForFeatureComponent
("one", TestComponent.class, emptyTypeCustomizer);
GeneratedClass generatedClass3 = prefixed.getOrAddForFeatureComponent(
"one", TestComponent.class, emptyTypeCustomizer);
GeneratedClass generatedClass4 = prefixed.getOrAddForFeatureComponent(
"one", TestComponent.class, emptyTypeCustomizer);
assertThat(generatedClass1).isSameAs(generatedClass2).isNotSameAs(generatedClass3);

View File

@ -98,7 +98,7 @@ public class CompositeMessageCondition implements MessageCondition<CompositeMess
checkCompatible(other);
List<MessageCondition<?>> otherConditions = other.getMessageConditions();
for (int i = 0; i < this.messageConditions.size(); i++) {
int result = compare (this.messageConditions.get(i), otherConditions.get(i), message);
int result = compare(this.messageConditions.get(i), otherConditions.get(i), message);
if (result != 0) {
return result;
}

View File

@ -244,7 +244,7 @@ public class ServletRequestDataBinder extends WebDataBinder {
@Nullable
protected Object getRequestParameter(String name, Class<?> type) {
Object value = this.request.getParameterValues(name);
if (value == null && !name.endsWith ("[]") &&
if (value == null && !name.endsWith("[]") &&
(List.class.isAssignableFrom(type) || type.isArray())) {
value = this.request.getParameterValues(name + "[]");
}

View File

@ -665,7 +665,7 @@ class UriTemplateServletAnnotationControllerHandlerMethodTests extends AbstractS
@Override
public View resolveViewName(final String viewName, Locale locale) {
return new AbstractView () {
return new AbstractView() {
@Override
public String getContentType() {
return null;

View File

@ -191,6 +191,7 @@
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
<!-- Whitespace -->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
<!-- Miscellaneous -->