Open j-baker opened 5 years ago
This is also mentioned by Pkoenig as a final comment on this: https://github.com/palantir/gradle-baseline/pull/680
Is there any intention here to relax the rule for things that return cheap constants (empty maps, sets, etc)?
At present, no method calls are really allowed in Optional.orElse.
This means that code like
will get refactored to
Code like:
will get refactored to
and
will get refactored to
automatically.
Basically, we ended up with a repo that gets much less readable. I get that we're here blocking the strategy of
optional.orElse(doExpensiveThing())
but there's always a tradeoff - and I think here we're making a lot of cases harder to read or less efficient - I think the automated migration burden should be higher.