Generation of synthesized parameters

Peter Jensen peter.jensen at oracle.com
Tue Jan 29 13:36:57 PST 2013


On 01/29/13 11:52, Jonathan Gibbons wrote:
> On 01/29/2013 11:40 AM, Eric McCorkle wrote:
>> In order to facilitate writing tests for the MethodParameters feature,
>> I'd like to get a complete list of all the cases when javac can generate
>> synthesized parameters.
>>
>> Here is a list I've put together from email discussions and comments 
>> in JBS:
>>
>> 1) outer "this" parameters
My tests assumes this for anon inner classes, local classes and 
non-static member classes.

>> 2) extra values passed to constructor for enum values
Test assume two first arguments are synthesized.

>> 3) hidden values passed to constructors of inner classes for final
>> variables
I forgot about this. The current test-cases do cover the case of final 
variable references.

>> 4) JLS mandated public no-arg constructors added by the compiler to
>> classes with no declared constructor: synthesized
For constructors I assume the only synthesized arguments are the one 
mentioned above.
This should be true for synthesized constructors as well, since they do 
not have any user declared constructors.

>> 5) The two parameters pre-ended to enum constructors by javac
>>
>>
>> Does this capture everything, or does it miss something?
>>
>> Ideally, I would like to put together a complete list of all cases that
>> should generate synthesized parameters.  (If one already exists, then
>> that's great).
>>
>> Thanks,
>> Eric
> 2 and 5 appear to be duplicates
>
> -- Jon




More information about the compiler-dev mailing list