@@ -155,7 +155,7 @@ private Spy.Ret handleEvent(final int listenerId,
155
155
156
156
// 如果是在BEFORE中立即返回,则后续不会再有RETURN事件产生
157
157
// 这里需要主动对齐堆栈
158
- if (event .type == Event .Type .BEFORE ) {
158
+ if (event .type == Event .Type .BEFORE ) {
159
159
process .popInvokeId ();
160
160
}
161
161
@@ -181,7 +181,7 @@ private Spy.Ret handleEvent(final int listenerId,
181
181
182
182
// 如果是在BEFORE中立即抛出,则后续不会再有THROWS事件产生
183
183
// 这里需要主动对齐堆栈
184
- if (event .type == Event .Type .BEFORE ) {
184
+ if (event .type == Event .Type .BEFORE ) {
185
185
process .popInvokeId ();
186
186
}
187
187
@@ -246,17 +246,24 @@ private void compensateProcessControlEvent(ProcessControlException pce, EventPro
246
246
final InvokeEvent iEvent = (InvokeEvent ) event ;
247
247
final Event compensateEvent ;
248
248
249
+ // 补偿立即返回事件
249
250
if (pce .getState () == ProcessControlException .State .RETURN_IMMEDIATELY
250
251
&& contains (processor .eventTypes , IMMEDIATELY_RETURN )) {
251
252
compensateEvent = process
252
253
.getEventFactory ()
253
254
.makeImmediatelyReturnEvent (iEvent .processId , iEvent .invokeId , pce .getRespond ());
254
- } else if (pce .getState () == ProcessControlException .State .THROWS_IMMEDIATELY
255
+ }
256
+
257
+ // 补偿立即抛出事件
258
+ else if (pce .getState () == ProcessControlException .State .THROWS_IMMEDIATELY
255
259
&& contains (processor .eventTypes , IMMEDIATELY_THROWS )) {
256
260
compensateEvent = process
257
261
.getEventFactory ()
258
262
.makeImmediatelyThrowsEvent (iEvent .processId , iEvent .invokeId , (Throwable ) pce .getRespond ());
259
- } else {
263
+ }
264
+
265
+ // 异常情况不补偿
266
+ else {
260
267
return ;
261
268
}
262
269
0 commit comments