compiler: java: handle null in compareTo