-
Bug
-
Resolution: Unresolved
-
P3
-
22
The specification mentions - https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/net/InetAddress.html#ofLiteral(java.lang.String)
Returns:
an InetAddress object with no hostname set, and constructed from the provided IP address literal.
As I read from the spec the returned InetAddress shall not be associated with any hostname?
Actual behavior - returns the hostName.
===
Inet4Address inet4Address = Inet4Address.ofLiteral("1.2.3.4");
System.out.println(inet4Address.getHostName());
===
It's not that clear what is ' no hostname set'.
Returns:
an InetAddress object with no hostname set, and constructed from the provided IP address literal.
As I read from the spec the returned InetAddress shall not be associated with any hostname?
Actual behavior - returns the hostName.
===
Inet4Address inet4Address = Inet4Address.ofLiteral("1.2.3.4");
System.out.println(inet4Address.getHostName());
===
It's not that clear what is ' no hostname set'.