Language selector

Illegal Access

Hey, there are two major Java versions released every year! We don’t have to wait 3 years or so for new features anymore. Isn’t that cool? 😉

Java was supposed “to be slow”. However, Java turns out to evolve so fast, that next releases aren’t just version bumps, but might significantly change the rules of the game. That’s a good reason to check out what’s new in Java.

To name a few changes:

Modern Java is really awesome when it comes to “Hello, World!” demos. It’s also cool for a sophisticated systems and algorithms, provided their authors write code which obeys a few fairly simple contracts and avoids obvious traps.

There are a few mantras regarding recent features of modern Java, such as:

  • records can replace JavaBeans everywhere
  • you never need to write hashCode() for records
  • pattern matching with instanceof is the best tool for equals()
  • just ignore --illegal-access and set it to permit
  • synchronize (new Long(42)) is the best for monitoring and so on.

This talk has been given at jLove, Doing Java Better and Java Day Lviv.

Another (half a) year has passed, another major Java™ version has been released. Java was supposed “to be slow”. However, Java turns out to evolve so fast, that next releases aren’t just version bumps, but might significantly change the rules of the game. That’s a good reason to check out what’s new in Java. We’re going to cover:

  • Records, where and how to use them, apart from DTO/VO
  • Pattern matching with instanceof A.K.A. Smart casting
  • Sealed classes, new dimension of types extensibility (for inheritance)
  • Warnings from Jigsaw (–illegal-access strikes back!)
  • And Valhalla (for value-based classes abuse)
  • Talking to native stuff from Panama
  • and more.

All visualised in actual code, not just slides.

Last year I wrote two posts about torturing Java records with Lombok. Fortunately (or not, depends on your point of view), Lombok’s team decided to end these sick plays. However, we don’t give up and go for builder!

Another (half a) year has passed, another major Java™ version has been released. Java was supposed “to be slow”. However, Java turns out to evolve so fast, that next releases aren’t just version bumps, but might significantly change the rules of the game. That’s a good reason to check out what’s new in Java. We’re going to cover:

  • Records, where and how to use them, apart from DTO/VO
  • Pattern matching with instanceof A.K.A. Smart casting
  • Sealed classes, new dimension of types extensibility (for inheritance)
  • Warnings from Jigsaw (–illegal-access strikes back!)
  • And Valhalla (for value-based classes abuse)
  • Talking to native stuff from Panama
  • and more.

All visualised in actual code, not just slides.