Created attachment 835194 [details] NPE workaround Description of problem: Some tests using mockito throw NullPointerException (wrapped in RuntimeException) because mockito fails to set MockitoNamingPolicy in cglib. Current implementation tries to set it by modifing private field of MethodProxy via reflection, which fails, because current version of cglib sets it to null after using it. It was already discussed in http://bugs.debian.org/707298. The suggested workaround is not setting it to null in cglib, but it seems to me that the value of NamingPolicy has already been used and changing it after the MethodProxy has been initialized doesn't really do anything. In the current upstream version (1.9.5) the problem still persist. I'm attaching a simple workaround, that just checks for null, which cannot break anything and fixes the tests that failed for me. But it seems like the proper solution would need a larger rewrite of parts of mockito that use internals of cglib. Steps to reproduce: 1. try to build current version of httpcomponents-client with tests enabled
Created attachment 835195 [details] Update to upstream version 1.9.5
I've applied Michael's patch for NPE. It fixes the test failures in httpcomponents-core (#1078979). We should probably create new bug for mockito update to 1.9.5.