A DESCRIPTION OF THE PROBLEM :
The documentation of the URI identities is wrong. It applies to the JAVA 7 documentation as well (others not tested). The amount of parameters in the "in all cases" example doesn't match the constructor. User-info is a component of authority and is superfluous. If removed it matches the constructor again.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
in all cases,
new URI(u.getScheme(),
u.getAuthority(),
u.getPath(), u.getQuery(),
u.getFragment())
.equals(u)
ACTUAL -
in all cases,
new URI(u.getScheme(),
u.getUserInfo(), u.getAuthority(),
u.getPath(), u.getQuery(),
u.getFragment())
.equals(u)
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/net/URI.html
The documentation of the URI identities is wrong. It applies to the JAVA 7 documentation as well (others not tested). The amount of parameters in the "in all cases" example doesn't match the constructor. User-info is a component of authority and is superfluous. If removed it matches the constructor again.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
in all cases,
new URI(u.getScheme(),
u.getAuthority(),
u.getPath(), u.getQuery(),
u.getFragment())
.equals(u)
ACTUAL -
in all cases,
new URI(u.getScheme(),
u.getUserInfo(), u.getAuthority(),
u.getPath(), u.getQuery(),
u.getFragment())
.equals(u)
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/8/docs/api/java/net/URI.html
- duplicates
-
JDK-8059450 Not quite correct code sample in javadoc
-
- Resolved
-