2.4.x

Same pull request for https://jira.codehaus.org/browse/GEOS-6218 that was applied to master in December.