You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by gi...@apache.org on 2021/11/09 00:46:55 UTC

[groovy-dev-site] branch asf-site updated: 2021/11/09 00:46:54: Generated dev website from groovy-website@a5b8caa

This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-dev-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 8b30463  2021/11/09 00:46:54: Generated dev website from groovy-website@a5b8caa
8b30463 is described below

commit 8b30463a9e17513c25536c198ea5db4ea1affdd5
Author: jenkins <bu...@apache.org>
AuthorDate: Tue Nov 9 00:46:54 2021 +0000

    2021/11/09 00:46:54: Generated dev website from groovy-website@a5b8caa
---
 wiki/GEP-13.html | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/wiki/GEP-13.html b/wiki/GEP-13.html
index 02ee051..e28de4f 100644
--- a/wiki/GEP-13.html
+++ b/wiki/GEP-13.html
@@ -159,7 +159,7 @@ It effectively limits all further extension and indicates no further code reuse
 </li>
 <li>
 <p>By making a base class package-private we can limit extension to only classes within
-the same package. If an abstract <code>Shape</code> class is package-private, I could have
+the same package. If an abstract <code>Shape</code> class is package-private, we could have
 public classes <code>Square</code> and <code>Circle</code> in the same package. This indicates that we want
 code reuse to occur only within the package. While it does limit creation of
 new shapes outside the original package, it offers no abstraction for a shape which
@@ -199,8 +199,8 @@ could be retained to offer support for this feature on earlier JVMs or versions
 of Groovy prior to any grammar changes.</p>
 </li>
 <li>
-<p>Prohibit extension of JDK16+ sealed classes or annotated <code>@Sealed</code> classes.
-Likewise for interfaces. This also applies for anonymous inner classes and traits.</p>
+<p>Prohibit extension of JDK17+ sealed classes or annotated <code>@Sealed</code> classes.
+This also applies for interfaces, anonymous inner classes and traits.</p>
 </li>
 <li>
 <p>Provide checks in other places where such extension might occur implicitly, e.g.:&nbsp;with <code>@Delegate</code>,
@@ -213,6 +213,20 @@ when using type coercion, etc.</p>
 <p>Allow the permitted subclasses to be inferred automatically just for the case
 where the base and all permitted subclasses are in the same file. (See JEP-409)</p>
 </li>
+<li>
+<p>Introduce the <code>sealed</code> modifier and <code>permits</code> clause in the grammar.</p>
+</li>
+<li>
+<p>By default, when running on JDK17+, sealed class information is added into the bytecode.
+We refer to such classes as <em>native</em> sealed classes.</p>
+</li>
+<li>
+<p>By default, when running on earlier JDKs, an annotation is added to a class to indicate that
+a class is sealed. Such classes will be recognized by Groovy 4+ compilers but not by Java.</p>
+</li>
+<li>
+<p>The <code>@SealedOptions</code> annotation has a <code>mode</code> annotation attribute which can override the default behavior.</p>
+</li>
 </ul>
 </div>
 </div>
@@ -225,9 +239,6 @@ are non-goals for the first implementation:</p>
 <div class="ulist">
 <ul>
 <li>
-<p>Introduce the <code>sealed</code> modifier and <code>permits</code> clause in the grammar.</p>
-</li>
-<li>
 <p>Require that all classes within a sealed hierarchy be compiled at the same time.</p>
 </li>
 <li>
@@ -237,9 +248,6 @@ are non-goals for the first implementation:</p>
 <p>Add warnings to the static compiler if a switch is used for a sealed hierarchy
 and not all types are exhaustively covered.</p>
 </li>
-<li>
-<p>When running on JDK16+, also add sealed class information into the bytecode.</p>
-</li>
 </ul>
 </div>
 </div>
@@ -290,7 +298,8 @@ and not all types are exhaustively covered.</p>
 <h2 id="_update_history">Update history</h2>
 <div class="sectionbody">
 <div class="paragraph">
-<p>1 (2021-07-22) Initial draft</p>
+<p>1 (2021-07-22) Initial draft
+2 (2021-11-06) Update to align with 4.0.0-beta-2</p>
 </div>
 </div>
 </div></div></div></div></div><footer id='footer'>