Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-15960

Put exception handling around properties.remove in AuthorizationStatusInterceptor.java for unmodifiableMap arguments

    Details

      Description

      From 5.0.3 and onwards, a new AuthorizationStatusInterceptor.java was introduced in alfresco-authorised-users project. This code intercepts method calls on NodeService and for particular methods "setProperties", "addProperties" and "createNode", it removes some entries in the map argument passed in in the following method:

      
          private void deleteVirtualProperties(Map<QName, Serializable> properties)
          {
              if (properties != null)
              {
                  properties.remove(statusQName);
                  properties.remove(deletedFlagQName);
              }
          }
      

      The problem is that sometimes the map argument passed in could be an unmodifiable view of the specified map and result in an UnsupportedOperationException - the remove operation is not supported by these maps as they provide users with "read-only" access to internal maps.

      This breaks the customer's code and the workaround is to use the lowercased nodeService so that the interceptor won't be invoked, but that's not an ideal solution.

      Can we put some exception handling around these properties.remove operations so that it doesn't throw unchecked exceptions and simply let the code continue?

        Attachments

          Activity

            People

            • Assignee:
              closedbugs Closed Bugs
              Reporter:
              ctan Craig Tan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 5 minutes
                4h 5m