diff --git a/impl/src/main/java/com/sun/faces/config/manager/Documents.java b/impl/src/main/java/com/sun/faces/config/manager/Documents.java index 38be387f1a..adc02b6023 100644 --- a/impl/src/main/java/com/sun/faces/config/manager/Documents.java +++ b/impl/src/main/java/com/sun/faces/config/manager/Documents.java @@ -24,7 +24,9 @@ import java.net.URI; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.FutureTask; @@ -86,17 +88,20 @@ public static DocumentInfo[] getXMLDocuments(ServletContext servletContext, List // Load and XML parse all documents to which the URLs that we collected above point to List> docTasks = new ArrayList<>(providers.size() << 1); + Set processedUris = new HashSet<>(); for (FutureTask> uriTask : uriTasks) { try { for (URI uri : uriTask.get()) { - FutureTask docTask = new FutureTask<>(new ParseConfigResourceToDOMTask(servletContext, validating, uri)); - docTasks.add(docTask); - - if (executor != null) { - executor.execute(docTask); - } else { - docTask.run(); + if (processedUris.add(uri)) { + FutureTask docTask = new FutureTask<>(new ParseConfigResourceToDOMTask(servletContext, validating, uri)); + docTasks.add(docTask); + + if (executor != null) { + executor.execute(docTask); + } else { + docTask.run(); + } } } } catch (InterruptedException ignored) {