Decrements the depth. @return the new depth value.
()
| 57 | * @return the new depth value. |
| 58 | */ |
| 59 | private int decrementDepth() { |
| 60 | Integer oldDepth = executionDepth.get(); |
| 61 | if (oldDepth == null) { |
| 62 | oldDepth = 0; |
| 63 | } |
| 64 | int newDepth = oldDepth.intValue() - 1; |
| 65 | if (newDepth == 0) { |
| 66 | executionDepth.remove(); |
| 67 | } else { |
| 68 | executionDepth.set(newDepth); |
| 69 | } |
| 70 | return newDepth; |
| 71 | } |
| 72 | |
| 73 | public void execute(Runnable command) { |
| 74 | int depth = incrementDepth(); |