I decompiled some java classes and I get a source with special characters:
this.val$b.dispose();
this.val$domainLabel.setText((String)domains_config.get("description"));
what does this mean: this.val$b
?
According to the Java spec (see http://docs.oracle.com/javase/specs/jls/se5.0/html/lexical.html#3.8) $ is a valid value in an identifier. However, note that "The $ character should be used only in mechanically generated source code or, rarely, to access preexisting names on legacy systems."
There are two common reasons for seeing dollar signs in a variable name in decompiled code:
1. Your source code contains an inner class (perhaps, but not necessarily an anonymous one), in which case things for the inner class will have variable and constructor names like outerclass$innerclass
. (See, for example http://docstore.mik.ua/orelly/java/exp/ch05_09.htm in the section on how inner classes really work). If the class is anonymous, the names will have a naming scheme/form like outerclass$ followed by outerclass$1 and so forth
2. The code has been run through an obfuscator. An obfuscator meets the criterion of "mechanically generating" the source code, so it can use dollar signs in the ame. An example would be RetroGuard, which explains in an FAQ on their website, the criterion for using $ in variable and class names. Essentially, the obfuscator uses the $ as a disambiguator and will rename classes or variables with generated names (typically single character letters used when possible to minimize code size), and what is renamed and what isn't depends on the variable's scope, etc.
In your particular example, val$b looks to me like it might be a variable name that has been obfuscated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With