@Test(expected = IllegalStateException.class) public void testCleanCurrentEntryInLocalError() { final String contextName = "abc"; try { ContextUtil.enter(contextName); Context curContext = ContextUtil.getContext(); AsyncEntry entry = new AsyncEntry(new StringResourceWrapper("testCleanCurrentEntryInLocal", EntryType.OUT), null, curContext); entry.cleanCurrentEntryInLocal(); entry.cleanCurrentEntryInLocal(); } finally { ContextTestUtil.cleanUpContext(); } }
void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } }
AsyncEntry extends CtEntry { void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } } }
AsyncEntry extends CtEntry { void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } } AsyncEntry(ResourceWrapper resourceWrapper, ProcessorSlot<Object> chain, Context context); }
AsyncEntry extends CtEntry { void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } } AsyncEntry(ResourceWrapper resourceWrapper, ProcessorSlot<Object> chain, Context context); Context getAsyncContext(); }
AsyncEntry extends CtEntry { void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } } AsyncEntry(ResourceWrapper resourceWrapper, ProcessorSlot<Object> chain, Context context); Context getAsyncContext();  }