Can't instantiate anonymous class more than 16 times
Wei Yin Teo
weiyinteo at gmail.com
Tue Aug 11 14:59:34 PDT 2009
No worry. Once a bug is identified, it can be fixed. :)
Anyway, I've found the work around i.e. by increasing the threshold
using -Dsun.reflect.inflationThreshold=100000000.
On 11 Aug 2009, at 22:28, Rémi Forax wrote:
> Le 11/08/2009 21:15, Wei Yin Teo a écrit :
>>
>> It doesn't work. :(
>>
>>
>> java.dyn.NoAccessException: receiver must be in caller class:
>> InstanceTest/27271057.<init>()void, from test.AnonymousClassLoading
>> at sun.dyn.MemberName.newNoAccessException(MemberName.java:421)
>> at java.dyn.MethodHandles.unreflectImpl(MethodHandles.java:496)
>> at java.dyn.MethodHandles
>> $Lookup.unreflectConstructor(MethodHandles.java:408)
>> at
>> test.AnonymousClassLoading.testLoading(AnonymousClassLoading.java:50)
>
> This is another bug :(
> Not your lucky day :)
>
> This one is funny because this is a bug totally in the mind of the
> programmer.
> There is a mismatch, the reflection API says "constructor dot invoke"
> which for the VM means "call <init>()" but it means create a new
> instance.
> So here, the code tries to just called the <init> method
> and failed because you are not in caller class.
>
> To summarize, unreflectConstructor() is currently broken :(
>
> Rémi
>
>
>
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20090811/9f2bcca7/attachment.html
More information about the mlvm-dev
mailing list