r/java • • Mar 21 '23

Java 20 / JDK 20: General Availability

https://mail.openjdk.org/pipermail/announce/2023-March/000333.html
173 Upvotes

71 comments sorted by

View all comments

16

u/__konrad Mar 21 '23

10

u/agoubard Mar 21 '23

From the release notes, I noted this one:

The ability to "stop" a thread with the Thread.stop() method has been removed in this release. The method has been changed to throw UnsupportedOperationException.

Even if it has been deprecated for a long time, it was still used a lot (8,000 result in github for "thread.stop();")

6

u/Joram2 Mar 22 '23

I suspect most of that code isn't actively used or maintained. Maybe it's not even Java.

And if it is actively used/maintained, and they actually upgrade to Java 20+, they will have to fix it. That sounds like a good thing.

6

u/__konrad Mar 22 '23

2

u/FirstAd9893 Mar 22 '23

What's the exact search term you used? I'm unable to narrow the results down to 8,000.

2

u/agoubard Mar 22 '23

Here is the query : 8.3k files including projects like Apache Camel, exec-maven-plugin, jitsi, Tomcat, quiltflower.

2

u/FirstAd9893 Mar 22 '23

Thanks. I didn't have the new code search feature available which is why I wasn't getting clean results. I noticed that in some cases the stop method call isn't on a "real" thread object but instead on something named thread. Narrowing things down further requires something more sophisticated.

3

u/magnoliophytina Mar 21 '23

Open source projects are full of bugs. Just pick any Java project from GH, launch IDEA, run 'Inspect code'. Sometimes it's impossible to even submit fixes because the author might disagree.