#18 unable to proxy class that extends generics super class

open
nobody
None
5
2006-05-12
2006-05-12
Ray Tsang
No

when trying to enhance/proxy a class declared that
extends a superclass w/ generics, such as:
public abstract class A extends B<T> {....}

it throws the following exception

net.sf.cglib.core.CodeGenerationException:
java.lang.ClassCastException-->java.lang.Class
at
net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
at
net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
at
net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:216)
at
net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:640)
at
net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
at
net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at
net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks