Fix ClassNotFoundException when triggering debugger actions#3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7832a7f4f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| " actionExecutorClass = contextClassLoader.loadClass(\"com.runtime.pivot.agent.ActionExecutor\");\n" + | ||
| " } catch (java.lang.ClassNotFoundException ignore) {\n" + |
There was a problem hiding this comment.
Fall back to system loader when context load fails to link
contextClassLoader.loadClass("com.runtime.pivot.agent.ActionExecutor") is only wrapped for ClassNotFoundException, but loadClass can also fail with linkage errors (for example NoClassDefFoundError/LinkageError when the class exists in that loader but its dependencies are incompatible). In that case this code aborts before reaching the system-loader fallback, so debugger actions still fail in mixed classloader setups instead of recovering. Treating linkage failures as a fallback condition here would preserve the intended behavior.
Useful? React with 👍 / 👎.
Motivation
com.runtime.pivot.agent.ActionExecutorfrom the system classloader in environments where the debugger uses a non-system classloader.Description
ActionExecutorUtilto generate an execution expression that first attempts to loadcom.runtime.pivot.agent.ActionExecutorusing the current thread's context classloader and then falls back toClassLoader.getSystemClassLoader()if not found.execute(...)and keep behavior identical when the class is available from the system classloader.src/main/java/com/runtime/pivot/plugin/utils/ActionExecutorUtil.java.Testing
./gradlew test --no-daemon, but the Gradle wrapper bootstrap failed to download the Gradle distribution due to an environment proxy returningHTTP/1.1 403 Forbidden, so unit tests could not be executed in this environment.Codex Task