[#24432] Added a trim for returning value to solve a space as suffix

into returned date (fixing the data displayed in the Timeline Widget)
This commit is contained in:
Francesco Mangiacrapa 2023-01-19 11:31:48 +01:00
parent 9910e79e4e
commit d954dafa90
2 changed files with 4 additions and 23 deletions

View File

@ -9,7 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
#### Bug fixes
- [#24263] Fixing JSON library v20090211
- [#24432] Fixing serialization issue using LinkedHashMap<String, String> instead of LinkedHashMap<String, Object>
- [#24432] Fixing serialization issue using LinkedHashMap<String, String> instead of LinkedHashMap<String, Object>.
- [#24432] Added a trim for returning value to solve a space as suffix into returned date (fixing the data displayed in the Timeline Widget)
## [v2.0.0] - 2022-11-17

View File

@ -1272,9 +1272,9 @@ public class ConvertToDataValueObjectModel {
List<String> listValue = targetDoc.read(jsonPath);
String result = "";
for (int i = 0; i < listValue.size() - 1; i++) {
result += listValue.get(i) + ", ";
result += listValue.get(i).trim() + ", ";
}
result += listValue.get(listValue.size() - 1);
result += listValue.get(listValue.size() - 1).trim();
targetJsonObject.put(theKey, result);
} catch (Exception e) {
LOG.trace("Error on setting key: {}, path: {}", theKey, jsonPath);
@ -1283,26 +1283,6 @@ public class ConvertToDataValueObjectModel {
}
}
// for (Object key : sourceJsonTemplate.keys()) {
// String jsonPath = null;
// String theKey = null;
// try {
// theKey = key + "";
// LOG.debug("Searching key: " + theKey);
// jsonPath = sourceJsonTemplate.getString(theKey);
// LOG.debug("with key: " + theKey + " read JSON path: " + jsonPath);
// List<String> listValue = targetDoc.read(jsonPath);
// String result = "";
// for (int i = 0; i < listValue.size() - 1; i++) {
// result += listValue.get(i) + ", ";
// }
// result += listValue.get(listValue.size() - 1);
// targetJsonObject.put(theKey, result);
// } catch (Exception e) {
// LOG.trace("Error on setting key: {}, path: {}", theKey, jsonPath);
// }
// }
return targetJsonObject;
}