<div><div>Hello Core Libs Dev team,<br /><br />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.<br />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].<br /><br />Please share your thoughts on whether such an improvement might be applied.<br /><br />Thank you for your help!</div><div> </div><div>Best regards,</div><div>Felix Desyatirikov<br /><br />[1] <a href="https://github.com/openjdk/jdk/commit/fbc562aa0ae1a47040f885f7da495ec8856ad179" rel="noopener noreferrer">https://github.com/openjdk/jdk/commit/fbc562aa0ae1a47040f885f7da495ec8856ad179</a><br />[2] <a href="https://github.com/openjdk/jdk/commit/11dbf7144265ad35ff3c73bd87b9e8dcc95ba2ab" rel="noopener noreferrer">https://github.com/openjdk/jdk/commit/11dbf7144265ad35ff3c73bd87b9e8dcc95ba2ab</a><br />[3] <a href="https://github.com/openjdk/jdk/commit/a554dccc5d5428673a5398b43f7d9d03b2ae3273" rel="noopener noreferrer">https://github.com/openjdk/jdk/commit/a554dccc5d5428673a5398b43f7d9d03b2ae3273</a><br />[4] <a href="https://github.com/openjdk/jdk/commit/957546a0668f64e69375408c63e4cb5376740e8b" rel="noopener noreferrer">https://github.com/openjdk/jdk/commit/957546a0668f64e69375408c63e4cb5376740e8b</a><br />[5] <a href="https://github.com/openjdk/jdk/commit/0003f0898874f3458b455caaedcf949ac69ce248" rel="noopener noreferrer">https://github.com/openjdk/jdk/commit/0003f0898874f3458b455caaedcf949ac69ce248</a></div></div>