Foojay Podcast #16: Welcome to Java 20!
Java CorePodcast

Foojay Podcast #16: Welcome to Java 20!

Since 2018, we get a new version of Java every 6 months.

Some are long-term supported versions that can be used for many years, while others are only maintained for a short time. Version 20 is such a short-term supported version.

So, what new features does this version bring? And why should we use it? And what can we expect from the next version, 21, in September that will be a long-term supported version?

Let’s find out and learn more about the process of the OpenJDK evolution!

Note: if you want to read more about the changes in OpenJDK 20 with code examples and a lot of additional info, check out the post by Hanno Embregts, here on Foojay.

Podcast Apps

You can listen and subscribe to the Foojay Podcast on:

Guests

Podcast Host

Content

Transcript

Automatically generated from the audio, so it can contain errors in names and technical terms. Suggest a correction.

[0:00] Hello and welcome to this new edition of the Foojay podcast March brings us version 20 of java let’s take a look inside welcome to the Foojay podcast all your news about OpenJDK since 2018 we get a new version of java every six months some of those are long-term supported versions that can be used for many years While others are only maintained for a short time version 20 is such a short-term supported version so what new features does this version Bring and why should we use it and what can we expect from the next version 21 in September that will be a long-term supported version let’s find out good morning hello welcome my name’s Simon Ritter I’m the deputy CTO at Azul I have been working with Java really from the very beginning because I joined Sun way back in 1996 pretty much the same week that JDK 1.0 was released and I follow Java all the way through the sun years got acquired by Oracle spent five years there and for the last seven and a half years nearly I’ve been at Azul hey I am Miriam so I joined the sign in 2011 I’m younger but since 2000s I’m I’m pretty much in Java I really love the ecosystem and

[1:19] Discovering I really like to use the Java assault spices so I have been out towards the robotics small framework to see how it works with the hardware and last year I’m working as a principal engineer at open value and helping the clients to migrate some of those to Azul system so they are pretty happy with immigration and I have outdoored a new book which will be introduced shortly today and I’m Frank de Porter I’ve been doing Java development for many years and in July last year joined Azul as a technical writer and I’m now making these podcasts for Foojay because I want to know more about Java and learn from all these experts in the community so we have Java 20 we released this podcast in the week that Java 20 is released can we expect any new major feature new things that have been added Simon there’s only one thing which is truly new and even then it’s a preview feature and that’s the idea of scoped values this is related to project Loom and project Loom started being introduced into the JDK in the last release so JDK 19 and that’s when we started seeing things like the introduction of virtual threads and

[2:37] Structured concurrency and what they’ve done is they’ve they’ve added this new jet which is as I say is around the idea of scoped values and the idea behind this is really as a sort of replacement for the way that thread local variables work because they say that there are some issues around the idea of using thread local variables one of them is the fact that they’re mutable and it seems that when it comes to using or writing programs there’s a real kind of difference of opinion about whether you should have mutability or not mutability in your application you know your variables and so on so they’ve introduced this idea of scoped values which are immutable versus thread local variables which are suitable so that’s one kind of the big change there but as I say this is part of project Loom and is this idea of implementing virtual threads into the JVM so that’s really kind of the only new feature if you like the other things which are included in JDK 20 are updates to existing jeps JDK enhancement proposals that have been introduced in previous versions and they’re going through revisions of that so maybe that’s

[3:47] Something we can explain is with each new version of java there are improvements in the whole system but there are also incubator and preview features that are not enabled by D4 but they keep evolving with each new release until they become really a new feature correct yes yes that’s right so the idea is that preview features are focused primarily on the language and if you look at things like record patterns for example because that’s one thing which is going through some changes at the moment so that’s a preview feature and as you rightly said by default you don’t get those features in the language because they’re not part of the specification they have to be provided in the implementation but they’re not turned on by default you need to explicitly when you compile your code tell the compiler that you want to use these preview features and then when you run your application you also need to tell the JVM that it needs to enable those preview features as well so preview features are primarily around the language and then you’ve got incubator modules which is more apis and tooling so that you can introduce new

[4:56] Classes new libraries and so on in the same way now there’s a little bit of misunderstanding about these things because people sometimes think that preview features and incubator modules are more about kind of beta testing but that’s not the case the idea is that these features have been delivered complete they’re finished they’re absolutely ready to go they could be used in production there’s no issue with that reason that they’re not fully integrated into the platform is more to do with the idea that the developers of OpenJDK want to give people a chance to look at these features and decide if there are things that need to be altered to make it more valuable to developers to give you an example of that when we had the introduction of the switch expression which is a nice thing because it allows us to return a value from a switch and then assign that once and we don’t have to remember to put each assignment in the set of case statements that we’re we’re working with that was really good but they also allowed people to use the sort of old style syntax of the switch statement with a switch expression and

[6:03] That involved the idea of using break with a value people said well yes you can get away with that because you can break to a label and that’s one way you can use break and a label can’t start and it cannot be a number so you can differentiate between break returning a value from a switch expression and break to a label outside of the loop that you’re in but it’s a bit sort of difficult to see you know it makes things unclear so the developer said yeah we understand that so rather than using break we’ll use yield and it makes it much clearer because you say Okay yield with a value break to a label so it’s things like that where it didn’t change any of the way that the feature worked it just made a little bit clearer a little bit easier to work with that kind of thing so it’s it’s a very powerful way of doing things and that is really one of the big benefits we’ve seen of having this six month release cycle is you can do incubator modules and preview features if you’ve got two three years between releases you just can’t do that it doesn’t make any sense but six months great because you can do

[7:09] Six months of development then maybe another six months of development two or three releases it’s part of the specification you mentioned sculpt values is a new version in this 20 but there’s also record patterns we have foreign function there’s virtual threat improvements the structured concurrency pattern matching so there is a lot of evolution even there in this version 20 although it’s not open yet so we will probably see a lot of these in the next version 21 then being finished is that the ID I think so as you say there are seven jeps in total in JDK 20. one of them the idea of scope values that’s the new one all the others are revisions to existing jets that would have been introduced in earlier versions and as you quite rightly point out because JDK 21 is going to be a long term support release I would expect that several of the ones which are currently in preview or incubator will be then a formal part of JDK 21 so that people can use those in production without having to turn on preview features explicitly so I think that’s that’s definitely going to be something we’ll

[8:19] See I’m kind of hopeful that the idea of virtual threads project Loom will be part of jdk21 it looks quite likely at the moment but you know we’ll have to wait and see I can’t guarantee that I agree with Simon I can’t agree the scope value it’s true it’s something new and I may think they added there to avoid to use the thread local as a trend local will allocate some memory it’s in the table then if you have a million virtual threats and use it local there oh come on you can be kind of disappointed and actually if you use the trade locals it’s allocate the memory and that’s the other problem and the slow value are kind of yes they are immutable I mean they are it’s promoted as a feature but it’s kind of requirements if you think that you will kind of like a child threat will extend like will get the access to this value and then you have more child threats in the virtual threats world you will be not really sure which kind of value you get if this would be more table aside of it the virtual threats are really kind of teeny rappers they are behave like threads yeah but they are just 3D pepper and the

[9:39] Scope value has allocated just to one value one memory place and that’s that’s the very big benefit I see I hope that it will make it the store value into the virtual test and virtual test also to the release 21 because it can really help a lot of scenarios I mean I can imagine if there’s already put so many effort into developing all these things and putting them in OpenJDK even if they are incubator or preview features the goal is definitely to get them in a version soon correct yes I mean that’s true but Simon said there is a this feedback from the community and from developers it’s kind of important I also see the benefit of six month releases it’s amazing because without this I think that wouldn’t be possible to make any of those well any any feature of those we know how it was kind of like three years okay cool we have it now come on feedback okay so we don’t okay next three years and for my personal thing I mean Java evolving so much right now it’s very work language to concert for the Enterprise application as as a number one language for the JVM As It produced

[10:56] The last instruction it’s not on steroids like some other languages like fixing the threads behind and the only just the steroids come visible when you have a processors or less resources I’m happy to see this Improvement I followed a few presentations about all these new features that are coming I’m really impressed by how thoughtful they are because IDs for future improvements are already part of these things so it’s not that the OpenJDK Community jumps on a new feature and fastly implements it no that there’s really a very good process of thinking why should we do it if we in the future want to do this will it have impact on the things that we are already doing so yeah I’m really impressed with how Java is evolving and then this whole Community behind it and giving features as a preview and then getting the feedback indeed that six months recycle is very important there yes I think that’s absolutely true because the kind of Architects behind the OpenJDK people like Brian Gertz people like Mark Reinhold and so on they are taking a very considered approach to how to evolve the platform

[12:09] As again you brightly say we’re not just throwing features in because well you know another language has got that feature so that’s really cool let’s put that in Java but then find that actually you know two years three years down the line maybe that doesn’t work quite so well so they are looking very carefully at what the long term Futures are and we’re doing this through sort of various bigger projects from the language perspective we’ve got project Amber which is a collection of sort of smaller language features so all of these things like record patterns records themselves the pattern matching features all of those are coming through project Amber and then we’ve got project Loom which is the virtual thread side of things we’ve got project Panama which is the native memory native function integration as a replacement for jni as a longer term thing we’ve got project Valhalla which is value types and that sort of kind of relates back to the whole idea of the scoped values because that’s you know looking at using values rather than variables as my right quite rightly points out you know the memory overhead

[13:15] Of using variables versus immutable values is much better so yeah there’s a lot of good work going on there and it is being done in a very considered way and middle you said in your introduction you just published the book practical design patterns for Java developers on your software design skills by implementing popular design patterns in Java it’s a mouthful what is a really good part so of course it’s about design patterns that’s the biggest part of your book but you also included the evolutions of java through the latest versions from I think you start from java 8 or 11. what are the most important changes that you’ve seen in the previous versions I’ve been thinking what I would love to have in a book about the design part because I’ve been on the teams driving the teams they all wanted to implement the all member design patterns to kind of clean code way or just unders I would say the produce the code which other will understand that’s the better definition yeah it’s clean or not it doesn’t matter but it will be good that it’s useful for others and I’ve been thinking what I

[14:24] Should add in such kind of books about design patterns and I have realized after many years of experiencing that people actually don’t know what a Java platform does for them they know nothing about the dynamic translation they’re not not really nothing I would say just hard words but some sometimes it’s overcome just get Dynamic translation how would the memory management works which are the guarantees this is why I put in this book some introduction about put the job platform is how it evolves which kind of crucial feature has been added from of course Java 8 I think everyone says streams stream API so and everyone use it everywhere so plus optional but the optional had also the reason and I saw that many times using the way well it’s better to not use them in that way because it produced a lot of boiled plate code yeah but it’s a that’s it it’s Evolution so I wanted to also explain the module system that has been added it’s amazing and it’s very useful if you consider if you have already considered the architecture written how your how actually which kind of parts of your system should be secured and how

[15:44] They should work together the module system gives you the really security it may do Clarity in the evolution of your application I haven’t seen a lot of projects using it but a couple of them yes maybe Simonson I’ve seen many others but yeah it’s pretty really quite it makes a developer development easier and people are not willing to accept it they might complain about what is the module system if I do this we should spend another podcast on modules only that’s on my list of videos it’s such a controversial subject and there are I don’t know if the most Pro or contrast but they’re definitely on both sides a lot of people so we definitely will have a look at modules in a later podcast I agree I think that will be a great subject for another podcast because in answer to what Myra said yeah I don’t see that many people using the module system in their application patient code I definitely see it used at the JDK level and using j-link to create tailored runtimes for specific things but I don’t see a lot of people adopting the module system in their application code I wonder if

[16:57] That isn’t because it’s too fine grained you know if we’re talking about microservices that kind of makes sense because you’re dividing up a monolithic application into specific services but do you really then need to drill down into the next level and start you know modularizing that probably there is a good reason for that but I think there is a reluctance on the part of Java developers to adopt that because they’re used to doing things in a particular way but yeah definitely a good thing for another podcast in your book Miro you have an article on Foojay about it I have written a book review together with Johannes so that’s also what I was impressed is that for each design pattern that you describe that you’ve linked to where it is used in OpenJDK itself it clearly shows that you you’re involved and know how OpenJDK is developed how do you keep up with how this project changes I can imagine there’s so much people involved and contributing code are you reviewing all pull requests or no no no no no that’s not for one person I mean that’s why the projects the JDK is bundle of multiple projects and each of

[18:08] Those bundle has its own Project Lead of all reviewers because it’s not possible so what I do actually I’m checking the code that’s true which I’m particularly interested in a parse in some parts how they were for example like with the logging API some of those things have been officially published on the internet but anyhow there is a kind of art how the things are implemented it’s for example collection API because at the University you get definitely implement the fifo or some kind of homeworks and that you are at the beginning so but you are yeah that’s that’s true that’s a nice story but if you go into the production in the industry which I consider the Java you will see how what else you need to consider not just only it’s not about what the deliver the task like the finished task like to have it before but it’s many other things that you need to consider that your implementation needs to reflect this is why I think the Java is so amazing like the like which Architects are really considering the vapors compatibility and the usage in the feature and you see this involvement

[19:25] Also in implementation improvements I I’m not saying here that everything is uploaded perfectly if it would be that would be great but you can see how the codes are changing based on the feature that has been added into the platform and this is why been able to linked user okay please you can check here to the Java implemented Parts I would say I didn’t link them into the C code implementation here hardcore I think for the book for Java developers and that’s actually fun thing because I wrote a post a few weeks ago about the time zone information in OpenJDK and it’s really fun that you can indeed go to GitHub go to OpenJDK take a look at the sources and then you find audiences for Belgium for me I find the whole history of when did the daylight saving change so that’s there it’s in the it’s in the project you can find it you can find how it’s used how it’s implemented how everything is linked together yeah that’s indeed a nice approach is looking into how is Java itself being made and what the Insight is OpenJDK project one of the reasons what I made it to link to the Java implementation because sometimes maybe

[20:48] It’s happened to you when you have been driving the project some Engineers were stocking to implement some new feature yeah they did it it’s like the new implementation example from the linked list yeah but they forgot okay this thing is already there so it does not have to be implemented by by you the reason why it doesn’t have to be implanted because any code you implement you need to maintain right at the cost of the main chain maintained could be very high and the JDK has bubble tested linked list yeah and it’s effective enough I was going to say that that’s a really interesting point of view because I absolutely agree with you but one of the problems that we have as Java developers is that I mean I haven’t done a count on this recently but I know in jdk8 there were four and a half thousand public classes in rt.jar and back in JDK 1.0 there were 102 classes in the class libraries when I started using Java I could actually hold all 102 classes in my head so I could remember what we had in terms of availability four and a half thousand nope definitely can’t do that but sometimes you miss that don’t you

[22:09] Think okay is there a public class that’s been implemented in the JDK class libraries that I can use to do that and it can take a bit of time to find where that thing might be I mean the collections API is an easy one but some of the more esoteric ones can be little bit difficult to find and figure out oh yeah is that right for what I’m doing maybe that’s a design anti-pattern that’s missing in your book that’s the not invented here principle but I didn’t make it so not good I need to make it myself That’s a classic anti-pattern there is not mention anti-pattern but I think it’s a it’s a mentioned somewhere in the sentence somewhere indirectly this is true but Simon says the JDK becomes a bit bigger way bigger it’s really hard to catch up with all the changes I figure out you don’t have to catch up with all the changes but just you need to have some some entry points where you should go to take a look whether something is different so there they have been added a lot of builders in the collection apis not only the collection apis and the string how for example the ending string

[23:15] That being done significant improvements and also I’ve seen the significant Improvement on Java 20. and there is a other reason for that but you know things are very important to handle and Developers rather Implement something what they have in head yeah they do this they maybe it works it’s it’s also tested by junit but the implementation on the JDK it can be far more fastly optimized by jet compiler it’s maintained yeah by the definition yeah it’s coming for the package so that means if something new comes for example string string templates will make it into the Decay and you have already implements a lot of Code by yourself so what you’re gonna choose I would choose the string templates right instead of maintaining my implementation I think this is one of those places where things like Foojay is very important because that’s a sort of centralized resource of information and it’s a great way of having a summary especially when you’re looking at what’s changed between releases going to Foojay and having that ability to see okay what was the difference between JDK 17 and JDK 18 or 19 and get that summary is

[24:31] A really useful kind of resource and then you’ve got articles that lead you into more detail about specific things and you know all that kind of stuff so yeah that’s a great thing there and Miro if you don’t have an article yet on Foojay about these new Builder patterns I know someone who can write that oh you can do that yeah okay but I published right when I was introducing the book I wrote the Builder patterns the Builder pattern there the reason for that was that the patterns are like Lego it’s like a building application like you’re building a Lego recently they’ve been playing with my son like building the railway station and the trains that’s amazing right I recently saw some discussion about clean code and necessity of the clean code and design Burns and that it end up so I don’t use any of those I just write a code okay so I just I don’t give a I write a code so I do agree but kind of so maybe you know the jit compiler is and start internal statistics are smart enough that can optimize in the way but if you’re using initiating new objects and improperly use the cutting and so on

[25:48] Is no chance that jit compiler does the work for you well yeah again that’s it’s an interesting discussion we’ve already had a podcast on this as well which is the approach to how you program and how much do you have to think at the lower level whilst you’re writing higher level code how much should you be thinking okay if I do it this way I’m going to produce less objects therefore I’m producing less load on the garbage collector and the memory allocation system versus I just want to write the code the way that makes most sense for the business logic that I’m trying to implement same thing with the jit compiler do I try and write my code with the jit compiler in mind my personal opinion is you should never do that well you should write the code in the best way which addresses the problem that you’re trying to solve you should let the runtime system handle that for you now there are obviously situations where you need to write more efficient code and you can do you think the same thing in different ways but you shouldn’t be thinking too low level about you know how many objects am I

[26:53] Creating how is my code going to work with the jit compiler because the people who write jit compilers are the people who write garbage collectors are very smart and they’re normally able to handle the kind of things that people do pretty easily so I know that when I look at what we do at Azul around the prime JVM where we do replace the way the garbage collector works we can keep up with allocation rates that are like 20 Gigabytes a second of object allocation so you don’t really need to think about do I need to worry about how many objects I’m allocating and if the garbage collector is smart enough especially if you’ve got very short-lived objects which is typically going to be garbage collector will just take care of that for you don’t need to worry about it so yeah and again another sort of podcast that we could have but it is really important I agree with you too I’m on the same same way so you should never thinking so low level when you’re writing the code you should feel fulfill the business need because that’s what I got gonna pay your check right probably optimize TVM byte code

[27:54] Will not pay your checks but anyhow they’re using the designer kind of approaching helps you to communicate with your peers this is one important things and what may is happening why I’m using this is because I would love to understand my code like a few years maybe in a few days so this is why I’m using it just kind of having the structure and benefit is it can be optimized in the internals this is out of the store but this is the benefit I’m getting out of it and we touch kind of slightly different topics right but it’s still related to the new features that are coming into the Java GDK 20 right they are have been done the significant improvements like structured concurrency made it try to deliver way how to write threaded application with handling the exception and kind of how to deal with the thread API and kind of descriptive way to the colleagues or if you don’t understand well very well I think the structured concurrency may help here to understand what is the scope where you can afford the scope how you can joint India and more important how you can close all your threads and this is one

[29:09] Of the things that has been added into the Java JV and ddk20 it’s Auto closable executor service that has been added so you can use it with try catch structure and will be close for you which is great so we’re going back to Java 20. so as we said before it will not be a long term supported why should I start using Java 20 as a developer the idea behind this is that what you really want to be doing is testing with JDK 20 it’s very unlikely that you would deploy J to K20 into production the only reason you might think about using one of the feature releases rather than long-term support release is if there’s a particular feature in there that you really want to have for your production system but as we’ve already said JDK 20 is pretty light in terms of things that have been added so it’s very unlikely you would want to do that but the important thing is to test against JDK 20 to make sure that the cumulative set of changes that you get between the long-term support releases don’t impact on your application should you then when JDK 21 comes out want to move to that as a deployment platform so it’s really

[30:19] More about testing than actual use in production but we must make clear that Java 20 is a full release it brings bugs fixes it brings improvements it is just as good aversion as 21 will be or 17 was it is a full release fully tested through all the review stages of every Java version correct yes I mean that that’s why it’s called a feature release because it has features in it so we have feature releases and we have long-term sport releases so we don’t refer to them as you know intermediate releases or anything like that it’s a feature release it’s a fully formed as you say includes new things you could if you wanted to use it in deployment deployed in production absolutely no reason not to other than the fact that the updates in terms of Maintenance will end after six months but other than that there’s no reason why you shouldn’t use it in production initially the idea was we’ll have long-term supporters versus every three years so that has been changed to two years so 17 was the last one long-term support the 21 is the next one in September I know that this project keeps evolving is there already a lot of

[31:29] Decisions being taken about what will be in 21 I know that virtual threats I’ve seen the Gap it’s in draft so virtual threats will they be in 21 that’s not sure generational zgc is also a for 21 are they already decided or when will this happen this is one of the things about the way that the JD OpenJDK development process works is that there is a JDK 21 project already you can get Early Access builds of that but all they’ve effectively done there is Fork from JDK 20. JDK 20 is not being released until next week so they’ve fought that off and they’ve started Development JDK 21. A lot of the things which get included in the next release will happen over the next couple of months so we get to you know the sort of like feature freeze which will probably be about halfway through the actual development cycle right now there’s only one thing which is opposed to Target JDK 21 that doesn’t mean it actually will go into 21 but proposed Target 21 is sequenced collections we will wait and see whether things like project Loom and all of that sort of good stuff and even maybe the sort of

[32:42] The record patterns and things like that whether they make it in most likely they will but they haven’t been announced as things that will be in JDK 21 yet I’ve seen like for instance also for a Java 20 already in December 8th there was the ramp down phase so that means already a few months before the actual release there is a process starting with finalizing that version correct that’s right yes I mean this is the thing about the way that it works so if you look at the schedule for JDK 20 Ram down phase one as you said was 8th of December ramp down phase two is like January so effectively you know ramp down phase one is when that’s kind of like most of the features are fixed there was actually one that kind of it ended up getting left out and then they had to go back and put it back in again because as somebody pointed out up the vector API which is not the vector plus the vector API which allows you to use single instruction multiple data wide registers type thing and somebody forgot to add the new update to the incubator module there and so they had to go back a little bit later and just say oh yes

[33:53] We are still incubating that it’s not a full feature but it was a fairly minor thing but yes rampdown is where they really kind of decide these are the things that are going in there okay we already talked about that there’s not that much involvement with Java 20 but what is definitely something you want to tell about is new version 20. there are a couple of things in terms of updates to the existing jeps and the features that are preview and incubator modules first of those is around the record patterns and there’s a small change in there which is quite interesting because what they’ve done is they’ve dropped the idea of named record patterns what that did allow you to do was to have a record pattern that you could match against with instance of and then you could provide a name so you could reference the name of the record in the code that you wanted to use with that now you can use the elements of the record that’s no problem but they also allowed you to have a name of the record and I looked at that and there were some kind of complexities that got involved in that because if you look at the way that

[34:55] Guarded patterns work they use when as the way of guarding the pattern so you say if something is an instance of something when and then you give a conditional to that and the problem is that when is used as a contextual keyword meaning that it only works as a keyword when it’s in that particular place but you really can get very confusing because that means you can use when as a variable name so you could use it as a name so you end up with when where you could actually write that code it’s you know I’ve got this in a presentation I did and the compiler I was trying this on JDK 19 and the compiler just gets really confused when you start using when as a variable name with a guarded pattern and a record it just it didn’t know what to do so they’ve taken that out to avoid the ambiguity and the problem they’re trying to resolve that with the compiler the other thing that I noticed was that in terms of the Forum function and specifically The Forum memory API they dropped the idea of a memory address so they did have a distinction between a memory segment and a memory address and

[36:06] Now they’re just using memory segment and I think that kind of makes things a little easier to work with it’s again it’s a little bit odd because they say the memory address is effectively a zero length memory segment now it’s one of those things where they’re sort of tidying things up and making sure that people have what they need in terms of the features so right right now I’m thinking about when so and I think maybe that makes a sense to make a code review before this is kind of going into the production anyhow it’s also a nice example but the reason why the six months releases are kind of required to get of reads such kind of ideas which can be really confusing there is a proof that this that makes sense to have a say six months releases and fix some kind of issues that you shouldn’t make it into the long terms support yeah anyhow you mentioned Simon that the sequence collection will be are targeted to 21 I think this is also kind of useful job in terms of handling the collection framework initial point the start point the first point the last one it’s

[37:21] Already held because I saw many different implementations to fixing the current problems with the coil not as not problems it’s kind of challenge with the current current collection framework and this is also example how Java evolves and how people are smart and really carefully considering each changes do not break it because not breaking anything with the old code like the related background but it’s very hard and I think the sequence collections are very nice example how to overcome this old problems to kind of evaluate the ecosystem in a proper way and make a less error prompt code I mean letting Engineers implementing their own implementation and finding and arise or stats the first element I mean is it actually because of that kind of bad example code that you’ve written with the one when that it goes back to the OpenJDK team and Community as this should not be possible this is something we should improve I think that’s that’s certainly part of it is that when situations like that are rise they realize that there are issues that need to be addressed I mean with that

[38:39] Specific one I was always a little bit confused because one of the changes they made from the original definition of record patterns and more guarded patterns was for the original guarded patterns they used the and operator so the double and which isn’t ambiguous when you can’t use double and as a variable name so you can differentiate between all the possible situations but they decided it was more readable to replace the double and operator with when and that then LED them into this sort of like Corner case where if you start using when as a variable name or as a pattern variable and then you use a guarded pattern as well it becomes more ambiguous and you can’t quite figure it out so there are a whole range of things that it’s very difficult to evolve a language like this so they have to be very careful and do it in this controlled way so like I said I really respect the work that all the OpenJDK Engineers are doing in terms of this we have already a lot to look forward for version 21 and we’ll have a new podcast then with the new features and let’s see what’s inside Java 21 in September thank

[39:49] You for joining and taking the time to discuss the new version of java thanks to the listeners and keep an eye on Foojay for future articles about development and everything related to the Java worlds of OpenJDK

Found a mistake, or something to add? Edit this page on GitHub

Written by

Frank Delporte

Frank Delporte is a Java Champion, Java Developer, Senior Technical Writer at Azul, Blogger, Author of "Java Programming for Raspberry Pi - A Hands-On Guide to Electronics and IoT Projects", and Open-Source Contributor for Pi4J, Lottie4J, Sheetmusic4J, …

Written by

Miro Wengner

Miro is a Java Champion and Oracle ACE Pro with a career-long focus on enterprise AI, including machine learning, neural networks, and probabilistic algorithms. As a contributor to OpenJDK and Mission Control, he specializes in optimizing Java performance, …

Written by

Simon Ritter

Simon is Deputy CTO at Azul.

Related posts

Join the discussion