Skip to content

Commit

Permalink
[skip ci] 修改部分代码格式
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Apr 22, 2022
1 parent 6d0ee35 commit 216050a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ public ConfiguredList(@Nullable ConfigurationProvider<?> provider,

@Override
public @NotNull List<V> get() {



if (isExpired()) { // 已过时的数据,需要重新解析一次。
List<V> list = new ArrayList<>();

List<?> data = getConfiguration().getList(getConfigPath());
if (data == null || data.isEmpty()) return useOrDefault(list);

for (Object dataVal : data) {
if (dataVal == null) continue;
try {
Expand All @@ -51,7 +46,6 @@ public ConfiguredList(@Nullable ConfigurationProvider<?> provider,
e.printStackTrace();
}
}

return updateCache(list);
} else if (getCachedValue() != null) return getCachedValue();
else if (getDefaultValue() != null) return getDefaultValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ public void set(Map<K, V> value) {
Map<String, Object> data = new LinkedHashMap<>();
for (Map.Entry<K, V> entry : value.entrySet()) {
try {
String key = keySerializer.parse(entry.getKey());
Object val = valueSerializer.parse(entry.getValue());
data.put(key, val);
data.put(
keySerializer.parse(entry.getKey()),
valueSerializer.parse(entry.getValue())
);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void set(V value) {
else {
try {
setValue(serializer.parse(value));
// getConfiguration().createSection(getSectionPath(), serializer.parse(value));
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 216050a

Please sign in to comment.