Ashay Rane ce6af25243
Fix localhost check in ListeningConnector.startListening test
Prior to this patch, the test failed if the hostname returned by
`startListening()` didn't match either the string "localhost" or the IP
addresses associated with "localhost", but this is fragile.  On machines
where a reverse lookup on 127.0.0.1 returns a string other than
localhost, the test fails, like in the following example:

```
>_ jdb -connect com.sun.jdi.SocketListen:port=50000
Listening at address: kubernetes.docker.internal:50000
...

>_ make test TEST=.../startlis001/TestDescription.java
...
Test case #1: start listening the address kubernetes.docker.internal:49532
Expected addresses: localhost:null or 127.0.0.1:null or 0:0:0:0:0:0:0:1:null
...
```

As a workaround, this patch uses `InetAddress.isLoopbackAddress()` on
the hostname portion of the address that is being listened.

Validated this patch on machines where the reverse lookup resolves to
either "localhost" or a different string.
2026-07-01 14:49:46 -05:00
..
2026-06-29 06:48:27 +00:00
2026-06-29 06:48:27 +00:00
2026-06-29 06:48:27 +00:00