Name: jl125535 Date: 07/13/2004
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html#next(java.util.regex.Pattern)
A DESCRIPTION OF THE PROBLEM :
The documentation for Scanner.next (Pattern) reads, in part:
"Returns the next string in the input that matches the specified pattern...."
while that of Scanner.next (String) reads:
"Returns the next token if it matches the pattern constructed from the specified string. ...
An invocation of this method of the form next(pattern) behaves in exactly the
same way as the invocation next(Pattern.compile(pattern)). "
The first sentences of these method descriptions are contradictory, because the phrasing does not match exactly.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
For Scanner.next(Pattern):
"Returns the next token if it matches the specified pattern...."
[ to match the phrasing of Scanner.next(String) ]
ACTUAL -
See the detailed description.
(Incident Review ID: 285248)
======================================================================