private static Map<Method, List<InterceptorInvoker>> initInterceptorInvokers(BeanManager beanManager,
                                                                                 CreationalContext<?> creationalContext,
                                                                                 Class<?> restClient) {
        Map<Method, List<InterceptorInvoker>> invokers = new HashMap<>();
        // Interceptor as a key in a map is not entirely correct (custom interceptors) but should work in most cases
        Map<Interceptor<?>, Object> interceptorInstances = new HashMap<>();
        
        AnnotatedType<?> restClientType = beanManager.createAnnotatedType(restClient);

        List<Annotation> classBindings = getBindings(restClientType.getAnnotations(), beanManager);

        for (AnnotatedMethod<?> method : restClientType.getMethods()) {
            Method javaMethod = method.getJavaMember();
            if (javaMethod.isDefault() || method.isStatic()) {
                continue;
            }
            List<Annotation> methodBindings = getBindings(method.getAnnotations(), beanManager);

            if (!classBindings.isEmpty() || !methodBindings.isEmpty()) {
                // Liberty change begin - handle aggregated FT annotation
                if (FT_ANNO_CLASS != null && containsFTannotation(methodBindings)) {
                    methodBindings.add(getFTAnnotation());
                }
                // Liberty change end
                Annotation[] interceptorBindings = merge(methodBindings, classBindings);

                List<Interceptor<?>> interceptors =
                    new ArrayList<>(beanManager.resolveInterceptors(InterceptionType.AROUND_INVOKE, 
                                                                    interceptorBindings));
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.finest("Resolved interceptors from beanManager, " + beanManager + ":" + interceptors);
                }

                if (!interceptors.isEmpty()) {
                    List<InterceptorInvoker> chain = new ArrayList<>();
                    for (Interceptor<?> interceptor : interceptors) {
                        chain.add(
                            new InterceptorInvoker(interceptor, 
                                                   interceptorInstances.computeIfAbsent(interceptor, 
                                                       i -> beanManager.getReference(i, 
                                                                                     i.getBeanClass(), 
                                                                                     creationalContext))));
                    }
                    invokers.put(javaMethod, chain);
                }
            }
        }
        return invokers.isEmpty() ? Collections.emptyMap() : invokers;
    }
private static Map < Method , List < InterceptorInvoker > > initInterceptorInvokers ( BeanManager beanManager , CreationalContext < ? > creationalContext , Class < ? > restClient ) { Map < Method , List < InterceptorInvoker > > invokers = new HashMap < > ( ) ; Map < Interceptor < ? > , Object > interceptorInstances = new HashMap < > ( ) ; AnnotatedType < ? > restClientType = beanManager . createAnnotatedType ( restClient ) ; List < Annotation > classBindings = getBindings ( restClientType . getAnnotations ( ) , beanManager ) ; for ( AnnotatedMethod < ? > method : restClientType . getMethods ( ) ) { Method javaMethod = method . getJavaMember ( ) ; if ( javaMethod . isDefault ( ) || method . isStatic ( ) ) { continue ; } List < Annotation > methodBindings = getBindings ( method . getAnnotations ( ) , beanManager ) ; if ( ! classBindings . isEmpty ( ) || ! methodBindings . isEmpty ( ) ) { if ( FT_ANNO_CLASS != null && containsFTannotation ( methodBindings ) ) { methodBindings . add ( getFTAnnotation ( ) ) ; } Annotation [ ] interceptorBindings = merge ( methodBindings , classBindings ) ; List < Interceptor < ? > > interceptors = new ArrayList < > ( beanManager . resolveInterceptors ( InterceptionType . AROUND_INVOKE , interceptorBindings ) ) ; if ( LOG . isLoggable ( Level . FINEST ) ) { LOG . finest ( "Resolved interceptors from beanManager, " + beanManager + ":" + interceptors ) ; } if ( ! interceptors . isEmpty ( ) ) { List < InterceptorInvoker > chain = new ArrayList < > ( ) ; for ( Interceptor < ? > interceptor : interceptors ) { chain . add ( new InterceptorInvoker ( interceptor , interceptorInstances . computeIfAbsent ( interceptor , i -> beanManager . getReference ( i , i . getBeanClass ( ) , creationalContext ) ) ) ) ; } invokers . put ( javaMethod , chain ) ; } } } return invokers . isEmpty ( ) ? Collections . emptyMap ( ) : invokers ; }
Liberty change end