This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1e1cb56 Refactor PaginationContext (#11943)
1e1cb56 is described below
commit 1e1cb565517c17cf02d749093e7a6ab061532fa8
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Aug 22 20:34:17 2021 +0800
Refactor PaginationContext (#11943)
---
.../infra/binder/segment/select/pagination/PaginationContext.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContext.java
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContext.java
index 711e1a6..0ee471e 100644
---
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContext.java
+++
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContext.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.binder.segment.select.pagination;
import lombok.Getter;
-import org.apache.commons.collections4.CollectionUtils;
import
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.NumberLiteralPaginationValueSegment;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.PaginationValueSegment;
@@ -54,7 +53,7 @@ public final class PaginationContext {
private long getValue(final PaginationValueSegment paginationValueSegment,
final List<Object> parameters) {
if (paginationValueSegment instanceof
ParameterMarkerPaginationValueSegment) {
- Object obj = CollectionUtils.isEmpty(parameters) ? 0L :
parameters.get(((ParameterMarkerPaginationValueSegment)
paginationValueSegment).getParameterIndex());
+ Object obj = null == parameters || parameters.isEmpty() ? 0L :
parameters.get(((ParameterMarkerPaginationValueSegment)
paginationValueSegment).getParameterIndex());
return obj instanceof Long ? (long) obj : (int) obj;
} else {
return ((NumberLiteralPaginationValueSegment)
paginationValueSegment).getValue();