Skip to content

Commit

Permalink
Merge pull request #145 from jglick/StepContext-FlowNode
Browse files Browse the repository at this point in the history
A call to get(FlowNode) need not wait for the CpsThread
  • Loading branch information
jglick committed Jun 16, 2017
2 parents 780ef90 + cabca49 commit 9995a33
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ public CpsBodyInvoker newBodyInvoker() {

@Override
protected <T> T doGet(Class<T> key) throws IOException, InterruptedException {
if (FlowNode.class.isAssignableFrom(key)) {
return key.cast(getNode());
}

CpsThread t = getThreadSynchronously();
if (t == null) {
throw new IOException("cannot find current thread");
Expand All @@ -299,9 +303,6 @@ protected <T> T doGet(Class<T> key) throws IOException, InterruptedException {
T v = t.getContextVariable(key);
if (v!=null) return v;

if (FlowNode.class.isAssignableFrom(key)) {
return key.cast(getNode());
}
if (key == CpsThread.class) {
return key.cast(t);
}
Expand Down

0 comments on commit 9995a33

Please sign in to comment.