private void checkPasteList(DataTree tree, GTreeNode destNode, List<GTreeNode> list,
			boolean isCutOperation) {

		if (list == null) {
			return;
		}

		boolean listChanged = removeDescendantsFromList(list);

		boolean resetClipboard = false;
		StringBuffer sb = new StringBuffer();

		for (int i = 0; i < list.size(); i++) {
			GTreeNode tnode = list.get(i);
			boolean removeNodeFromList = false;

			if (tnode.getParent() != null && isCutOperation && !destNode.equals(tnode)) {
				if (destNode == tnode.getParent()) {
					removeNodeFromList = true;
					sb.append(
						"File " + tnode.getName() + " already exists at " + tnode.getParent());
				}
				else if (tnode instanceof DomainFolderNode) {
					if (destNode.isAncestor(tnode)) {
						removeNodeFromList = true;
					}
				}
			}
			else if (tnode.getParent() == null || destNode == tnode) {
				removeNodeFromList = true;
				if (destNode == tnode) {
					sb.append("Cannot paste file to itself: " + destNode.getName());
				}
			}
			if (removeNodeFromList) {
				list.remove(i);
				if (i > 0) {
					--i;
				}
				resetClipboard = true;
				if (tnode.getParent() != null) {
					if (tnode instanceof Cuttable) {
						((Cuttable) tnode).setIsCut(false);
					}
				}
			}
		}
		if (resetClipboard || listChanged) {
			if (sb.length() > 0) {
				String title = isCutOperation ? "Cannot Move File(s)" : "Cannot Copy File(s)";
				String action = isCutOperation ? "moved" : "copied";

				Msg.showWarn(getClass(), tree, title,
					"The following file(s) could not be " + action + ":\n" + sb.toString());
			}
		}
	}
Update the given list of nodes to paste if the corresponding file or
folder cannot be pasted; remove it from the list and update the
clipboard with the new list.
@param destNode destination node
@param list list of nodes to paste
@param isCutOperation true if this is a cut vs copy; for cut, files
cannot be in use
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataPasteAction.java