Generation of synthesized parameters (original) (raw)

Alex Buckley alex.buckley at oracle.com
Tue Jan 29 17:38:17 PST 2013


"visible in Java" is the wrong model. Almost anything in a class file will be "visible" to code in that class. The question is whether a construct in a class file is there because a compiler felt like implementing something in a particular way ("synthetic", and its subclass "bridge") or because a compiler was told to do it that way exactly ("synthesized").

Alex

On 1/29/2013 5:20 PM, Remi Forax wrote:

On 01/30/2013 02:00 AM, Alex Buckley wrote:

Bridge methods are a kind of synthetic method - there is no normative text in the JLS which mandates emission of bridge methods - so the parameters of a bridge method would never be synthesized.

Alex so correct me if I'm wrong, synthetic is for method generated by the compiler but not visible in Java, and synthetized for method generated by javac but visible in Java. Rémi On 1/29/2013 1:41 PM, Remi Forax wrote: and what about bridges, should their parameter are synthetized or not ?

class A { private static class B { // two consructors here, one is a bridges } public void main(String[] args) { new B(); } } Rémi



More information about the compiler-dev mailing list