Decompiled Java classes have some special characters

I decompiled some Java classes and I get the source with special characters:

this.val$b.dispose();
this.val$domainLabel.setText((String)domains_config.get("description"));

what does this mean this.val$b:?

+3
source share
5 answers

According to the Java specification (see http://docs.oracle.com/javase/specs/jls/se5.0/html/lexical.html#3.8 ) $ is a valid value in the identifier. However, note that "The $ character should only be used in mechanically generated source code or, less commonly, to access existing names on legacy systems."

In decompiled code, there are two common reasons for designating dollar signs in a variable name:

1. (, ), outerclass$innerclass. (., , http://docstore.mik.ua/orelly/java/exp/ch05_09.htm , ). , /, โ€‹โ€‹ outerclass $, $1 ..

2. . " " , ame. RetroGuard, -, $ . , obfuscator $ disambiguator ( , , ), , ..

val $b , , .

+7

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html , , ,

,

. - , , "$", ". , , "$" " ". , . , , . ; " _", . . , , . ( ). , . . ; , , , , , , s, c g. ,

+1

(Eh, , )

$ Java, , .

0

"$" is a valid character in java identifiers. Thus, "val $ b" is simply the name of the field. See http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8

0
source

Valid Java identifiers can contain letters ( a- z, a- z), numbers ( 0- 9), underscores ( _), and dollars ( $). So the names of the names you see are a real name without any special meaning.

0
source

All Articles