From e5507b6a1587ea21eef06466597af8d3fb7ceeb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wu=20Yong=20=E5=90=B4=E5=92=8F?= Date: Wed, 21 Aug 2024 11:21:40 +0200 Subject: [PATCH] Correct the behavior of adding schematron validation. During the build, the schematron validation will be added when a schematron is provided in the schematron builder. To ensure the Transformation has been added to the list, the field schematronValidations should be set. Simply return an empty list will in the end ignore the provided schematron. --- src/main/java/de/kosit/validationtool/impl/Scenario.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/kosit/validationtool/impl/Scenario.java b/src/main/java/de/kosit/validationtool/impl/Scenario.java index fc09350..1b8d0b2 100644 --- a/src/main/java/de/kosit/validationtool/impl/Scenario.java +++ b/src/main/java/de/kosit/validationtool/impl/Scenario.java @@ -80,7 +80,10 @@ public class Scenario { private Transformation reportTransformation; public List getSchematronValidations() { - return this.schematronValidations == null ? new ArrayList<>() : this.schematronValidations; + if (this.schematronValidations == null) { + this.schematronValidations = new ArrayList<>(); + } + return this.schematronValidations; } public String getName() {