Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Java11/Examples"
m (→PAGE UNDER CONSTRUCTION =======) |
m |
||
Line 1: | Line 1: | ||
− | === PAGE | + | === PAGE Nearing Completion - under construction === |
This is an informal page listing examples of features that are implemented by the Java 11 Support. You are welcome to try out these examples. If you find bugs, please file a bug after checking for a duplicate entry [https://bugs.eclipse.org/bugs/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=J11.Open&sharer_id=152344 here]. | This is an informal page listing examples of features that are implemented by the Java 11 Support. You are welcome to try out these examples. If you find bugs, please file a bug after checking for a duplicate entry [https://bugs.eclipse.org/bugs/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=J11.Open&sharer_id=152344 here]. | ||
Line 99: | Line 99: | ||
} | } | ||
</source> | </source> | ||
− | | Compiler errors | + | | |
+ | Compiler errors shown | ||
|- | |- | ||
− | ! colspan="3" | | + | ! colspan="3" | Nestmates |
|- | |- | ||
− | ! scope="row" | Basic | + | ! scope="row" | Basic Nesting Principles |
| | | | ||
+ | Nestmate Concept: A JVM concept - All inner classes are now conceptually considered as one group. | ||
+ | This was already the case in Java Source, but JVM also now recognizes this. | ||
+ | First step is that two new attributes have been added, NestHost and NestMember. | ||
+ | The top most class will have the NestMember attribute listing all the members while | ||
+ | each of the inner classes will have a NestHost attribute listing the top level class. | ||
+ | Using this, some of the synthetic bridge methods are elided transparent to the programmer. | ||
+ | Note that this feature is relevant only for tools that process byte code and hence, in general, | ||
+ | this feature would be "transparent" to a "normal" programmer. This feature is applicable for byte | ||
+ | code processors, for eg our Disassembler has been enhanced to show these attributes. | ||
<br> | <br> | ||
<br> | <br> | ||
− | | | + | <br> |
+ | <source lang="java"> | ||
+ | public class X { | ||
+ | private class A { | ||
+ | class B {} | ||
+ | } | ||
+ | private class Y extends A { | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | <br> | ||
+ | | In X.class (Disassembled) | ||
+ | Nest Members: | ||
+ | #21 X$A, | ||
+ | #24 X$A$B, | ||
+ | #27 X$Y | ||
+ | |||
+ | In each of X$A, X$A$B, X$Y the attribute: | ||
+ | Nest Host: #22 X | ||
|- | |- | ||
− | + | } | |
− | + |
Revision as of 04:20, 14 August 2018
PAGE Nearing Completion - under construction
This is an informal page listing examples of features that are implemented by the Java 11 Support. You are welcome to try out these examples. If you find bugs, please file a bug after checking for a duplicate entry here.