“redundant cast to java.lang.Object” warning for necessary cast
问题 Consider this Minimal, Reproducible Example : interface Code { static void main(String[] args) { symbol( String.valueOf( true ? 'a' : true ? 'b' : true ? 'c' : fail() ) ); } private static void symbol(String symbol) { System.out.println(symbol); } private static <R> R fail() { throw null; } } (Being near minimal, true is a stand in for a useful boolean expression. We can ignore beyond the first ? : (in the real code, there are lots).) This 'obviously' gives the error. 4: reference to valueOf