-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P3
-
Affects Version/s: 22
-
Component/s: core-libs
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'.