solr
solr copied to clipboard
SOLR-16318: WIP - Use up to JDK 11 features
https://issues.apache.org/jira/browse/SOLR-16318
Description
- Use enhanced for loops
- Avoid type declaration when
<>can be used - Use
computeIfAbsent - use
Objects.requireNonNullElseto simplify if/else statements - Simplify lambda statements
Collections.sort->list.sort- Use string
.containsinstead of checkingindexOf - Avoid unnecessary boxing/unboxing
Thanks @madrob for the quick review. I threw it up to review myself and wasn't expecting comments yet :) I agree with your findings and many probably repeat throughout. I'll clean it up over the next few days.
I am not really up on the new stuff in JDK 11 @risdenk so probably not the best person to review... ;-)
@epugh mostly an FYI since you were going through intelli warnings - these are also intellij warnings/findings behind the scenes.
This is being broken into pieces slowly.