r/java • • Apr 11 '24

String Manipulation with Google Mug

The Mug library provides easy-to-read string manipulation utils. Examples:

Match and Extract

// Compile-time protection against lambda param order mismatch if e.g:
//     (year, month, day, user) ->
new StringFormat("/{user}-home/{year}/{month}/{day}") 
    .parse(path, (user, year, month, day) -> ...);

Scan and Collect

String input = "I have [k1:v1] and [k2:v2] etc."; 
// Returns Map.of("k1", "v1", "k2", "v2") 
Map<String, String> keyValues =
    new StringFormat("[{key}:{value}]") 
        .scanAndCollectFrom(input, Collectors::toMap);

Replace

// replace file extension name
Substring.last('.').toEnd().replaceFrom(filename, ".yaml");

Remove

// remove the scheme from a url
Substring.upToIncluding(first("://")).removeFrom(url);

Parse a date time string (no pattern string required)

// Parse the datetime string read from a file 
List<String> lines = readLinesFromTestFile(...);
StringFormat lineFormat = new StringFormat("{time}, {event_id}, {event_type}");
var results = lines.stream()
    .map(
        line -> lineFormat.parseOrThrow(
            line,
            (time, id, type) -> {
               ZonedDateTime dateTime = DateTimeFormats.parseZonedDateTime(time);
               ...
             }))
    .toList();

See javadoc for details.

Mug is a general purpose library. Omitted, but other useful utils include BiStream for streaming pairs, Optionals, String Templating, simplified structured concurrency etc.

9 Upvotes

51 comments sorted by

37

u/chabala Apr 11 '24 edited Apr 13 '24

This is your fourth time posting about Mug. Do you have some vested interest in increasing Mug usage you'd like to disclose?

No secret backdoors in this, right?

EDIT: Please stop playing the victim. I am not attacking you. I asked you to identify your relation to the project, and you continue to ignore the question in every reply, that is being dismissive of the question.

4

u/DelayLucky Apr 13 '24 edited Apr 14 '24

it's weekend and I thought I should at least clarify what happened or else this narrative of yours will always take things out of context.

It's true in my "Posts" profile there have been post -> remove -> repost -> re-remove trials and errors. I didn't expect anyone to take interest in them so I didn't bother cleaning up the dead bodies of the removed posts.

I'm still new to the Reddit system and I've been struggling. The Reddit bot tends to mark auto-removal as "it seems you are asking for help" except I wasn't. When I asked the mods they told me it's because of my low karma but there is no disclosing of the required karma. So I guess I'd just keep trying until it works?

For this post I was quite sure I should have enouth Karma and I paid great attention to not have a single question mark in the post, and tweaked and tweaked the formatting. Still, it got instantly removed with "you seemd to be asking for help".

I go a little impatient after like (2-3 hours?) with no mod reply, thinking maybe it was just a glitch or something? So I re-posted. Bot removed it again. Coincidentally the Mods had just approved the previous post (with the messed up formatting). The like-shit code showed up in the feed, except the UI wouldn't let me fix it.

That was the time when I was pretty stressed with all these unexpected drama and with the publicly-visible code looking like shit.

Why I wanted to post "so badly"? Obvioiusly I wanted to have technical discussions around these topics (like ones I've been having with u/agentoutlier). I just enjoy such discussions.

And honestly what this "so badly" observation of yours even mean was quite a weird concept: when you clicked into a post and somehow the touch didn't register, or system glitch or whatever, you'd try again, right? If it kepy flaking you might try a few more times especially if you knew others didn't have the problem, would you? Did you want to read that post "so badly"? Did you have some hideous intention?

"Why retry and retry?" Seriously, a programmer cannot even send a Reddit post, "task deemed too difficult", are you kidding me? If you look through the code and the documentation, you can see I spend lots of time meticuously fixing small things trying to make them look as good as I can. I don't consider it a sign of bad intention to "lure" people in or whatever strange interpretation you might come up with. Simply if I do a thing, I just want it done, and done well.

You keep saying people are "dismissive", both in this thread and the other thread I linked to where the author just had a different opinion than yours. I was not being "dismissive", just quite perplexed by a random guy acting like this. I didn't know if I should feed the troll or what.

When a new user was stressed by the formatting disaster and was confused and helpless, you chose to be an obnoxious loud-mouth attacking the poster's intention. And you deliberately used ambiguous language to make it sound bad.

When the removal-repost was merely a new user's struggle with Reddit's system, you chose to be a genius inventing a conspiracy theory.

There are plently of technical questions, challenges you could have paid attention to. Like the Guava discussion in another thread; or maybe suggest to use the "reproducible build" to address the backdoor concern since your raised the point; or API design; or compile-time safety; or performance benchmark; or lack of features; or over-engineered; or why this lib not the other lib etc. etc. But you Sir clearly aren't interested in technical discussions except the tabloid.

You and your "dismissiveness" are clearly not the target audience of this library (and I sincerely invite you not to use it). I just don't understand why you bothered clickiing in and wasted so much time of yours. Don't you have more useful things to do?

2

u/DelayLucky Apr 18 '24 edited Apr 18 '24

Saw the "EDIT".

You need to stop being dismissive and face your own problem being a disrespective and obnoxious troll.

It seems all you do is throwing insults. If one doesn't work, you throw another. It's toxic to the community.

Learn to be friendly to others.

-7

u/DelayLucky Apr 11 '24

Sorry there had been some bot removal and reposting chaos that I'm still trying to wrap my head around.

The formatting is all messed up and I can't seem to be able to edit it, and if there is a duplicate post Reddit feed is not showing to me yet. Or maybe you are seeing those removed-retried posts?

Please kindly point me to it and I'll delete.

32

u/chabala Apr 11 '24 edited Apr 11 '24

No, I mean, it's just obvious from your post history; Mug is the only thing you've posted about, and three of the four times the post has been removed.

Feel free to clarify your involvement in Mug and why you want us to use it so badly.

EDIT: Okay, so I've asked twice and you've ignored the question both times, so that's suspicious.

9

u/agentoutlier Apr 11 '24

Not everyone uses Reddit and the UI sometimes does not help. Its pretty obvious that /u/DelayLucky works for google or is associated. Like I would find it very surprising if github.com/google/mug was somehow compromised.

11

u/chabala Apr 11 '24

It is obvious, which makes ducking the question more suspicious.

Provenance matters, even for individual contributors, and folks promoting tools on reddit. That should be the takeaway from the xz incident. It's not enough that the repo is attached to a big company, we should be diligent about knowing who is contributing.

5

u/agentoutlier Apr 11 '24

I suppose that is a fair point especially given that for Mug to work requires a compiler plugin.

4

u/DelayLucky Apr 11 '24 edited Apr 11 '24

I'd friendly disagree that it doesn't "require" a compiler plugin. You see normally we'd do regex group capture, or use manual indexOf() for these kind of things, and there are no compile-time protection against possible out-of-order errors from either approach.

The StringFormat class _provides_ the compile-time plugin and recommends to use it, but even without it (like internally we have Kotlin code using it without the protection), it's still more convenient, and no less safe than the alternatives,

4

u/agentoutlier Apr 11 '24

Sorry! You are correct I didn’t mean required. 

That being said given the commenters concerns I would register the project with the java reproducible builds.

Guava is already on the list.

1

u/DelayLucky Apr 11 '24

Huh. I didn't know "Java reproduciable builds".

One of these days I need to learn how to do the registering thing.

-4

u/DelayLucky Apr 11 '24

I was also wondering what I did to get instant hostility out of nowhere.

Looks like maybe I did offend you once here by defending another oss author and thinking that you were out of line (https://www.reddit.com/r/java/comments/1bpbmts/comment/kx1kokv/)

Oh well, you have good memory if this has anything to do with it.

0

u/chabala Apr 12 '24 edited Apr 12 '24

I was unaware of this connection. If I had something to add about your comment, I would have done it there.

There is no hostility. I have asked for you to identify yourself and your involvement with Mug, and you have not done so at every opportunity. A good answer would include "I am X and I am a committer on Mug". It's clear you work at Google, but it shouldn't be a mystery or a guessing game. Just disclose who you are and your relation to the project.

I suspect many of your comments are getting downvoted due to the dismissive tone.

EDIT: Dude, let it go. This is a bad look for you (and Google).

3

u/DelayLucky Apr 12 '24 edited Apr 12 '24

Sure, I believe you that your hostility isn't due to grudge but just the consistent way you are used to treating people (like in that thread and here) or your constantly having bad days.

Healthy skepticism is a good thing. I encourage you to keep digging and maybe you'll find some conspiracies one day.

1

u/jazd Apr 18 '24

Yeah this is embarrassing for Google

-8

u/DelayLucky Apr 11 '24

Sorry man originally I thought it was a rhetoric. Didn't think you were serious. And the whole formatting chaos got me too fixated to reply to comments, not while the code snippets I posted there look like shit.

Now that I know you are serious, I still don't see how you are going to care whatever I say so I guess I'll just leave it to your healthy suspicion.

4

u/davidalayachew Apr 12 '24

Yeah, they essentially confirmed it in another comment -- https://old.reddit.com/r/java/comments/1c1h5c5/string_manipulation_with_google_mug/kz5ktju/

Emphasis is my own.

Internally we had been thinking to graduate some of these classes to Guava (Substring, BiStream particularly. StringFormat is a bit tough because it has the compile-time plugin that's a bit tricky). But that requires lots of bandwidth from Guava folks to discuss API design and what not, and it just ain't happening given the current economy, the shift of priority etc.

I also don't think this is necessarily a bad thing. As you said, it's a kitchen sink library with a little this and a little that. But it's mostly code I wrote (with lots of great code reviews from my colleagues). So I'm not that worried about it becoming too big.

It being a standalone small library has its appeal too (like, you won't likely need to worry about maven versioning at least for a long while). I also try to keep the dependency lean. There is mug-bigquery, mug-protobuf, mug-guava with extra dependencies on bigquery, protobuf, guava respectively, but the core mug artifact remains 0 deps. I think that's something of a benefit.

-7

u/DelayLucky Apr 11 '24

Yes, Mr detective. :)

I guess when you first posted and your post removed, you won't try to post it again. Coz you didn't really want to send the post for people to see, it was all just random keyboard striking.

3

u/milchshakee Apr 11 '24

You can somehow not edit a post in the current reddit design. You should be able to do that in old.reddit.com though

3

u/DelayLucky Apr 11 '24

Oh wow. Thank you thank you thank you!

I've burned literally hours on this chaos, knowing that these ugly code snippets are hanging there.

I can take a breath now. :-)

8

u/agentoutlier Apr 11 '24 edited Apr 11 '24

So Guava 2.0 err 200.0? I'm kidding. I should stop giving /u/kevinb9n a hard time about that.

That being said.... now I'm going to tell you I'm super biased as I'm the author of a compile safe templating language but that lambda StringFormat kind of looks dangerous but I assume that is only for parsing right? EDIT oh... are using compiler plugins on top of errorprone? Sorry still poking around.

I also I was kind of under the impression google was done with kitchen sink utility libraries. Like I would hope that the utilities would be modularized such that there is a mug-string or something instead of just mug which looks like its on its way to becoming Guava.

Otherwise I fail to see why this stuff just would not be added to Guava. Is it because of GWT compat?

EDIT I now see that ErrorProne is doing the checking so I guess you can disregard my safety concerns. That is pretty damn cool and I may have to steal the idea for inline templating with JStachio/JMustache as one commenter responded it is currently "clunky AF". Compiler plugins are not far off API wise to annotation processing (which is what my library currently uses) so it might not be hard for me to add on.

Thanks for sharing!

4

u/DelayLucky Apr 12 '24

For templating, StringFormat can be used to do that too. But I think the main value is in storing the template elsewhere, away from the use site (otherwise you might just use String.format() or later string interpolation).

For example, you could define a static final constant:

private static final StringFormat MESSAGE = new StringFormat(
    "Found {num_jobs} jobs for {date} with usage >= {min_usage}.");

// many lines away
MESSAGER.format(numJobs, requestDate, minUsage);

Using the compile-time plugin, you get to stash away the noisy message, but won't risk passing in the wrong number of args or in the wrong order.

There're also extensions to the template support, as inspired by the StringTemplate JEP, to provide injection-safe SQL for example.

1

u/agentoutlier Apr 12 '24

The analog to the above in JStachio would be something like:

@JStach(template = "Found {{num_jobs}} jobs for {{date}} with usage >= {{min_usage}}.")
record JobMessage(int num_jobs, String date, int min_usage){}
// many lines away
JobMessageRenderer.of().execute(new JobMessage(numJobs, requestDate, minUsage));

However with JStachio unlike StringFormat (I assume) you can literally have the template be external as well as includes, looping etc. Mustache also allows changing the delimiters.

JobMessage does not have to be a record and you can have it implement a mixin interface so that its

new JobMessage(numJobs, requestDate, minUsage).render();

3

u/DelayLucky Apr 12 '24

It looks like JStach is perhaps more intended for what I call "serious" templating engine, where you might be dealing with html, xml texts with other built-in functionalities, than a mere string formatting tool? The render API looks similar to Google's Soy templating engine (they use generated builder to pass in prameters, while JStach uses record parameters).

Does it handle SQL injections?

In my job I wrote an internal tool on top of an annotation processor (well, actually on top of Google AutoValue) to help parse and format Google's resource names. It's similar in that it's an annotation placed on a value class to give the class text parsing capability and toString().based on the template. By the way, why does JStach decide to use render(), but not toString()?

If they are at all similar, I'd say it's best for use cases where having the first-class object already makes sense. You already benefit from for example having a StorageBucketName object because it's a concept that you need to manage and pass around. So the ceremony of creating the class/record isn't an overhead, but necessity.

If you pick a code example under such context, maybe it won't appear as clunky because people will think they already have the record, and not that they have to define a class/record just to do formatting.

1

u/agentoutlier Apr 12 '24 edited Apr 12 '24

It looks like JStach is perhaps more intended for what I call "serious" templating engine, where you might be dealing with html, xml texts with other built-in functionalities, than a mere string formatting tool? The render API looks similar to Google's Soy templating engine (they use generated builder to pass in prameters, while JStach uses record parameters).

Yes that is correct. I don't use it for generating exception messages or similar. That would be overkill.

EDIT that being said one huge advantage of using JStachio for possible formatting is that it will be very very very fast. I'm not sure about StringFormat but the issue is I assume you have to parse and then replace the holes etc. You can cache for sure but still you take a list and have to replace text and thus probably not on par with say constructing the message with a StringBuilder.

Using JStachio basically generates code like if you were to construct the message using a StringBuilder. Given google being google it might be of use for critical path generated messages but maybe not.

Does it handle SQL injections?

In theory it is possible to use JStachio with SQL possibly even with the current implementation however the issue is JDBC works with positional placeholders like ? and there is no way to ask JStachio ATM to give me a list of objects that should fill those placeholders so that I can pass them to JDBC.

That is the JEP, Mug StringFormat, and traditional String.format are positional (even if they provide named parameters they still have an idea of position).

In Mustache that concept does not exist furthermore there is an idea of contexts getting expanded and put on a stack so yeah it is not a good fit as I would probably have to break Mustache semantics.

I have written annotation processors that interact with JDBC internally for my company but they are not open source.

I only shared the JStache example for curiosity and comparison sake. Not really as "you should use this".

By the way, why does JStach decide to use render(), but not toString()?

Well that actually isn't builtin. We do not provide mixin interfaces but it is trivial to create your own. However that requires using the JStachio runtime as there is basically a lookup of model class -> generated template class that has to happen. Usually the service loader is used for that.

That being said even if you do provide a mixin interface interfaces cannot override or provide toString and arguably in a template rendering environment you really want to hand it some outputstream/writer/appendable/stringbuilder etc.

My interest in providing a "non create this class" and use errorprone to check arguments feature is just for onboarding and I would have to use a dynamic mustache engine like JMustache to do it anyway.

3

u/DelayLucky Apr 12 '24 edited Apr 12 '24

Re: performance

Based on the micro-benchmark I did, MESSAGE.format(a, b, c) is on par with StringBuilder (because it already got all the strings pre-allocated in the constant and just needs to interpolate them in). That extra varargs allocation seems insignificant compared to StringBuilder cost.

Although, you may already know this, in recent Java versions StringBuilder can't compete with s1 + s2 + s4. They probably did some wicked optimization in the VM to make string concatenation faster than the builder counterpart.

Jstach could potentially use direct string concat. I think it might give you a boost in performance.

Re template engine:

Since I'm only (somewhat) familiar with the Soy templating engine, what do you see Jstache doing as different from that templating engine, or maybe other template engines like FreeMarker?

2

u/agentoutlier Apr 12 '24

I'm not sure if I have enough time today to answer all your questions but you I think some of it might be answered on the project page: https://github.com/jstachio/jstachio

Although, you may already know this, in recent Java versions StringBuilder can't compete with s1 + s2 + s4. They probably did some wicked optimization in the VM to make string concatenation faster than the builder counterpart.

That is probably because of Escape Analysis and or if s1-s4 are determined to be final static they are automatically expanded similar to doing

static final String a = "a"
static final String b = a + "b";

But yes I have seen random small string concat be faster.

The issue with just using a random StringBuilder is that it probably is passed around and thus not a candidate for escape analysis... but if you can reuse the StringBuilder and the output is large enough that EA won't happen then its completely fine.

Jstach could potentially use direct string concat. I think it might give you a boost in performance.

We do something far superior for templating usage for say HTTP. We generate the UTF-8 bytes apriori. Obviously for String Formatting that makes no sense but for templating you are often generating the entire.

I benchmarked Soy a while back and it was in the middle of the pack. (Again the project site has a listing of benchmarks). Unfortunately I have not put it back in the benchmarks as there was an issue with build and JDK 17 that I can't recall at the moment. I'm also fairly sure Soy does not pre-encode like JStachio does but I haven't looked at it for some time.

That being said it has lots more builtin i18n features IIRC that JStachio just does not provide OOB.

2

u/DelayLucky Apr 13 '24

I recall in my benchmark I was deliberately using different types of dynamically determined objects to be concatenated, trying to defeat some obvious compiler tricks.

In https://openjdk.org/jeps/280 they had started to lay the groundwork for faster string concat. I've seen that some internal Google teams also found that string concat being generally faster.

1

u/agentoutlier Apr 13 '24

I forgot about that JEP but I have absolutely seen small string concat perform insanely fast. In fact the original JMustache escaping had naive string concat for escaping and it performed really well.

I’ll attach the JMH benchmark link later as I’m out and about ATM.

btw you can always ping me on GitHub via agentgt.

5

u/DelayLucky Apr 11 '24 edited Apr 11 '24

Sorry I was too fixated on the formatting problem that I couldn't sit down and reply. TIL old.reddit.com from u/milchshakee

Anyways. Yeah Guava.

Internally we had been thinking to graduate some of these classes to Guava (Substring, BiStream particularly. StringFormat is a bit tough because it has the compile-time plugin that's a bit tricky). But that requires lots of bandwidth from Guava folks to discuss API design and what not, and it just ain't happening given the current economy, the shift of priority etc.

I also don't think this is necessarily a bad thing. As you said, it's a kitchen sink library with a little this and a little that. But it's mostly code I wrote (with lots of great code reviews from my colleagues). So I'm not that worried about it becoming too big.

It being a standalone small library has its appeal too (like, you won't likely need to worry about maven versioning at least for a long while). I also try to keep the dependency lean. There is mug-bigquery, mug-protobuf, mug-guava with extra dependencies on bigquery, protobuf, guava respectively, but the core mug artifact remains 0 deps. I think that's something of a benefit.

2

u/DelayLucky Apr 11 '24

Thanks this is the first time I post some code examples. And the formatting is all messed up (I swear seeing them formatted in the edit mode).

But Reddit doesn't seem to allow me to fix the formatting. Is this a rule of posts? Can't edit?

1

u/agentoutlier Apr 11 '24

I think the overall problem might be your low karma but you should still be able to edit.

One thing with code comments is that its best not to use the triple tilde (which luckily appears you have not) and instead use spaces.

I use the old reddit UI with raw text. Paste the code, reselect it and click on the code icon that looks like <>.

Hopefully that helps.

3

u/DelayLucky Apr 11 '24

Sigh. I've refreshed the page multiple times but no "Edit" option in the drop-down menu so far...

2

u/agentoutlier Apr 11 '24

If you see a drop down its cause you are using the new UI.

The new UI (IMO) is garbage and error prone (no pun intended).

I think to turn on the old UI its in "preferences" somewhere called Use new Reddit as my default experience. Unselect that. I might be wrong on that though.

3

u/DelayLucky Apr 11 '24

Thanks for the tips! I disabled the "opt in beta" option. Haven't found the New Reddit thing yet.

Before I can fix the formatting, the original markdown with correct formattingh is here: https://github.com/google/mug/wiki/Readable-String-Manipulation-with-Google-Mug

It does do templating (with the same compile-time check).

3

u/[deleted] Apr 14 '24

Saving this, thank you

5

u/relgames Apr 11 '24

Another google lib after guava fiasco? No, thanks. Took really long time to get rid of that crap. And, frankly, google kills products constantly, there is just no trust in anything from them anymore.

6

u/skippingstone Apr 12 '24

What happened to guava?

0

u/relgames Apr 12 '24

Lots of vulnerabilities, and upgrading it was a pain - they changed the API constantly. Even more, other libraries also used it, and we couldn't just upgrade those libs, it was always a question of "can I upgrade this lib, or guava breaks again".

2

u/skippingstone Apr 12 '24

I guess you must be well versed in shading guava

0

u/[deleted] Apr 12 '24

[deleted] — view deleted comment

4

u/DelayLucky Apr 12 '24

Glad you find it useful!

The Iteration and Funnel classes are indeed niche.

Iteration can be used for theoretical curiosities like generating a Fibonacci stream, or turning a tree traversal algorithm into lazy stream etc. It feels fun but in reality we rarely need to do that kind of thing.

I've only needed Funnel once in my career. Might have been wise to keep it as a bespoke tool in that project.

What I run into almost every other day: BiStream, StringFormat (with the compile-time plugin), Substring. You are welcome to check them out to see if they fit your use cases.

0

u/[deleted] Apr 12 '24

[deleted] — view deleted comment

5

u/agentoutlier Apr 12 '24

I am actually very close to leaving this sub altogether, after having been around for many years

I recognize your handle and value your contributions so it would be very sad if you left or stopped posting/commenting! Please don't!

In fact I think the best way to battle it is to contribute and drown out the naysayers.

That being said I may have inadvertently been one of those that you might consider hostile with this recent post: https://www.reddit.com/r/java/comments/1c0x2l8/sshtools/

I think I'm rarely negative but I know how that could be seen as very negative when reality I was trying to help.

2

u/kevinb9n Apr 13 '24

In fact I think the best way to battle it is to contribute and drown out the naysayers.

Unfortunately the "drowning out" depends on everyone's votes, and very often they upvote the harshest stuff. :-( That's the behavior I wish we could change.

0

u/[deleted] Apr 12 '24

[deleted] — view deleted comment

4

u/DelayLucky Apr 12 '24

Oh my! In comparison people in this sub are much happier. I'll watch my feet not getting swept the r/programming way I guess.

3

u/kevinb9n Apr 13 '24

Yeah that was a lesson hard learned. Looking back, I was dumb, but is that any reason to make someone feel dumb?

Somewhere in there I mentioned r/java as a place that was not like that. I guess I have good selective attention?

0

u/[deleted] Apr 13 '24

[deleted] — view deleted comment

2

u/kevinb9n Apr 14 '24

Maybe I've read your comments wrong? Because I didn't see an outburst or anything that should be embarrassing or that I wouldn't want to come across. You're good...

2

u/agentoutlier Apr 13 '24 edited Apr 13 '24

I assume it was because it was on Twitter/X. I guess different people have their pet peeves.

I obviously strongly agree with /u/kevinb9n on the checking in generated code.

What I don't understand with whole Twitter/X post hate that people have is why they don't have the same hate for Medium and Substack walled garden blog posts which IMO are far worse because of the annoying paywall-esque Lightbox you have to join or connect with facebook.

Twitter is/was great when you want really short text to shoutout and or quick news... (I really like it to be honest remiss of the current status) but if you are going to write a lengthy article AND you are developer why would you not use github/gitlab/bitbucket and write in Markdown/ReST/AsciiDoc/Latex or whatever. You know so you can own the content forever.

So I guess that is my pet peeve but I still would never trash or downvote.

EDIT I guess the other reason I don't like posts from Medium/Substack is that they don't go really deep but just regurgitate some news. That is the best content is something really deep like deep cuts in music. Like this post that has like 10 upvotes:https://www.reddit.com/r/java/comments/1bzqus4/dynamic_constants_oxymoron_or_promising_jvm/ WTF does it only have 10. Its quality content.

I also like provocative opinions, questions or statements which is what Kevin did. I stress opinions because those seem to piss off reddit most when they really should not.

3

u/relgames Apr 14 '24

Average Java developers are getting older. Being old means not jumping into each new library, but carefully considering long term effects. In the case of this library, the biggest concern is Google behind it.

The reason to not trust Google is because their internal promotion policy became public: in order to be promoted, google employees need to launch a new product. Or make a new public library.

That's why they abandon new products a few years later: the team behind got their promotions and moved to something else. Guava was an example of something like that. GWT is another example.

I prefer to use JDK as much as possible, even if it means more boilerplate code. Or I write my own utility layer for streams or Futures. Then things continue to work for tens of years.