Intellij from Microsoft JDConf

Speaker: Trisha Gee – @trisha_gee

A note on speaking quickly: this wasn’t specific to Trisha, but she mentioned it. A 25 minute talk doesn’t mean take a 30-45 minute talk and talk faster. It means have less content. Luckily, Trisha could refer to Venkat’s talk and actually have less content.

In any case, I learned new stuff for IntelliJ, so that’s good. And nice seeing two live demos (Venkat and Trisha) in a row.

  • Supports next version of Java (before released)
  • Modern Java is anything in Java 9 or higher because majority still on Java 8
  • Have two options: LTS (currently Java 11) or latest (currently Java 15)
  • Can choose version of Java for project including preview features version for most recent version of Java
  • Showed refactoring to replace reference with “var”.
    • And how to customize so doesn’t warn on every opportunity.
    • Weak warning = gray out each refactoring opportunity.
    • Inlay hints – can turn off hints for specific things like implicit types
    • Won’t allow you do to the refactoring if changes the meaning. (Ex: when would change List<String> to List<Object>
  • Convenience factory methods for collections
    • Offers to replace Collections.unmodifiableXX() with List.of, Set.of(), Map.of
    • Highlight code and alt-enter to see formatting options that apply to that code
    • Java 11 has Collectors.toUnmodifiableList() and Optional.isEmpty()
  • Java 15 – Switch expressions
    • Can refactor existing code to enhanced switch and make shorter
    • Can merge branches
  • Java 15 – Text blocks
    • Can refactor the mess of concatenation and \n into text block
    • Can “inject” javascript or json to validate and autocomplete the embedded text