fix up bi-di warning message

This commit is contained in:
Grahame Grieve 2023-07-20 08:21:34 +10:00
parent 616cf5fdb3
commit fc75c0ea6b
2 changed files with 15 additions and 5 deletions

View File

@ -57,8 +57,18 @@ public class UnicodeUtilities {
return list.isEmpty();
}
public String summary() {
return "Unicode Character "+describe(list.get(list.size()-1).c)+" at index "+list.get(list.size()-1).i+" has no terminating match";
public String summary(String src) {
char ch = list.get(list.size()-1).c;
int i = list.get(list.size()-1).i;
String pt;
if (i == 0) {
pt = "";
} else if (i < 5) {
pt = " (preceding text = '"+src.substring(0, i)+"')";
} else {
pt = " (preceding text = '"+src.substring(i-5, i)+"')";
}
return "Unicode Character "+describe(ch)+" at index "+i+" has no terminating match"+pt;
}
@ -148,7 +158,7 @@ public class UnicodeUtilities {
if (ss.empty()) {
return null;
} else {
return ss.summary();
return ss.summary(src);
}
}

View File

@ -739,8 +739,8 @@ BUNDLE_SEARCH_NO_MODE = SearchSet bundles should have search modes on the entrie
INV_FAILED = Rule {0} Failed
PATTERN_CHECK_STRING = The pattern [{0}] defined in the profile {1} not found. Issues: {2}
TYPE_SPECIFIC_CHECKS_DT_URL_EXAMPLE = Example URLs are not allowed in this context ({0})
UNICODE_BIDI_CONTROLS_CHARS_DISALLOWED = The Unicode sequence has bi-di control characters which are not allowed in this context: {1}
UNICODE_BIDI_CONTROLS_CHARS_MATCH = The Unicode sequence has unterminated bi-di control characters (see CVE-2021-42574): {1}
UNICODE_BIDI_CONTROLS_CHARS_DISALLOWED = The Unicode sequence has bi-di control characters which are not allowed in this context: {0}
UNICODE_BIDI_CONTROLS_CHARS_MATCH = The Unicode sequence has unterminated bi-di control characters (see CVE-2021-42574): {0}
CODESYSTEM_CS_HL7_MISSING_ELEMENT_SHALL = HL7 Defined CodeSystems SHALL have a stated value for the {0} element so that users know the status and meaning of the code system clearly
CODESYSTEM_CS_HL7_MISSING_ELEMENT_SHOULD = HL7 Defined CodeSystems SHOULD have a stated value for the {0} element so that users know the status and meaning of the code system clearly
CODESYSTEM_CS_NONHL7_MISSING_ELEMENT = CodeSystems SHOULD have a stated value for the {0} element so that users know the status and meaning of the code system clearly