void (final @NotNull Element element, final @NotNull String childElementName, boolean externalizeJarDirectories) { for (VirtualFilePointer pointer : myList) { String url = pointer.getUrl(); if (url.isEmpty()) { // pointer is disposed, avoid externalizing garbage continue; } Element rootPathElement = new Element(childElementName); rootPathElement.setAttribute(URL_ATTR, url); element.addContent(rootPathElement); } if (externalizeJarDirectories) { writeJarDirs(myJarDirectories, element, false); writeJarDirs(myJarRecursiveDirectories, element, true); } }