This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
datajack-api/src/main/java/ru/sbtqa/tag/datajack/providers Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments