<div dir="ltr">Hi Stefan,<br><div class="gmail_extra"><br><div class="gmail_quote">2013/5/8 Stefan Denker <span dir="ltr"><<a href="mailto:Stefan+debian@dn-kr.de" target="_blank">Stefan+debian@dn-kr.de</a>></span><br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear Maintainer,<br>
<br>
The current version of libcglib in debian breaks the libmockito-java<br>
package. I've put together a test class (With code taken from<br>
<a href="http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html#13" target="_blank">http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html#13</a><br>
)<br>
<br>
|List list = new LinkedList();<br>
|List spy = spy(list);<br>
|<br>
|// using the spy calls real methods<br>
|spy.add("one");<br>
|spy.add("two");<br>
<br>
Trying to run this yields :<br>
<br>
|java.lang.RuntimeException: Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses<br>
|at org.mockito.internal.creation.cglib.CGLIBHacker.setMockitoNamingPolicy(CGLIBHacker.java:29)<br>
|at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:42)<br>
|at $java.util.LinkedList$$EnhancerByMockitoWithCGLIB$$440d9615.add(<generated>)<br>
|at testSpy.spying(testSpy.java:17)<br>
|Caused by: java.lang.NullPointerException<br>
|at org.mockito.internal.creation.cglib.CGLIBHacker.setMockitoNamingPolicy(CGLIBHacker.java:23)<br>
<br>
Downgrading libcglib to 2.2+dfsg-2 (squeeze) fixes this.<br>
<br>
Browsing the changes in cglib, I traced this down to the<br>
MethodProxy.java class, particularly this change:<br>
<a href="http://cglib.cvs.sourceforge.net/viewvc/cglib/cglib/src/proxy/net/sf/cglib/proxy/MethodProxy.java?r1=1.14&r2=1.15" target="_blank">http://cglib.cvs.sourceforge.net/viewvc/cglib/cglib/src/proxy/net/sf/cglib/proxy/MethodProxy.java?r1=1.14&r2=1.15</a><br>


<br>
I believe the change was accidental, so the attached patch restores the<br>
old behaviour. Applying it to libcglib-java makes my test run.<br>
<br>
This is just a workaround, but it is the minimal change to get Mockito<br>
working again in Debian.<br></blockquote><div><br></div><div style>Thanks for your analysis of this issue and your provided workaround.</div><div style>I'm a bit reluctant to apply your patch as-is because, in fact, upstream added "createInfo = null;" to fix </div>

<div style><a href="http://sourceforge.net/p/cglib/bugs/28/">http://sourceforge.net/p/cglib/bugs/28/</a><br></div></div><div class="gmail_extra"><br></div>I'll check with them how to fix this properly...<br><br clear="all">

<div style>Regards,</div>-- <br><div dir="ltr">Damien</div>
</div></div>