This code is specifically here to get around jboss-as bugs / details, and so should not be removed. The comment was pretty clear.