To use pattern matching for switch with Java 17, go to ProjectSettings | Project, set the Project SDK to 17 and set Project language level to ‘ 17 (Preview) – Pattern matching for switch’: More support is on the way in future IntelliJ IDEA releases. It also helps replace if-else statement chains with switch, improving code readability.īefore we dive into pattern matching for switch, let’s ensure we have the basic IntelliJ IDEA configuration set up.īasic support for Java 17 is available in IntelliJ IDEA 2021.2.1. Also, case labels are no longer limited to constant values. The type of the selector expression that can be used with a switch is expanded to any reference value. As the name suggests, it adds patterns to the case labels in the switch statements and switch expressions. Pattern matching for switch is introduced as a preview feature. Now a visible class or interface doesn’t need to be implicitly extensible. Sealed classes decouple accessibility from extensibility. You can use this link for a comprehensive list of all the new Java 17 features.Īdded as a standard Java language feature in Java 17, sealed classes enable you to control the hierarchies to model your business domain. I will also highlight how these features can reduce the cognitive complexity for developers. I’ll cover what these features are, why you might need them, and how you can start using them in IntelliJ IDEA. In this blog post, I will limit the coverage of Java 17 to its language features – Sealed Classes and Pattern Matching for switch. If you have been waiting to move on from Java 8 or 11, now is the time to weigh its advantages. Given that Java 17 is also an LTS release, it’s not just the developers but enterprises also noticing it. If you have any thoughts about making IntelliJ IDEA better, please comment on this post or report your suggestions to our issue tracker.A new Java release every six months can be exciting, overwhelming, or both. įor other resolved issues, refer to the release notes. Lombok is now bundled with IntelliJ IDEA Community Edition 2020.3. įixed the problem preventing the IDE settings from being exported into a file įixed the issue causing Spring configurations not to be saved and reloaded. įixed the erroneous behavior of the New File popup. įixed the Expand/Collapse All buttons in the TODO tool window. įixed the major release icon for IntelliJ IDEA Community Edition 2020.3. įixed the IDE so that it now runs Android projects correctly. Improved the UI for including dependencies with the “Provided” scope. įixed the IDE to start correctly when checking out from GitHub using the JetBrains Toolbox browser extension. įixed the possibility to close a tool window in an empty state with a shortcut. run.xml files when running Compound Run Configurations. Other significant fixes in v2020.3.1 include:įixed duplication of Pull Request comments. Update to v.2020.3.1 now and share your feedback with us! Please note that a previously installed IntelliJ IDEA version running via Rosetta2 will not update to run natively. To start working, download a separate installer for IntelliJ IDEA for Apple Silicon on our website or in the Toolbox App (under the Available for Apple M1 section). We are back with our first bug-fix release for IntelliJ IDEA 2020.3! The improved v2020.3.1 polishes the recently released features and supports Apple Silicon! That’s right, Apple fans, you can now work in IntelliJ IDEA on your Mac with an M1 chip.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |