RFR 8199437 [11]Improve diagnostic system assertion message in com.sun.net.httpserver impl
Chris Hegarty
chris.hegarty at oracle.com
Wed Mar 14 13:16:30 UTC 2018
An odd assertion has been observed in the com.sun.net
HTTP Server code, that is currently unexplainable. I'd
like to add some additional diagnostics information to
the assertion so that it may be more helpful if seen
again.
--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java
@@ -408,7 +408,9 @@
}
handle (chan, conn);
} else {
- assert false;
+ assert false :
String.format("Unexpected non-readable key, where "
+ + " key's channel:%s,
isValid:%b, interestOps:%d, readyOps:%d",
+ key.channel(), key.isValid(),
key.interestOps(), key.readyOps());
}
} catch (CancelledKeyException e) {
handleException(key, null);
-Chris.
More information about the net-dev
mailing list