Remove trailing whitespace (as noted by Checkstyle) and correct several typos.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk@1644814 13f79535-47bb-0310-9956-ffa450edef68
Simplify: class-casted value is already available in a local variable. No change in functionality.

Merged r1644815 from tomcat/trunk.

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