From a68f5e22cff4263d39a18f3d96e8fe9ae559dc99 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 13 May 2020 18:14:27 +0800 Subject: [PATCH] fix: fix code style --- .../nacos/config/server/controller/ConfigOpsController.java | 3 ++- .../alibaba/nacos/core/distributed/raft/utils/JRaftOps.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java index fc48978bd..c87239449 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java @@ -81,13 +81,14 @@ public class ConfigOpsController { @GetMapping(value = "/derby") public RestResult derbyOps(@RequestParam(value = "sql") String sql) { String selectSign = "select"; + String limitSign = "ROWS FETCH NEXT"; String limit = " OFFSET 0 ROWS FETCH NEXT 1000 ROWS ONLY"; try { if (PropertyUtil.isEmbeddedStorage()) { LocalDataSourceServiceImpl dataSourceService = (LocalDataSourceServiceImpl) DynamicDataSource .getInstance().getDataSource(); if (StringUtils.startsWithIgnoreCase(sql, selectSign)) { - if (!StringUtils.containsIgnoreCase(sql, "ROWS FETCH NEXT")) { + if (!StringUtils.containsIgnoreCase(sql, limitSign)) { sql += limit; } JdbcTemplate template = dataSourceService.getJdbcTemplate(); diff --git a/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/JRaftOps.java b/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/JRaftOps.java index 9e6f07342..1b419c4ff 100644 --- a/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/JRaftOps.java +++ b/core/src/main/java/com/alibaba/nacos/core/distributed/raft/utils/JRaftOps.java @@ -33,6 +33,7 @@ import java.util.Objects; /** * @author liaochuntao */ +@SuppressWarnings("all") public enum JRaftOps { TRANSFER_LEADER("transferLeader") {