public CpsThreadDump getThreadDump() { return CpsThreadDump.from(this); }
throw new AssertionError(); // since we are checking programPromise.isDone() upfront } catch (ExecutionException e) { return CpsThreadDump.from(new Exception("Failed to resurrect program state",e));
/** * A mock thread dump that merely displays some fixed text. * @param text possibly multiline string */ @SuppressWarnings("serial") public static @Nonnull CpsThreadDump fromText(@Nonnull final String text) { return CpsThreadDump.from(new Throwable() { @Override public String toString() { return text; } @Override public Throwable fillInStackTrace() { return this; // irrelevant } }); }