-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
P4
-
None
-
Affects Version/s: None
-
Component/s: core-libs
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The documentation for https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#asPredicate
states
Creates a predicate which can be used to match a string.
Returns:
The predicate which can be used for matching on a string
but does NOT say which matching method will be invoked on the matcher: matches(), lookingAt(), or find()
Decompiling shows that it's find(), but the docs should state that explicitly, especially since the provided phrase "for matching on a string" is lexigraphically closest to matches(), which is not the method that is used.
The documentation for https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#asPredicate
states
Creates a predicate which can be used to match a string.
Returns:
The predicate which can be used for matching on a string
but does NOT say which matching method will be invoked on the matcher: matches(), lookingAt(), or find()
Decompiling shows that it's find(), but the docs should state that explicitly, especially since the provided phrase "for matching on a string" is lexigraphically closest to matches(), which is not the method that is used.
- duplicates
-
JDK-8164781 Pattern.asPredicate specification is incomplete
-
- Closed
-