Why Java methods with varargs identified as transient?

后端 未结 3 1759
闹比i
闹比i 2021-02-07 02:56

I was playing with Java Reflection API and observed that methods with variadic argument list become transient. Why is that and what does transient keyword mean in t

3条回答
  •  忘了有多久
    2021-02-07 03:22

    This looks like a bug in the implementation. I think that the root cause might be that the bit set in the .class file for transient fields is the same for varargs methods (see http://java.sun.com/docs/books/jvms/second_edition/ClassFileFormat-Java5.pdf, pages 122 and 119).

提交回复
热议问题