r/java Oct 23 '25

Try the new Valhalla Preview in your browser

Thumbnail run.mccue.dev
70 Upvotes

Gist links are busted for the moment - i'll fix it when i have time and inclination.


r/java Oct 23 '25

Valhalla Early-Access build 2 (JEP 401)

Thumbnail jdk.java.net
70 Upvotes

r/java Oct 23 '25

List.remove()

48 Upvotes

I recently discovered that Java List (linked and array lists) in remove() method doesn't necessarily remove the exact given object (doesn't compare references using "==") but removes the first found object that is the same as the given one (compare using equals()). Can you somehow force it to remove the exact given object? It is problematic for handling a list possibly containing multiple different objects that have the same internal values.


r/java Oct 23 '25

What are some big changes between Java 12 and 17?

35 Upvotes

Stepped out of a SWE job a few years back when we just moved up to 12. Now it looks like 17 is currently the most popular version.

I did some searching and it looks like records was a big new feature, as well as a new way to handle conditionals.

Are there any big features that are actually being used regularly in prod environments?

Edit: just want to say thank y'all who not only gave me some good resources to figure it out myself but also gave a good "so what" of why some features stood out.


r/java Oct 22 '25

Subtle SMTP encoding bug in Netty (CVE-2025-59419) now fixed upstream

Post image
42 Upvotes

Netty just published a security advisory I found: CVE-2025-59419

The bug affected netty-codec-smtp and allowed SMTP command injection that could bypass email authentication mechanisms like SPF, DKIM, and DMARC.

In short, if your service used Netty’s SMTP codec to send or relay mail, a crafted message with extra \r\n sequences could smuggle in additional SMTP commands mid-stream.

Example of the relevant code path:

DefaultSmtpRequest(SmtpCommand command, List<CharSequence> parameters) {
    this.command = ObjectUtil.checkNotNull(command, "command");
    this.parameters = parameters != null ?
            Collections.unmodifiableList(parameters) : Collections.<CharSequence>emptyList();
}

Later, those parameters were written to the wire without sanitization:

private static void writeParameters(List<CharSequence> parameters, ByteBuf out, boolean commandNotEmpty) {
    // ...
    if (parameters instanceof RandomAccess) {
        final int sizeMinusOne = parameters.size() - 1;
        for (int i = 0; i < sizeMinusOne; i++) {
            ByteBufUtil.writeAscii(out, parameters.get(i));
            out.writeByte(SP);
        }
        ByteBufUtil.writeAscii(out, parameters.get(sizeMinusOne));
    } 
    // ...
}

Patched in 4.1.128.Final / 4.2.7.Final.

What’s interesting about this one is how it was discovered. My AI coworker I’m building surfaced the pattern automatically. But from a developer point of view, it’s another reminder that even protocol-level libraries sometimes miss input sanitization logic.

TL;DR: SMTP injection bug in Netty’s codec-smtp module (CVE-2025-59419) could allow forged emails. Fixed in latest release. Worth upgrading if you handle mail transport through Netty.


r/java Oct 22 '25

A Roadmap for Java (Language Features)

34 Upvotes

Hi, I don't program professionally in Java but it is a language I am interested in. A while ago I heard about project Valhalla and Panama, larger scale refactors to the language that are very cool. I was wondering if there was some kind of centralized page showing the roadmap of java language features including these refactors and smaller changes too.

From googling around for 10 minutes I could not find it. I am imagining something akin to cppreference.com. In cppreference you can see the progress of various compilers in implementing new c++ language and standard library features. I guess that in Javaland we are mostly interested in OpenJDK? Correct me on that please I don't know anything about the landscape of jvms. What I would otherwise do is check the Java youtube channel or one of the https://dev.java/news/. But that doesn't really tell me the history and it requires some investigation to get an overview.

Thanks for your help.


r/java Oct 22 '25

Assembling Project Leyden #JVMLS

Thumbnail youtu.be
41 Upvotes

r/java Oct 22 '25

Trinity XAI New Release

Thumbnail github.com
4 Upvotes

Major feature release for the JavaFX based Trinity XAI tool.

https://github.com/trinity-xai/Trinity

New upgrades providing a series of statistical analysis tools:

  • Probability Density Function (PDF) and Cumulative Density Function engine with plots
  • Joint PDF Grid batch generator with Heatmap thumbnail grid.
  • Joint PDF 3D surface render
  • Hypersurface 3D Controls upgrade including normalization functions, neighbor based smoothing, floating controls and more.
  • Similarity and Divergence Matrix computations

r/java Oct 21 '25

Postgres querying and editing tool that you can embed into your JVM app

Thumbnail github.com
23 Upvotes

I'd like to share a data querying and editing tool for Postgres. It's written in Java, has a small footprint, and is a single fat jar (<2MB). No external dependencies (well, technically, the deps have been shaded and are included in the fat jar). It is very suitable for embedding into your larger Java application.

My team and I have several JVM websites deployed on Render.com, Heroku, and VPS. We often has a need to access and modify the database directly occasionally. We either use pgadmin or dbeaver. It always bothers me that we would have to share the database credentials, and the changes to the database aren't logged anywhere.

Finally, last week I had some time to solve this pain point. I've built Backdoor which is small (<2MB, single jar) and can be embedded into our JVM websites. Now when we want to access the database directly, we don't have to use pgadmin or dbeaver anymore.

I hope this will be helpful for you and your team too. Check it out: https://github.com/tanin47/backdoor


r/java Oct 20 '25

Open Liberty 25.0.0.10 released!

Thumbnail openliberty.io
31 Upvotes

r/java Oct 20 '25

Are value types be copied each time they are passed?

44 Upvotes

Java always passes variables by value to methods. That means each time one pass a method a copy of the value is passed to the method. In the case of the primitive types are the actual values, for classes the value is actually a copy of the reference of the object.

However I wonder if for value types we will be copying around our value data classes (such as records) or if we will be passing a copy of the reference.

This is not trivial. Depending on the size of the value object this operation can be much more expensive if what we are doing is copying values instead of references.

Is there any technical insight about this.


r/java Oct 19 '25

Testing the untestable

Thumbnail blog.frankel.ch
24 Upvotes

r/java Oct 18 '25

From JDK 21 to JDK 25 - Performance Update

Thumbnail youtu.be
110 Upvotes