removed switch statement with string to allow compilation with jdk6