solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-16318: WIP - Use up to JDK 11 features

Open risdenk opened this issue 3 years ago • 3 comments

https://issues.apache.org/jira/browse/SOLR-16318

Description

  • Use enhanced for loops
  • Avoid type declaration when <> can be used
  • Use computeIfAbsent
  • use Objects.requireNonNullElse to simplify if/else statements
  • Simplify lambda statements
  • Collections.sort -> list.sort
  • Use string .contains instead of checking indexOf
  • Avoid unnecessary boxing/unboxing

risdenk avatar Jun 21 '22 13:06 risdenk

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.

risdenk avatar Jun 22 '22 14:06 risdenk

I am not really up on the new stuff in JDK 11 @risdenk so probably not the best person to review... ;-)

epugh avatar Jun 24 '22 16:06 epugh

@epugh mostly an FYI since you were going through intelli warnings - these are also intellij warnings/findings behind the scenes.

risdenk avatar Jun 24 '22 16:06 risdenk

This is being broken into pieces slowly.

risdenk avatar Oct 14 '22 19:10 risdenk