(Container cnt)
| 332 | /// |
| 333 | /// - `cnt`: The container to schedule for revalidation |
| 334 | void revalidateLater(Container cnt) { |
| 335 | if (!pendingRevalidateQueue.contains(cnt)) { |
| 336 | // It doesn't need to be in queue more than once. |
| 337 | Iterator<Container> it = pendingRevalidateQueue.iterator(); |
| 338 | |
| 339 | // Iterate through the existing queue to make sure that this container |
| 340 | // isn't already scheduled to be revalidated. |
| 341 | while (it.hasNext()) { |
| 342 | Container existing = it.next(); |
| 343 | if (existing.contains(cnt)) { |
| 344 | // cnt is already in a container that is scheduled for revalidation |
| 345 | // we don't need to add it. |
| 346 | return; |
| 347 | } else if (cnt.contains(existing)) { |
| 348 | // cnt is the parent of this container. Remove the existing container |
| 349 | // as it will be covered by a revalidate of cnt |
| 350 | it.remove(); |
| 351 | } |
| 352 | |
| 353 | } |
| 354 | pendingRevalidateQueue.add(cnt); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | /// Removes a container from the revalidation queue. This is called from |
| 359 | /// `Container#revalidate()`. |
no test coverage detected