Dollar sign values ​​in a Java method handle?

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, 0x708b55c8] 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' must be the name of the method. But I checked the source code and its interfaces, there is no method called "access". I could not find the answer on Google, since Google hates all kinds of interruptions. Can anyone help here? Many thanks.

+8
java dollar-sign
source share
1 answer

Quoted from an article related by @birryree :

The private member m of class C can be used by another class D if one class surrounds another, or if it is enclosed in a common class. Since the virtual machine does not know about this grouping, the compiler creates a local protocol of access methods in C so that D can read, write, or call the m element. These methods have access form names $ 0, access $ 1, etc. . They are never published. Access methods are unique in that they can be added to closing classes, and not just to inner classes.

+10
source share

All Articles