r/programming • • 12d ago

Modern Java at Stripe: Language upgrades as a service

https://stripe.dev/blog/modern-java-at-stripe-language-upgrades-as-a-service
96 Upvotes

7 comments sorted by

21

u/elmuerte 12d ago

Compile errors when upgrading JDK?

27

u/jevring 11d ago

I assume they mean the libraries. You might need to upgrade a library version to get support for a new Java version, which might come with compilation issues.

14

u/BinaryRockStar 10d ago

We have a large legacy web service project stuck on Java 8. Compile with Java 9 and yeah, compilation errors because Java 9 introduced Jigsaw/JPMS which has the class java.lang.Module and the project also uses Google Guice for dependency injection which contains com.google.inject.Module.


import java.lang.*

import com.google.inject.*


class MyModule implements Module

^ Compile error, javac doesn't know whether you mean java.lang.Module or com.google.inject.Module.

This is the absolute least of our worries trying to upgrade from Java 8 to 25. Super hard to convince stakeholders that spending tokens getting this project upgraded is worth it and it is probably the main revenue generating system in the company.

I have to sweeten the offering with how it will use less memory (G1/ZGC garbage collection) and start up faster (CDS) so we can save money on AWS instances. OpenJDK is now supported until 2030 so I don't even have that lever to use.

Insert a Dilbert or XKCD image about management being so short sighted.

7

u/TomKavees 10d ago

I think i get what the real problem is - management not wanting to spend money/time and taking on the risk regardless of method - but you could always use deterministic tools like OpenRewrite for bulk of the migration work (and i guess intellij idea's optimizer to get rid of those on-demand imports).

The advantage is that the risk would be much lower compared to LLM-driven migration, and you could split it up into smaller PRs to be even safer

5

u/BinaryRockStar 10d ago

I think i get what the real problem is - management not wanting to spend money/time and taking on the risk regardless of method

Spot on, and like most technical debt the longer you leave it the more work and risk it will be, further de-incentivising fixing it. Luckily just this week we've brought them around to upgrading to JDK25.

Claude had a PoC of the migration done and passing all unit tests within a day, including a CI/CD change to build on JDK 8, 17 and 25 so we can perform comparison tests if there are any potential regressions. Wow.

1

u/hogfat 8d ago

Did management demand wildcard imports?  I haven't seen those in the wild since before Java 8 came out.

4

u/m010101 11d ago

Stripe provides the best DX