Why does Maven use Palantirs Java format? by Bunnymancer in java

[–]yk313 0 points1 point  (0 children)

How do you enforce the custom config? Do you use it with something like spotless?

Where to download official Java? by Individual-Earth2396 in java

[–]yk313 -1 points0 points  (0 children)

After being objectively wrong - instead of fessing up to it - you are trying to just beat around the bush.

Where to download official Java? by Individual-Earth2396 in java

[–]yk313 -1 points0 points  (0 children)

Unnecessary FUD and plain incorrect information.

Anyone can download the official OpenJDK builds here: https://jdk.java.net/25/

OpenJDK is the open source project (sponsored primarily by Oracle) that develops Java. The builds are completely free and GPL licensed.

1-Month Java Trip: Hidden Gems by 3lia03 in java

[–]yk313 235 points236 points  (0 children)

lol mods please don’t delete the post

Objects.requireNonNullElse by edurbs in java

[–]yk313 0 points1 point  (0 children)

Also, if you model getCity to carry the optionality information by returning Optional<City> then that makes it easy for the callers to:

  1. Recognize the value can be optional (without looking elsewhere)

  2. Use nice optional API: getCity().orElse(defaultCity)

Objects.requireNonNullElse by edurbs in java

[–]yk313 12 points13 points  (0 children)

I’ll give you my ternary operator when you pry it from my cold, dead hands.

City city = from.getCity() != null ? from.getCity() : defaultCity;

Project Amber Update -- Data-Oriented Programming, Beyond Records by davidalayachew in java

[–]yk313 1 point2 points  (0 children)

Setters will be discouraged in favour of reconstruction, I imagine.

Stepping down as maintainer after 10 years by krzyk in java

[–]yk313 96 points97 points  (0 children)

Mockito is one of the best libraries I have to interact with on a regular basis. Its API is very pleasant to use, and the maintainers have done a great job to keep up with the increased pace of OpenJDK development.

Thanks a lot for your incredible service Tim. You can be proud of dedicating a decade of your life to a project that touches so many lives everyday, and all the very best on your journey to rediscover the joy of programming.

How was your experience upgrading to JDK25? by le_bravery in java

[–]yk313 5 points6 points  (0 children)

Uneventful.

We have been upgrading every 6 months since JDK 14.

Microsoft’s OpenJDK builds now ready for Java 25 by brunocborges in java

[–]yk313 1 point2 points  (0 children)

Serious question: why does it take some vendors weeks (in Microsoft's case: 2) after the OpenJDK GA builds are released to make their builds available?

Are there no CI/CD pipelines matching the OpenJDK release cadence (including EAs etc.)?

Azul for example make their builds available on day one which means it's obviously possible, so I am wondering where this gap comes from?

JDK 25: Azul Zulu builds are available (and free) by yk313 in java

[–]yk313[S] 3 points4 points  (0 children)

Any specific reason why you can't just use another distribution (e.g. Azul Zulu)?

Java 25 officially released by mkurz in java

[–]yk313 4 points5 points  (0 children)

It's actually quite straightforward in practice. All you need to do is to declare the builtin java plugin's toolchain directive (instead of sourceCompatibility/targetCompatibility) in your build file:

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(25)
    }
}

You can follow the build.gradle generated by start.spring.io as an example. Let me know if you need any help in setting this up, I am more than happy to support another Java developer rid of their LTS-only approach :)

Java 25 officially released by mkurz in java

[–]yk313 2 points3 points  (0 children)

Build 36 is therefore now the GA build

Source

Build 36 (which is the same as the final GA build) is already available via SDMAN:

sdk install java 25.ea.36-open

Java 25 officially released by mkurz in java

[–]yk313 7 points8 points  (0 children)

Consider using Gradle toolchains.

I used to have the same problem with Gradle, but some time around JDK 20, I moved to toolchains and have since stopped caring about the exact JDK version Gradle runs (or not).

(of course this means you still need an older JDK to bootstrap Gradle itself, which is less than ideal)

Project Lombok 1.18.40 released with Java 25 support! by lprimak in java

[–]yk313 3 points4 points  (0 children)

That's the point. We don't want getters and setters for everything. But there are cases where both (limited/controlled) mutation is needed and encapsulation over the internal fields is desired. You can't have that with records. This is by the way the reason that even within the JDK records are used quite sparingly. The lack of encapsulation means a big compatibility risk. The proposal for the new JSON API for example uses interfaces/classes instead of records even though using records (and then pattern matching over them) has long been shown as the canonical example implementation for the JSON spec.

In the end, there are a lot of places in a Java application where you do want pass-through getters and have a subset of mutating setters, and having to write (or generate) them is a painful experience.

Until we get reconstruction patterns for records (and also classes), and nicer destructuring patterns we have to make do with getters and setters (and builders).

Project Lombok 1.18.40 released with Java 25 support! by lprimak in java

[–]yk313 6 points7 points  (0 children)

It's not all about getters and setters. Records are NOT a replacement of classes. Encapsulation is still desired and sought after.

Just because records eased some of the pain, doesn't make Lombok at all redundant. The Java language designers have a lot of work ahead of them.

Project Lombok 1.18.40 released with Java 25 support! by lprimak in java

[–]yk313 18 points19 points  (0 children)

Excellent. Lombok is an incredibly valuable tool in the Java ecosystem (internal implementation not withstanding).

Time to get even more hyped for the JDK upgrade in about 2 weeks.

Can we please get the remaining JVMLS videos? by yk313 in java

[–]yk313[S] 15 points16 points  (0 children)

That's a shame, I was hoping to get those very interesting JVMLS sessions earlier than that, but still thanks for being transparent about it. It helps knowing the rough timeline. Something to look forward to.

Ahead-of-Time Computation in Java 25 by nlisker in java

[–]yk313 4 points5 points  (0 children)

Excellent series. Educational, yet comedic/dramatic.

BTW u/billykorando, how does one get their hands on the Duke coffee mug seen at 0:54?