From 151ff2872a8a618e9f4390d88cc6a356d3993128 Mon Sep 17 00:00:00 2001 From: hduelme Date: Sun, 12 Feb 2023 18:53:29 +0100 Subject: [PATCH] Use List.addAll() instead of iteration. Resolves #1336. --- .../xml/xsd/commons/CommonsXsdSchemaCollection.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java index b9b1d693..6f974917 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java @@ -189,10 +189,7 @@ public class CommonsXsdSchemaCollection implements XsdSchemaCollection, Initiali if (!processedIncludes.contains(includedSchema)) { inlineIncludes(includedSchema, processedIncludes, processedImports); findImports(includedSchema, processedImports, processedIncludes); - List includeItems = includedSchema.getItems(); - for (XmlSchemaObject includedItem : includeItems) { - schemaItems.add(includedItem); - } + schemaItems.addAll(includedSchema.getItems()); } // remove the schemaItems.remove(i);