https://bugzilla.redhat.com/show_bug.cgi?id=1040350
Bug ID: 1040350
Summary: NPE in setting NamingPolicy
Product: Fedora
Version: rawhide
Component: mockito
Keywords: Patch
Assignee: rkennke(a)redhat.com
Reporter: msimacek(a)redhat.com
QA Contact: extras-qa(a)fedoraproject.org
CC: akurtako(a)redhat.com,
java-sig-commits(a)lists.fedoraproject.org,
jerboaa(a)gmail.com, omajid(a)redhat.com,
rkennke(a)redhat.com
Created attachment 835194
-->
https://bugzilla.redhat.com/attachment.cgi?id=835194&action=edit
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
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug
https://bugzilla.redhat.com/token.cgi?t=gecMVLtPiV&a=cc_unsubscribe