raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.23k stars 804 forks source link

Method matchers works by chance #1592

Closed Mixfaa closed 7 months ago

Mixfaa commented 7 months ago

I tried creating static proxies with bytebuddy 1.14.11, JDK 17, Kotlin jvm 1.9.22 and Intellij Idea 2023.3.2 (I also tried java - same effect)

Methods interception works 50/50, I can run app 4 times get expected result only 2 times

I published code to github: https://github.com/Mixfaa/bytebuddy_issue It written in kotlin but I tried same on java and got same effect

Wait a min, i will upload video

Mixfaa commented 7 months ago

Here is video: https://youtu.be/S4KyWBBpzg0

Mixfaa commented 7 months ago

I found out it its because of methods order