test_class.declarator: classpathCache
test_class.modifier: private static
test_class.original_string: private static ClasspathCache classpathCache;
test_class.type: ClasspathCache
test_class.var_name: classpathCache
test_class.file: agent/core/src/test/java/org/glowroot/agent/live/ClasspathCacheTest.java
test_class.identifier: ClasspathCacheTest
test_case.body: @Test
      public void shouldReadFullFullClass() {
          // when
          List<String> classNames =
                  classpathCache.getMatchingClassNames("com.google.common.collect.ImmutableMap", 5);
          // then
          assertThat(classNames).contains("com.google.common.collect.ImmutableMap");
      }
test_case.class_method_signature: ClasspathCacheTest.shouldReadFullFullClass()
test_case.full_signature: @Test public void shouldReadFullFullClass()
test_case.identifier: shouldReadFullFullClass
test_case.invocations: getMatchingClassNames contains assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReadFullFullClass()
focal_class.declarator: logger = LoggerFactory.getLogger(ClasspathCache.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ClasspathCache.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: analyzedWorld
focal_class.modifier: private final
focal_class.original_string: private final AnalyzedWorld analyzedWorld;
focal_class.type: AnalyzedWorld
focal_class.var_name: analyzedWorld
focal_class.declarator: instrumentation
focal_class.modifier: private final @Nullable
focal_class.original_string: private final @Nullable Instrumentation instrumentation;
focal_class.type: Instrumentation
focal_class.var_name: instrumentation
focal_class.declarator: classpathLocations = Sets.newHashSet()
focal_class.modifier: @GuardedBy("this")
      private final
focal_class.original_string: @GuardedBy("this")
      private final Set<Location> classpathLocations = Sets.newHashSet();
focal_class.type: Set<Location>
focal_class.var_name: classpathLocations
focal_class.declarator: classNameLocations = ImmutableMultimap.of()
focal_class.modifier: @GuardedBy("this")
      private
focal_class.original_string: @GuardedBy("this")
      private ImmutableMultimap<String, Location> classNameLocations = ImmutableMultimap.of();
focal_class.type: ImmutableMultimap<String, Location>
focal_class.var_name: classNameLocations
focal_class.file: agent/core/src/main/java/org/glowroot/agent/live/ClasspathCache.java
focal_class.identifier: ClasspathCache
focal_class.class_method_signature: ClasspathCache.ClasspathCache(AnalyzedWorld analyzedWorld, @Nullable Instrumentation instrumentation)
focal_class.full_signature:   ClasspathCache(AnalyzedWorld analyzedWorld, @Nullable Instrumentation instrumentation)
focal_class.identifier: ClasspathCache
focal_class.parameters: (AnalyzedWorld analyzedWorld, @Nullable Instrumentation instrumentation)
focal_class.signature:  ClasspathCache(AnalyzedWorld analyzedWorld, @Nullable Instrumentation instrumentation)
focal_class.class_method_signature: ClasspathCache.getMatchingClassNames(String partialClassName, int limit)
focal_class.full_signature: synchronized ImmutableList<String> getMatchingClassNames(String partialClassName, int limit)
focal_class.identifier: getMatchingClassNames
focal_class.modifiers: synchronized
focal_class.parameters: (String partialClassName, int limit)
focal_class.return: ImmutableList<String>
focal_class.signature: ImmutableList<String> getMatchingClassNames(String partialClassName, int limit)
focal_class.class_method_signature: ClasspathCache.getAnalyzedMethods(String className)
focal_class.full_signature: synchronized ImmutableList<UiAnalyzedMethod> getAnalyzedMethods(String className)
focal_class.identifier: getAnalyzedMethods
focal_class.modifiers: synchronized
focal_class.parameters: (String className)
focal_class.return: ImmutableList<UiAnalyzedMethod>
focal_class.signature: ImmutableList<UiAnalyzedMethod> getAnalyzedMethods(String className)
focal_class.class_method_signature: ClasspathCache.updateCache()
focal_class.full_signature: synchronized void updateCache()
focal_class.identifier: updateCache
focal_class.modifiers: synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateCache()
focal_class.class_method_signature: ClasspathCache.updateCacheWithClasspathClasses(Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void updateCacheWithClasspathClasses(Multimap<String, Location> newClassNameLocations)
focal_class.identifier: updateCacheWithClasspathClasses
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void updateCacheWithClasspathClasses(Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.updateCacheWithBootstrapClasses(Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void updateCacheWithBootstrapClasses(Multimap<String, Location> newClassNameLocations)
focal_class.identifier: updateCacheWithBootstrapClasses
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void updateCacheWithBootstrapClasses(Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.updateCache(ClassLoader loader, Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void updateCache(ClassLoader loader, Multimap<String, Location> newClassNameLocations)
focal_class.identifier: updateCache
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (ClassLoader loader, Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void updateCache(ClassLoader loader, Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.getKnownClassLoaders()
focal_class.full_signature: private List<ClassLoader> getKnownClassLoaders()
focal_class.identifier: getKnownClassLoaders
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: List<ClassLoader>
focal_class.signature: List<ClassLoader> getKnownClassLoaders()
focal_class.class_method_signature: ClasspathCache.loadClassNames(Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void loadClassNames(Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNames
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNames(Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromJarFile(File jarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void loadClassNamesFromJarFile(File jarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromJarFile
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (File jarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromJarFile(File jarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromManifestClassPath(JarInputStream jarIn, File jarFile,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: @GuardedBy("this") private void loadClassNamesFromManifestClassPath(JarInputStream jarIn, File jarFile,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromManifestClassPath
focal_class.modifiers: @GuardedBy("this") private
focal_class.parameters: (JarInputStream jarIn, File jarFile,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromManifestClassPath(JarInputStream jarIn, File jarFile,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.combineClassNamesWithLimit(
              Set<String> fullMatchingClassNames, Set<String> matchingClassNames, int limit)
focal_class.full_signature: private static ImmutableList<String> combineClassNamesWithLimit(
              Set<String> fullMatchingClassNames, Set<String> matchingClassNames, int limit)
focal_class.identifier: combineClassNamesWithLimit
focal_class.modifiers: private static
focal_class.parameters: (
              Set<String> fullMatchingClassNames, Set<String> matchingClassNames, int limit)
focal_class.return: ImmutableList<String>
focal_class.signature: ImmutableList<String> combineClassNamesWithLimit(
              Set<String> fullMatchingClassNames, Set<String> matchingClassNames, int limit)
focal_class.class_method_signature: ClasspathCache.getAnalyzedMethods(Location location, String className)
focal_class.full_signature: private static List<UiAnalyzedMethod> getAnalyzedMethods(Location location, String className)
focal_class.identifier: getAnalyzedMethods
focal_class.modifiers: private static
focal_class.parameters: (Location location, String className)
focal_class.return: List<UiAnalyzedMethod>
focal_class.signature: List<UiAnalyzedMethod> getAnalyzedMethods(Location location, String className)
focal_class.class_method_signature: ClasspathCache.getAnalyzedMethods(byte[] bytes)
focal_class.full_signature: private static List<UiAnalyzedMethod> getAnalyzedMethods(byte[] bytes)
focal_class.identifier: getAnalyzedMethods
focal_class.modifiers: private static
focal_class.parameters: (byte[] bytes)
focal_class.return: List<UiAnalyzedMethod>
focal_class.signature: List<UiAnalyzedMethod> getAnalyzedMethods(byte[] bytes)
focal_class.class_method_signature: ClasspathCache.getAnalyzedMethods(Class<?> clazz)
focal_class.full_signature: private static List<UiAnalyzedMethod> getAnalyzedMethods(Class<?> clazz)
focal_class.identifier: getAnalyzedMethods
focal_class.modifiers: private static
focal_class.parameters: (Class<?> clazz)
focal_class.return: List<UiAnalyzedMethod>
focal_class.signature: List<UiAnalyzedMethod> getAnalyzedMethods(Class<?> clazz)
focal_class.class_method_signature: ClasspathCache.tryToGetFileFromURL(URL url, ClassLoader loader)
focal_class.full_signature: private static @Nullable Location tryToGetFileFromURL(URL url, ClassLoader loader)
focal_class.identifier: tryToGetFileFromURL
focal_class.modifiers: private static @Nullable
focal_class.parameters: (URL url, ClassLoader loader)
focal_class.return: Location
focal_class.signature: Location tryToGetFileFromURL(URL url, ClassLoader loader)
focal_class.class_method_signature: ClasspathCache.getURLs(ClassLoader loader)
focal_class.full_signature: private static List<URL> getURLs(ClassLoader loader)
focal_class.identifier: getURLs
focal_class.modifiers: private static
focal_class.parameters: (ClassLoader loader)
focal_class.return: List<URL>
focal_class.signature: List<URL> getURLs(ClassLoader loader)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromDirectory(File dir, String prefix, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: private static void loadClassNamesFromDirectory(File dir, String prefix, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromDirectory
focal_class.modifiers: private static
focal_class.parameters: (File dir, String prefix, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromDirectory(File dir, String prefix, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromJarFileInsideJarFile(File jarFile,
              String jarFileInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: private static void loadClassNamesFromJarFileInsideJarFile(File jarFile,
              String jarFileInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromJarFileInsideJarFile
focal_class.modifiers: private static
focal_class.parameters: (File jarFile,
              String jarFileInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromJarFileInsideJarFile(File jarFile,
              String jarFileInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromDirectoryInsideJarFile(File jarFile,
              String directoryInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: private static void loadClassNamesFromDirectoryInsideJarFile(File jarFile,
              String directoryInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromDirectoryInsideJarFile
focal_class.modifiers: private static
focal_class.parameters: (File jarFile,
              String directoryInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromDirectoryInsideJarFile(File jarFile,
              String directoryInsideJarFile, Location location,
              Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.loadClassNamesFromJarInputStream(JarInputStream jarIn, String directory,
              Location location, Multimap<String, Location> newClassNameLocations)
focal_class.full_signature: private static void loadClassNamesFromJarInputStream(JarInputStream jarIn, String directory,
              Location location, Multimap<String, Location> newClassNameLocations)
focal_class.identifier: loadClassNamesFromJarInputStream
focal_class.modifiers: private static
focal_class.parameters: (JarInputStream jarIn, String directory,
              Location location, Multimap<String, Location> newClassNameLocations)
focal_class.return: void
focal_class.signature: void loadClassNamesFromJarInputStream(JarInputStream jarIn, String directory,
              Location location, Multimap<String, Location> newClassNameLocations)
focal_class.class_method_signature: ClasspathCache.getFileFromJBossVfsURL(URL url, ClassLoader loader)
focal_class.full_signature: private static @Nullable Location getFileFromJBossVfsURL(URL url, ClassLoader loader)
focal_class.identifier: getFileFromJBossVfsURL
focal_class.modifiers: private static @Nullable
focal_class.parameters: (URL url, ClassLoader loader)
focal_class.return: Location
focal_class.signature: Location getFileFromJBossVfsURL(URL url, ClassLoader loader)
focal_class.class_method_signature: ClasspathCache.getLocationFromFile(File file)
focal_class.full_signature: private static @Nullable Location getLocationFromFile(File file)
focal_class.identifier: getLocationFromFile
focal_class.modifiers: private static @Nullable
focal_class.parameters: (File file)
focal_class.return: Location
focal_class.signature: Location getLocationFromFile(File file)
focal_class.class_method_signature: ClasspathCache.getLocationFromJarFile(String f)
focal_class.full_signature: private static Location getLocationFromJarFile(String f)
focal_class.identifier: getLocationFromJarFile
focal_class.modifiers: private static
focal_class.parameters: (String f)
focal_class.return: Location
focal_class.signature: Location getLocationFromJarFile(String f)
focal_class.class_method_signature: ClasspathCache.getBytes(Location location, String className)
focal_class.full_signature: private static byte[] getBytes(Location location, String className)
focal_class.identifier: getBytes
focal_class.modifiers: private static
focal_class.parameters: (Location location, String className)
focal_class.return: byte[]
focal_class.signature: byte[] getBytes(Location location, String className)
focal_class.class_method_signature: ClasspathCache.getBytesFromJarFile(String name, File jarFile)
focal_class.full_signature: private static byte[] getBytesFromJarFile(String name, File jarFile)
focal_class.identifier: getBytesFromJarFile
focal_class.modifiers: private static
focal_class.parameters: (String name, File jarFile)
focal_class.return: byte[]
focal_class.signature: byte[] getBytesFromJarFile(String name, File jarFile)
focal_class.class_method_signature: ClasspathCache.getBytesFromJarFileInsideJarFile(String name, File jarFile,
              String jarFileInsideJarFile)
focal_class.full_signature: private static byte[] getBytesFromJarFileInsideJarFile(String name, File jarFile,
              String jarFileInsideJarFile)
focal_class.identifier: getBytesFromJarFileInsideJarFile
focal_class.modifiers: private static
focal_class.parameters: (String name, File jarFile,
              String jarFileInsideJarFile)
focal_class.return: byte[]
focal_class.signature: byte[] getBytesFromJarFileInsideJarFile(String name, File jarFile,
              String jarFileInsideJarFile)
focal_class.class_method_signature: ClasspathCache.getBytesFromDirectoryInsideJarFile(String name, File jarFile,
              String directoryInsideJarFile)
focal_class.full_signature: private static byte[] getBytesFromDirectoryInsideJarFile(String name, File jarFile,
              String directoryInsideJarFile)
focal_class.identifier: getBytesFromDirectoryInsideJarFile
focal_class.modifiers: private static
focal_class.parameters: (String name, File jarFile,
              String directoryInsideJarFile)
focal_class.return: byte[]
focal_class.signature: byte[] getBytesFromDirectoryInsideJarFile(String name, File jarFile,
              String directoryInsideJarFile)
focal_method.body: synchronized ImmutableList<String> getMatchingClassNames(String partialClassName, int limit) {
          // update cache before proceeding
          updateCache();
          PartialClassNameMatcher matcher = new PartialClassNameMatcher(partialClassName);
          Set<String> fullMatchingClassNames = Sets.newLinkedHashSet();
          Set<String> matchingClassNames = Sets.newLinkedHashSet();
          // also check loaded classes, e.g. for groovy classes
          Iterator<String> i = classNameLocations.keySet().iterator();
          if (instrumentation != null) {
              List<String> loadedClassNames = Lists.newArrayList();
              for (Class<?> clazz : instrumentation.getAllLoadedClasses()) {
                  if (!clazz.getName().startsWith("[")) {
                      loadedClassNames.add(clazz.getName());
                  }
              }
              i = Iterators.concat(i, loadedClassNames.iterator());
          }
          while (i.hasNext()) {
              String className = i.next();
              String classNameUpper = className.toUpperCase(Locale.ENGLISH);
              boolean potentialFullMatch = matcher.isPotentialFullMatch(classNameUpper);
              if (matchingClassNames.size() == limit && !potentialFullMatch) {
                  // once limit reached, only consider full matches
                  continue;
              }
              if (fullMatchingClassNames.size() == limit) {
                  break;
              }
              if (matcher.isPotentialMatch(classNameUpper)) {
                  if (potentialFullMatch) {
                      fullMatchingClassNames.add(className);
                  } else {
                      matchingClassNames.add(className);
                  }
              }
          }
          return combineClassNamesWithLimit(fullMatchingClassNames, matchingClassNames, limit);
      }
focal_method.class_method_signature: ClasspathCache.getMatchingClassNames(String partialClassName, int limit)
focal_method.full_signature: synchronized ImmutableList<String> getMatchingClassNames(String partialClassName, int limit)
focal_method.identifier: getMatchingClassNames
focal_method.invocations: updateCache newLinkedHashSet newLinkedHashSet iterator keySet newArrayList getAllLoadedClasses startsWith getName add getName concat iterator hasNext next toUpperCase isPotentialFullMatch size size isPotentialMatch add add combineClassNamesWithLimit
focal_method.modifiers: synchronized
focal_method.parameters: (String partialClassName, int limit)
focal_method.return: ImmutableList<String>
focal_method.signature: ImmutableList<String> getMatchingClassNames(String partialClassName, int limit)