just found this bit, while reading eclipse JDT's documentation:
IMethodBinding.getParameterTypes()
: . . . Note: The result does not include synthetic parameters introduced by inner class emulation.
I can't find any reference to inner class emulation in JLS... Anyone knows what this emulation is? Throwing an example, would help as well. :)
I think that the Eclipse documentation writer being a little bit loose with the terminology. As far as the JLS is concerned, an inner class is an inner class and doesn't need to be emulated.
However, there is a bit of trickiness in the way that inner classes get implemented by a typical JVM, and this is where the synthetic constructor parameters come into the equation. What is going on is that the JVM implements classes the same whether they are nested or not. There are no special bytecodes for referring to variables in enclosing classes, so the compilers generate code that fetch them via the synthetic attributes.
More details may be found in the original Sun Java 1.1 Inner Classes Specification.
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