Commits

rainerh  committed 61cfdc9

XW-708 Have CompoundRootAccessor support unmodifiable maps
applied patch submitted by Jasper Rosenberg, thanks!

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@2044e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits eaeb5a8

Comments (0)

Files changed (1)

File core/src/main/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java

      * Used by OGNl to generate bytecode
      */
     public String getSourceSetter(OgnlContext context, Object target, Object index) {
-        return null;  
+        return null;
     }
 
     private final static Logger LOG = LoggerFactory.getLogger(CompoundRootAccessor.class);
                     return;
                 } else if (o instanceof Map) {
                     Map<Object, Object> map = (Map) o;
-                    map.put(name, value);
-                    return;
+                    try {
+                        map.put(name, value);
+                        return;
+                    } catch (UnsupportedOperationException e) {
+                        // This is an unmodifiable Map, so move on to the next element in the stack
+                    }
                 }
 //            } catch (OgnlException e) {
 //                if (e.getReason() != null) {
                     String s = (String) aSet;
                     sb.append(s).append("\n");
                 }
-                
+
                 return sb.toString();
             } catch (IntrospectionException e) {
                 e.printStackTrace();