ks = (s == null) ? (KeyStroke) null : KeyStroke.getKeyStroke(s);

If I saw anyone write code like that they would be on the receiving end of a headslap.