Refactor transformations to enable the handing of overflow (the previous code ignored this possibility).

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1605054 13f79535-47bb-0310-9956-ffa450edef68