Avoid UnsupportedOperationEx. with active SecurityManager

Issue: SPR-9970
Merge branch 'SPR-9970' into 3.2.x

* SPR-9970:
  Avoid UnsupportedOperationEx. with active SecurityManager