Files
hpr-knowledge-base/hpr_transcripts/hpr2990.txt

100 lines
10 KiB
Plaintext
Raw Normal View History

Episode: 2990
Title: HPR2990: JDK14 - Wrap up edition
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr2990/hpr2990.mp3
Transcribed: 2025-10-24 14:22:24
---
This is Hacker Public Radio Episode 2990 for Friday, 17 January 2020.
Today's show is entitled J.D.K. 14 Wrap-Up Edition.
It is hosted by Daniel Person and is about 15 minutes long
and carries a clean flag. The summer is.
We look into what is included in the next release of the J.D.K.
This episode of HPR is brought to you by archive.org.
Support universal access to all knowledge by heading over to archive.org forward slash donate.
www.hacker.org
Hello hackers and welcome to another podcast in Hacker Public Radio by Daniel Passion.
And I'm going to talk about J.D.K. 14 today, the wrap-up edition.
I use Java every day and I'm still on Java 8 because that was a lost version that had a performance color profile for creating images.
But Java is moving forward and we get a new release every six months.
And this is the release that will be released on the 17th of March.
We are in ramp down phase 1 now.
The ramp down phase 2 starts at the 16th of January.
Then we have the initial release candidate at the 6th of February.
And then we have the final release candidate at the 20th of February.
So we know now in the ramp down phase 1 what is going to be included in Java 14.
So I will go through each of these and talk a little bit about them.
First off we have the JEP 305 pattern matching for instance of.
And this is a preview. So this is the first time they are showing this interface.
And there might be changes in later previews before they actually standardize it into the platform.
And in this pattern matching they have added an assignment to for instance a string in this case.
So if we have an if statement where you check if object is an instance of string, you can add the variable name afterwards.
And then you can use that inside of that if statement.
I'm not really sure if this is a good way to show that you are actually assigning a variable.
Perhaps you could set the variable before the var s equals object instance of string for instance.
I've also talked a little bit about people with people in my community on YouTube.
And they thought that maybe we could do it a little bit more like Kotlin where you have some unsafe and safe assignments on the is operator.
Or you could put it into the platform as an instance.of.
So you actually have static, very static functions that actually handle the instance call.
And then you can have an optional back and use that with filters and so on.
So there's a lot of different ways to do this.
Perhaps you have a better solution or a thought of how you can implement this in a good way.
Then please give me a comment in the comment section.
And I'm very interested to hear about what you think about this JEP.
Next up we have JEP 3, 4, 3 packaging tool.
And this is an incubator.
So it's also very early.
And just of this is that they want to create a tool where you can take your job application that you have already prepared.
So you have a minimal JDK chip with it and create Debian or RPM packages or PikaJ or damage files for macOS or MSI or EXE files for windows.
It's just a way to package these with an installer so you can easily install Java applications.
Next up we have JEP 3, 4, 5.
And this is Numaware memory allocation for G1.
And this is only for Linux systems because you need some platform independent, platform dependent logic there.
And this is the non-uniform memory access that you can use with G1 for large scale implementations where you have multiple nodes with one JVM.
That uses memory from different nodes and it's aware of the uniformity of the memory access.
So you can actually use memory that are closer to the JVM in order to get better performance.
Next up we have switch expressions.
And this is the switch statement that we have in Java today where you need to do break after each case.
And the new way they are implementing this is with arrow function so you can actually have a case with a specific, let's say, case Saturday and then an arrow.
And that block of code that you have after that without any break or anything you can actually just say what it's going to do.
And you can also use return statements to set a variable for a switch statement.
So this is standardized now so it's in the platform.
And if you are interested then follow the links on the show notes and you can read more about it.
Next up we have JFR event streaming and this is also a new API very early where they are trying to implement a streaming manner for all the different events that can happen in the JVM in order to monitor their application during runtime or debug some thing that might not work well or if you want to profile your application.
Next up we have JEP 352 and this is non volatile mapped byte buffers.
So this is an improvement of the file channel clause and the mapped byte buffer clause.
So you can actually have direct I.O.X.S with a better performance on non volatile memory on Linux systems.
And the reason that they have just only Linux system is that MMAP has this MAP sync variable that you can set in Linux which makes this possible.
So it's only for Linux systems for now.
Next up we have JEP 370 and this is foreign memory access API.
And there's a new API to actually use native memory in a much more safe way and this is corrected with the earlier JEP.
And this is a replacement for the unsafe and other things that you used earlier in the some API that was actually a part of the main JDK functionality and not something that you as a developer should use it should be for the JDK.
So therefore they have made all those private and now they are trying to find a way to open up so you can use foreign memory or native memory in the system in a more automatic way.
Next up we have JEP 358 and this is helpful null pointer exceptions.
So have you ever run a job application and got a null pointer exception you might have had a stressful day in production where everything broke down and you didn't really figure out what happened.
You just got a line number and you needed to figure out what was null in this line.
And they are actually you in the JVM you have more information than what you get on the error messages today.
So what they will add is actually what variable or what field on an object is null so you can actually debug this faster and get more information in your exception.
Next up we have JEP 359 and these are records and it's a preview so it's very early and this is a way to create structures without creating a clause with all the getters and setters and everything that you need in that.
So records are a smaller easier way to write data clauses and they are immutable they have a public constructors a bunch of getters you have hash code and equal and also two string and all this will be given to you if you use the record syntax.
Next up we have JEP 368 and this is text blocks and this is the second preview so we will already look at this and it's actually a way to when you create strings you can use triple bunny ears and then you write your string and you can do that on multiple lines.
And in the second preview they have added that you can add backslash in this text if you don't want line breaks in this multi line text string and you can also add dash s if you want the line breaks but you will keep want to keep the actual spacing so you don't want to frame all the spacing around.
They have also added some functions so you can for instance strip indentations you can translate escapes and you can also use formatted and this is a simple way to add things into your string and then use this formatted to input different variables into that text string.
Next up we have JEP 366 and this is the start of removing things from the APIs they have deprecated the parallel scavenge and old GC combination and the reason I did that is because it's not used by the majority of people in the Java community and that combination was really hard to maintain.
So it's now deprecated and will be removed in later versions and then we have JEP 362 and this is a deprecation of the solaris and spark porch of the JVM and spark is actually still used and maintained by fidget.
So even this year but I guess that the usage of the JVM on spark is probably not large enough to keep that implementation so they have deprecated that in the JVM and will be removed in later versions.
Then we have JEP 367 so they have removed pack 200 tools and APIs and this was mostly to package your your files as pack 200 and that is now removed in JDK 14 and it was deprecated as early as JDK 11.
And we also have JEP 363 and they have removed the old current mark sweep the CMS garbage collector and that was also deprecated in JDK 11 and this is a really interesting garbage collector.
There is some one of them that you will be in contact with on universities you actually are reading about mark a concurrent mark sweep and you figure out how to actually use and create a garbage collector but it's not efficient enough to keep in the JDK so therefore it is removed.
And the reason I call this Java 14 wrap up edition is because they have put in a bunch of new functionality and added much more than they did in 13 but remember that 14 as with 11 is the long time support version.
So this is the one that Oracle will give support for up to eight years I believe so that's why it's a little bit larger than the version that came six months ago.
So this was what I wanted to cover today I hope that you found this interesting I hope that you are excited about some of these new functionalities to Java if you are using Java.
If you have any questions or suggestions please leave them in the comments section and until next time happy coding.
You've been listening to Hecker Public Radio at HeckerPublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show like all our shows was contributed by an HBR listener like yourself.
If you ever thought of recording a podcast then click on our contribute link to find out how easy it really is.
Hecker Public Radio was founded by the digital dog pound and the Infonomicon Computer Club and is part of the binary revolution at binrev.com.
If you have comments on today's show please email the host directly leave a comment on the website or record a follow-up episode yourself.
Unless otherwise stated today's show is released under creative comments, attribution, share alike 3.0 license.