Skip to content

Commit 86578e1

Browse files
committed
Merge pull request #29202 from izeye
* pr/29202: Polish "Deprecate support for theme" changes Closes gh-29202
2 parents f31eb2d + 907c96b commit 86578e1

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

spring-web/src/main/java/org/springframework/web/context/support/AbstractRefreshableWebApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* {@link org.springframework.context.support.AbstractApplicationContext},
5858
* this class detects a bean of type {@link org.springframework.ui.context.ThemeSource}
5959
* in the context, under the special bean name "themeSource".
60-
* Theme support is deprecated as of 6.0
60+
* Theme support is deprecated as of 6.0 with no direct replacement.
6161
*
6262
* <p><b>This is the web context to be subclassed for a different bean definition format.</b>
6363
* Such a context implementation can be specified as "contextClass" context-param

spring-web/src/main/java/org/springframework/web/context/support/GenericWebApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* <p>In addition to the special beans detected by
5353
* {@link org.springframework.context.support.AbstractApplicationContext AbstractApplicationContext},
5454
* this class detects a {@link ThemeSource} bean in the context, with the name "themeSource".
55-
* Theme support is deprecated as of 6.0
55+
* Theme support is deprecated as of 6.0 with no direct replacement.
5656
*
5757
* <p>If you wish to register annotated <em>component classes</em> with a
5858
* {@code GenericWebApplicationContext}, you can use an

spring-web/src/main/java/org/springframework/web/context/support/StaticWebApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* {@link org.springframework.context.support.AbstractApplicationContext},
5151
* this class detects a bean of type {@link org.springframework.ui.context.ThemeSource}
5252
* in the context, under the special bean name "themeSource".
53-
* Theme support is deprecated as of 6.0
53+
* Theme support is deprecated as of 6.0 with no direct replacement.
5454
*
5555
* @author Rod Johnson
5656
* @author Juergen Hoeller

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ public class DispatcherServlet extends FrameworkServlet {
169169
/** Well-known name for the LocaleResolver object in the bean factory for this namespace. */
170170
public static final String LOCALE_RESOLVER_BEAN_NAME = "localeResolver";
171171

172-
/** Well-known name for the ThemeResolver object in the bean factory for this namespace. */
172+
/**
173+
* Well-known name for the ThemeResolver object in the bean factory for this namespace.
174+
* @deprecated as of 6.0, with no direct replacement
175+
*/
173176
@Deprecated
174177
public static final String THEME_RESOLVER_BEAN_NAME = "themeResolver";
175178

@@ -227,13 +230,15 @@ public class DispatcherServlet extends FrameworkServlet {
227230
/**
228231
* Request attribute to hold the current ThemeResolver, retrievable by views.
229232
* @see org.springframework.web.servlet.support.RequestContextUtils#getThemeResolver
233+
* @deprecated as of 6.0, with no direct replacement
230234
*/
231235
@Deprecated
232236
public static final String THEME_RESOLVER_ATTRIBUTE = DispatcherServlet.class.getName() + ".THEME_RESOLVER";
233237

234238
/**
235239
* Request attribute to hold the current ThemeSource, retrievable by views.
236240
* @see org.springframework.web.servlet.support.RequestContextUtils#getThemeSource
241+
* @deprecated as of 6.0, with no direct replacement
237242
*/
238243
@Deprecated
239244
public static final String THEME_SOURCE_ATTRIBUTE = DispatcherServlet.class.getName() + ".THEME_SOURCE";

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ public org.springframework.ui.context.Theme getTheme() {
409409
* Determine the fallback theme for this context.
410410
* <p>The default implementation returns the default theme (with name "theme").
411411
* @return the fallback theme (never {@code null})
412+
* @deprecated as of 6.0, with no direct replacement
412413
*/
413414
@Deprecated
414415
protected org.springframework.ui.context.Theme getFallbackTheme() {
@@ -447,6 +448,7 @@ public void changeTheme(@Nullable org.springframework.ui.context.Theme theme) {
447448
* {@link org.springframework.web.servlet.ThemeResolver ThemeResolver}.
448449
* @param themeName the name of the new theme
449450
* @see org.springframework.web.servlet.ThemeResolver#setThemeName
451+
* @deprecated as of 6.0, with no direct replacement
450452
*/
451453
@Deprecated
452454
public void changeTheme(String themeName) {
@@ -740,6 +742,7 @@ public String getMessage(MessageSourceResolvable resolvable, boolean htmlEscape)
740742
* @param code the code of the message
741743
* @param defaultMessage the String to return if the lookup fails
742744
* @return the message
745+
* @deprecated as of 6.0, with no direct replacement
743746
*/
744747
@Deprecated
745748
public String getThemeMessage(String code, String defaultMessage) {
@@ -755,6 +758,7 @@ public String getThemeMessage(String code, String defaultMessage) {
755758
* @param args arguments for the message, or {@code null} if none
756759
* @param defaultMessage the String to return if the lookup fails
757760
* @return the message
761+
* @deprecated as of 6.0, with no direct replacement
758762
*/
759763
@Deprecated
760764
public String getThemeMessage(String code, @Nullable Object[] args, String defaultMessage) {
@@ -770,6 +774,7 @@ public String getThemeMessage(String code, @Nullable Object[] args, String defau
770774
* @param args arguments for the message as a List, or {@code null} if none
771775
* @param defaultMessage the String to return if the lookup fails
772776
* @return the message
777+
* @deprecated as of 6.0, with no direct replacement
773778
*/
774779
@Deprecated
775780
public String getThemeMessage(String code, @Nullable List<?> args, String defaultMessage) {
@@ -785,6 +790,7 @@ public String getThemeMessage(String code, @Nullable List<?> args, String defaul
785790
* @param code the code of the message
786791
* @return the message
787792
* @throws org.springframework.context.NoSuchMessageException if not found
793+
* @deprecated as of 6.0, with no direct replacement
788794
*/
789795
@Deprecated
790796
public String getThemeMessage(String code) throws NoSuchMessageException {
@@ -799,6 +805,7 @@ public String getThemeMessage(String code) throws NoSuchMessageException {
799805
* @param args arguments for the message, or {@code null} if none
800806
* @return the message
801807
* @throws org.springframework.context.NoSuchMessageException if not found
808+
* @deprecated as of 6.0, with no direct replacement
802809
*/
803810
@Deprecated
804811
public String getThemeMessage(String code, @Nullable Object[] args) throws NoSuchMessageException {
@@ -813,6 +820,7 @@ public String getThemeMessage(String code, @Nullable Object[] args) throws NoSuc
813820
* @param args arguments for the message as a List, or {@code null} if none
814821
* @return the message
815822
* @throws org.springframework.context.NoSuchMessageException if not found
823+
* @deprecated as of 6.0, with no direct replacement
816824
*/
817825
@Deprecated
818826
public String getThemeMessage(String code, @Nullable List<?> args) throws NoSuchMessageException {
@@ -826,6 +834,7 @@ public String getThemeMessage(String code, @Nullable List<?> args) throws NoSuch
826834
* @param resolvable the MessageSourceResolvable
827835
* @return the message
828836
* @throws org.springframework.context.NoSuchMessageException if not found
837+
* @deprecated as of 6.0, with no direct replacement
829838
*/
830839
@Deprecated
831840
public String getThemeMessage(MessageSourceResolvable resolvable) throws NoSuchMessageException {

spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public class InterceptorRegistryTests {
5757

5858
private final HandlerInterceptor interceptor1 = new LocaleChangeInterceptor();
5959

60-
@Deprecated
6160
private final HandlerInterceptor interceptor2 = new ThemeChangeInterceptor();
6261

6362
private TestWebRequestInterceptor webInterceptor1;

0 commit comments

Comments
 (0)