Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I tried to prevent the need for using the
This seemed to work fine at first, but there is a problem with the Mockups API.
I tried to debug a bit and found out, that if I run with the
After some more debugging I found out that the problem actually is, that the
I looked around for an alternative and I think
Maybe it would even be better to make the class that is used for this configurable by some way, so that one can choose the class that is manipulated.
Or have a list of all sorts of probable candidates, trying one after the other, always checking whether the fields were added, stopping after one class was successfully manipulated.
Actually, the most reliable and stable way would maybe be to not rely on some class not having been loaded before. Is there a reason it is done this way and not e. g. system properties are used to store the mocking bridges?
And I thought that NegativeArraySizeException would never be used...
Ok, I will change the way a class is chosen for the "$MMB" field, so it's more robust. Use of system properties was attempted in the past, it doesn't work (only Strings can be added safely).