mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -591,6 +591,7 @@ public class Setting extends AbsSetting implements Map<String, String> {
|
||||
* @param fields lambda,不能为空
|
||||
* @return this
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Setting setFields(final SerSupplier<String>... fields) {
|
||||
Arrays.stream(fields).forEach(f -> set(LambdaUtil.getFieldName(f), f.get()));
|
||||
return this;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package cn.hutool.setting.dialect;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.file.FileNameUtil;
|
||||
import cn.hutool.core.io.resource.NoResourceException;
|
||||
import cn.hutool.core.map.SafeConcurrentHashMap;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
@@ -30,7 +31,7 @@ public class PropsUtil {
|
||||
*/
|
||||
public static Props get(final String name) {
|
||||
return propsMap.computeIfAbsent(name, (filePath)->{
|
||||
final String extName = FileUtil.extName(filePath);
|
||||
final String extName = FileNameUtil.extName(filePath);
|
||||
if (StrUtil.isEmpty(extName)) {
|
||||
filePath = filePath + "." + Props.EXT_NAME;
|
||||
}
|
||||
|
Reference in New Issue
Block a user