RFR: CSR JDK-8203630 Add instance method equivalents for String::format
forax at univ-mlv.fr
Wed May 23 21:07:34 UTC 2018
Please, don't call it format too !
Trying to do a :: on a class with instance methods and static methods with the same doesn't work well, and format() being a varargs will not help.
I see several reasons to not introduce this method whatever its name (interpolate ?),
- String.format is very slow (compared to the String concatenation), providing several new slow methods doesn't seem to go to the right direction
- the problem can be solved easily by writing a the javadoc sentence saying that one can use a static import, or write an article about String.format(), or better talk with Eclipse/Jetbrains, so they will add a quickfix to do the static import automatically like with assert* in tests.
- at some point in the future, we may want to add a way to interpolate strings in Java, the runtime support, StringConcatFactory, is already in the JDK.
----- Mail original -----
> De: "Jim Laskey" <james.laskey at oracle.com>
> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> Envoyé: Mercredi 23 Mai 2018 16:28:29
> Objet: RFR: CSR JDK-8203630 Add instance method equivalents for String::format
> csr: https://bugs.openjdk.java.net/browse/JDK-8203630
More information about the core-libs-dev