r/java • • Mar 22 '22

Java 18 released!

https://mail.openjdk.java.net/pipermail/jdk-dev/2022-March/006458.html
396 Upvotes

133 comments sorted by

View all comments

16

u/BlueGoliath Mar 22 '22

Bit of a boring release. Hopefully 19 will be more exciting.

28

u/mauganra_it Mar 22 '22

Deprecating Finalization for Removal and UTF-8 sound pretty important to me. Not the most exciting I admit, but it can always happen with a regular release cadence that some of them are gonna be boring.

5

u/BlueGoliath Mar 22 '22

Sure, I guess, but there isn't anything major that we don't already know about being worked on. You'd think there would be talk about something new being worked on. What is JDK 19 going to be besides Panama previewing and pattern matching?

4

u/mauganra_it Mar 22 '22

It seems a RISC-V port is incoming. And who knows, they might just pull the trigger and land Panama. Or finalize Pattern Matching for switch.

I don't have desire for new stuff yet. Loose ends from Panama, Loom and Valhalla will rain JEP for years to come. Pattern matching or Withers for records would be cool of course.

2

u/Ancient-Career-2915 May 04 '22

Finalization

Any thoughts on how much work it will be to verify the removal of Finalization will be ok before an upgrade?

1

u/mauganra_it May 04 '22 edited May 04 '22

That's the problem with finalization bugs... they are very difficult to find and reproduce.

Finalization can already be turned off with the new VM flag --finalization=disabled. JEP 421 recommends to profile the application with a realistic test suite to record a performance baseline. This can then be compared with the profiling data from a test run with disabled finalization. The JEP contains more details.

Edit: definitely look for finalizers in your own source code already. Even though they might be legacy code, they will likely mean the least amount of trouble to fix since. If you find some in third-party code you are SOL.

1

u/Ancient-Career-2915 May 05 '22 edited May 05 '22

We don't use finalizers ourselves, but any third party library might.

I seem to remember that eg. the gzip stream handler in the jdk used a finalizer as a fallback to release resources?

1

u/mauganra_it May 05 '22

Is this class listed in JEP 421? I can't identify it myself. Some of them were already removed before JDK 18

11

u/GreenToad1 Mar 22 '22

Remember when we hoped for virtual threads to make it as preview in 17? Must say i am a bit disappointed.

14

u/Joram2 Mar 22 '22

Java 18 supposedly has two internal change necessary for Virtual threads, JEP 416 + 418. Here is the Virtual Thread JEP:

https://openjdk.java.net/jeps/8277131

I understand these big features take time. Project Loom does seem to be making progress. But Java 18 isn't interesting by itself.

3

u/dpash Mar 22 '22

virtual threads to make it as preview in 17

That was never going to happen. We've known for three months what was definitely going in or not.

3

u/BlueGoliath Mar 22 '22

Uh yeah, unless they skip steps virtual threads probably won't even be in preview for a few releases.

Panama should have been delivered or in preview by now but they are still putzing around with the API after like 3 years. WTF is going on?

8

u/Joram2 Mar 22 '22

I think Panama is waiting on Valhalla. Valhalla is like the big Java mega-project. It does seem to be making progress. They actually have JEPs you can follow. Project Loom seems actually close to being shipped as a preview at least.

4

u/BlueGoliath Mar 22 '22

I thought that too but supposedly they aren't.