mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
691ccd0f3d
commit
19098c0429
@ -26,7 +26,8 @@ public class IterChain<T> implements Iterator<T>, Chain<Iterator<T>, IterChain<T
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new composite iterator with provided iterators.
|
* 构造
|
||||||
|
* @param iterators 多个{@link Iterator}
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public IterChain(Iterator<T>... iterators) {
|
public IterChain(Iterator<T>... iterators) {
|
||||||
|
@ -5,6 +5,7 @@ import cn.hutool.core.convert.AbstractConverter;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ByteUtil;
|
import cn.hutool.core.util.ByteUtil;
|
||||||
|
import cn.hutool.core.util.CharUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
@ -124,7 +125,7 @@ public class ArrayConverter extends AbstractConverter<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 单纯字符串情况下按照逗号分隔后劈开
|
// 单纯字符串情况下按照逗号分隔后劈开
|
||||||
final String[] strings = StrUtil.split(value.toString(), StrUtil.COMMA);
|
final String[] strings = StrUtil.splitToArray(value.toString(), CharUtil.COMMA);
|
||||||
return convertArrayToArray(strings);
|
return convertArrayToArray(strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cn.hutool.core.exceptions;
|
package cn.hutool.core.exceptions;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.io.FastByteArrayOutputStream;
|
import cn.hutool.core.io.FastByteArrayOutputStream;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@ -246,7 +246,7 @@ public class ExceptionUtil {
|
|||||||
length = limit;
|
length = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(replaceCharToStrMap)) {
|
if (MapUtil.isNotEmpty(replaceCharToStrMap)) {
|
||||||
final StringBuilder sb = StrUtil.builder();
|
final StringBuilder sb = StrUtil.builder();
|
||||||
char c;
|
char c;
|
||||||
String value;
|
String value;
|
||||||
|
@ -56,11 +56,11 @@ public class Ipv4Util {
|
|||||||
public static List<String> list(String ipRange, boolean isAll) {
|
public static List<String> list(String ipRange, boolean isAll) {
|
||||||
if (ipRange.contains(IP_SPLIT_MARK)) {
|
if (ipRange.contains(IP_SPLIT_MARK)) {
|
||||||
// X.X.X.X-X.X.X.X
|
// X.X.X.X-X.X.X.X
|
||||||
final String[] range = StrUtil.split(ipRange, IP_SPLIT_MARK);
|
final String[] range = StrUtil.splitToArray(ipRange, IP_SPLIT_MARK);
|
||||||
return list(range[0], range[1]);
|
return list(range[0], range[1]);
|
||||||
} else if (ipRange.contains(IP_MASK_SPLIT_MARK)) {
|
} else if (ipRange.contains(IP_MASK_SPLIT_MARK)) {
|
||||||
// X.X.X.X/X
|
// X.X.X.X/X
|
||||||
final String[] param = StrUtil.split(ipRange, IP_MASK_SPLIT_MARK);
|
final String[] param = StrUtil.splitToArray(ipRange, IP_MASK_SPLIT_MARK);
|
||||||
return list(param[0], Integer.parseInt(param[1]), isAll);
|
return list(param[0], Integer.parseInt(param[1]), isAll);
|
||||||
} else {
|
} else {
|
||||||
return ListUtil.toList(ipRange);
|
return ListUtil.toList(ipRange);
|
||||||
@ -315,16 +315,5 @@ public class Ipv4Util {
|
|||||||
return getBeginIpLong(ip, maskBit)
|
return getBeginIpLong(ip, maskBit)
|
||||||
+ ~ipv4ToLong(getMaskByMaskBit(maskBit));
|
+ ~ipv4ToLong(getMaskByMaskBit(maskBit));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static StringBuffer toBin(int x) {
|
|
||||||
StringBuffer result = new StringBuffer();
|
|
||||||
result.append(x % 2);
|
|
||||||
x /= 2;
|
|
||||||
while (x > 0) {
|
|
||||||
result.append(x % 2);
|
|
||||||
x /= 2;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
//-------------------------------------------------------------------------------- Private method end
|
//-------------------------------------------------------------------------------- Private method end
|
||||||
}
|
}
|
||||||
|
@ -49,12 +49,6 @@ public class CharSequenceUtil {
|
|||||||
*/
|
*/
|
||||||
public static final String SPACE = " ";
|
public static final String SPACE = " ";
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>The maximum size to which the padding constant(s) can expand.</p>
|
|
||||||
* <p>填充常量可以最大填充的数量</p>
|
|
||||||
*/
|
|
||||||
private static final int PAD_LIMIT = 8192;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>字符串是否为空白,空白的定义如下:</p>
|
* <p>字符串是否为空白,空白的定义如下:</p>
|
||||||
* <ol>
|
* <ol>
|
||||||
@ -2325,7 +2319,7 @@ public class CharSequenceUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<String> result = new LinkedList<>();
|
final List<String> result = new LinkedList<>();
|
||||||
final String[] split = split(str, prefix);
|
final String[] split = splitToArray(str, prefix);
|
||||||
if (prefix.equals(suffix)) {
|
if (prefix.equals(suffix)) {
|
||||||
// 前后缀字符相同,单独处理
|
// 前后缀字符相同,单独处理
|
||||||
for (int i = 1, length = split.length - 1; i < length; i += 2) {
|
for (int i = 1, length = split.length - 1; i < length; i += 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user