You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ge...@apache.org on 2005/05/02 15:14:44 UTC

svn commit: r165626 - /struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java

Author: germuska
Date: Mon May  2 06:14:43 2005
New Revision: 165626

URL: http://svn.apache.org/viewcvs?rev=165626&view=rev
Log:
Since JavaDoc says that an IllegalArgumentException will be thrown if there is no default MessageResources, go ahead and do that.

Modified:
    struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java

Modified: struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java
URL: http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java?rev=165626&r1=165625&r2=165626&view=diff
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java (original)
+++ struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java Mon May  2 06:14:43 2005
@@ -70,11 +70,13 @@
                                                prefix + "'");
         }
         actionCtx.setModuleConfig(moduleConfig);
+        String key = Globals.MESSAGES_KEY + prefix;
         MessageResources messageResources = (MessageResources)
-            actionCtx.getApplicationScope().get(Globals.MESSAGES_KEY + prefix);
-        if (messageResources != null) {
-            actionCtx.setMessageResources(messageResources);
+            actionCtx.getApplicationScope().get(key);
+        if (messageResources == null) {
+            throw new IllegalArgumentException("No message resources found in application scope under " + key);
         }
+        actionCtx.setMessageResources(messageResources);
 
         return (false);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org