code: protected <T> boolean handleRWMapper(ProviderInfo<T> em, Class<?> expectedType, Message m,
                                           Class<?> providerClass) {
          Class<?> mapperClass = ClassHelper.getRealClass(bus, em.getOldProvider());
          Type[] types = null;
          if (m != null && MessageUtils.isTrue(m.getContextualProperty(IGNORE_TYPE_VARIABLES))) {
              types = new Type[] { mapperClass };
          } else {
              types = getGenericInterfaces(mapperClass, expectedType);
          }
  
          for (Type t : types) {
              if (t instanceof ParameterizedType) {
                  ParameterizedType pt = (ParameterizedType) t;
                  Type[] args = pt.getActualTypeArguments();
                  for (int i = 0; i < args.length; i++) {
                      Type arg = args[i];
                      if (arg instanceof TypeVariable) {
                          TypeVariable<?> var = (TypeVariable<?>) arg;
                          Type[] bounds = var.getBounds();
                          boolean isResolved = false;
                          for (int j = 0; j < bounds.length; j++) {
                              Class<?> cls = InjectionUtils.getRawType(bounds[j]);
                              if (cls != null && cls.isAssignableFrom(expectedType)) {
                                  isResolved = true;
                                  break;
                              }
                          }
                          if (!isResolved) {
                              return false;
                          }
                          return true;
                      }
                      Class<?> actualClass = InjectionUtils.getRawType(arg);
                      if (actualClass == null) {
                          continue;
                      }
                      if (expectedType.isArray() && !actualClass.isArray()) {
                          expectedType = expectedType.getComponentType();
                      }
                      if (actualClass.isAssignableFrom(expectedType) || actualClass == Object.class) {
                          return true;
                      }
                  }
              } else if (t instanceof Class && providerClass.isAssignableFrom((Class<?>) t)) {
                  return true;
              }
          }
  
          return false;
      }
docs: _PERF_