Open rjeeb opened 1 year ago
Predicate
and Optional*
are all merged.
String.format()
is likely not feasible - it requires parsing the format string at runtime, and handling the various possible patterns. That sort of code can't be optimized by the compiler without knowing ahead of time what all format strings will be.
https://github.com/gwtproject/gwt/blob/e981e97325e0bbf8b16b407143ac297d7f07be01/user/super/com/google/gwt/emul/java/lang/String.java#L71-L73
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html#syntax
In theory we could require that the format param will be a string literal and pre-compile the formats so that unused formatting code can be pruned. In practice, that sort of change likely wouldn't be accepted to j2cl, so we should consider carefully if we want to introduce that incompatibility.
Methods to support:
String:
lines()
isBlank()
chars()
format()
repeat()
codePoints()
stripTrailing()
stripLeading()
strip()
Predicate:
not()
OptionalDouble:
isEmpty()
OptionalDouble:
isEmpty()
OptionalLong:
isEmpty()