From 65472e48a799051956a184017a47d9de0db4da28 Mon Sep 17 00:00:00 2001 From: Moary Chen Date: Fri, 10 Jan 2025 11:19:17 +0800 Subject: [PATCH] Sort --- .../merger/util/TestPropertiesComparer.java | 2 -- .../merger/util/TestPropertiesUtils.java | 16 ++++++++-------- .../util/TestPropertiesValueInjectHelper.java | 15 +++++++-------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesComparer.java b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesComparer.java index 312e7f2fc743b..0df94d3e802c1 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesComparer.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesComparer.java @@ -3,8 +3,6 @@ package com.azure.spring.messaging.servicebus.implementation.properties.merger.util; -import com.azure.spring.messaging.servicebus.implementation.properties.merger.util.TestPropertiesUtils; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesUtils.java b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesUtils.java index f3087fa294590..d400428bc20d3 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesUtils.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesUtils.java @@ -27,25 +27,25 @@ public class TestPropertiesUtils { public static final String GETTER_METHOD = "getter"; private static final String OTHERS_METHOD = "others"; - public static final Set> IGNORED_CLASSES = Set.of(Consumer.class, Object.class, Class.class); + public static final Set> IGNORED_CLASSES = Set.of(Class.class, Consumer.class, Object.class); public static final Set BUILT_IN_MEMBER_VARIABLE_NAMES = - Set.of("client", "proxy", "retry", "credential", "profile", "environment", "fixed", "exponential"); + Set.of("client", "credential", "environment", "exponential", "fixed", "profile", "proxy", "retry"); public static final Class[] NO_SETTER_PROPERTIES_CLASSES = new Class[] { - AzureAmqpSdkProperties.class, AmqpClientProperties.class, AmqpProxyProperties.class, AmqpRetryProperties.class, - TokenCredentialProperties.class, + AzureAmqpSdkProperties.class, + AzureEnvironmentProperties.class, + AzureProfileOptionsAdapter.class, AzureProfileProperties.class, ClientProperties.class, + ExponentialRetryProperties.class, + FixedRetryProperties.class, ProxyProperties.class, RetryProperties.class, - AzureEnvironmentProperties.class, - AzureProfileOptionsAdapter.class, - FixedRetryProperties.class, - ExponentialRetryProperties.class + TokenCredentialProperties.class }; public static String groupMethodName(Method method) { diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesValueInjectHelper.java b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesValueInjectHelper.java index 6ac82cc4b0ed8..6d735b7fa6f32 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesValueInjectHelper.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/util/TestPropertiesValueInjectHelper.java @@ -9,7 +9,6 @@ import com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider; import com.azure.spring.cloud.core.provider.RetryOptionsProvider; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; -import com.azure.spring.messaging.servicebus.implementation.properties.merger.util.TestPropertiesUtils; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -146,26 +145,26 @@ private static void invokeSetter(T target, static class HighPriorityMethodComparator implements Comparator { - private final List highPriorityVariables; + private final List priorities; - HighPriorityMethodComparator(List highPriorityVariables) { - this.highPriorityVariables = highPriorityVariables; + HighPriorityMethodComparator(List priorities) { + this.priorities = priorities; } @Override public int compare(Method o1, Method o2) { String o1Value = o1.getName().toLowerCase(); String o2Value = o2.getName().toLowerCase(); - if (highPriorityVariables.contains(o1Value) && !highPriorityVariables.contains(o2Value)) { + if (priorities.contains(o1Value) && !priorities.contains(o2Value)) { return 1; } - if (!highPriorityVariables.contains(o1Value) && highPriorityVariables.contains(o2Value)) { + if (!priorities.contains(o1Value) && priorities.contains(o2Value)) { return -1; } - if (highPriorityVariables.contains(o1Value) && highPriorityVariables.contains(o2Value)) { - return highPriorityVariables.indexOf(o1Value) - highPriorityVariables.indexOf(o2Value); + if (priorities.contains(o1Value) && priorities.contains(o2Value)) { + return priorities.indexOf(o1Value) - priorities.indexOf(o2Value); } return o1Value.compareTo(o2Value);