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

Commit 3d01b00

Browse files
Сидоченко Виктор ВикторовичСидоченко Виктор Викторович
authored andcommitted
format code
1 parent d104c11 commit 3d01b00

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,18 @@ private Object parseArray(BasicDBObject basicO, String key) throws DataException
207207
if (!isArray(key)) {
208208
throw new DataException(String.format("%s.%s is not an array!", this.collectionName, key));
209209
}
210+
210211
String arrayKey = key.split("\\[")[0];
211212
String arrayIndex = key.split("\\[")[1].split("\\]")[0];
213+
212214
if (basicO.get(arrayKey) instanceof BasicDBObject && isReference((BasicDBObject) basicO.get(arrayKey))) {
213215
basicO = ((AbstractDataProvider) get(arrayKey)).basicObject;
214216
arrayKey = basicO.keySet().iterator().next();
215217
way = key;
216218
} else {
217219
way += "." + key;
218220
}
221+
219222
Object listCandidate = basicO.get(arrayKey);
220223

221224
if (!(listCandidate instanceof BasicDBList)) {
@@ -361,11 +364,7 @@ public void applyGenerator(Class<? extends GeneratorCallback> callback) {
361364
*/
362365
@Override
363366
public boolean isReference() {
364-
Object value = this.basicObject.get(VALUE_TPL);
365-
if (!(value instanceof BasicDBObject)) {
366-
return false;
367-
}
368-
return ((BasicDBObject) value).containsField(COLLECTION_TPL) && ((BasicDBObject) value).containsField("path");
367+
return isReference(this.basicObject);
369368
}
370369

371370
private boolean isReference(BasicDBObject basicDBObject) {

0 commit comments

Comments
 (0)