/*
Filters Joox by the spring bean's name (name or id) leveraging name to support legacy spring
765908
public static FastFilter springid(final String id)
    {
        return new FastFilter()
        {
            @Override
            public boolean filter(Context context)
            {
                String name = $(context).attr("name");
                String idVal = $(context).attr("id");

                LOG.info("Matching: " + id + " Against -- ID: " + idVal + " Name: " + name);

                return (StringUtils.equals(id, idVal) || StringUtils.equals(id, name));
            }
        };
    }
971711
private void registerJsonProxyBean(DefaultListableBeanFactory defaultListableBeanFactory, String className, String path) {
		BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
				.rootBeanDefinition(JsonProxyFactoryBean.class)
				.addPropertyValue("serviceUrl", appendBasePath(path))
				.addPropertyValue("serviceInterface", className);
		
		if (objectMapper != null) {
			beanDefinitionBuilder.addPropertyValue("objectMapper", objectMapper);
		}
		
		if (contentType != null) {
			beanDefinitionBuilder.addPropertyValue("contentType", contentType);
		}
		
		defaultListableBeanFactory.registerBeanDefinition(className + "-clientProxy", beanDefinitionBuilder.getBeanDefinition());
	}
29197
private void filterJPAParameterInfo(Type type, String name, String fieldName) {
        String attributeName = getAttributeName(fieldName);
        Attribute entityAttribute =
            ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(persistenceUnit))
                .getEntityAttribute(entityClass, attributeName);
        Class fieldType = entityAttribute.getJavaType();

        if (type.equals(Type.INDEXED)) {
            typedParameter.addJPAParameter(new JPAParameter(null, Integer.valueOf(name), fieldType));
        } else {
            typedParameter.addJPAParameter(new JPAParameter(name, null, fieldType));
        }
    }
833134
def set_col_name(self, index, name):
        
        javabridge.call(self.jobject, "setColName", "(ILjava/lang/String;)V", index, name)
1144945
static void filterUnwantedReferences(List<JpaRef> result, Collection<BeanId> query) {
        ListIterator<JpaRef> it = result.listIterator();
        while (it.hasNext()) {
            // remove reference from result that was not part of the query
            BeanId found = it.next().getSource();
            if (!query.contains(found)) {
                it.remove();
            }
        }
    }
35200
@SuppressWarnings("unchecked")
    public static <T> BeanMap<T> filterRequestFields(T src) {
        return (BeanMap<T>) FilteringBeanMap.from(src, parsePathProperties());
    }
997359
private void filterBranches(final Element root) {
        final QName[][] props = getExtProps(root.getAttribute(ATTRIBUTE_NAME_DOMAINS));
        filterBranches(root, Collections.emptyList(), props);
    }
219376
private String getConnectionFactoryName(String beanName) {
		if (beanName.length() > CONNECTION_FACTORY_SUFFIX.length()
				&& StringUtils.endsWithIgnoreCase(beanName, CONNECTION_FACTORY_SUFFIX)) {
			return beanName.substring(0,
					beanName.length() - CONNECTION_FACTORY_SUFFIX.length());
		}
		return beanName;
	}
1150092
private FilterIndexingServiceProvider findIndexingServiceProvider(IndexedFilter indexedFilter) {
      if (filterIndexingServiceProviders != null) {
         for (FilterIndexingServiceProvider provider : filterIndexingServiceProviders) {
            if (provider.supportsFilter(indexedFilter)) {
               return provider;
            }
         }
      }
      log.noFilterIndexingServiceProviderFound(indexedFilter.getClass().getName());
      return null;
   }
1265333
@SuppressWarnings("unused")
    private void initalizeReferences(Collection<Bean> beans) {
        Map<BeanId, Bean> userProvided = BeanUtils.uniqueIndex(beans);
        for (Bean bean : beans) {
            for (String name : bean.getReferenceNames()) {
                List<BeanId> values = bean.getReference(name);
                if (values == null) {
                    continue;
                }
                for (BeanId beanId : values) {
                    // the does not exist in storage, but may exist in the
                    // set of beans provided by the user.
                    Bean ref = userProvided.get(beanId);
                    if (ref == null) {
                        Optional<Bean> optional = beanManager.getEager(beanId);
                        if (optional.isPresent()) {
                            ref = optional.get();
                        }
                    }
                    beanId.setBean(ref);
                    schemaManager.setSchema(Arrays.asList(beanId.getBean()));
                }
            }
        }
    }
929964
private String annotationName(Annotation annotation) {
        if (annotation.annotationType().isAssignableFrom(Named.class)) {
            return ((Named) annotation).value();
        } else if ("javax.inject.Named".equals(annotation.annotationType().getName())) {
            return Jsr330Helper.getNamedValue(annotation);
        } else {
            return null;
        }
    }
864269
private void registerServiceProxy(DefaultListableBeanFactory defaultListableBeanFactory, String servicePath, String serviceBeanName) {
		BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JsonServiceExporter.class).addPropertyReference("service", serviceBeanName);
		BeanDefinition serviceBeanDefinition = findBeanDefinition(defaultListableBeanFactory, serviceBeanName);
		for (Class<?> currentInterface : getBeanInterfaces(serviceBeanDefinition, defaultListableBeanFactory.getBeanClassLoader())) {
			if (currentInterface.isAnnotationPresent(JsonRpcService.class)) {
				String serviceInterface = currentInterface.getName();
				logger.debug("Registering interface '{}' for JSON-RPC bean [{}].", serviceInterface, serviceBeanName);
				builder.addPropertyValue("serviceInterface", serviceInterface);
				break;
			}
		}
		if (objectMapper != null) {
			builder.addPropertyValue("objectMapper", objectMapper);
		}

		if (errorResolver != null) {
			builder.addPropertyValue("errorResolver", errorResolver);
		}

		if (invocationListener != null) {
			builder.addPropertyValue("invocationListener", invocationListener);
		}

		if (registerTraceInterceptor != null) {
			builder.addPropertyValue("registerTraceInterceptor", registerTraceInterceptor);
		}

		if (httpStatusCodeProvider != null) {
			builder.addPropertyValue("httpStatusCodeProvider", httpStatusCodeProvider);
		}

		if (convertedParameterTransformer != null) {
			builder.addPropertyValue("convertedParameterTransformer", convertedParameterTransformer);
		}

		builder.addPropertyValue("backwardsCompatible", backwardsCompatible);
		builder.addPropertyValue("rethrowExceptions", rethrowExceptions);
		builder.addPropertyValue("allowExtraParams", allowExtraParams);
		builder.addPropertyValue("allowLessParams", allowLessParams);

		defaultListableBeanFactory.registerBeanDefinition(servicePath, builder.getBeanDefinition());
	}
236393
private void registerJsfCdiToSpring(BeanDefinition definition) {

		if (definition instanceof AnnotatedBeanDefinition) {
			AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;

			String scopeName = null;
			// firstly check whether bean is defined via configuration
			if (annDef.getFactoryMethodMetadata() != null) {
				scopeName = deduceScopeName(annDef.getFactoryMethodMetadata());
			}
			else {
				// fallback to type
				scopeName = deduceScopeName(annDef.getMetadata());
			}

			if (scopeName != null) {
				definition.setScope(scopeName);

				log.debug("{} - Scope({})", definition.getBeanClassName(), scopeName.toUpperCase());
			}
		}
	}
929655
public static @NotNull SqlQuery namedQuery(@NotNull @SQL String sql, @NotNull Object bean) {
        return namedQuery(sql, VariableResolver.forBean(bean));
    }
768495
@Bean
	@ConditionalOnProperty(value = "spring.sleuth.web.exception-logging-filter-enabled",
			matchIfMissing = true)
	public FilterRegistrationBean exceptionThrowingFilter(
			SleuthWebProperties webProperties) {
		FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(
				new ExceptionLoggingFilter());
		filterRegistrationBean.setDispatcherTypes(DispatcherType.ASYNC,
				DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.INCLUDE,
				DispatcherType.REQUEST);
		filterRegistrationBean.setOrder(webProperties.getFilterOrder());
		return filterRegistrationBean;
	}
1255631
protected ConnectionFactory retrieveConnectionFactory(String name) throws JMSException {
        if (name == null && defaultConnectionFactory != null) {
            return defaultConnectionFactory; // injected
        }
        else {
            try {
                // autowiring did not occur
                return (ConnectionFactory)SpringAppContext.getInstance().getBean(name);
            }
            catch (Exception ex) {
                logger.severeException(ex.getMessage(), ex);
                throw new JMSException("JMS ConnectionFactory not found: " + name);
            }
        }
    }
783633
function filter(name, options) {
  return utils.through.obj(function(file, enc, next) {
    if (file.isNull()) {
      next();
      return;
    }

    var basename = path.basename(file.history[0]);
    var stem = basename.slice(0, -3);

    if (basename === name || stem === name) {
      next(null, file);
    } else {
      next();
    }
  });
}