fix PageResult bug

This commit is contained in:
Looly 2021-07-08 00:57:24 +08:00
parent ba9bfee1b6
commit 2b824561ea
4 changed files with 8 additions and 5 deletions

View File

@ -17,6 +17,8 @@
### 🐞Bug修复 ### 🐞Bug修复
* 【core 】 修复RadixUtil.decode非static问题issue#I3YPEH@Gitee * 【core 】 修复RadixUtil.decode非static问题issue#I3YPEH@Gitee
* 【core 】 修复EqualsBuilder数组判断问题pr#1694@Github * 【core 】 修复EqualsBuilder数组判断问题pr#1694@Github
* 【setting】 修复Props中Charset对象无法序列化的问题pr#1694@Github
* 【db 】 修复PageResult首页判断逻辑问题issue#1699@Github
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------

View File

@ -31,7 +31,7 @@ public class PageUtil {
* *
* @param customFirstPageNo 自定义的首页页码为0或者1 * @param customFirstPageNo 自定义的首页页码为0或者1
*/ */
public static void setFirstPageNo(int customFirstPageNo) { synchronized public static void setFirstPageNo(int customFirstPageNo) {
firstPageNo = customFirstPageNo; firstPageNo = customFirstPageNo;
} }

View File

@ -16,7 +16,7 @@ public class PageResult<T> extends ArrayList<T> {
public static final int DEFAULT_PAGE_SIZE = Page.DEFAULT_PAGE_SIZE; public static final int DEFAULT_PAGE_SIZE = Page.DEFAULT_PAGE_SIZE;
/** /**
* 页码0表示第一页 * 页码{@link PageUtil#getFirstPageNo()}表示第一页
*/ */
private int page; private int page;
/** /**
@ -142,7 +142,7 @@ public class PageResult<T> extends ArrayList<T> {
* @return 是否第一页 * @return 是否第一页
*/ */
public boolean isFirst() { public boolean isFirst() {
return this.page == 0; return this.page == PageUtil.getFirstPageNo();
} }
/** /**

View File

@ -67,9 +67,10 @@ public final class Props extends Properties implements BasicTypeGetter<String>,
private URL propertiesFileUrl; private URL propertiesFileUrl;
private WatchMonitor watchMonitor; private WatchMonitor watchMonitor;
/** /**
* properties文件编码 * properties文件编码<br>
* issue#1701此属性不能被序列化故忽略序列化
*/ */
private Charset charset = CharsetUtil.CHARSET_ISO_8859_1; private transient Charset charset = CharsetUtil.CHARSET_ISO_8859_1;
// ----------------------------------------------------------------------- 私有属性 end // ----------------------------------------------------------------------- 私有属性 end
/** /**