cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anathan...@apache.org
Subject svn commit: r1154308 - /cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java
Date Fri, 05 Aug 2011 16:48:37 GMT
Author: anathaniel
Date: Fri Aug  5 16:48:37 2011
New Revision: 1154308

URL: http://svn.apache.org/viewvc?rev=1154308&view=rev
Log:
Limit scope of @SuppressWarnings("unchecked")

Modified:
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java?rev=1154308&r1=1154307&r2=1154308&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/controller/ControllerContextHelper.java
Fri Aug  5 16:48:37 2011
@@ -45,19 +45,20 @@ public class ControllerContextHelper {
      * @return The controller context map as being available in the current
      *         servlet request.
      */
-    @SuppressWarnings("unchecked")
     public static Map<String, Object> getContext(Map<String, ? extends Object>
parameters) {
         HttpServletRequest request = HttpContextHelper.getRequest(parameters);
         Object controllerContext = request.getAttribute(CONTEXT_OBJECT);
 
         if (controllerContext instanceof Map) {
-            return (Map<String, Object>) controllerContext;
+            @SuppressWarnings("unchecked")
+            Map<String, Object> result = (Map<String, Object>) controllerContext;
+            return result;
         }
 
         if (controllerContext != null) {
             LOG.warn("The parameters contain an entry with the key " + CONTEXT_OBJECT + "
but it is not a map.");
         }
-        return Collections.EMPTY_MAP;
+        return Collections.emptyMap();
     }
 
     /**



Mime
View raw message