1 / 71

Java 11 – Keeping the Java Release Train on the Right Track

Java 11 – Keeping the Java Release Train on the Right Track. Jeanne Boyarsky QCon – June 28, 2018. speakerdeck.com/boyarsky. So much changed since Java 9 & Jigsaw ’ s release!. For more on Java 9, see: https://speakerdeck.com/boyarsky/welcome-to-java-9?slide=1. Topics: Ecosystem changes

genevievel
Download Presentation

Java 11 – Keeping the Java Release Train on the Right Track

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java 11 – Keeping the Java Release Train on the Right Track Jeanne Boyarsky QCon– June 28, 2018 speakerdeck.com/boyarsky

  2. So much changed since Java 9 & Jigsaw’s release!

  3. For more on Java 9, see: https://speakerdeck.com/boyarsky/welcome-to-java-9?slide=1

  4. Topics: • Ecosystem changes • Language changes

  5. About Me 16 years as Java Developer

  6. Memories!

  7. The Saga of Jigsaw • 2011 – Maybe part of Java 7. Nope Plan B • 2012 - Part of Java 8. No wait • 2014 - Part of Java 9

  8. Java 9 “Release” Dates • Sept 2016 • May 2017 • July 2017 • Sept 2017

  9. Counting lessons? • 1.0, 1.1, 1.2, 1.3, 1.4 • 5.0 • 6, 7, 8, 9, 10, 11

  10. Advanced counting lessons • 10 = 2018.3 • 11 = 2018.9 • 12 = ?

  11. Wait, a major version every 6 months? • + Syntax changes • + Smaller features • - Years of features

  12. Frequency of Release F Predictability of Release D Java School Report Card Developer Community  A Features  B

  13. Frequency of Release F Predictability of Release D JVM College Report Card Vocabulary  B Polyglot programming  A

  14. Re-org at the train station

  15. How many languages do you know? Examples • Java • Kotlin • Groovy • Scala • SQL • HTML • JavaScript • CSS • One (or zero) • Two – Five • Six or more

  16. Before Now

  17. Before Now

  18. More time to code while I wait for the next train!

  19. Arrivals Train Schedule

  20. Security Patches Departure Schedule

  21. Security Patches Departure Schedule

  22. Wait. So what happens next? How long will Java 12 have security patches? Answer: 6 months What is the next LTS version after Java 11? Java 11 + 3*2 = 17

  23. A Tale of Two JDKs

  24. Only bug fixes remain Only bug fixes allowed

  25. Get ready to play

  26. Tip: Aliases alias javac11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/javac alias java11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java

  27. (10/11) Local variable syntax

  28. (10) • String name = "Jeanne”; • var name = "Jeanne"; • List list = List.of(1, 2, 3); • var list = List.of(1, 2, 3); • Syntactical sugar/less boilerplate • Not immutable (no val)

  29. (10) varname = "Jeanne"; String name2 = name; • Compiled code same with var

  30. (10) List<WebElement> headers = thead.findElements(By.tagName("th")); VolunteerDashboardRowheaderRow = new VolunteerDashboardRow(headers); vs varheaders = thead.findElements(By.tagName("th")); varheaderRow = new VolunteerDashboardRow(headers);

  31. (10) varcsvPath = createAndGetFile(CSV_DATA); try (varcsvWriter = Files.newBufferedWriter(csvPath); varcsvPrinter = new CSVPrinter(csvWriter, CSVFormat.DEFAULT));{ }

  32. (10) Map<Integer, String> productMap1 = new HashMap<Integer, String>(); Map<Integer, String> productMap2 = new HashMap<>(); varproductMap3 = new HashMap<Integer, String>();

  33. (10) Where can we use? • varname = "Jeanne"; • varother = name + 2; • var list = List.of(1, 2, 3); • for (var num : list) {}

  34. (10) Where can’t we use? • class Inner { var bad = "abc"; } • var noGood; • noGood = 4; • Also instance variables, etc

  35. (10) Does this work? varvar = "var";

  36. (10) http://openjdk.java.net/projects/amber/LVTIstyle.html

  37. (11) Lambdas Predicate<String> pred1 = p -> true; Predicate<String> pred2 = (String p) -> true; Predicate<String> pred3 = (varp) -> true;

  38. (11) Annotations BiPredicate< Map<Integer, String>, List<String>> func = (@NotNullvarmap, varlist) -> true;

  39. (11) All or nothing Good (varmap, varlist) -> true No good (varmap, list) -> true (varmap, List list) -> true

  40. (10/11) Garbage collection

  41. (10) Choose your own GC • Who cares? • Agile. With releases every 6 months, features are smaller

  42. (10) Faster Default GC For more, see https://speakerdeck.com/cguntur/garbage-collection-in-java-9

  43. (10) Regions & space vs speed For more, see https://speakerdeck.com/cguntur

  44. (11) Epsilon GC • Never reclaims memory • Program proceeds until run out of heap • GC never runs • To use: • -XX:+UseEpsilonGC • (or) -XX:+UseNoGC

  45. (11) Epsilon GC Good for • Performance/memory stress test • Very short programs • Last ditch performance improvements • (this probably isn’t you)

  46. (11) Z GC • Experimental • 10ms or less pause time • Only for Linux/x64 • To use, enable both: • -XX:+UnlockExperimentalVMOptions • -XX:+UseZGC

  47. (11) I’m done incubating! Http Client

More Related