Java Evolution

corejava

Why Care about Evolution?

blue-collar

A Brief History of Java

Version Year New Language Features Number of Classes and Interfaces
1.0 1996 The language itself 200
1.1 1997 Inner classes 418
1.2 1998 The strictfp modifier 1,588
1.3 2000 Nothing at all 1,883
1.4 2002 Assertions 2,696
5.0 2004 Generic classes, “for each” loop, varargs, autoboxing, metadata, enumerations, static import 3,551
6 2006 Nothing at all 4,069
7 2011 Switch with strings, diamond operator, binary literals, exception handling enhancements 4,509
8 2014 Lambda expressions, interfaces with default methods 4,733
9 2017 Modules 6,603
10 2018 var 6,599 (!)
11 2018 Nothing at all 4,910 (!!)—Java FX, JNLP, Java EE overlap, CORBA removed
12 2019 switch expression preview 4,935
13 2019 Text blocks preview 4,904

The Release Cadence

Java-SE-Lifecycle-131-a

Projects, JEPs, Incubation, Preview

best-incubators-chicken-eggs

File API Evolution

umbrella

HttpClient

client

HttpClient

client

Raw String Literals

raw

Off the Deep End

off-the-deep-end-3

Text Blocks

blocks

Scala Pattern Matching

scala

Java Pattern Matching

patterm

Switch expressions

switches-and-crossings

Give Me a Break

break

Frankenswitch

frankenstein

Evolution is Not a One-Way Street

evolution-backwards

The Matrix (JDK 12)

Expression Statement
No fallthrough
int numLetters = switch (day) {
   case MONDAY, FRIDAY, SUNDAY -> 6;
   case TUESDAY -> 7;
   case THURSDAY, SATURDAY -> 8;
   default -> 9;
};
switch (day) {
   case MONDAY, FRIDAY, SUNDAY ->
      numLetters = 6;
   case TUESDAY -> {
      logger.info("Tuesday");
      numLetters = 7;
   }
   case THURSDAY, SATURDAY ->
      numLetters = 8;
   default ->
      numLetters = 9;
}
Fallthrough
int numLetters = switch(day) {
   case MONDAY, FRIDAY, SUNDAY:
      break 6;
   case TUESDAY:
      logger.info("Tuesday");
      break 7;
   case THURSDAY:
      logger.info("Thursday");
   case SATURDAY:
      break 8;
   default:
      break 9;
};
switch(day) {
   case MONDAY, FRIDAY, SUNDAY:
      numLetters = 6;
      break;
   case TUESDAY:
      logger.info("Tuesday");
      numLetters = 7;
      break;
   case THURSDAY:
      logger.info("Thursday");      
   case SATURDAY:
      numLetters = 8;
      break;
   default:
      numLetters = 9;
}

The Original Sin

original-sin

Loom

loom

Kick the Tires

kicking-car-tires

Structured Concurrency

Timeout

TIMEOUT

Cancellation

online-railway-irctc-ticket-cancellation-rules-in-hindi

State of the Project

state

Conclusion

end