From 382347832d85028c2ceac9f916644931df71c7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Soto=20Valero?= Date: Wed, 30 Nov 2022 11:53:18 +0100 Subject: [PATCH] Fix #19 --- src/main/java/se/kth/deptrim/util/PomUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/se/kth/deptrim/util/PomUtils.java b/src/main/java/se/kth/deptrim/util/PomUtils.java index 24aee40..9d894d8 100644 --- a/src/main/java/se/kth/deptrim/util/PomUtils.java +++ b/src/main/java/se/kth/deptrim/util/PomUtils.java @@ -65,6 +65,7 @@ private String createSpecializedPomFromDebloatedPom(Set oneCo DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(new File(debloatedPomPath)); document.getDocumentElement().normalize(); + int numberOfTrimmedDependencies = oneCombinationOfTrimmedDependencies.size(); NodeList dependencies = document.getDocumentElement().getElementsByTagName("dependency"); String debloatedAndSpecializedPom = debloatedPomPath.replace(".xml", "-spl.xml"); for (TrimmedDependency thisDependency : oneCombinationOfTrimmedDependencies) { @@ -86,7 +87,10 @@ private String createSpecializedPomFromDebloatedPom(Set oneCo } } } - debloatedAndSpecializedPom = debloatedAndSpecializedPom.replace(".xml", "-" + combinationNumber + ".xml"); + debloatedAndSpecializedPom = debloatedAndSpecializedPom.replace( + ".xml", + "-" + combinationNumber + "_" + numberOfTrimmedDependencies + "_" + trimmedDependencies.size() + ".xml" + ); saveUpdatedDomInANewPom(document, debloatedAndSpecializedPom); return debloatedAndSpecializedPom; }