#Java has evolved. Your code can too.

https://javaevolved.github.io/

java.evolved Code Snippets | java.evolved

A collection of modern Java code snippets. Every old Java pattern next to its clean, modern replacement โ€” side by side.

java.evolved

@frankel some good stuff in there. Would be cool if Java came with some similar tool like the new go fix: https://pkg.go.dev/cmd/fix

I find it a very modern approach for the language designers to consider the whole lifecycle of an application: "Hey we added a new feature, of course we help you to add it to your code base". Just like modern languages like rust and go already come with a package manager, formatter, linter etc.

fix command - cmd/fix - Go Packages

Fix is a tool executed by "go fix" to update Go programs that use old features of the language and library and rewrite them to use newer ones.

@campfireman The only tool I know of that plays the same role is #OpenRewrite https://docs.openrewrite.org/
OpenRewrite by Moderne | Large Scale Automated Refactoring | OpenRewrite Docs

Large-scale automated source code refactoring

@frankel Thanks for the tip, that looks very useful, much broader scope! Could have saved quite some time with the Java 8 -> 17 and SpringBoot 2 -> 3 tooling at my previous job
@frankel thanks.
Very good website that helps me to get rid of old habits
Like this
https://javaevolved.github.io/collections/collectors-teeing.html
Since Java 12 !
TWELVE...
Collectors.teeing() | java.evolved

Compute two aggregations in a single stream pass.

java.evolved

@ptl I notice that you aren't a faithful reader of my blog ๐Ÿ˜‰

https://blog.frankel.ch/teeing-java-api/

Teeing, a hidden gem in the Java API

Last week, I described a use-case for a custom Stream Collector. I received a intriguing comment on Twitter: There was a 'Not Found' error fetching URL: 'https://twitter.com/Miguucm/status/1389258245886390292' Hats off to you, Miguel! Your comment revealed a method I didnโ€™t know! So I decided to investigate what the teeing() method is about. Returns a Collector that is a composite of two downstream collectors.

A Java geek
@frankel
I am... See the little check box in feedly
But I missed that post !
@ptl ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚
No worries, Iโ€™m kidding. Happy you find my RSS feed useful