private synchronized void assertAllPointersDisposed() {
    for (Map.Entry<VirtualFilePointerListener, FilePointerPartNode> entry : myPointers.entrySet()) {
      FilePointerPartNode root = entry.getValue();
      ArrayList<FilePointerPartNode> left = new ArrayList<FilePointerPartNode>();
      root.getPointersUnder(null, false, "", left);
      if (!left.isEmpty()) {
        VirtualFilePointerImpl p = left.get(0).leaf;
        try {
          p.throwDisposalError("Not disposed pointer: " + p);
        } finally {
          for (FilePointerPartNode pair : left) {
            VirtualFilePointerImpl pointer = pair.leaf;
            pointer.dispose();
          }
        }
      }
    }

    synchronized (myContainers) {
      if (!myContainers.isEmpty()) {
        VirtualFilePointerContainerImpl container = myContainers.iterator().next();
        container.throwDisposalError("Not disposed container");
      }
    }
  }
 @TestOnly
 int numberOfPointers() {
   int number = 0;
   for (FilePointerPartNode root : myPointers.values()) {
     number = root.getPointersUnder();
   }
   return number;
 }
 private void addAllPointers(@NotNull Collection<VirtualFilePointerImpl> pointers) {
   List<FilePointerPartNode> out = new ArrayList<FilePointerPartNode>();
   for (FilePointerPartNode root : myPointers.values()) {
     root.getPointersUnder(null, false, "", out);
   }
   for (FilePointerPartNode node : out) {
     pointers.add(node.leaf);
   }
 }
 private void addPointersUnder(
     VirtualFile parent,
     boolean separator,
     @NotNull CharSequence childName,
     @NotNull List<FilePointerPartNode> out) {
   for (FilePointerPartNode root : myPointers.values()) {
     root.getPointersUnder(parent, separator, childName, out);
   }
 }
コード例 #5
0
 private void addPointersUnder(@NotNull String path, @NotNull List<FilePointerPartNode> out) {
   for (FilePointerPartNode root : myPointers.values()) {
     root.getPointersUnder(path, 0, out);
   }
 }