Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo parent for MultipleParentsClassLoader #2312

Merged
merged 4 commits into from Jun 3, 2021

Conversation

charlesmunger
Copy link
Contributor

66998ea inadvertently undid a change from 9bc9be6, which breaks behavior under some classloaders that special-case mockito classes. Use of an explicit parent with MultipleParentsClassLoader appears to be discouraged in the documentation also.

Followup for #2303

66998ea inadvertently undid a change from 9bc9be6, which breaks behavior under some classloaders that special case mockito classes. Use of an explicit parent with `MultipleParentsClassLoader` appears to be discouraged in the documentation also.
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2021

Codecov Report

Merging #2312 (62bd555) into main (d475354) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2312      +/-   ##
============================================
+ Coverage     84.61%   84.65%   +0.04%     
- Complexity     2766     2768       +2     
============================================
  Files           328      328              
  Lines          8428     8428              
  Branches       1011     1011              
============================================
+ Hits           7131     7135       +4     
  Misses         1015     1015              
+ Partials        282      278       -4     
Impacted Files Coverage Δ
.../creation/bytebuddy/SubclassBytecodeGenerator.java 80.71% <100.00%> (+1.42%) ⬆️
...to/internal/util/concurrent/WeakConcurrentMap.java 39.39% <0.00%> (+2.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d475354...62bd555. Read the comment docs.

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! Can we please add a regression test for this scenario? Preferably without introducing any new dependencies. E.g. let's not add GWTMockito as dependency to our test suite, but instead construct a ClassLoader ourselves that would behave as if it was the ClassLoader in GWTMockito.

@charlesmunger
Copy link
Contributor Author

I spent some time thinking about it and reduced the test case to something understandable.

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I slightly refactored the test code to make it clear which exact classes will be loaded by the child ClassLoader and which are not. I have verified that reverting the change in SubclassBytecodeGenerator makes the test fail again.

Thanks Charles for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants