@Override public String toString() { StringBuilder builder = new StringBuilder().append(super.toString()).append("[status="); if (isCancelled()) { builder.append("CANCELLED"); } else if (isDone()) { addDoneString(builder); } else { String pendingDescription; try { pendingDescription = pendingToString(); } catch (RuntimeException e) { // Don't call getMessage or toString() on the exception, in case the exception thrown by the // subclass is implemented with bugs similar to the subclass. pendingDescription = "Exception thrown from implementation: " + e.getClass(); } // The future may complete during or before the call to getPendingToString, so we use null // as a signal that we should try checking if the future is done again. if (pendingDescription != null && !pendingDescription.isEmpty()) { builder.append("PENDING, info=[").append(pendingDescription).append("]"); } else if (isDone()) { addDoneString(builder); } else { builder.append("PENDING"); } } return builder.append("]").toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder().append(super.toString()).append("[status="); if (isCancelled()) { builder.append("CANCELLED"); } else if (isDone()) { addDoneString(builder); } else { String pendingDescription; try { pendingDescription = pendingToString(); } catch (RuntimeException e) { // Don't call getMessage or toString() on the exception, in case the exception thrown by the // subclass is implemented with bugs similar to the subclass. pendingDescription = "Exception thrown from implementation: " + e.getClass(); } // The future may complete during or before the call to getPendingToString, so we use null // as a signal that we should try checking if the future is done again. if (!isNullOrEmpty(pendingDescription)) { builder.append("PENDING, info=[").append(pendingDescription).append("]"); } else if (isDone()) { addDoneString(builder); } else { builder.append("PENDING"); } } return builder.append("]").toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder().append(super.toString()).append("[status="); if (isCancelled()) { builder.append("CANCELLED"); } else if (isDone()) { addDoneString(builder); } else { String pendingDescription; try { pendingDescription = pendingToString(); } catch (RuntimeException e) { // Don't call getMessage or toString() on the exception, in case the exception thrown by the // subclass is implemented with bugs similar to the subclass. pendingDescription = "Exception thrown from implementation: " + e.getClass(); } // The future may complete during or before the call to getPendingToString, so we use null // as a signal that we should try checking if the future is done again. if (!isNullOrEmpty(pendingDescription)) { builder.append("PENDING, info=[").append(pendingDescription).append("]"); } else if (isDone()) { addDoneString(builder); } else { builder.append("PENDING"); } } return builder.append("]").toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder().append(super.toString()).append("[status="); if (isCancelled()) { builder.append("CANCELLED"); } else if (isDone()) { addDoneString(builder); } else { String pendingDescription; try { pendingDescription = pendingToString(); } catch (RuntimeException e) { // Don't call getMessage or toString() on the exception, in case the exception thrown by the // subclass is implemented with bugs similar to the subclass. pendingDescription = "Exception thrown from implementation: " + e.getClass(); } // The future may complete during or before the call to getPendingToString, so we use null // as a signal that we should try checking if the future is done again. if (!isNullOrEmpty(pendingDescription)) { builder.append("PENDING, info=[").append(pendingDescription).append("]"); } else if (isDone()) { addDoneString(builder); } else { builder.append("PENDING"); } } return builder.append("]").toString(); }
@Override public String toString() { StringBuilder builder = new StringBuilder().append(super.toString()).append("[status="); if (isCancelled()) { builder.append("CANCELLED"); } else if (isDone()) { addDoneString(builder); } else { String pendingDescription; try { pendingDescription = pendingToString(); } catch (RuntimeException e) { // Don't call getMessage or toString() on the exception, in case the exception thrown by the // subclass is implemented with bugs similar to the subclass. pendingDescription = "Exception thrown from implementation: " + e.getClass(); } // The future may complete during or before the call to getPendingToString, so we use null // as a signal that we should try checking if the future is done again. if (!isNullOrEmpty(pendingDescription)) { builder.append("PENDING, info=[").append(pendingDescription).append("]"); } else if (isDone()) { addDoneString(builder); } else { builder.append("PENDING"); } } return builder.append("]").toString(); }