struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From germu...@apache.org
Subject svn commit: r165626 - /struts/core/trunk/src/share/org/apache/struts/chain/commands/AbstractSelectModule.java
Date Mon, 02 May 2005 13:14:44 GMT
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


Mime
View raw message