<div dir="ltr"><div>You're right.</div><div>It's that common developer urge to refactor things.</div><div><br></div><div>-- Thiago.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sáb., 22 de abr. de 2023 às 11:31, Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com">kevin.rushforth@oracle.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
I see.<br>
<br>
No, I wouldn't want to see a global change like this. In new code
(or code that it being significantly changed), it is fine to use new
language features like pattern-matching switch statements. We've
already done this in some cases. However, I wouldn't want to see a
wholesale modification of existing code just for the sake of
modernizing that code.<br>
<br>
Worth noting, there is a PR under review to add a section to the JDK
dev guide that addresses this point, stating that refactoring
changes in stable code are discouraged. See
<a href="https://github.com/openjdk/guide/pull/101" target="_blank">https://github.com/openjdk/guide/pull/101</a><br>
<br>
-- Kevin<br>
<br>
<br>
<div>On 4/22/2023 7:13 AM, Thiago Milczarek
Sayão wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div>Sure, I meant something like:</div>
<div>
<div>
<pre><span style="color:rgb(116,157,237)">if </span>(<span style="color:rgb(114,207,214)">owner </span>!= <span style="color:rgb(116,157,237)">null </span>&& <span style="color:rgb(114,207,214)">owner </span><span style="color:rgb(116,157,237)">instanceof </span>WindowStage) {
((WindowStage) <span style="color:rgb(114,207,214)">owner</span>).<span style="color:rgb(222,188,126)">setEnabled</span>(<span style="color:rgb(116,157,237)">true</span>);
}
</pre>
</div>
</div>
</div>
<div>To:<br>
</div>
<div>
<div>
<pre><span style="color:rgb(116,157,237)">if </span>(<span style="color:rgb(114,207,214)">owner </span><span style="color:rgb(116,157,237)">instanceof </span>WindowStage <span style="color:rgb(177,137,245)">windowStage</span>) {
<span style="color:rgb(177,137,245)">windowStage</span>.<span style="color:rgb(222,188,126)">setEnabled</span>(<span style="color:rgb(116,157,237)">true</span>);
}</pre>
</div>
</div>
<div><br>
</div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Em sáb., 22 de abr. de 2023
às 11:09, Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com" target="_blank">kevin.rushforth@oracle.com</a>>
escreveu:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The minimum JDK version
is 17, so JavaFX cannot use any features that <br>
are only available in a later JDK. Further, we cannot use
any preview <br>
features.<br>
<br>
-- Kevin<br>
<br>
<br>
On 4/22/2023 6:59 AM, Thiago Milczarek Sayão wrote:<br>
> Hi,<br>
><br>
> Can I submit PR for pattern matching or enhanced
switches?<br>
><br>
> I was thinking about creating an umbrella project like
"Adopt new <br>
> language features from project amber" and submit "per
module" and "per <br>
> feature" PRs.<br>
><br>
> -- Cheers<br>
<br>
</blockquote>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote></div>