(Hashtable<Integer, Boolean> touchedNodes)
| 32 | |
| 33 | /* Check for a cycle by doing a depth-first-search. */ |
| 34 | public boolean hasCycle(Hashtable<Integer, Boolean> touchedNodes) { |
| 35 | VisitState[] visited = new VisitState[maxLocks]; |
| 36 | for (int i = 0; i < maxLocks; i++) { |
| 37 | visited[i] = VisitState.FRESH; |
| 38 | } |
| 39 | return hasCycle(visited, touchedNodes); |
| 40 | } |
| 41 | |
| 42 | private boolean hasCycle(VisitState[] visited, Hashtable<Integer, Boolean> touchedNodes) { |
| 43 | if (touchedNodes.containsKey(lockId)) { |