// finds the byte code path root (dir or jar) // TODO: inner classes will not be found (need to replace . with $) static File byteCodePathForClass(Class c) { if (c == null) null; ClassLoader cl = getClassLoader(c); // handle JavaXClassLoader Cl files = cast getOpt(cl, 'files); if (files != null) { S name = c.getName().replace('.', '/') + ".class"; for (File location : files) if (dirOrZipContainsPath(location, name)) ret location; fail(name + " not found in: " + files); } null; } static File byteCodePathForClass(O o) { ret byteCodePathForClass(_getClass(o)); }