mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package cn.hutool.setting;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* 基于分组的Map<br>
|
||||
* 此对象方法线程安全
|
||||
@@ -226,7 +226,6 @@ public class GroupedMap extends LinkedHashMap<String, LinkedHashMap<String, Stri
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Set<String> keySet() {
|
||||
readLock.lock();
|
||||
@@ -277,7 +276,6 @@ public class GroupedMap extends LinkedHashMap<String, LinkedHashMap<String, Stri
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Set<java.util.Map.Entry<String, LinkedHashMap<String, String>>> entrySet() {
|
||||
readLock.lock();
|
||||
|
@@ -1,18 +1,5 @@
|
||||
package cn.hutool.setting;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.WatchEvent;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
@@ -31,6 +18,19 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.log.StaticLog;
|
||||
import cn.hutool.setting.dialect.Props;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.WatchEvent;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* 设置工具类。 用于支持设置(配置)文件<br>
|
||||
* BasicSetting用于替换Properties类,提供功能更加强大的配置文件,同时对Properties文件向下兼容
|
||||
@@ -638,7 +638,6 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
*
|
||||
* @param m Map
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public void putAll(Map<? extends String, ? extends String> m) {
|
||||
this.groupedMap.putAll(DEFAULT_GROUP, m);
|
||||
@@ -657,7 +656,6 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
*
|
||||
* @return 默认分组(空分组)中的所有键列表
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Set<String> keySet() {
|
||||
return this.groupedMap.keySet(DEFAULT_GROUP);
|
||||
@@ -668,7 +666,6 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
*
|
||||
* @return 默认分组(空分组)中的所有值列表
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Collection<String> values() {
|
||||
return this.groupedMap.values(DEFAULT_GROUP);
|
||||
@@ -679,7 +676,6 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
*
|
||||
* @return 默认分组(空分组)中的所有键值对列表
|
||||
*/
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Set<Entry<String, String>> entrySet() {
|
||||
return this.groupedMap.entrySet(DEFAULT_GROUP);
|
||||
|
@@ -56,7 +56,6 @@ public class SettingUtil {
|
||||
* @since 5.1.3
|
||||
*/
|
||||
public static Setting getFirstFound(String... names) {
|
||||
Setting setting;
|
||||
for (String name : names) {
|
||||
try {
|
||||
return get(name);
|
||||
|
@@ -57,7 +57,6 @@ public class PropsUtil {
|
||||
* @return 当前环境下配置文件
|
||||
*/
|
||||
public static Props getFirstFound(String... names) {
|
||||
Props props;
|
||||
for (String name : names) {
|
||||
try {
|
||||
return get(name);
|
||||
|
@@ -72,7 +72,6 @@ public class PropsTest {
|
||||
@Test
|
||||
public void toBeanWithNullPrefixTest(){
|
||||
Props configProp = new Props();
|
||||
Boolean isInit = configProp.getBool("isInit");
|
||||
|
||||
configProp.setProperty("createTime", Objects.requireNonNull(DateUtil.parse("2020-01-01")));
|
||||
configProp.setProperty("isInit", true);
|
||||
|
Reference in New Issue
Block a user