Fix: Coverage not working for Beanutils #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #52
Modify the SingleTestRunner to set the current thread's context ClassLoader to the test class's ClassLoader immediately before creating/running the JUnit Request, and restore the original context ClassLoader afterwards. This is a minimal and safe change focused on the place tests are launched; it increases the chance that dynamically loaded classes (like Beanutils usage) are instrumented by coverage tools that consult the thread context ClassLoader. Keep changes limited to try/finally block to guarantee restoration and preserve existing behavior (including System.exit flows).
AI Analysis
Issue description is sparse, but 'Coverage not working for Beanutils' suggests classes loaded dynamically (BeanUtils uses reflection) may be loaded with a different classloader than the coverage agent expects. A minimal, targeted change is to ensure the test runner uses the test class's classloader as the thread context classloader so coverage instrumentation can see/attach to those loads.
Changes Made
framework/lib/formatter/src/edu/washington/cs/mut/testrunner/SingleTestRunner.javaAI Model Used
gpt-5-mini
Confidence Score
75%
This PR was automatically generated by Kodin AI