Apply Checkstyle MethodParamPadCheck module
This commit also fixes its violations. Closes gh-34173
This commit is contained in:
parent
0f38c28e91
commit
6d86b23fbe
|
@ -213,8 +213,8 @@ class ApplicationListenerMethodAdapterTests extends AbstractApplicationEventList
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void invokeListenerWithWrongGenericPayload() {
|
void invokeListenerWithWrongGenericPayload() {
|
||||||
Method method = ReflectionUtils.findMethod
|
Method method = ReflectionUtils.findMethod(
|
||||||
(SampleEvents.class, "handleGenericStringPayload", EntityWrapper.class);
|
SampleEvents.class, "handleGenericStringPayload", EntityWrapper.class);
|
||||||
EntityWrapper<Integer> payload = new EntityWrapper<>(123);
|
EntityWrapper<Integer> payload = new EntityWrapper<>(123);
|
||||||
invokeListener(method, new PayloadApplicationEvent<>(this, payload));
|
invokeListener(method, new PayloadApplicationEvent<>(this, payload));
|
||||||
verify(this.sampleEvents, times(0)).handleGenericStringPayload(any());
|
verify(this.sampleEvents, times(0)).handleGenericStringPayload(any());
|
||||||
|
|
|
@ -67,7 +67,7 @@ class ConversionServiceFactoryBeanTests {
|
||||||
converters.add(new ConverterFactory<String, Bar>() {
|
converters.add(new ConverterFactory<String, Bar>() {
|
||||||
@Override
|
@Override
|
||||||
public <T extends Bar> Converter<String, T> getConverter(Class<T> targetType) {
|
public <T extends Bar> Converter<String, T> getConverter(Class<T> targetType) {
|
||||||
return new Converter<> () {
|
return new Converter<>() {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public T convert(String source) {
|
public T convert(String source) {
|
||||||
|
|
|
@ -148,8 +148,8 @@ class GeneratedClassesTests {
|
||||||
"one", TestComponent.class, emptyTypeCustomizer);
|
"one", TestComponent.class, emptyTypeCustomizer);
|
||||||
GeneratedClass generatedClass2 = this.generatedClasses.getOrAddForFeatureComponent(
|
GeneratedClass generatedClass2 = this.generatedClasses.getOrAddForFeatureComponent(
|
||||||
"one", TestComponent.class, emptyTypeCustomizer);
|
"one", TestComponent.class, emptyTypeCustomizer);
|
||||||
GeneratedClass generatedClass3 = prefixed.getOrAddForFeatureComponent
|
GeneratedClass generatedClass3 = prefixed.getOrAddForFeatureComponent(
|
||||||
("one", TestComponent.class, emptyTypeCustomizer);
|
"one", TestComponent.class, emptyTypeCustomizer);
|
||||||
GeneratedClass generatedClass4 = prefixed.getOrAddForFeatureComponent(
|
GeneratedClass generatedClass4 = prefixed.getOrAddForFeatureComponent(
|
||||||
"one", TestComponent.class, emptyTypeCustomizer);
|
"one", TestComponent.class, emptyTypeCustomizer);
|
||||||
assertThat(generatedClass1).isSameAs(generatedClass2).isNotSameAs(generatedClass3);
|
assertThat(generatedClass1).isSameAs(generatedClass2).isNotSameAs(generatedClass3);
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class CompositeMessageCondition implements MessageCondition<CompositeMess
|
||||||
checkCompatible(other);
|
checkCompatible(other);
|
||||||
List<MessageCondition<?>> otherConditions = other.getMessageConditions();
|
List<MessageCondition<?>> otherConditions = other.getMessageConditions();
|
||||||
for (int i = 0; i < this.messageConditions.size(); i++) {
|
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) {
|
if (result != 0) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class ServletRequestDataBinder extends WebDataBinder {
|
||||||
@Nullable
|
@Nullable
|
||||||
protected Object getRequestParameter(String name, Class<?> type) {
|
protected Object getRequestParameter(String name, Class<?> type) {
|
||||||
Object value = this.request.getParameterValues(name);
|
Object value = this.request.getParameterValues(name);
|
||||||
if (value == null && !name.endsWith ("[]") &&
|
if (value == null && !name.endsWith("[]") &&
|
||||||
(List.class.isAssignableFrom(type) || type.isArray())) {
|
(List.class.isAssignableFrom(type) || type.isArray())) {
|
||||||
value = this.request.getParameterValues(name + "[]");
|
value = this.request.getParameterValues(name + "[]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,7 +665,7 @@ class UriTemplateServletAnnotationControllerHandlerMethodTests extends AbstractS
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View resolveViewName(final String viewName, Locale locale) {
|
public View resolveViewName(final String viewName, Locale locale) {
|
||||||
return new AbstractView () {
|
return new AbstractView() {
|
||||||
@Override
|
@Override
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -191,6 +191,7 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
||||||
|
|
||||||
<!-- Whitespace -->
|
<!-- Whitespace -->
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
|
|
||||||
<!-- Miscellaneous -->
|
<!-- Miscellaneous -->
|
||||||
|
|
Loading…
Reference in New Issue