Author: bphillips
Date: Sun Jul 21 13:55:36 2013
New Revision: 1505390

URL: http://svn.apache.org/r1505390
Log:
WW-4099 updated JavaDoc for getText methods to clearly state that if there is 
no value found for the provided key then the method should return the provided 
key.

Modified:
    
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java?rev=1505390&r1=1505389&r2=1505390&view=diff
==============================================================================
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java
 Sun Jul 21 13:55:36 2013
@@ -24,7 +24,7 @@ import java.util.ResourceBundle;
 /**
  * Provides access to {@link ResourceBundle}s and their underlying text 
messages.
  * Implementing classes can delegate {@link TextProviderSupport}. Messages 
will be
- * searched in multiple resource bundles, startinag with the one associated 
with
+ * searched in multiple resource bundles, starting with the one associated with
  * this particular class (action in most cases), continuing to try the message
  * bundle associated with each superclass as well. It will stop once a bundle 
is
  * found that contains the given text. This gives a cascading style that allow
@@ -39,7 +39,7 @@ import java.util.ResourceBundle;
  * <bean class="org.demo.MyTextProvider" 
name="myTextProvider" 
type="com.opensymphony.xwork2.TextProvider" />
  * <constant name="struts.xworkTextProvider" 
value="myTextProvider" />
  * <p/>
- * if you want to also use your implemntation for framework's messages define 
another constant (remember to put
+ * if you want to also use your implementation for framework's messages define 
another constant (remember to put
  * into it all framework messages)
  * &lt;constant name=&quot;system&quot; value=&quot;myTextProvider&quot; /&gt;
  * <p/>
@@ -61,10 +61,11 @@ public interface TextProvider {
     boolean hasKey(String key);
 
     /**
-     * Gets a message based on a message key, or null if no message is found.
+     * Gets a message based on a message key or if no message is found the 
provided key
+     * is returned.
      *
      * @param key the resource bundle key that is to be searched for
-     * @return the message as found in the resource bundle, or null if none is 
found.
+     * @return the message as found in the resource bundle, or the provided 
key if none is found.
      */
     String getText(String key);
 
@@ -92,21 +93,21 @@ public interface TextProvider {
 
     /**
      * Gets a message based on a key using the supplied args, as defined in
-     * {@link java.text.MessageFormat}, or null if no message is found.
+     * {@link java.text.MessageFormat} or the provided key if no message is 
found.
      *
      * @param key  the resource bundle key that is to be searched for
      * @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.
+     * @return the message as found in the resource bundle, or the provided 
key if none is found.
      */
     String getText(String key, List<?> args);
 
     /**
      * Gets a message based on a key using the supplied args, as defined in
-     * {@link java.text.MessageFormat}, or null if no message is found.
+     * {@link java.text.MessageFormat}, or the provided key if no message is 
found.
      *
      * @param key  the resource bundle key that is to be searched for
      * @param args an array 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.
+     * @return the message as found in the resource bundle, or the provided 
key if none is found.
      */
     String getText(String key, String[] args);
 


Reply via email to