This is an automated email from the ASF dual-hosted git repository.

zhangliang 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 e6ab264d8b9 Rename EncryptConditionValues.get() (#33624)
e6ab264d8b9 is described below

commit e6ab264d8b9499470b575f7b239f674c6fb21e11
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Nov 12 13:34:32 2024 +0800

    Rename EncryptConditionValues.get() (#33624)
---
 .../encrypt/rewrite/condition/EncryptConditionValues.java           | 6 +++---
 .../parameter/rewriter/EncryptPredicateParameterRewriter.java       | 2 +-
 .../predicate/EncryptPredicateRightValueTokenGenerator.java         | 2 +-
 .../encrypt/rewrite/condition/EncryptConditionValuesTest.java       | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValues.java
 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValues.java
index f231f9078f0..7c75d043096 100644
--- 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValues.java
+++ 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValues.java
@@ -32,12 +32,12 @@ public final class EncryptConditionValues {
     private final EncryptCondition condition;
     
     /**
-     * Get values.
+     * Get encrypt condition values.
      *
      * @param params parameters
-     * @return values
+     * @return got values
      */
-    public List<Object> getValues(final List<Object> params) {
+    public List<Object> get(final List<Object> params) {
         List<Object> result = new 
ArrayList<>(condition.getPositionValueMap().values());
         for (Entry<Integer, Integer> entry : 
condition.getPositionIndexMap().entrySet()) {
             Object param = params.get(entry.getValue());
diff --git 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/parameter/rewriter/EncryptPredicateParameterRewriter.java
 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/parameter/rewriter/EncryptPredicateParameterRewriter.java
index a0c6f75d03f..b4ca5e082c7 100644
--- 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/parameter/rewriter/EncryptPredicateParameterRewriter.java
+++ 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/parameter/rewriter/EncryptPredicateParameterRewriter.java
@@ -59,7 +59,7 @@ public final class EncryptPredicateParameterRewriter 
implements ParameterRewrite
         String schemaName = ((TableAvailable) 
sqlStatementContext).getTablesContext().getSchemaName()
                 .orElseGet(() -> new 
DatabaseTypeRegistry(sqlStatementContext.getDatabaseType()).getDefaultSchemaName(databaseName));
         for (EncryptCondition each : encryptConditions) {
-            encryptParameters(paramBuilder, each.getPositionIndexMap(), 
getEncryptedValues(schemaName, each, new 
EncryptConditionValues(each).getValues(params)));
+            encryptParameters(paramBuilder, each.getPositionIndexMap(), 
getEncryptedValues(schemaName, each, new 
EncryptConditionValues(each).get(params)));
         }
     }
     
diff --git 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/predicate/EncryptPredicateRightValueTokenGenerator.java
 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/predicate/EncryptPredicateRightValueTokenGenerator.java
index 09cf4eb1803..e5a221b20c2 100644
--- 
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/predicate/EncryptPredicateRightValueTokenGenerator.java
+++ 
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/predicate/EncryptPredicateRightValueTokenGenerator.java
@@ -85,7 +85,7 @@ public final class EncryptPredicateRightValueTokenGenerator 
implements Collectio
         int startIndex = encryptCondition.getStartIndex();
         int stopIndex = encryptCondition.getStopIndex();
         Map<Integer, Object> indexValues = getPositionValues(
-                encryptCondition.getPositionValueMap().keySet(), 
getEncryptedValues(schemaName, encryptTable, encryptCondition, new 
EncryptConditionValues(encryptCondition).getValues(parameters)));
+                encryptCondition.getPositionValueMap().keySet(), 
getEncryptedValues(schemaName, encryptTable, encryptCondition, new 
EncryptConditionValues(encryptCondition).get(parameters)));
         Collection<Integer> parameterMarkerIndexes = 
encryptCondition.getPositionIndexMap().keySet();
         if (encryptCondition instanceof EncryptBinaryCondition && 
((EncryptBinaryCondition) encryptCondition).getExpressionSegment() instanceof 
FunctionSegment) {
             FunctionSegment functionSegment = (FunctionSegment) 
((EncryptBinaryCondition) encryptCondition).getExpressionSegment();
diff --git 
a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValuesTest.java
 
b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValuesTest.java
index fbc7cec9b4a..3c049640a88 100644
--- 
a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValuesTest.java
+++ 
b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/condition/EncryptConditionValuesTest.java
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.when;
 class EncryptConditionValuesTest {
     
     @Test
-    void assertGetValues() {
+    void assertGet() {
         Map<Integer, Integer> positionIndexMap = new HashMap<>(2, 1F);
         positionIndexMap.put(0, 0);
         positionIndexMap.put(2, 1);
@@ -41,7 +41,7 @@ class EncryptConditionValuesTest {
         EncryptCondition condition = mock(EncryptCondition.class);
         when(condition.getPositionIndexMap()).thenReturn(positionIndexMap);
         when(condition.getPositionValueMap()).thenReturn(positionValueMap);
-        List<Object> actual = new 
EncryptConditionValues(condition).getValues(Arrays.asList("foo", "bar"));
+        List<Object> actual = new 
EncryptConditionValues(condition).get(Arrays.asList("foo", "bar"));
         assertThat(actual.size(), is(3));
         assertThat(actual.get(0), is("foo"));
         assertThat(actual.get(1), is(1));

Reply via email to