Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/816#discussion_r141596090
--- Diff:
core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java ---
@@ -256,6 +246,17 @@ public synchronized void
initInternalFuture(ListenableFuture<T> result) {
if (submittedByTask==null) return null;
return submittedByTask.orNull();
}
+ @Override
+ public String getSubmittedByTaskId() {
+ if (submittedByTask==null || submittedByTask.isAbsent()) return
null;
--- End diff --
I'd instead change `setSubmittedByTask(Maybe<Task>)` to
`setSubmittedByTask(Maybe<Task>, String taskId)`, and store the `taskId` as a
field. That would feel much simpler, and would decreasing the coupling between
what extra things this code handles (i.e. the `MaybeSupplier` that implements
`Identifiable`) and the code that calls it.
---