You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a proxy class that delegates all method invocation to an existing InvocationHandler implementation without success. The issue seems to stem from having a setter method that has a primitive parameter in my implemented interface (ProxyedInterface). With the bellow test case I get the following exception:
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
test/ProxyedInterface_Proxy_T3rJCc0Y.setPrimitive(JLjava/lang/String;)V @33: aastore
Reason:
Type long_2nd (current frame, stack[7]) is not assignable to 'java/lang/Object'
Current Frame:
bci: @33
flags: { }
locals: { 'test/ProxyedInterface_Proxy_T3rJCc0Y', long, long_2nd, 'java/lang/String' }
stack: { 'java/lang/reflect/InvocationHandler', 'test/ProxyedInterface_Proxy_T3rJCc0Y', 'java/lang/reflect/Method', '[Ljava/lang/Object;', '[Ljava/lang/Object;', integer, long, long_2nd }
Bytecode:
0x0000000: b200 102a 1206 1222 05bd 0013 5903 b200
0x0000010: 2653 5904 1229 53b6 0019 05bd 0004 5903
0x0000020: 1f53 5904 2d53 b900 1f04 0057 b1
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2575)
at java.lang.Class.getDeclaredField(Class.java:2060)
at net.bytebuddy.instrumentation.LoadedTypeInitializer$ForStaticField.onLoad(LoadedTypeInitializer.java:119)
at net.bytebuddy.instrumentation.LoadedTypeInitializer$Compound.onLoad(LoadedTypeInitializer.java:195)
at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.initialize(DynamicType.java:2519)
at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:2507)
at saden1.issues.bytebuddy.ServiceLocatorProxyNGTest.testSomeMethod(ServiceLocatorProxyNGTest.java:37)
This is indeed a bug. I simply forgot to apply a boxing assignment for the arguments. I just implemented a reproducing test and prepare a fix. I'll release a version 0.4.1 with this some minor bug-fixes later this day.
The bug-fix release 0.4.1 is already available in JCenter and is currently synchronized to Maven Central. It should be available from there in a couple of hours.
I am trying to create a proxy class that delegates all method invocation to an existing InvocationHandler implementation without success. The issue seems to stem from having a setter method that has a primitive parameter in my implemented interface (ProxyedInterface). With the bellow test case I get the following exception:
The text was updated successfully, but these errors were encountered: