摘抄spring源码中的Java工具类的代码片段

/**
 * Load a {@link ClassPathResource} qualified by the simple name of clazz,
 * and relative to the package for clazz.
 * 

Example: given a clazz 'com.foo.BarTests' and a resourceSuffix of 'context.xml', * this method will return a ClassPathResource representing com/foo/BarTests-context.xml *

Intended for use loading context configuration XML files within JUnit tests. */ public static ClassPathResource qualifiedResource(Class clazz, String resourceSuffix) { return new ClassPathResource(String.format("%s-%s", clazz.getSimpleName(), resourceSuffix), clazz); }

private final Set singletonsCurrentlyInCreation =
      Collections.newSetFromMap(new ConcurrentHashMap<>(16));

 

你可能感兴趣的:(spring)