Skip to content

Commit 2122b8c

Browse files
authored
优化 AbstractParser.java 缩进
1 parent b05016f commit 2122b8c

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

APIJSONORM/src/main/java/apijson/orm/AbstractParser.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,39 +1563,39 @@ else if (join != null){
15631563
throw new UnsupportedDataTypeException(TAG + ".onJoinParse join 只能是 String 或 Map<String, Object> 类型!");
15641564
}
15651565

1566-
List<Entry<String, Object>> slashKeys = new ArrayList<>();
1567-
List<Entry<String, Object>> nonSlashKeys = new ArrayList<>();
1568-
Set<Entry<String, Object>> entries = joinMap == null ? null : joinMap.entrySet();
1566+
List<Entry<String, Object>> slashKeys = new ArrayList<>();
1567+
List<Entry<String, Object>> nonSlashKeys = new ArrayList<>();
1568+
Set<Entry<String, Object>> entries = joinMap == null ? null : joinMap.entrySet();
15691569

1570-
if (entries == null || entries.isEmpty()) {
1571-
Log.e(TAG, "onJoinParse set == null || set.isEmpty() >> return null;");
1572-
return null;
1573-
}
1574-
for (Entry<String, Object> e : entries) {
1575-
String path = e.getKey();
1576-
if (path != null && path.indexOf("/") > 0) {
1577-
slashKeys.add(e); // 以 / 开头的 key,例如 </Table/key@
1578-
} else {
1579-
nonSlashKeys.add(e); // 普通 key,例如 Table: {}
1580-
}
1581-
}
1570+
if (entries == null || entries.isEmpty()) {
1571+
Log.e(TAG, "onJoinParse set == null || set.isEmpty() >> return null;");
1572+
return null;
1573+
}
1574+
for (Entry<String, Object> e : entries) {
1575+
String path = e.getKey();
1576+
if (path != null && path.indexOf("/") > 0) {
1577+
slashKeys.add(e); // 以 / 开头的 key,例如 </Table/key@
1578+
} else {
1579+
nonSlashKeys.add(e); // 普通 key,例如 Table: {}
1580+
}
1581+
}
15821582

1583-
Map<String, Object> whereJoinMap = new LinkedHashMap<>();
1583+
Map<String, Object> whereJoinMap = new LinkedHashMap<>();
15841584

1585-
for (Entry<String, Object> e : nonSlashKeys) {
1586-
String tableKey = e.getKey(); // 如 "Location_info"
1587-
Object tableObj = e.getValue(); // value 是 Map
1585+
for (Entry<String, Object> e : nonSlashKeys) {
1586+
String tableKey = e.getKey(); // 如 "Location_info"
1587+
Object tableObj = e.getValue(); // value 是 Map
1588+
1589+
if (request.containsKey(tableKey)) {
1590+
whereJoinMap.put(tableKey, tableObj);
1591+
} else {
1592+
Log.w(TAG, "跳过 join 中 key = " + tableKey + ",因为它不在 request 中");
1593+
}
1594+
}
15881595

1589-
if (request.containsKey(tableKey)) {
1590-
whereJoinMap.put(tableKey, tableObj);
1591-
} else {
1592-
Log.w(TAG, "跳过 join 中 key = " + tableKey + ",因为它不在 request 中");
1593-
}
1594-
}
15951596

1597+
Set<Entry<String, Object>> set = joinMap == null ? null : new LinkedHashSet<>(slashKeys);
15961598

1597-
Set<Entry<String, Object>> set = joinMap == null ? null : new LinkedHashSet<>(slashKeys);
1598-
;
15991599
if (set == null || set.isEmpty()) {
16001600
Log.e(TAG, "onJoinParse set == null || set.isEmpty() >> return null;");
16011601
return null;

0 commit comments

Comments
 (0)