flowable-engine icon indicating copy to clipboard operation
flowable-engine copied to clipboard

BpmnXMLUtil.parseExtensionElement setElementText has bug of Line wrap cover

Open windNarrowedEyes opened this issue 2 years ago • 1 comments

Describe the bug 当 extensionElements 元素 text中存在换行时 xtr.next(); 方法会导致数据被覆盖 When there is a line break in the extensionElements element text, xtr. text(); Method can cause data to be overwritten Expected behavior A clear and concise description of what you expected to happen.

Code while (!readyWithExtensionElement && xtr.hasNext()) { xtr.next(); if (xtr.isCharacters() || XMLStreamReader.CDATA == xtr.getEventType()) { if (StringUtils.isNotEmpty(xtr.getText().trim())) { //fix set to append extensionElement.setElementText(xtr.getText().trim()); } } else if (xtr.isStartElement()) { ExtensionElement childExtensionElement = parseExtensionElement(xtr); extensionElement.addChildElement(childExtensionElement); } else if (xtr.isEndElement() && extensionElement.getName().equalsIgnoreCase(xtr.getLocalName())) { readyWithExtensionElement = true; } }

windNarrowedEyes avatar May 10 '24 01:05 windNarrowedEyes

Please provide a unit test showing the issue, then we can look into this further. Without a unit test we have to close the issue.

tijsrademakers avatar May 10 '24 06:05 tijsrademakers