You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Klaus Ahrenberg (Jira)" <ji...@apache.org> on 2020/03/27 00:40:00 UTC

[jira] [Created] (NETBEANS-4073) JDK14 features still declared as preview (e.g. switch) - Project contains "file with errors"

Klaus Ahrenberg created NETBEANS-4073:
-----------------------------------------

             Summary: JDK14 features still declared as preview (e.g. switch) - Project contains "file with errors"
                 Key: NETBEANS-4073
                 URL: https://issues.apache.org/jira/browse/NETBEANS-4073
             Project: NetBeans
          Issue Type: Bug
          Components: ide - Code, platform - JDK Problems
    Affects Versions: 11.3
         Environment: Manjaro Linux, JDK14, NB11.3
            Reporter: Klaus Ahrenberg
         Attachments: switch_expression.png

With configuration NB11.2 and JDK13 I used the flag --enable-preview to use the new switch command for example. In JDK14  the new switch command is not longer a preview feature, it's implemented in the JDK now.

However, in NB11.3 and JDK14 I cannot use the --enable-preview flag. Running/compiling with this flag results in error. If I remove the flag, application is compiling and running in JDK14.

The Netbeans IDE itself shows in the project still "files with errors" and at every program run it displays the message "project still has failures. Continue?". If I look at the marked files with error, it shows me the files where the new switch command is used. The hint is "Use --enable-preview flag" which can not be used anymore.

To reproduce:
 - Create Java App - Source level and JDK version 14
 - Use new switch statement in code

 

{{switch (b) {}}
 {{   case 1 -> System.out.println("1");}}
 {{   default -> System.out.println("other");}}
 {{}}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists