Skip to content

Commit 254c372

Browse files
committed
Polishing
1 parent d5ff232 commit 254c372

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

spring-beans/src/test/java/org/springframework/beans/factory/xml/ResourceEntityResolverTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public ClassLoader getClassLoader() {
8989
}
9090
}
9191

92+
9293
private static class ConfigurableFallbackEntityResolver extends ResourceEntityResolver {
9394

9495
private final boolean shouldThrow;
@@ -98,7 +99,6 @@ private static class ConfigurableFallbackEntityResolver extends ResourceEntityRe
9899

99100
boolean fallbackInvoked = false;
100101

101-
102102
private ConfigurableFallbackEntityResolver(boolean shouldThrow) {
103103
super(new NoOpResourceLoader());
104104
this.shouldThrow = shouldThrow;
@@ -111,9 +111,8 @@ private ConfigurableFallbackEntityResolver(@Nullable InputSource returnValue) {
111111
this.returnValue = returnValue;
112112
}
113113

114-
115-
@Nullable
116114
@Override
115+
@Nullable
117116
protected InputSource resolveSchemaEntity(String publicId, String systemId) {
118117
this.fallbackInvoked = true;
119118
if (this.shouldThrow) {
@@ -123,6 +122,8 @@ protected InputSource resolveSchemaEntity(String publicId, String systemId) {
123122
}
124123
}
125124

125+
126+
@SuppressWarnings("serial")
126127
static class ResolutionRejectedException extends RuntimeException {}
127128

128129
}

spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslatorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*/
5252
public class SQLErrorCodeSQLExceptionTranslatorTests {
5353

54-
private static SQLErrorCodes ERROR_CODES = new SQLErrorCodes();
54+
private static final SQLErrorCodes ERROR_CODES = new SQLErrorCodes();
5555
static {
5656
ERROR_CODES.setBadSqlGrammarCodes("1", "2");
5757
ERROR_CODES.setInvalidResultSetAccessCodes("3", "4");
@@ -64,6 +64,7 @@ public class SQLErrorCodeSQLExceptionTranslatorTests {
6464
}
6565

6666

67+
@SuppressWarnings("deprecation")
6768
@Test
6869
public void errorCodeTranslation() {
6970
SQLExceptionTranslator sext = new SQLErrorCodeSQLExceptionTranslator(ERROR_CODES);

spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@
116116
* {@link org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator}.
117117
*
118118
* <li>The dispatcher's strategy for resolving multipart requests is determined by a
119-
* {@link org.springframework.web.multipart.MultipartResolver} implementation. An
120-
* implementation for Servlet 3 is included. The MultipartResolver bean name is
121-
* "multipartResolver"; default is none.
119+
* {@link org.springframework.web.multipart.MultipartResolver} implementation.
120+
* An implementation for standard Servlet multipart processing is included.
121+
* The MultipartResolver bean name is "multipartResolver"; default is none.
122122
*
123123
* <li>Its locale resolution strategy is determined by a {@link LocaleResolver}.
124124
* Out-of-the-box implementations work via HTTP accept header, cookie, or session.
@@ -318,8 +318,8 @@ public class DispatcherServlet extends FrameworkServlet {
318318
private LocaleResolver localeResolver;
319319

320320
/** ThemeResolver used by this servlet. */
321-
@Nullable
322321
@Deprecated
322+
@Nullable
323323
private ThemeResolver themeResolver;
324324

325325
/** List of HandlerMappings used by this servlet. */
@@ -808,8 +808,8 @@ else if (logger.isDebugEnabled()) {
808808
* @return the ThemeSource, if any
809809
* @see #getWebApplicationContext()
810810
*/
811-
@Nullable
812811
@Deprecated
812+
@Nullable
813813
public final org.springframework.ui.context.ThemeSource getThemeSource() {
814814
return (getWebApplicationContext() instanceof org.springframework.ui.context.ThemeSource ?
815815
(org.springframework.ui.context.ThemeSource) getWebApplicationContext() : null);

spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
171171
/**
172172
* HTTP methods supported by {@link jakarta.servlet.http.HttpServlet}.
173173
*/
174-
private static final Set<String> HTTP_SERVLET_METHODS = Set.of("DELETE", "HEAD", "GET", "OPTIONS", "POST", "PUT",
175-
"TRACE");
174+
private static final Set<String> HTTP_SERVLET_METHODS =
175+
Set.of("DELETE", "HEAD", "GET", "OPTIONS", "POST", "PUT", "TRACE");
176176

177177

178178
/** ServletContext attribute to find the WebApplicationContext in. */
@@ -866,7 +866,8 @@ protected void onRefresh(ApplicationContext context) {
866866
public void destroy() {
867867
getServletContext().log("Destroying Spring FrameworkServlet '" + getServletName() + "'");
868868
// Only call close() on WebApplicationContext if locally managed...
869-
if (!this.webApplicationContextInjected && this.webApplicationContext instanceof ConfigurableApplicationContext cac) {
869+
if (!this.webApplicationContextInjected &&
870+
this.webApplicationContext instanceof ConfigurableApplicationContext cac) {
870871
cac.close();
871872
}
872873
}
@@ -1131,8 +1132,7 @@ else if (logger.isTraceEnabled()) {
11311132
logger.debug("Exiting from \"" + dispatchType + "\" dispatch, status " + status + headers);
11321133
}
11331134
else {
1134-
HttpStatusCode httpStatus = HttpStatusCode.valueOf(status);
1135-
logger.debug("Completed " + httpStatus + headers);
1135+
logger.debug("Completed " + HttpStatusCode.valueOf(status) + headers);
11361136
}
11371137
}
11381138

0 commit comments

Comments
 (0)