Summary
-------
The language of the original implementation does not include information about exceptions occurring in the supplied function.
Solution
--------
Include a clarifying paragraph: "Any exception thrown by f() will be propagated to the caller."
```
diff -r fcbc56748cbd src/java.base/share/classes/java/lang/String.java
--- a/src/java.base/share/classes/java/lang/String.java Mon Dec 10 13:02:32 2018 -0400
+++ b/src/java.base/share/classes/java/lang/String.java Mon Dec 10 14:52:09 2018 -0400
@@ -2985,6 +2985,9 @@
* This method allows the application of a function to {@code this}
* string. The function should expect a single String argument
* and produce an {@code R} result.
+ * <p>
+ * Any exception thrown by {@code f()} will be propagated to the
+ * caller.
*
* @param f functional interface to a apply
*
```
Specification
-------------
```
/**
* This method allows the application of a function to {@code this}
* string. The function should expect a single String argument
* and produce an {@code R} result.
* <p>
* Any exception thrown by {@code f()} will be propagated to the
* caller.
*
* @param f functional interface to a apply
*
* @param <R> class of the result
*
* @return the result of applying the function to this string
*
* @see java.util.function.Function
*
* @since 12
*/
public <R> R transform(Function<? super String, ? extends R> f) {
```