Skip to content

Commit 0cf7f7b

Browse files
committed
Polishing
1 parent 949c3d4 commit 0cf7f7b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -269,7 +269,7 @@ public void handleNotAnnotatedReturnValue() throws Exception {
269269
assertThat(this.container.getModel().get("testBean")).isSameAs(testBean);
270270
}
271271

272-
@Test // gh-25182
272+
@Test // gh-25182
273273
public void resolveConstructorListArgumentFromCommaSeparatedRequestParameter() throws Exception {
274274
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
275275
mockRequest.addParameter("listOfStrings", "1,2");
@@ -279,7 +279,6 @@ public void resolveConstructorListArgumentFromCommaSeparatedRequestParameter() t
279279
given(factory.createBinder(any(), any(), eq("testBeanWithConstructorArgs")))
280280
.willAnswer(invocation -> {
281281
WebRequestDataBinder binder = new WebRequestDataBinder(invocation.getArgument(1));
282-
283282
// Add conversion service which will convert "1,2" to a list
284283
binder.setConversionService(new DefaultFormattingConversionService());
285284
return binder;
@@ -309,7 +308,6 @@ private static class StubRequestDataBinder extends WebRequestDataBinder {
309308

310309
private boolean validateInvoked;
311310

312-
313311
public StubRequestDataBinder(Object target, String objectName) {
314312
super(target, objectName);
315313
}
@@ -345,7 +343,7 @@ public void validate(Object... validationHints) {
345343
}
346344

347345

348-
@SessionAttributes(types=TestBean.class)
346+
@SessionAttributes(types = TestBean.class)
349347
private static class ModelAttributeHandler {
350348

351349
@SuppressWarnings("unused")
@@ -360,22 +358,23 @@ public void modelAttribute(
360358
}
361359
}
362360

361+
363362
static class TestBeanWithConstructorArgs {
364363

365364
final List<String> listOfStrings;
366365

367366
public TestBeanWithConstructorArgs(List<String> listOfStrings) {
368367
this.listOfStrings = listOfStrings;
369368
}
370-
371369
}
372370

373-
@ModelAttribute("modelAttrName") @SuppressWarnings("unused")
371+
372+
@ModelAttribute("modelAttrName")
373+
@SuppressWarnings("unused")
374374
private String annotatedReturnValue() {
375375
return null;
376376
}
377377

378-
379378
@SuppressWarnings("unused")
380379
private TestBean notAnnotatedReturnValue() {
381380
return null;

spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -2236,6 +2236,7 @@ void routerFunction() throws ServletException, IOException {
22362236
assertThat(response.getContentAsString()).isEqualTo("foo-body");
22372237
}
22382238

2239+
22392240
@Controller
22402241
static class ControllerWithEmptyValueMapping {
22412242

@@ -3573,7 +3574,6 @@ public void httpHeaders(@RequestHeader HttpHeaders headers, Writer writer) throw
35733574
assertThat(headers.getContentType()).as("Invalid Content-Type").isEqualTo(new MediaType("text", "html"));
35743575
multiValueMap(headers, writer);
35753576
}
3576-
35773577
}
35783578

35793579
@Controller

0 commit comments

Comments
 (0)