diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
index 68eb86af0..3c81d0ec3 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
@@ -70,6 +70,7 @@ public class BaseValidator {
* Set this parameter to false
if the validation does not pass
* @return Returns thePass
(in other words, returns true
if the rule did not fail validation)
*/
+ //todo: remove after i18n implementation done
protected boolean fail(List errors, IssueType type, int line, int col, String path, boolean thePass, String msg) {
if (!thePass) {
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.FATAL);
@@ -77,6 +78,14 @@ public class BaseValidator {
return thePass;
}
+ protected boolean fail(List errors, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
+ if (!thePass) {
+ String msg = formatMessage(theMessage, theMessageArguments);
+ addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.FATAL);
+ }
+ return thePass;
+ }
+
/**
* Test a rule and add a {@link IssueSeverity#FATAL} validation message if the validation fails
*
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
index 44849ccee..a516c401c 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
@@ -3798,7 +3798,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (qItem.getType() == null) {
fail(errors, IssueType.REQUIRED, element.line(), element.col(), stack.getLiteralPath(), false,messages.getString("Definition_for_item__does_not_contain_a_type"), qItem.getLinkId());
} else if (qItem.getType() == QuestionnaireItemType.DISPLAY) {
- List items = new ArrayList();
+ List items = new ArrayList<>();
element.getNamedChildren("item", items);
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), items.isEmpty(),messages.getString("Items_not_of_type_DISPLAY_should_not_have_items__linkId_0"), qItem.getLinkId());
} else {