You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "kusalk (via GitHub)" <gi...@apache.org> on 2024/10/17 07:54:42 UTC
[PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
kusalk opened a new pull request, #1086:
URL: https://github.com/apache/struts/pull/1086
WW-3714
--
This PR deprecates and provides repackaged replacements for the following APIs, ahead of their permanent migration in Struts 7.0:
- ``
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "kusalk (via GitHub)" <gi...@apache.org>.
kusalk closed pull request #1086: WW-3714 Deprecate and repackage common APIs part 7
URL: https://github.com/apache/struts/pull/1086
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "kusalk (via GitHub)" <gi...@apache.org>.
kusalk commented on PR #1086:
URL: https://github.com/apache/struts/pull/1086#issuecomment-2418944169
Hmm these specific changes are getting a bit too complex/risky for my liking
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #1086:
URL: https://github.com/apache/struts/pull/1086#issuecomment-2418839070
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) **Quality Gate failed**
Failed conditions
 [26.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_coverage&view=list) (required ≥ 80%)
 [18.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_duplicated_lines_density&view=list) (required ≤ 3%)
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) (required ≥ A)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #1086:
URL: https://github.com/apache/struts/pull/1086#issuecomment-2418953526
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) **Quality Gate failed**
Failed conditions
 [23.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_coverage&view=list) (required ≥ 80%)
 [22.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_duplicated_lines_density&view=list) (required ≤ 3%)
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) (required ≥ A)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #1086:
URL: https://github.com/apache/struts/pull/1086#issuecomment-2418856399
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) **Quality Gate failed**
Failed conditions
 [23.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_coverage&view=list) (required ≥ 80%)
 [22.3% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1086&metric=new_duplicated_lines_density&view=list) (required ≤ 3%)
 [B Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086) (required ≥ A)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1086)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarLint](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] WW-3714 Deprecate and repackage common APIs part 7 [struts]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #1086:
URL: https://github.com/apache/struts/pull/1086#discussion_r1804312035
##########
core/src/main/java/com/opensymphony/xwork2/validator/ValidatorContext.java:
##########
@@ -18,23 +18,175 @@
*/
package com.opensymphony.xwork2.validator;
-import com.opensymphony.xwork2.LocaleProvider;
-import com.opensymphony.xwork2.TextProvider;
+import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.interceptor.ValidationAware;
+import com.opensymphony.xwork2.util.ValueStack;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
/**
- * The context for validation. This interface extends others to provide methods for reporting
- * errors and messages as well as looking up error messages in a resource bundle using a specific locale.
- *
- * @author Jason Carreira
+ * @deprecated since 6.7.0, use {@link org.apache.struts2.validator.ValidatorContext} instead.
*/
-public interface ValidatorContext extends ValidationAware, TextProvider, LocaleProvider {
-
- /**
- * Translates a simple field name into a full field name in OGNL syntax.
- *
- * @param fieldName the field name to lookup.
- * @return the full field name in OGNL syntax.
- */
- String getFullFieldName(String fieldName);
+@Deprecated
+public interface ValidatorContext extends org.apache.struts2.validator.ValidatorContext, ValidationAware {
+
+ static ValidatorContext adapt(org.apache.struts2.validator.ValidatorContext actualContext) {
+ if (actualContext instanceof ActionContext) {
+ return (ValidatorContext) actualContext;
+ }
+ return actualContext != null ? new LegacyAdapter(actualContext) : null;
+ }
+
+ class LegacyAdapter implements ValidatorContext {
+
+ private final org.apache.struts2.validator.ValidatorContext adaptee;
+
+ public LegacyAdapter(org.apache.struts2.validator.ValidatorContext adaptee) {
+ this.adaptee = adaptee;
+ }
+
+ @Override
+ public String getFullFieldName(String fieldName) {
+ return adaptee.getFullFieldName(fieldName);
+ }
+
+ @Override
+ public Locale getLocale() {
+ return adaptee.getLocale();
+ }
+
+ @Override
+ public boolean isValidLocaleString(String localeStr) {
+ return adaptee.isValidLocaleString(localeStr);
+ }
+
+ @Override
+ public boolean isValidLocale(Locale locale) {
+ return adaptee.isValidLocale(locale);
+ }
+
+ @Override
+ public boolean hasKey(String key) {
+ return adaptee.hasKey(key);
+ }
+
+ @Override
+ public String getText(String key) {
+ return adaptee.getText(key);
+ }
+
+ @Override
+ public String getText(String key, String defaultValue) {
+ return adaptee.getText(key, defaultValue);
+ }
+
+ @Override
+ public String getText(String key, String defaultValue, String obj) {
+ return adaptee.getText(key, defaultValue, obj);
+ }
+
+ @Override
+ public String getText(String key, List<?> args) {
+ return adaptee.getText(key, args);
+ }
+
+ @Override
+ public String getText(String key, String[] args) {
+ return adaptee.getText(key, args);
+ }
+
+ @Override
+ public String getText(String key, String defaultValue, List<?> args) {
+ return adaptee.getText(key, defaultValue, args);
+ }
+
+ @Override
+ public String getText(String key, String defaultValue, String[] args) {
+ return adaptee.getText(key, defaultValue, args);
+ }
+
+ @Override
+ public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
+ return adaptee.getText(key, defaultValue, args, stack);
Review Comment:
## OGNL Expression Language statement with user-controlled input
OGNL Expression Language statement depends on a [user-provided value](1).
OGNL Expression Language statement depends on a [user-provided value](2).
[Show more details](https://github.com/apache/struts/security/code-scanning/669)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org