Commit d709287c authored by Matija Obreza's avatar Matija Obreza
Browse files

REMARKS: Use fieldName if it doesn't contain spaces

parent f7d23706
......@@ -483,13 +483,18 @@ public class BatchRESTServiceImpl implements BatchRESTService {
if (StringUtils.isBlank(remarkText))
continue;
String[] mcpdRemark = remarkText.split(":", 2);
String fieldName = null, remark = null;
if (mcpdRemark.length == 2) {
fieldName = StringUtils.defaultIfBlank(mcpdRemark[0].trim(), null);
remark = StringUtils.defaultIfBlank(mcpdRemark[1].trim(), null);
int pos = remarkText.indexOf(':');
if (pos >= 0 && !remarkText.substring(0, pos - 1).trim().contains(" ")) {
String[] mcpdRemark = remarkText.split(":", 2);
if (mcpdRemark.length == 2) {
fieldName = StringUtils.defaultIfBlank(mcpdRemark[0].trim(), null);
remark = StringUtils.defaultIfBlank(mcpdRemark[1].trim(), null);
} else {
remark = StringUtils.defaultIfBlank(mcpdRemark[0].trim(), null);
}
} else {
remark = StringUtils.defaultIfBlank(mcpdRemark[0].trim(), null);
remark = StringUtils.defaultIfBlank(remarkText, null);
}
if (remark == null && fieldName == null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment