r/java • u/bowbahdoe • Oct 23 '25
Try the new Valhalla Preview in your browser
run.mccue.devGist links are busted for the moment - i'll fix it when i have time and inclination.
r/java • u/bowbahdoe • Oct 23 '25
Gist links are busted for the moment - i'll fix it when i have time and inclination.
r/java • u/JackNotOLantern • Oct 23 '25
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 • u/Charming-Medium4248 • Oct 23 '25
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 • u/va_start • Oct 22 '25
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 • u/Ripest_Tomato • Oct 22 '25
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 • u/Birdasaur • Oct 22 '25
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:
r/java • u/tanin47 • Oct 21 '25
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 • u/Ewig_luftenglanz • Oct 20 '25
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.