fix trace command may not print result problem. #1817

oneagent
hengyunabc 4 years ago
parent 00faa3c4c9
commit e6f5b5971d

@ -81,8 +81,11 @@ public class AbstractTraceAdviceListener extends AdviceListenerAdapter {
private void finishing(ClassLoader loader, Advice advice) {
// 本次调用的耗时
TraceEntity traceEntity = threadLocalTraceEntity(loader);
double cost = threadLocalWatch.costInMillis();
if (--traceEntity.deep == 0) {
if (traceEntity.deep >= 1) { // #1817 防止deep为负数
traceEntity.deep--;
}
if (traceEntity.deep == 0) {
double cost = threadLocalWatch.costInMillis();
try {
boolean conditionResult = isConditionMet(command.getConditionExpress(), advice, cost);
if (this.isVerbose()) {

@ -18,14 +18,6 @@ public class TraceEntity {
this.deep = 0;
}
public int getDeep() {
return deep;
}
public void setDeep(int deep) {
this.deep = deep;
}
private TraceTree createTraceTree(ClassLoader loader) {
return new TraceTree(ThreadUtil.getThreadNode(loader, Thread.currentThread()));
}

Loading…
Cancel
Save