pre commit 2.11.0.2

This commit is contained in:
bwcx_jzy 2024-01-02 11:58:49 +08:00
parent 3b37bac06f
commit ccd449893a
No known key found for this signature in database
GPG Key ID: E187D6E9DDDE8C53
3 changed files with 23 additions and 9 deletions

View File

@ -1,5 +1,13 @@
# 🚀 版本日志
### 2.11.0.2-beta (2024-01-02)
### 🐞 解决BUG、优化功能
1. 【all】修复 环境变量为 null 是未忽略
------
### 2.11.0.1-beta (2024-01-02)
### 🐣 新增功能

View File

@ -90,6 +90,10 @@ public class EnvironmentMapBuilder {
Map<String, String> map = new LinkedHashMap<>(this.map.size());
for (Map.Entry<String, Item> entry : this.map.entrySet()) {
Item entryValue = entry.getValue();
if (entryValue.value == null) {
// 值不能为 null
continue;
}
map.put(entry.getKey(), entryValue.value);
}
Optional.ofNullable(appendMap).ifPresent(objectMap -> {

View File

@ -256,15 +256,17 @@ public class StringUtil {
return MapUtil.newHashMap();
}
List<Tuple> collect = envStrList.stream()
.map(StrUtil::trim)
.filter(s -> !StrUtil.isEmpty(s) && !StrUtil.startWith(s, "#"))
.map(s -> {
List<String> list1 = StrUtil.splitTrim(s, "=");
if (CollUtil.size(list1) != 2) {
return null;
}
return new Tuple(list1.get(0), list1.get(1));
}).filter(Objects::nonNull).collect(Collectors.toList());
.map(StrUtil::trim)
.filter(s -> !StrUtil.isEmpty(s) && !StrUtil.startWith(s, "#"))
.map(s -> {
List<String> list1 = StrUtil.splitTrim(s, "=");
if (CollUtil.size(list1) != 2) {
return null;
}
return new Tuple(list1.get(0), list1.get(1));
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
return CollStreamUtil.toMap(collect, objects -> objects.get(0), objects -> objects.get(1));
}