(Object x)
| 260 | |
| 261 | // Reports whether x is already present on the visitation stack, pushing it if not. |
| 262 | private boolean push(Object x) { |
| 263 | // cyclic? |
| 264 | for (int i = 0; i < depth; i++) { |
| 265 | if (x == stack[i]) { |
| 266 | return false; |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | if (stack == null) { |
| 271 | this.stack = new Object[4]; |
| 272 | } else if (depth == stack.length) { |
| 273 | this.stack = Arrays.copyOf(stack, 2 * stack.length); |
| 274 | } |
| 275 | this.stack[depth++] = x; |
| 276 | return true; |
| 277 | } |
| 278 | |
| 279 | private void pop() { |
| 280 | this.stack[--depth] = null; |
no test coverage detected