Proxy an array in Java -


for debugging purposes want create proxy array object[] get:

exception in thread "main" java.lang.classcastexception: com.sun.proxy.$proxy0 cannot cast [ljava.lang.object; 

when casting proxy object[]. using debugproxy code oracle tutorial: dynamic proxy tutorial. here code:

public static void main(string[] args) {     object[] obarr = new object[10];     object proxy = debugproxy.newinstance(obarr);     obarr = (object[]) proxy;     system.out.println(arrays.tostring(obarr)); } 

is there way create proxy array?


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -