diff --git a/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java index cec69afab..62ac41289 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java @@ -35,7 +35,6 @@ import org.apache.struts2.dispatcher.Parameter; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; import java.util.Locale; import java.util.Map; @@ -96,12 +95,12 @@ public class I18nInterceptor extends AbstractInterceptor { public static final String DEFAULT_SESSION_ATTRIBUTE = "WW_TRANS_I18N_LOCALE"; public static final String DEFAULT_PARAMETER = "request_locale"; - public static final String DEFAULT_REQUESTONLY_PARAMETER = "request_only_locale"; + public static final String DEFAULT_REQUEST_ONLY_PARAMETER = "request_only_locale"; public static final String DEFAULT_COOKIE_ATTRIBUTE = DEFAULT_SESSION_ATTRIBUTE; public static final String DEFAULT_COOKIE_PARAMETER = "request_cookie_locale"; protected String parameterName = DEFAULT_PARAMETER; - protected String requestOnlyParameterName = DEFAULT_REQUESTONLY_PARAMETER; + protected String requestOnlyParameterName = DEFAULT_REQUEST_ONLY_PARAMETER; protected String attributeName = DEFAULT_SESSION_ATTRIBUTE; protected LocaleProvider localeProvider; diff --git a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java index de056b90b..5018815c6 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java @@ -78,7 +78,7 @@ public class I18nInterceptorTest extends TestCase { } public void testDenmarkLocaleRequestOnly() throws Exception { - prepare(I18nInterceptor.DEFAULT_REQUESTONLY_PARAMETER, "da_DK"); + prepare(I18nInterceptor.DEFAULT_REQUEST_ONLY_PARAMETER, "da_DK"); interceptor.intercept(mai); assertFalse(mai.getInvocationContext().getParameters().get(I18nInterceptor.DEFAULT_PARAMETER).isDefined()); // should have been removed @@ -124,7 +124,7 @@ public class I18nInterceptorTest extends TestCase { } public void testWithVariantRequestOnly() throws Exception { - prepare(I18nInterceptor.DEFAULT_REQUESTONLY_PARAMETER, "ja_JP_JP"); + prepare(I18nInterceptor.DEFAULT_REQUEST_ONLY_PARAMETER, "ja_JP_JP"); interceptor.intercept(mai); assertFalse(mai.getInvocationContext().getParameters().get(I18nInterceptor.DEFAULT_PARAMETER).isDefined()); // should have been removed