[External] : Re: PR to new language features from project amber

Thiago Milczarek Sayão thiago.sayao at gmail.com
Sat Apr 22 15:51:20 UTC 2023


You're right.
It's that common developer urge to refactor things.

-- Thiago.

Em sáb., 22 de abr. de 2023 às 11:31, Kevin Rushforth <
kevin.rushforth at oracle.com> escreveu:

> I see.
>
> 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.
>
> 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 https://github.com/openjdk/guide/pull/101
>
> -- Kevin
>
>
> On 4/22/2023 7:13 AM, Thiago Milczarek Sayão wrote:
>
> Sure, I meant something like:
>
> if (owner != null && owner instanceof WindowStage) {
>     ((WindowStage) owner).setEnabled(true);
> }
>
> To:
>
> if (owner instanceof WindowStage windowStage) {
>     windowStage.setEnabled(true);
> }
>
>
> Em sáb., 22 de abr. de 2023 às 11:09, Kevin Rushforth <
> kevin.rushforth at oracle.com> escreveu:
>
>> The minimum JDK version is 17, so JavaFX cannot use any features that
>> are only available in a later JDK. Further, we cannot use any preview
>> features.
>>
>> -- Kevin
>>
>>
>> On 4/22/2023 6:59 AM, Thiago Milczarek Sayão wrote:
>> > Hi,
>> >
>> > Can I submit PR for pattern matching or enhanced switches?
>> >
>> > I was thinking about creating an umbrella project like "Adopt new
>> > language features from project amber" and submit "per module" and "per
>> > feature" PRs.
>> >
>> > -- Cheers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230422/c7432512/attachment-0001.htm>


More information about the openjfx-dev mailing list