https://issues.apache.org/jira/browse/AMQ-5352

Applied and tested, all tests still passing after this change.