Fixed issue where empty narrative caused a StringIndexOutOfBoundsException
Fixed encoding issue on XmlParserTest so it'll run in windows
This commit is contained in:
parent
51f2ce1e37
commit
428af56c82
|
@ -71,15 +71,17 @@ public class XhtmlDt extends BasePrimitive<List<XMLEvent>> {
|
|||
*/
|
||||
@Override
|
||||
public void setValueAsString(String theValue) throws DataFormatException {
|
||||
String value = theValue.trim();
|
||||
if (value.charAt(0) != '<') {
|
||||
value = "<div>" + value + "</div>";
|
||||
if (theValue == null || theValue.isEmpty()) {
|
||||
super.setValueAsString(null);
|
||||
} else {
|
||||
String value = theValue.trim();
|
||||
if (value.charAt(0) != '<') {
|
||||
value = "<div>" + value + "</div>";
|
||||
}
|
||||
super.setValueAsString(value);
|
||||
}
|
||||
|
||||
super.setValueAsString(value);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasContent() {
|
||||
return getValue() != null && getValue().size() > 0;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class XmlParserTest {
|
|||
|
||||
@Test
|
||||
public void testProfileWithBoundCode() throws IOException {
|
||||
String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/DMIXAuditException.xml"));
|
||||
String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/DMIXAuditException.xml"), "UTF-8");
|
||||
ourCtx.newXmlParser().parseResource(Profile.class, content);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue