This commit is contained in:
choweli
2025-04-17 10:55:02 +08:00
parent 22d487624d
commit 038a6ca0c8
123 changed files with 232 additions and 224 deletions

View File

@@ -1560,7 +1560,7 @@ public class CollUtil {
final String arrayStr = StrUtil.unWrap((CharSequence) value, '[', ']');
iter = SplitUtil.splitTrim(arrayStr, StrUtil.COMMA).iterator();
} else if (value instanceof Map && BeanUtil.isWritableBean(TypeUtil.getClass(elementType))) {
//https://github.com/dromara/hutool/issues/3139
//https://github.com/chinabugotech/hutool/issues/3139
// 如果值为Map而目标为一个Bean则Map应整体转换为Bean而非拆分成Entry转换
iter = new ArrayIter<>(new Object[]{value});
} else {

View File

@@ -196,7 +196,7 @@ public class TemporalAccessorConverter extends AbstractConverter {
final Instant instant;
if (DateFormatManager.FORMAT_SECONDS.equals(this.format)) {
// https://gitee.com/dromara/hutool/issues/I6IS5B
// https://gitee.com/chinabugotech/hutool/issues/I6IS5B
// Unix时间戳
instant = Instant.ofEpochSecond(time);
} else {

View File

@@ -186,7 +186,7 @@ public class UUID implements java.io.Serializable, Comparable<UUID> {
/**
* 获取随机生成的UUIDv7<br>
* 【开源之夏】贡献内容https://gitee.com/dromara/hutool/pulls/1263
* 【开源之夏】贡献内容https://gitee.com/chinabugotech/hutool/pulls/1263
*
* @return UUIDv7
* @author Cason(https://gitee.com/Casonhqc)

View File

@@ -131,7 +131,7 @@ public class LambdaFactory {
* 通过Lambda函数代理方法或构造
* <p>
* TODO 在多模块项目中使用module-info.java声明的模块项目使用此方法获取的Lookup对象存在权限不足问题<br>
* 见https://gitee.com/dromara/hutool/issues/I96JIP
* 见https://gitee.com/chinabugotech/hutool/issues/I96JIP
* </p>
*
* @param funcType 函数类型

View File

@@ -34,7 +34,7 @@ import java.util.stream.Stream;
/**
* 复制jdk16中的Optional以及自己进行了一点调整和新增比jdk8中的Optional多了几个实用的函数<br>
* 详细见:<a href="https://gitee.com/dromara/hutool/pulls/426"></a>
* 详细见:<a href="https://gitee.com/chinabugotech/hutool/pulls/426"></a>
*
* @param <T> 包裹里元素的类型
* @author VampireAchao

View File

@@ -25,7 +25,7 @@ import java.util.List;
* 平滑加权轮询选择器
*
* <p>
* 来自https://gitee.com/dromara/hutool/pulls/982/
* 来自https://gitee.com/chinabugotech/hutool/pulls/982/
* </p>
* <p>
* 介绍https://cloud.tencent.com/developer/beta/article/1680928

View File

@@ -81,7 +81,7 @@ public class BitStatusUtil {
* <li>必须大于0</li>
* <li>必须为偶数</li>
* </ul>
* 原因见https://github.com/dromara/hutool/pull/3706
* 原因见https://github.com/chinabugotech/hutool/pull/3706
*
* @param args 被检查的状态
*/

View File

@@ -25,7 +25,7 @@ import java.util.Stack;
/**
* 数学表达式计算工具类<br>
* 见https://github.com/dromara/hutool/issues/1090#issuecomment-693750140
* 见https://github.com/chinabugotech/hutool/issues/1090#issuecomment-693750140
*
* @author trainliang, Looly
* @since 5.4.3

View File

@@ -27,7 +27,7 @@ import java.util.Currency;
/**
* 单币种货币类,处理货币算术、币种和取整。
* <p>
* 感谢提供此方法的用户https://github.com/dromara/hutool/issues/605
* 感谢提供此方法的用户https://github.com/chinabugotech/hutool/issues/605
*
* <p>
* 货币类中封装了货币金额和币种。目前金额在内部是long类型表示

View File

@@ -306,7 +306,7 @@ public class NumberUtil extends NumberValidator {
public static BigDecimal div(final Number v1, final Number v2, int scale, final RoundingMode roundingMode) {
Assert.notNull(v2, "Divisor must be not null !");
if (null == v1 || isZero(v1)) {
// https://gitee.com/dromara/hutool/issues/I6UZYU
// https://gitee.com/chinabugotech/hutool/issues/I6UZYU
return BigDecimal.ZERO;
}

View File

@@ -109,7 +109,7 @@ public class Ipv4Util implements Ipv4Pool {
* <p>
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
* <p>
* 见https://github.com/dromara/hutool/issues/428
* 见https://github.com/chinabugotech/hutool/issues/428
*
* @return 本机网卡IP地址获取失败返回{@code null}
*/
@@ -129,7 +129,7 @@ public class Ipv4Util implements Ipv4Pool {
* <p>
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
* <p>
* 见https://github.com/dromara/hutool/issues/428
* 见https://github.com/chinabugotech/hutool/issues/428
*
* @return 本机网卡IP地址获取失败返回{@code null}
*/
@@ -149,7 +149,7 @@ public class Ipv4Util implements Ipv4Pool {
* <p>
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
* <p>
* 见https://github.com/dromara/hutool/issues/428
* 见https://github.com/chinabugotech/hutool/issues/428
*
* @param includeSiteLocal 是否包含局域网地址如10.0.0.0 ~ 10.255.255.255、172.16.0.0 ~ 172.31.255.255、192.168.0.0 ~ 192.168.255.255
* @return 本机网卡IP地址获取失败返回{@code null}

View File

@@ -168,7 +168,7 @@ public class Ipv6Util {
* <p>
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
* <p>
* 见https://github.com/dromara/hutool/issues/428
* 见https://github.com/chinabugotech/hutool/issues/428
*
* @return 本机网卡IP地址获取失败返回{@code null}
*/

View File

@@ -424,7 +424,7 @@ public class NetUtil {
* <p>
* 此方法不会抛出异常,获取失败将返回{@code null}<br>
* <p>
* 见https://github.com/dromara/hutool/issues/428
* 见https://github.com/chinabugotech/hutool/issues/428
*
* @return 本机网卡IP地址获取失败返回{@code null}
*/

View File

@@ -158,9 +158,9 @@ public interface RegexPool {
* 中国车牌号码(兼容新能源车牌)
*/
String PLATE_NUMBER =
//https://gitee.com/dromara/hutool/issues/I1B77H?from=project-issue
//https://gitee.com/chinabugotech/hutool/issues/I1B77H?from=project-issue
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
//https://gitee.com/dromara/hutool/issues/I1BJHE?from=project-issue
//https://gitee.com/chinabugotech/hutool/issues/I1BJHE?from=project-issue
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]\\d{3}\\d{1,3}[领])|" +
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$";

View File

@@ -807,7 +807,7 @@ public class ArrayUtilTest {
@Test
public void insertPrimitiveTest() {
// https://gitee.com/dromara/hutool/pulls/874
// https://gitee.com/chinabugotech/hutool/pulls/874
final boolean[] booleans = new boolean[10];
final byte[] bytes = new byte[10];

View File

@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
public class BeanCopyMappingTest {
/**
* https://gitee.com/dromara/hutool/issues/I4C48U <br>
* https://gitee.com/chinabugotech/hutool/issues/I4C48U <br>
* 传递复制不要用注解别名,应该用动态映射
*/
@Test

View File

@@ -301,7 +301,7 @@ public class BeanUtilTest {
final SubPersonWithAlias subPersonWithAlias = BeanUtil.toBean(map, SubPersonWithAlias.class);
assertEquals("sub名字", subPersonWithAlias.getSubName());
// https://gitee.com/dromara/hutool/issues/I6H0XF
// https://gitee.com/chinabugotech/hutool/issues/I6H0XF
// is_booleana并不匹配booleana字段
assertFalse(subPersonWithAlias.isBooleana());
Assertions.assertNull(subPersonWithAlias.getBooleanb());
@@ -569,7 +569,7 @@ public class BeanUtilTest {
}
/**
* <a href="https://github.com/dromara/hutool/issues/1173">#1173</a>
* <a href="https://github.com/chinabugotech/hutool/issues/1173">#1173</a>
*/
@Test
public void beanToBeanOverlayFieldTest() {
@@ -661,7 +661,7 @@ public class BeanUtilTest {
@Test
public void copyBeanPropertiesFunctionFilterTest() {
//https://gitee.com/dromara/hutool/pulls/590
//https://gitee.com/chinabugotech/hutool/pulls/590
final Person o = new Person();
o.setName("asd");
o.setAge(123);
@@ -982,7 +982,7 @@ public class BeanUtilTest {
@Test
public void valueProviderToBeanTest(){
// https://gitee.com/dromara/hutool/issues/I5B4R7
// https://gitee.com/chinabugotech/hutool/issues/I5B4R7
final CopyOptions copyOptions = CopyOptions.of();
final Map<String, String> filedMap= new HashMap<>();
filedMap.put("name", "sourceId");
@@ -1007,7 +1007,7 @@ public class BeanUtilTest {
@Test
public void hasGetterTest() {
// https://gitee.com/dromara/hutool/issues/I6M7Z7
// https://gitee.com/chinabugotech/hutool/issues/I6M7Z7
final boolean b = BeanUtil.hasGetter(Object.class);
assertFalse(b);
}

View File

@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
import java.io.Serializable;
/**
* https://github.com/dromara/hutool/issues/1687
* https://github.com/chinabugotech/hutool/issues/1687
*/
public class Issue1687Test {

View File

@@ -20,7 +20,7 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* https://github.com/dromara/hutool/issues/2009
* https://github.com/chinabugotech/hutool/issues/2009
*/
public class Issue2009Test {

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* https://github.com/dromara/hutool/issues/2082<br>
* https://github.com/chinabugotech/hutool/issues/2082<br>
* 当setXXX有重载方法的时候BeanDesc中会匹配到重载方法增加类型检查来规避之
*/
public class Issue2082Test {

View File

@@ -28,7 +28,7 @@ import java.util.Map;
public class Issue2202Test {
/**
* https://github.com/dromara/hutool/issues/2202
* https://github.com/chinabugotech/hutool/issues/2202
*/
@Test
public void mapToBeanWithFieldNameEditorTest(){

View File

@@ -25,7 +25,7 @@ public class Issue3096Test {
void beanDescTest() {
final BeanDesc desc = BeanUtil.getBeanDesc(User.class);
// https://github.com/dromara/hutool/issues/3096
// https://github.com/chinabugotech/hutool/issues/3096
// 新修改的规则中isLastPage字段优先匹配setIsLastPage这个顺序固定。
// 只有setIsLastPage不存在时才匹配setLastPage
Assertions.assertEquals("setLastPage", desc.getSetter("lastPage").getName());

View File

@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* https://gitee.com/dromara/hutool/issues/I8MEIX<br>
* https://gitee.com/chinabugotech/hutool/issues/I8MEIX<br>
* get操作非原子
*/
public class IssueI8MEIXTest {

View File

@@ -28,7 +28,7 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 见:<a href="https://github.com/dromara/hutool/issues/1895">https://github.com/dromara/hutool/issues/1895</a><br>
* 见:<a href="https://github.com/chinabugotech/hutool/issues/1895">https://github.com/chinabugotech/hutool/issues/1895</a><br>
* 并发问题测试在5.7.15前LRUCache存在并发问题多线程get后map结构变更导致null的位置不确定
* 并可能引起死锁。
*/
@@ -37,7 +37,7 @@ public class LRUCacheTest {
@Test
@Disabled
public void putTest(){
//https://github.com/dromara/hutool/issues/2227
//https://github.com/chinabugotech/hutool/issues/2227
final LRUCache<String, String> cache = CacheUtil.newLRUCache(100, 10);
for (int i = 0; i < 10000; i++) {
//ThreadUtil.execute(()-> cache.put(RandomUtil.randomString(5), "1243", 10));

View File

@@ -41,7 +41,7 @@ public class WeakCacheTest {
@Test
@Disabled
public void removeByGcTest(){
// https://gitee.com/dromara/hutool/issues/I51O7M
// https://gitee.com/chinabugotech/hutool/issues/I51O7M
final WeakCache<String, String> cache = new WeakCache<>(-1);
cache.put("a", "1");
cache.put("b", "2");

View File

@@ -37,7 +37,7 @@ public class ClassLoaderUtilTest {
@Test
public void isPresentTest() {
final boolean present = ClassLoaderUtil.isPresent("cn.hutool.v7.core.classloader.core.ClassLoaderUtil");
final boolean present = ClassLoaderUtil.isPresent("cn.hutool.v7.core.classloader.ClassLoaderUtil");
Assertions.assertTrue(present);
}

View File

@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* https://gitee.com/dromara/hutool/pulls/532
* https://gitee.com/chinabugotech/hutool/pulls/532
*/
public class MetroHashTest {

View File

@@ -895,7 +895,7 @@ public class CollUtilTest {
@Test
public void setValueByMapTest() {
// https://gitee.com/dromara/hutool/pulls/482
// https://gitee.com/chinabugotech/hutool/pulls/482
final List<Person> people = Arrays.asList(
new Person("aa", 12, "man", 1),
new Person("bb", 13, "woman", 2),

View File

@@ -32,7 +32,7 @@ import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
/**
* https://gitee.com/dromara/hutool/pulls/1240
* https://gitee.com/chinabugotech/hutool/pulls/1240
*/
public class IndexedComparatorTest {
@Test

View File

@@ -27,7 +27,7 @@ public class IssueI5DRU0Test {
@Test
@Disabled
public void appendTest(){
// https://gitee.com/dromara/hutool/issues/I5DRU0
// https://gitee.com/chinabugotech/hutool/issues/I5DRU0
// 向zip中添加文件的时候如果添加的文件的父目录已经存在会报错。实际中目录存在忽略即可。
ZipUtil.append(Paths.get("d:/test/zipTest.zip"), Paths.get("d:/test/zipTest"), StandardCopyOption.REPLACE_EXISTING);
}

View File

@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
import java.io.File;
/**
* https://gitee.com/dromara/hutool/issues/IAGYDG
* https://gitee.com/chinabugotech/hutool/issues/IAGYDG
*/
public class IssueIAGYDGTest {
@Test

View File

@@ -170,7 +170,7 @@ public class ZipUtilTest {
@Test
@Disabled
public void zipStreamTest(){
//https://github.com/dromara/hutool/issues/944
//https://github.com/chinabugotech/hutool/issues/944
final String dir = "d:/test";
final String zip = "d:/test.zip";
try (final OutputStream out = PathUtil.getOutputStream(Paths.get(zip))){
@@ -184,7 +184,7 @@ public class ZipUtilTest {
@Test
@Disabled
public void zipStreamTest2(){
// https://github.com/dromara/hutool/issues/944
// https://github.com/chinabugotech/hutool/issues/944
final String file1 = "d:/test/a.txt";
final String file2 = "d:/test/a.txt";
final String file3 = "d:/test/asn1.key";
@@ -234,7 +234,7 @@ public class ZipUtilTest {
@Test
@Disabled
public void unzipTest3() {
// https://github.com/dromara/hutool/issues/3018
// https://github.com/chinabugotech/hutool/issues/3018
ZipUtil.unzip("d:/test/default.zip", "d:/test/");
}
}

View File

@@ -410,7 +410,7 @@ public class ConvertTest {
@Test
public void toBigDecimalTest(){
// https://github.com/dromara/hutool/issues/1818
// https://github.com/chinabugotech/hutool/issues/1818
final String str = "33020000210909112800000124";
final BigDecimal bigDecimal = ConvertUtil.toBigDecimal(str);
assertEquals(str, bigDecimal.toPlainString());
@@ -420,7 +420,7 @@ public class ConvertTest {
@Test
public void toFloatTest(){
// https://gitee.com/dromara/hutool/issues/I4M0E4
// https://gitee.com/chinabugotech/hutool/issues/I4M0E4
final String hex2 = "CD0CCB43";
final byte[] value = HexUtil.decode(hex2);
final float f = ConvertUtil.toFloat(value);

View File

@@ -20,7 +20,7 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* https://github.com/dromara/hutool/issues/3105
* https://github.com/chinabugotech/hutool/issues/3105
*/
public class Issue3105Test {
@Test

View File

@@ -40,7 +40,7 @@ public class CalendarUtilTest {
final Calendar calendar = CalendarUtil.parse("2021-09-27 00:00:112323",
DateFormatPool.NORM_DATETIME_FORMAT, false);
// https://github.com/dromara/hutool/issues/1849
// https://github.com/chinabugotech/hutool/issues/1849
// 在使用严格模式时,秒不正确,抛出异常
DateUtil.date(calendar);
});

View File

@@ -137,7 +137,7 @@ public class ChineseDateTest {
@Test
public void getChineseMonthTest2(){
//https://github.com/dromara/hutool/issues/2112
//https://github.com/chinabugotech/hutool/issues/2112
final ChineseDate springFestival = new ChineseDate(Objects.requireNonNull(DateUtil.parse("2022-02-01")));
final String chineseMonth = springFestival.getChineseMonth();
Assertions.assertEquals("正月", chineseMonth);
@@ -145,7 +145,7 @@ public class ChineseDateTest {
@Test
public void day19700101Test(){
// https://gitee.com/dromara/hutool/issues/I4UTPK
// https://gitee.com/chinabugotech/hutool/issues/I4UTPK
Date date = DateUtil.parse("1970-01-01");
//noinspection ConstantConditions
ChineseDate chineseDate = new ChineseDate(date);
@@ -173,7 +173,7 @@ public class ChineseDateTest {
@Test
public void getGregorianDateTest(){
// https://gitee.com/dromara/hutool/issues/I4ZSGJ
// https://gitee.com/chinabugotech/hutool/issues/I4ZSGJ
ChineseDate chineseDate = new ChineseDate(1998, 5, 1);
Assertions.assertEquals("1998-06-24 00:00:00", chineseDate.getGregorianDate().toString());

View File

@@ -973,7 +973,7 @@ public class DateUtilTest {
@Test
public void parseNotFitTest() {
Assertions.assertThrows(DateException.class, ()->{
//https://github.com/dromara/hutool/issues/1332
//https://github.com/chinabugotech/hutool/issues/1332
// 在日期格式不匹配的时候,测试是否正常报错
DateUtil.parse("2020-12-23", DateFormatPool.PURE_DATE_PATTERN);
});

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
public class Issue2981Test {
/**
* https://github.com/dromara/hutool/issues/2981<br>
* https://github.com/chinabugotech/hutool/issues/2981<br>
* 按照ISO8601规范以Z结尾表示UTC时间否则为当地时间
*/
@SuppressWarnings("DataFlowIssue")

View File

@@ -24,7 +24,7 @@ import java.util.Calendar;
public class Issue3011Test {
@Test
public void isSameMonthTest() {
// https://github.com/dromara/hutool/issues/3011
// https://github.com/chinabugotech/hutool/issues/3011
// 判断是否同一个月,还需考虑公元前和公元后的的情况
// 此处公元前2020年和公元2021年返回年都是2021
final Calendar calendar1 = Calendar.getInstance();

View File

@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
public class StopWatchTest {
/**
* https://gitee.com/dromara/hutool/issues/I6HSBG
* https://gitee.com/chinabugotech/hutool/issues/I6HSBG
*/
@Test
public void prettyPrintTest() {

View File

@@ -50,7 +50,7 @@ public class ZodiacTest {
@Test
public void getZodiacOutOfRangeTest() {
// https://github.com/dromara/hutool/issues/3036
// https://github.com/chinabugotech/hutool/issues/3036
Assertions.assertThrows(IllegalArgumentException.class, ()-> DateUtil.getZodiac(Month.UNDECIMBER.getValue(), 10));
}
}

View File

@@ -24,7 +24,7 @@ import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* https://gitee.com/dromara/hutool/issues/I8IUTB
* https://gitee.com/chinabugotech/hutool/issues/I8IUTB
*/
public class DefaultRegexDateParserTest {

View File

@@ -95,7 +95,7 @@ public class FileTypeUtilTest {
@Test
@Disabled
public void webpTest() {
// https://gitee.com/dromara/hutool/issues/I5BGTF
// https://gitee.com/chinabugotech/hutool/issues/I5BGTF
final File file = FileUtil.file("d:/test/a.webp");
final BufferedInputStream inputStream = FileUtil.getInputStream(file);
final String type = FileTypeUtil.getType(inputStream);

View File

@@ -23,7 +23,7 @@ import java.io.File;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* https://gitee.com/dromara/hutool/issues/IAB65V
* https://gitee.com/chinabugotech/hutool/issues/IAB65V
*/
public class IssueIAB65VTest {
@Test

View File

@@ -44,7 +44,7 @@ public class CaseInsensitiveMapTest {
@Test
public void mergeTest(){
//https://github.com/dromara/hutool/issues/2086
//https://github.com/chinabugotech/hutool/issues/2086
final Map.Entry<String, String> b = MapUtil.entry("a", "value");
final Map.Entry<String, String> a = MapUtil.entry("A", "value");
final CaseInsensitiveMap<Object, Object> map = new CaseInsensitiveMap<>();

View File

@@ -22,6 +22,7 @@ import cn.hutool.v7.core.thread.ThreadUtil;
import cn.hutool.v7.core.util.ObjUtil;
import cn.hutool.v7.core.util.RandomUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
public class WeakConcurrentMapTest {
@@ -60,6 +61,7 @@ public class WeakConcurrentMapTest {
}
@Test
@Disabled
public void getConcurrencyTest() {
final WeakConcurrentMap<String, String> cache = new WeakConcurrentMap<>();
final ConcurrencyTester tester = new ConcurrencyTester(2000);

View File

@@ -48,7 +48,7 @@ public class CalculatorTest {
@Test
public void conversationTest5(){
// https://github.com/dromara/hutool/issues/1984
// https://github.com/chinabugotech/hutool/issues/1984
final double conversion = Calculator.conversion("((1/1) / (1/1) -1) * 100");
assertEquals(0, conversion, 0);
}
@@ -61,7 +61,7 @@ public class CalculatorTest {
@Test
public void conversationTest7() {
//https://gitee.com/dromara/hutool/issues/I4KONB
//https://gitee.com/chinabugotech/hutool/issues/I4KONB
final double conversion = Calculator.conversion("((-2395+0) * 0.3+140.24+35+90)/30");
assertEquals(-15.11D, conversion, 0.01);
}
@@ -69,7 +69,7 @@ public class CalculatorTest {
@Test
public void issue2964Test() {
// 忽略数字之间的运算符,按照乘法对待。
// https://github.com/dromara/hutool/issues/2964
// https://github.com/chinabugotech/hutool/issues/2964
final double calcValue = Calculator.conversion("(11+2)12");
assertEquals(156D, calcValue, 0.001);
}

View File

@@ -398,7 +398,7 @@ public class NumberUtilTest {
@Test
public void issue2878Test() throws ParseException {
// https://github.com/dromara/hutool/issues/2878
// https://github.com/chinabugotech/hutool/issues/2878
// 当数字中包含一些非数字字符时按照JDK的规则不做修改。
final BigDecimal bigDecimal = NumberUtil.toBigDecimal("345.sdf");
assertEquals(NumberFormat.getInstance().parse("345.sdf"), bigDecimal.longValue());

View File

@@ -44,7 +44,7 @@ public class UrlBuilderTest {
@Test
public void buildWithoutSlashTest() {
// https://github.com/dromara/hutool/issues/2459
// https://github.com/chinabugotech/hutool/issues/2459
String buildUrl = UrlBuilder.of().setScheme("http").setHost("192.168.1.1").setPort(8080).setWithEndTag(false).build();
assertEquals("http://192.168.1.1:8080", buildUrl);
@@ -297,7 +297,7 @@ public class UrlBuilderTest {
@Test
public void encodePathTest2() {
// https://gitee.com/dromara/hutool/issues/I4RA42
// https://gitee.com/chinabugotech/hutool/issues/I4RA42
// Path中`:`在第一个segment需要转义之后的不需要
final String urlStr = "https://hutool.cn/aa/bb/Pre-K,Kindergarten,First,Second,Third,Fourth,Fifth/Page:3";
final UrlBuilder urlBuilder = UrlBuilder.ofHttp(urlStr, CharsetUtil.UTF_8);
@@ -316,7 +316,7 @@ public class UrlBuilderTest {
@Test
public void fragmentEncodeTest() {
// https://gitee.com/dromara/hutool/issues/I49KAL
// https://gitee.com/chinabugotech/hutool/issues/I49KAL
// 见https://stackoverflow.com/questions/26088849/url-fragment-allowed-characters
final String url = "https://hutool.cn/docs/#/?id=简介";
UrlBuilder urlBuilder = UrlBuilder.ofHttp(url);
@@ -328,7 +328,7 @@ public class UrlBuilderTest {
@Test
public void slashEncodeTest() {
// https://github.com/dromara/hutool/issues/1904
// https://github.com/chinabugotech/hutool/issues/1904
// 在query中"/"是不可转义字符
// 见https://www.rfc-editor.org/rfc/rfc3986.html#section-3.4
final String url = "https://invoice.maycur.com/2b27a802-8423-4d41-86f5-63a6b259f61e.xlsx?download/2b27a802-8423-4d41-86f5-63a6b259f61e.xlsx&e=1630491088";
@@ -351,7 +351,7 @@ public class UrlBuilderTest {
@Test
public void addPathEncodeTest2() {
// https://github.com/dromara/hutool/issues/1912
// https://github.com/chinabugotech/hutool/issues/1912
final String url = UrlBuilder.of()
.setScheme("https")
.setHost("domain.cn")
@@ -377,7 +377,7 @@ public class UrlBuilderTest {
@Test
public void fragmentTest() {
// https://gitee.com/dromara/hutool/issues/I49KAL#note_8060874
// https://gitee.com/chinabugotech/hutool/issues/I49KAL#note_8060874
final String url = "https://www.hutool.cn/#/a/b?timestamp=1640391380204";
final UrlBuilder builder = UrlBuilder.ofHttp(url);
@@ -386,7 +386,7 @@ public class UrlBuilderTest {
@Test
public void fragmentAppendParamTest() {
// https://gitee.com/dromara/hutool/issues/I49KAL#note_8060874
// https://gitee.com/chinabugotech/hutool/issues/I49KAL#note_8060874
final String url = "https://www.hutool.cn/#/a/b";
final UrlBuilder builder = UrlBuilder.ofHttp(url);
builder.setFragment(builder.getFragment() + "?timestamp=1640391380204");
@@ -450,7 +450,7 @@ public class UrlBuilderTest {
@Test
public void issue2243Test() {
// https://github.com/dromara/hutool/issues/2243
// https://github.com/chinabugotech/hutool/issues/2243
// 如果用户已经做了%编码,不应该重复编码
final String url = "https://hutool.cn/v1.0?privateNum=%2B8616512884988";
final String s = UrlBuilder.of(url, null).toString();
@@ -492,7 +492,7 @@ public class UrlBuilderTest {
@Test
public void addPathTest() {
//https://gitee.com/dromara/hutool/issues/I5O4ML
//https://gitee.com/chinabugotech/hutool/issues/I5O4ML
UrlBuilder.of().addPath("");
UrlBuilder.of().addPath("/");
UrlBuilder.of().addPath("//");

View File

@@ -40,7 +40,7 @@ class UrlDecoderTest {
@Test
void issue3063Test() throws UnsupportedEncodingException {
// https://github.com/dromara/hutool/issues/3063
// https://github.com/chinabugotech/hutool/issues/3063
final String s = "测试";
final String expectedDecode = "%FE%FF%6D%4B%8B%D5";

View File

@@ -68,7 +68,7 @@ public class UrlQueryTest {
@Test
public void parseTest4() {
// https://github.com/dromara/hutool/issues/1989
// https://github.com/chinabugotech/hutool/issues/1989
final String queryStr = "imageMogr2/thumbnail/x800/format/jpg";
final UrlQuery query = UrlQuery.of(queryStr, CharsetUtil.UTF_8);
Assertions.assertEquals(queryStr, query.toString());

View File

@@ -23,7 +23,7 @@ import java.lang.reflect.Type;
import java.util.Map;
/**
* 见:<a href="https://gitee.com/dromara/hutool/pulls/447/files">https://gitee.com/dromara/hutool/pulls/447/files</a>
* 见:<a href="https://gitee.com/chinabugotech/hutool/pulls/447/files">https://gitee.com/chinabugotech/hutool/pulls/447/files</a>
* <p>
* TODO 同时继承泛型和实现泛型接口需要解析此处为F
*/

View File

@@ -573,7 +573,7 @@ public class EasyStreamTest {
}
/**
* https://github.com/dromara/hutool/pull/3128
* https://github.com/chinabugotech/hutool/pull/3128
*/
@Test
void testStreamBigDecimal() {

View File

@@ -37,7 +37,7 @@ public class CharSequenceUtilTest {
@Test
public void replaceTest2() {
// https://gitee.com/dromara/hutool/issues/I4M16G
// https://gitee.com/chinabugotech/hutool/issues/I4M16G
final String replace = "#{A}";
final String result = CharSequenceUtil.replace(replace, "#{AAAAAAA}", "1");
assertEquals(replace, result);
@@ -72,7 +72,7 @@ public class CharSequenceUtilTest {
result = CharSequenceUtil.addSuffixIfNot(str, " is Good");
assertEquals(str + " is Good", result);
// https://gitee.com/dromara/hutool/issues/I4NS0F
// https://gitee.com/chinabugotech/hutool/issues/I4NS0F
result = CharSequenceUtil.addSuffixIfNot("", "/");
assertEquals("/", result);
}
@@ -113,7 +113,7 @@ public class CharSequenceUtilTest {
@Test
public void subPreGbkTest() {
// https://gitee.com/dromara/hutool/issues/I4JO2E
// https://gitee.com/chinabugotech/hutool/issues/I4JO2E
final String s = "华硕K42Intel酷睿i31代2G以下独立显卡不含机械硬盘固态硬盘120GB-192GB4GB-6GB";
String v = CharSequenceUtil.subPreGbk(s, 40, false);
@@ -131,7 +131,7 @@ public class CharSequenceUtilTest {
@Test
public void startWithTest() {
// https://gitee.com/dromara/hutool/issues/I4MV7Q
// https://gitee.com/chinabugotech/hutool/issues/I4MV7Q
assertFalse(CharSequenceUtil.startWith("123", "123", false, true));
assertFalse(CharSequenceUtil.startWith(null, null, false, true));
assertFalse(CharSequenceUtil.startWith("abc", "abc", true, true));

View File

@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
public class IssueI73AB9Test {
/**
* https://gitee.com/dromara/hutool/issues/I73AB9
* https://gitee.com/chinabugotech/hutool/issues/I73AB9
*/
@Test
void subWithLengthTest() {

View File

@@ -50,16 +50,16 @@ public class NamingCaseTest {
.set("H#case", "H#case")
.set("PNLabel", "PN_label")
.set("wPRunOZTime", "w_P_run_OZ_time")
// https://github.com/dromara/hutool/issues/2070
// https://github.com/chinabugotech/hutool/issues/2070
.set("customerNickV2", "customer_nick_v2")
// https://gitee.com/dromara/hutool/issues/I4X9TT
// https://gitee.com/chinabugotech/hutool/issues/I4X9TT
.set("DEPT_NAME","DEPT_NAME")
.forEach((key, value) -> Assertions.assertEquals(value, NamingCase.toUnderlineCase(key)));
}
@Test
public void issueI5TVMUTest(){
// https://gitee.com/dromara/hutool/issues/I5TVMU
// https://gitee.com/chinabugotech/hutool/issues/I5TVMU
Assertions.assertEquals("t1C1", NamingCase.toUnderlineCase("t1C1"));
}

View File

@@ -389,7 +389,7 @@ public class StrUtilTest {
containsAny = StrUtil.containsAny("aaabbbccc", "d", "c");
Assertions.assertTrue(containsAny);
// https://gitee.com/dromara/hutool/issues/I7WSYD
// https://gitee.com/chinabugotech/hutool/issues/I7WSYD
containsAny = StrUtil.containsAny("你好啊", "", null);
Assertions.assertFalse(containsAny);
}
@@ -598,7 +598,7 @@ public class StrUtilTest {
@Test
public void testReplace2() {
// https://gitee.com/dromara/hutool/issues/I4M16G
// https://gitee.com/chinabugotech/hutool/issues/I4M16G
final String replace = "#{A}";
final String result = StrUtil.replace(replace, "#{AAAAAAA}", "1");
assertEquals(replace, result);

View File

@@ -62,7 +62,7 @@ public class TextSimilarityTest {
@Test
@Disabled
void longestCommonSubstringLengthTest() {
// https://github.com/dromara/hutool/issues/3045
// https://github.com/chinabugotech/hutool/issues/3045
final String strCommon = RandomUtil.randomStringLower(1024 * 32);
final String strA = RandomUtil.randomStringLower(1024 * 32) + strCommon;
final String strB = RandomUtil.randomStringLower(1024 * 32) + strCommon;

View File

@@ -55,7 +55,7 @@ public class EscapeUtilTest {
}
/**
* https://gitee.com/dromara/hutool/issues/I49JU8
* https://gitee.com/chinabugotech/hutool/issues/I49JU8
*/
@Test
public void escapeAllTest2(){

View File

@@ -105,7 +105,7 @@ public class SplitUtilTest {
}
/**
* https://github.com/dromara/hutool/issues/2099
* https://github.com/chinabugotech/hutool/issues/2099
*/
@Test
public void splitByRegexTest(){

View File

@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class SyncFinisherTest {
/**
* https://gitee.com/dromara/hutool/issues/I716SX
* https://gitee.com/chinabugotech/hutool/issues/I716SX
*/
@SuppressWarnings("DataFlowIssue")
@Test

View File

@@ -151,7 +151,7 @@ public class TreeTest {
}
/**
* https://gitee.com/dromara/hutool/pulls/1248/
* https://gitee.com/chinabugotech/hutool/pulls/1248/
*/
@Test
public void lambdaConfigTest() {

View File

@@ -33,7 +33,7 @@ public class ClassUtilTest {
@Test
public void getClassNameTest() {
final String className = ClassUtil.getClassName(ClassUtil.class, false);
Assertions.assertEquals("cn.hutool.v7.core.reflect.core.ClassUtil", className);
Assertions.assertEquals("cn.hutool.v7.core.reflect.ClassUtil", className);
final String simpleClassName = ClassUtil.getClassName(ClassUtil.class, true);
Assertions.assertEquals("ClassUtil", simpleClassName);
@@ -47,9 +47,10 @@ public class ClassUtilTest {
@Test
public void getShortClassNameTest() {
final String className = "cn.hutool.v7.core.text.core.StrUtil";
final String className = "cn.hutool.v7.core.text.StrUtil";
final String result = ClassUtil.getShortClassName(className);
Assertions.assertEquals("o.d.h.c.t.StrUtil", result);
System.out.println(result);
Assertions.assertEquals("c.h.v.c.t.StrUtil", result);
}
@Test

View File

@@ -62,7 +62,7 @@ public class HexUtilTest {
String a = "0x3544534F444";
Assertions.assertTrue(HexUtil.isHexNumber(a));
// https://gitee.com/dromara/hutool/issues/I62H7K
// https://gitee.com/chinabugotech/hutool/issues/I62H7K
a = "0x0000000000000001158e460913d00000";
Assertions.assertTrue(HexUtil.isHexNumber(a));
@@ -70,7 +70,7 @@ public class HexUtilTest {
a = "0x0000001000T00001158e460913d00000";
Assertions.assertFalse(HexUtil.isHexNumber(a));
// 错误的,https://github.com/dromara/hutool/issues/2857
// 错误的,https://github.com/chinabugotech/hutool/issues/2857
a = "-1";
Assertions.assertFalse(HexUtil.isHexNumber(a));
}

View File

@@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.List;
/**
* https://github.com/dromara/hutool/issues/3136
* https://github.com/chinabugotech/hutool/issues/3136
*/
public class Issue3136Test {

View File

@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
public class SystemUtilTest {
@Test
void getSystemPropertiesTest() {
final String s = SystemUtil.get("path");
final String s = SystemUtil.get("PATH");
Assertions.assertNotNull(s);
}
}

View File

@@ -14,5 +14,5 @@
# limitations under the License.
#
cn.hutool.v7.extra.aop.engine.spring.SpringCglibProxyEngine
cn.hutool.v7.extra.aop.engine.jdk.JdkProxyEngine
cn.hutool.v7.core.spi.ListServiceLoaderTest$TestService2
cn.hutool.v7.core.spi.ListServiceLoaderTest$TestService1