Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
12.3
-
None
Description
When one has a Java project using JDK 16 and has the source level set to 16, Netbeans still shows the use of pattern matching as an error even though it is no longer a preview feature. The code is question still compiles successfully.
public class Test{ private boolean test(Object obj){ if (obj instanceof String s){ return s.isBlank(); } return false; } }
15 and 16 aren't listed in the source level drop-down for Netbeans Module projects, so you have to specify 15 or 16 directly in the properties file. That may be related, but I am not sure.