2016年05月18日   码农之路   5,854 次浏览
When you invoke invokeMethod for the first time, JVM use a slower route, which is easier for programmers to debug (so it’s slower!), so it will show a more friendly argument type mismatch message when you passes a bad argument.
When you invoke invokeMethod for a lot of times (16 times are enough in my tests), JVM generated a GeneratedMethodAccessor*** in runtime, which is faster, with less error checking. So it will show such an ugly java.lang.ClassCastException@603a3e21 message when you passes a bad argument.
>>> Hello World <<<
这篇内容是否帮助到你了呢?
如果你有任何疑问或有建议留给其他朋友,都可以给我留言。