Instanceof casting simplification.

Closes: #4265
This commit is contained in:
Tomasz Forys
2023-01-05 18:55:37 +01:00
committed by Christoph Strobl
parent 7f74794a11
commit 561c3d4f39
114 changed files with 728 additions and 804 deletions

View File

@@ -96,15 +96,14 @@ class MongoResultsWriter implements ResultsWriter {
for (Object key : doc.keySet()) {
Object value = doc.get(key);
if (value instanceof Document) {
value = fixDocumentKeys((Document) value);
} else if (value instanceof BasicDBObject) {
value = fixDocumentKeys(new Document((BasicDBObject) value));
if (value instanceof Document document) {
value = fixDocumentKeys(document);
} else if (value instanceof BasicDBObject basicDBObject) {
value = fixDocumentKeys(new Document(basicDBObject));
}
if (key instanceof String) {
if (key instanceof String newKey) {
String newKey = (String) key;
if (newKey.contains(".")) {
newKey = newKey.replace('.', ',');
}