开发者

Meanings of dollar sign in Java method descriptor?

开发者 https://www.devze.com 2023-04-08 17:16 出处:网络
For example, its part of the Jikes RVM stack. at [0x70cfba90, 0x708cfaa4] Lorg/apache/lucene/index/SegmentInfos;

For example, its part of the Jikes RVM stack.

at [0x70cfba90, 0x708cfaa4] Lorg/apache/lucene/index/SegmentInfos; 
       **access$000**(Ljava/lang/String;)V
at [0x70cfbb04, 0x708b开发者_运维问答55c8] Lorg/apache/lucene/index/SegmentInfos$
       FindSegmentsFile; run()Ljava/lang/Object; at line 554
at [0x70cfbb24, 0x708c4a8d] Lorg/apache/lucene/index/SegmentInfos; 
       read(Lorg/apache/lucene/store/Directory;)V at line 272

'access' should be a method name. But I checked the class source code and its interfaces, there is no method there called 'access'. I couldn't find an answer on Google, since Google hates all kinds of punctuations. Can anyone help here? Thanks very much.


Quoted from the article linked by @birryree:

A private member m of a class C may be used by another class D, if one class encloses the other, or if they are enclosed by a common class. Since the virtual machine does not know about this sort of grouping, the compiler creates a local protocol of access methods in C to allow D to read, write, or call the member m. These methods have names of the form access$0, access$1, etc. They are never public. Access methods are unique in that they may be added to enclosing classes, not just inner classes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号