mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
Solves WW-3547 - TextProvider.getText(String, List<Object>) changed to getText(String, List<?>)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1076704 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -73,7 +73,7 @@ public class TestAction extends ActionSupport {
|
||||
|
||||
/** This is the method invoked by the {@link org.apache.struts2.util.TextProviderHelper}.
|
||||
* Returns the test value if defined otherwise delegates to the default TextProvider */
|
||||
public String getText(String key, String defaultValue, List args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
if (this.texts.containsKey(key)) {
|
||||
return this.texts.get(key);
|
||||
} else {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
|
||||
return getTextProvider().getText(aTextName, defaultValue, obj);
|
||||
}
|
||||
|
||||
public String getText(String aTextName, List<Object> args) {
|
||||
public String getText(String aTextName, List<?> args) {
|
||||
return getTextProvider().getText(aTextName, args);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
|
||||
return getTextProvider().getText(key, args);
|
||||
}
|
||||
|
||||
public String getText(String aTextName, String defaultValue, List<Object> args) {
|
||||
public String getText(String aTextName, String defaultValue, List<?> args) {
|
||||
return getTextProvider().getText(aTextName, defaultValue, args);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
|
||||
return getTextProvider().getText(key, defaultValue, args);
|
||||
}
|
||||
|
||||
public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
return getTextProvider().getText(key, defaultValue, args, stack);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class CompositeTextProvider implements TextProvider {
|
||||
* @return
|
||||
* @see {@link com.opensymphony.xwork2.TextProvider#getText(String, java.util.List)}
|
||||
*/
|
||||
public String getText(String key, List<Object> args) {
|
||||
public String getText(String key, List<?> args) {
|
||||
return getText(key, key, args);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class CompositeTextProvider implements TextProvider {
|
||||
* @return
|
||||
* @see {@link com.opensymphony.xwork2.TextProvider#getText#getText(String, String, java.util.List)}
|
||||
*/
|
||||
public String getText(String key, String defaultValue, List<Object> args) {
|
||||
public String getText(String key, String defaultValue, List<?> args) {
|
||||
// if there's one text provider that gives us a msg not the same as defaultValue
|
||||
// for this key, we are ok, else try the next
|
||||
// text provider
|
||||
@@ -186,9 +186,9 @@ public class CompositeTextProvider implements TextProvider {
|
||||
* @param args
|
||||
* @param stack
|
||||
* @return
|
||||
* @see {@link com.opensymphony.xwork2.TextProvider#getText(String, String, java.util.List, com.opensymphony.xwork2.util.OgnlValueStack)}
|
||||
* @see {@link com.opensymphony.xwork2.TextProvider#getText(String, String, java.util.List, com.opensymphony.xwork2.util.ValueStack)}
|
||||
*/
|
||||
public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
// if there's one text provider that gives us a msg not the same as defaultValue
|
||||
// for this key, we are ok, else try the next
|
||||
// text provider
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
|
||||
return text;
|
||||
}
|
||||
|
||||
public String getText(String key, List<Object> args) {
|
||||
public String getText(String key, List<?> args) {
|
||||
Object[] params;
|
||||
if (args != null) {
|
||||
params = args.toArray();
|
||||
@@ -78,7 +78,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
|
||||
return LocalizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale(), params);
|
||||
}
|
||||
|
||||
public String getText(String key, String defaultValue, List<Object> args) {
|
||||
public String getText(String key, String defaultValue, List<?> args) {
|
||||
String text = getText(key, args);
|
||||
if(text == null && defaultValue == null) {
|
||||
defaultValue = key;
|
||||
@@ -124,7 +124,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
|
||||
return getText(key, defaultValue, args);
|
||||
}
|
||||
|
||||
public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
//we're not using the value stack here
|
||||
return getText(key, defaultValue, args);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public interface TextProvider {
|
||||
* @param args a list args to be used in a {@link java.text.MessageFormat} message
|
||||
* @return the message as found in the resource bundle, or null if none is found.
|
||||
*/
|
||||
String getText(String key, List<Object> args);
|
||||
String getText(String key, List<?> args);
|
||||
|
||||
/**
|
||||
* Gets a message based on a key using the supplied args, as defined in
|
||||
@@ -120,7 +120,7 @@ public interface TextProvider {
|
||||
* @param args a list args to be used in a {@link java.text.MessageFormat} message
|
||||
* @return the message as found in the resource bundle, or defaultValue if none is found
|
||||
*/
|
||||
String getText(String key, String defaultValue, List<Object> args);
|
||||
String getText(String key, String defaultValue, List<?> args);
|
||||
|
||||
/**
|
||||
* Gets a message based on a key using the supplied args, as defined in
|
||||
@@ -146,7 +146,7 @@ public interface TextProvider {
|
||||
* @param stack the value stack to use for finding the text
|
||||
* @return the message as found in the resource bundle, or defaultValue if none is found
|
||||
*/
|
||||
String getText(String key, String defaultValue, List<Object> args, ValueStack stack);
|
||||
String getText(String key, String defaultValue, List<?> args, ValueStack stack);
|
||||
|
||||
/**
|
||||
* Gets a message based on a key using the supplied args, as defined in
|
||||
|
||||
@@ -163,7 +163,7 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
|
||||
* @param args a List of args to be used in a MessageFormat message
|
||||
* @return value of named text
|
||||
*/
|
||||
public String getText(String key, List<Object> args) {
|
||||
public String getText(String key, List<?> args) {
|
||||
return getText(key, key, args);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
|
||||
* @param args a List of args to be used in a MessageFormat message
|
||||
* @return value of named text
|
||||
*/
|
||||
public String getText(String key, String defaultValue, List<Object> args) {
|
||||
public String getText(String key, String defaultValue, List<?> args) {
|
||||
Object[] argsArray = ((args != null && !args.equals(Collections.emptyList())) ? args.toArray() : null);
|
||||
if (clazz != null) {
|
||||
return LocalizedTextUtil.findText(clazz, key, getLocale(), defaultValue, argsArray);
|
||||
@@ -238,7 +238,7 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
|
||||
* @param stack the value stack to use for finding the text
|
||||
* @return the message as found in the resource bundle, or defaultValue if none is found
|
||||
*/
|
||||
public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
Object[] argsArray = ((args != null) ? args.toArray() : null);
|
||||
Locale locale;
|
||||
if (stack == null){
|
||||
|
||||
+3
-3
@@ -118,7 +118,7 @@ public class DelegatingValidatorContext implements ValidatorContext {
|
||||
return textProvider.getText(aTextName, defaultValue, obj);
|
||||
}
|
||||
|
||||
public String getText(String aTextName, List<Object> args) {
|
||||
public String getText(String aTextName, List<?> args) {
|
||||
return textProvider.getText(aTextName, args);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class DelegatingValidatorContext implements ValidatorContext {
|
||||
return textProvider.getText(key, args);
|
||||
}
|
||||
|
||||
public String getText(String aTextName, String defaultValue, List<Object> args) {
|
||||
public String getText(String aTextName, String defaultValue, List<?> args) {
|
||||
return textProvider.getText(aTextName, defaultValue, args);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class DelegatingValidatorContext implements ValidatorContext {
|
||||
return textProvider.getTexts(aBundleName);
|
||||
}
|
||||
|
||||
public String getText(String key, String defaultValue, List<Object> args, ValueStack stack) {
|
||||
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
|
||||
return textProvider.getText(key, defaultValue, args, stack);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user