Skip to content

Commit d6297d9

Browse files
committed
Add more comments to clarify sbtFindMainClassLoader
1 parent 2b5a064 commit d6297d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agent/src/main/java/scalive/Server.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ private static ClassLoader sbtFindMainClassLoader() throws Exception {
156156
// Thread Context Class Loaders:
157157
//
158158
// #Id ClassLoader Info
159-
// 1 URLClassLoader main #1 [main] <--- Take out this one
159+
// 1 URLClassLoader main #1 [main] <--- Take out this one (Info is not always "main #1 [main]")
160160
// 2 ClasspathFilter xitrum-akka.actor.default-dispatcher-2 #31 [run-main-group-0]
161161

162162
Collection<ClassLoaderInfo> clis = DISCOVERY.listClassLoaders();
163163
for (ClassLoaderInfo cli: clis) {
164164
ClassLoader cl = cli.getClassLoader();
165165
String name = cli.getClassLoaderName();
166166

167-
// Can't use info because it can be "process reaper #8 [system]" etc.
167+
// Can't use info because it's not fixed; can be "process reaper #8 [system]" etc.
168168
boolean mainClassLoader = cl instanceof URLClassLoader && "URLClassLoader".equals(name);
169169

170170
if (mainClassLoader) return cl;

0 commit comments

Comments
 (0)