From 8c1ba6a4f07cb1ba212670a77df44d1d91a5708a Mon Sep 17 00:00:00 2001 From: duanzhengqiang Date: Wed, 29 Nov 2023 11:07:53 +0800 Subject: [PATCH] minor refactor of SQLHintUtils --- .../java/org/apache/shardingsphere/infra/hint/SQLHintUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintUtils.java index c3ca0598253e6..8b73a6e9cd350 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintUtils.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintUtils.java @@ -62,7 +62,7 @@ public static Properties getSQLHintProps(final String comment) { int endIndex = comment.endsWith(SQL_COMMENT_SUFFIX) ? comment.indexOf(SQL_COMMENT_SUFFIX) : comment.length(); Collection sqlHints = Splitter.on(SQL_HINT_SPLIT).trimResults().splitToList(comment.substring(startIndex, endIndex).trim()); for (String each : sqlHints) { - List hintValues = Splitter.on(SQL_HINT_VALUE_SPLIT).trimResults().splitToList(each); + List hintValues = Splitter.on(SQL_HINT_VALUE_SPLIT).limit(SQL_HINT_VALUE_SIZE).trimResults().splitToList(each); if (SQL_HINT_VALUE_SIZE == hintValues.size()) { result.put(hintValues.get(0), convert(hintValues.get(1))); }