reverting switch on string to an if/else for jdk 1.6 compatibility.