Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 804260e

Browse files
committed
todo: remove quotes
1 parent 47f362b commit 804260e

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

datajack-api/src/main/java/ru/sbtqa/tag/datajack/providers/AbstractDataProvider.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -307,25 +307,19 @@ public String getValue() throws DataException {
307307

308308
BasicDBObject dbObject = new BasicDBObject();
309309

310-
basicObject.keySet().stream().forEach(s -> {
311-
try {
312-
AbstractDataProvider instance = createInstance((BasicDBObject) basicObject.get(s), collectionName, way + "." + s);
310+
for (String s : basicObject.keySet()){
311+
312+
BasicDBObject target = (basicObject.get(s) instanceof BasicDBObject) ?
313+
(BasicDBObject) basicObject.get(s) :
314+
basicObject;
315+
316+
AbstractDataProvider instance = createInstance(target, collectionName, way + "." + s);
313317
instance.applyGenerator(callback);
314318
dbObject.put(s, instance.getValue());
315-
} catch (ClassCastException e) {
316-
AbstractDataProvider instance = null;
317-
try {
318-
instance = createInstance((BasicDBObject) basicObject, collectionName, way + "." + s);
319-
instance.applyGenerator(callback);
320-
dbObject.put(s, instance.getValue());
321-
} catch (DataException e1) {
322-
e1.printStackTrace();
323-
}
324-
} catch (DataException e) {
325-
e.printStackTrace();
326-
}
327-
328-
});
319+
320+
321+
322+
}
329323
result = dbObject.toString();
330324
}
331325
}

0 commit comments

Comments
 (0)