From 14ea4d63bf3d7bec9c77fb61ca5e760cb4c67105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Tue, 16 Apr 2024 12:55:32 +0300 Subject: [PATCH] Fix validation of @dot.xml files As per https://www.eclipse.org/jdt/core/compiler_32_006.dtd problem tag has mandatory id attribute. Set it to the value passed as problemId. --- .../java/org/eclipse/tycho/core/EcJLogFileEnhancer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/EcJLogFileEnhancer.java b/tycho-core/src/main/java/org/eclipse/tycho/core/EcJLogFileEnhancer.java index 617c4b812a..69b8c9cd30 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/EcJLogFileEnhancer.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/EcJLogFileEnhancer.java @@ -21,7 +21,6 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -155,6 +154,7 @@ public void addProblem(String severity, int lineNumber, int charStart, int charE Element element = new Element("problem"); element.setAttribute("line", Integer.toString(lineNumber)); element.setAttribute("severity", severity); + element.setAttribute("id", Integer.toString(problemId)); element.setAttribute("charStart", Integer.toString(charStart)); element.setAttribute("charEnd", Integer.toString(charEnd)); element.setAttribute("categoryID", Integer.toString(categoryId)); @@ -183,8 +183,8 @@ public void addProblem(String severity, int lineNumber, int charStart, int charE } public boolean hasClass(String classFile) { - return source.getChildren("classfile").stream().map(elem -> elem.getAttributeValue("path")).filter(Objects::nonNull) - .anyMatch(path -> path.endsWith(classFile)); + return source.getChildren("classfile").stream().map(elem -> elem.getAttributeValue("path")) + .filter(Objects::nonNull).anyMatch(path -> path.endsWith(classFile)); } }