mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix bug
This commit is contained in:
parent
41532e0a4d
commit
acf40a5d1f
@ -43,6 +43,7 @@
|
|||||||
* 【core 】 修复DateUtil.formatChineseDate显示问题(issue#I4KK5F@Gitee)
|
* 【core 】 修复DateUtil.formatChineseDate显示问题(issue#I4KK5F@Gitee)
|
||||||
* 【poi 】 修复CellUtil.setCellValuestyle空导致值无法写入问题(issue#1995@Github)
|
* 【poi 】 修复CellUtil.setCellValuestyle空导致值无法写入问题(issue#1995@Github)
|
||||||
* 【poi 】 修复CellUtil.setComment参数设置错误问题
|
* 【poi 】 修复CellUtil.setComment参数设置错误问题
|
||||||
|
* 【core 】 修复QueryBuilder解析路径导致的错误(issue#1989@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -322,14 +322,6 @@ public class UrlQuery {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i - pos == len) {
|
|
||||||
// 没有任何参数符号
|
|
||||||
if (queryStr.startsWith("http") || queryStr.contains("/")) {
|
|
||||||
// 可能为url路径,忽略之
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理结尾
|
// 处理结尾
|
||||||
addParam(name, queryStr.substring(pos, i), charset);
|
addParam(name, queryStr.substring(pos, i), charset);
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package cn.hutool.core.lang.tree;
|
package cn.hutool.core.lang.tree;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.lang.Console;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@ -95,12 +94,12 @@ public class TreeTest {
|
|||||||
final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
|
final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
|
||||||
tree.filter((t)->{
|
tree.filter((t)->{
|
||||||
final CharSequence name = t.getName();
|
final CharSequence name = t.getName();
|
||||||
return null != name && name.toString().contains("管理");
|
return null != name && name.toString().contains("店铺");
|
||||||
});
|
});
|
||||||
|
|
||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
tree.walk((tr)-> ids.add(tr.getId()));
|
tree.walk((tr)-> ids.add(tr.getId()));
|
||||||
Assert .assertEquals(6, ids.size());
|
Assert .assertEquals(4, ids.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -313,4 +313,11 @@ public class UrlBuilderTest {
|
|||||||
final UrlBuilder of = UrlBuilder.ofHttpWithoutEncode(url);
|
final UrlBuilder of = UrlBuilder.ofHttpWithoutEncode(url);
|
||||||
Assert.assertEquals(url, of.toString());
|
Assert.assertEquals(url, of.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void paramTest(){
|
||||||
|
String url = "http://ci.xiaohongshu.com/spectrum/c136c98aa2047babe25b994a26ffa7b492bd8058?imageMogr2/thumbnail/x800/format/jpg";
|
||||||
|
final UrlBuilder builder = UrlBuilder.ofHttp(url);
|
||||||
|
Assert.assertEquals(url, builder.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,18 @@ public class UrlQueryTest {
|
|||||||
public void parseTest3(){
|
public void parseTest3(){
|
||||||
// issue#1688@Github
|
// issue#1688@Github
|
||||||
String u = "https://www.baidu.com/proxy";
|
String u = "https://www.baidu.com/proxy";
|
||||||
final UrlQuery query = UrlQuery.of(u, Charset.defaultCharset());
|
final UrlQuery query = UrlQuery.of(URLUtil.url(u).getQuery(), Charset.defaultCharset());
|
||||||
Assert.assertTrue(MapUtil.isEmpty(query.getQueryMap()));
|
Assert.assertTrue(MapUtil.isEmpty(query.getQueryMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void parseTest4(){
|
||||||
|
// https://github.com/dromara/hutool/issues/1989
|
||||||
|
String queryStr = "imageMogr2/thumbnail/x800/format/jpg";
|
||||||
|
final UrlQuery query = UrlQuery.of(queryStr, CharsetUtil.CHARSET_UTF_8);
|
||||||
|
Assert.assertEquals(queryStr, query.toString());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void buildWithMapTest() {
|
public void buildWithMapTest() {
|
||||||
Map<String, String> map = new LinkedHashMap<>();
|
Map<String, String> map = new LinkedHashMap<>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user