Pattern matching refactoring proposal

Alan Bateman Alan.Bateman at oracle.com
Fri Mar 29 01:45:29 UTC 2024



On 29/03/2024 05:43, science2000 wrote:
> Hello Core Libs Dev team,
>
> I would like to propose a patch [1] that applies pattern matching for 
> 'instanceof' (JEP-394) and 'switch-case' (JEP-433) on java.base. I 
> suppose this enchantment will improve readability and reduce the code 
> redundancy in cases of casts after 'inctanceof' checking.
> For better reviewing this improvement can be split into 4 tasks 1 for 
> each package: java [2], javax [3], sun [4] and com.sun.crypto [5].
>
> Please share your thoughts on whether such an improvement might be 
> applied.

 From a quick scan, you'll probably be asked to rename a lot of the 
variables as they very inconsistent with the naming in the changed 
source file, otherwise they should be safe and I assume you'll run at 
least tier1+tier2 at least.

-Alan


More information about the core-libs-dev mailing list