@@ -121,18 +121,18 @@ protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
121121
122122 boolean sticky = invokers .get (0 ).getUrl ()
123123 .getMethodParameter (methodName , Constants .CLUSTER_STICKY_KEY , Constants .DEFAULT_CLUSTER_STICKY );
124- {
125- //ignore overloaded method
126- if (stickyInvoker != null && !invokers .contains (stickyInvoker )) {
127- stickyInvoker = null ;
128- }
129- //ignore concurrency problem
130- if (sticky && stickyInvoker != null && (selected == null || !selected .contains (stickyInvoker ))) {
131- if (availablecheck && stickyInvoker .isAvailable ()) {
132- return stickyInvoker ;
133- }
124+
125+ //ignore overloaded method
126+ if (stickyInvoker != null && !invokers .contains (stickyInvoker )) {
127+ stickyInvoker = null ;
128+ }
129+ //ignore concurrency problem
130+ if (sticky && stickyInvoker != null && (selected == null || !selected .contains (stickyInvoker ))) {
131+ if (availablecheck && stickyInvoker .isAvailable ()) {
132+ return stickyInvoker ;
134133 }
135134 }
135+
136136 Invoker <T > invoker = doSelect (loadbalance , invocation , invokers , selected );
137137
138138 if (sticky ) {
@@ -210,19 +210,18 @@ private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
210210 }
211211
212212 // Just pick an available invoker using loadbalance policy
213- {
214- if (selected != null ) {
215- for (Invoker <T > invoker : selected ) {
216- if ((invoker .isAvailable ()) // available first
217- && !reselectInvokers .contains (invoker )) {
218- reselectInvokers .add (invoker );
219- }
213+ if (selected != null ) {
214+ for (Invoker <T > invoker : selected ) {
215+ if ((invoker .isAvailable ()) // available first
216+ && !reselectInvokers .contains (invoker )) {
217+ reselectInvokers .add (invoker );
220218 }
221219 }
222- if (!reselectInvokers .isEmpty ()) {
223- return loadbalance .select (reselectInvokers , getUrl (), invocation );
224- }
225220 }
221+ if (!reselectInvokers .isEmpty ()) {
222+ return loadbalance .select (reselectInvokers , getUrl (), invocation );
223+ }
224+
226225 return null ;
227226 }
228227
0 commit comments