@Override public String toString() { // We do a best effort to print the right toString() and that's it. try { boolean valid = _key != null && _key.isValid(); int keyInterests = valid ? _key.interestOps() : -1; int keyReadiness = valid ? _key.readyOps() : -1; return String.format("%s{io=%d/%d,kio=%d,kro=%d}", super.toString(), _currentInterestOps, _desiredInterestOps, keyInterests, keyReadiness); } catch (Throwable x) { return String.format("%s{io=%s,kio=-2,kro=-2}", super.toString(), _desiredInterestOps); } } }
@Override public String toString() { // Do NOT use synchronized (this) // because it's very easy to deadlock when debugging is enabled. // We do a best effort to print the right toString() and that's it. try { boolean valid = _key!=null && _key.isValid(); int keyInterests = valid ? _key.interestOps() : -1; int keyReadiness = valid ? _key.readyOps() : -1; return String.format("%s{io=%d,kio=%d,kro=%d}", super.toString(), _interestOps.get(), keyInterests, keyReadiness); } catch (CancelledKeyException x) { return String.format("%s{io=%s,kio=-2,kro=-2}", super.toString(), _interestOps.get()); } } }
@Override public String toString() { // Do NOT use synchronized (this) // because it's very easy to deadlock when debugging is enabled. // We do a best effort to print the right toString() and that's it. try { boolean valid = _key!=null && _key.isValid(); int keyInterests = valid ? _key.interestOps() : -1; int keyReadiness = valid ? _key.readyOps() : -1; return String.format("%s{io=%d,kio=%d,kro=%d}", super.toString(), _interestOps.get(), keyInterests, keyReadiness); } catch (CancelledKeyException x) { return String.format("%s{io=%s,kio=-2,kro=-2}", super.toString(), _interestOps.get()); } } }
@Override public String toString() { // Do NOT use synchronized (this) // because it's very easy to deadlock when debugging is enabled. // We do a best effort to print the right toString() and that's it. try { boolean valid = _key!=null && _key.isValid(); int keyInterests = valid ? _key.interestOps() : -1; int keyReadiness = valid ? _key.readyOps() : -1; return String.format("%s{io=%d,kio=%d,kro=%d}", super.toString(), _interestOps.get(), keyInterests, keyReadiness); } catch (CancelledKeyException x) { return String.format("%s{io=%s,kio=-2,kro=-2}", super.toString(), _interestOps.get()); } } }