Often when I type Java 8 stream code in IntelliJ (version 2019.1.3 Community Edition) and use autocompletion IntelliJ generates redundant casts in the resulting code.
An artificial minimal example looks like this:
Type:
List<? extends List<? extends Future<?>>> list = new ArrayList<>();
list.stream().map(l -> l.stream().map(f -> f.isD
with the cursor placed after the capital D of f.isD. IntelliJ now suggests to me to complete the f.isD to f.isDone(). When I accept this and press return the following is generated:
list.stream().map(l -> l.stream().map(f -> ((Future) f).isDone()));
Why does IntelliJ cast f to Future? This is redundant which is immediately detected by IntelliJ which now complains (i.e. warns) about the redundant cast.
I searched the web for some setting to turn this off or correct this auto-completion somehow but could not find any solution. Please help, this drives me crazy!