Java-6 compatibility

remove switch over String, which is java-7 only.