RFR: 8314481: JDWPTRANSPORT_ERROR_INTERNAL code in socketTransport.c can never be executed

Chris Plummer cjplummer at openjdk.org
Thu Aug 17 15:13:58 UTC 2023


[JDK-8250630](https://bugs.openjdk.org/browse/JDK-8250630) introduced the following change:


     if (listenAddr == NULL) {
+        // No address of preferred addres family found, grab the fist one.
+        listenAddr = &(addrInfo[0]);
+    }
+
+    if (listenAddr == NULL) {
         dbgsysFreeAddrInfo(addrInfo);
         RETURN_ERROR(JDWPTRANSPORT_ERROR_INTERNAL, "listen failed: wrong address");
     }


After this change it is no longer possible for the RETURN_ERROR block to ever be executed because listenAddr can not ever still be NULL. The entire block should be removed.

-------------

Commit messages:
 - Get rid of dead code

Changes: https://git.openjdk.org/jdk/pull/15330/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15330&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314481
  Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/15330.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15330/head:pull/15330

PR: https://git.openjdk.org/jdk/pull/15330


More information about the serviceability-dev mailing list