[ https://issues.apache.org/jira/browse/NETBEANS-194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated NETBEANS-194: ------------------------------------ Labels: pull-request-available (was: ) > JShell integration causes NULL Pointer exception on JDK9 > -------------------------------------------------------- > > Key: NETBEANS-194 > URL: https://issues.apache.org/jira/browse/NETBEANS-194 > Project: NetBeans > Issue Type: Bug > Components: java - JShell > Affects Versions: 9.0 > Reporter: Matthias Bläsing > Assignee: Matthias Bläsing > Labels: pull-request-available > > I ran netbeans with JDK 9.0.1 and tested the JShell integration. While > running it, I received two NullPointerExceptions: > *Steps to reproduce:* > - run netbeans with JDK 9.0.1: {{ant -Dnbjdk.home=<JDK9> tryme}} > - Create a "Java Application" project. > - Choose "Execute Java Shell" > - Observe the output in the console > *Result 1: Exception instead of JShell:* > {noformat} > [exec] java.lang.NullPointerException > [exec] at > org.netbeans.modules.jshell.support.ShellSession.customizeBuilderOnJDK9(ShellSession.java:787) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.customizeBuilder(ShellSession.java:743) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.access$700(ShellSession.java:148) > [exec] at > org.netbeans.modules.jshell.support.ShellSession$Launcher.makeBuilder(ShellSession.java:623) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.createJShellInstance(JShellLauncher.java:250) > [exec] at > org.netbeans.modules.jshell.support.ShellSession$Launcher.createJShellInstance(ShellSession.java:628) > [exec] at > org.netbeans.modules.jshell.tool.JShellTool.resetState(JShellTool.java:745) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.resetState(JShellLauncher.java:207) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.ensureLive(JShellLauncher.java:195) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.getJShell(JShellLauncher.java:201) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.initJShell(ShellSession.java:830) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.getJShell(ShellSession.java:314) > [exec] [catch] at > org.netbeans.modules.jshell.support.ShellSession.lambda$null$2(ShellSession.java:519) > [exec] at > org.netbeans.modules.jshell.model.ConsoleModel$ModelAccImpl.execute(ConsoleModel.java:1104) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.lambda$start$3(ShellSession.java:515) > [exec] at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > [exec] at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > [exec] at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [exec] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {noformat} > *After fix (return empty list instead of NULL):* > {noformat} > [exec] java.lang.NullPointerException > [exec] at > org.netbeans.modules.jshell.env.JShellEnvironment.customizeJShell(JShellEnvironment.java:270) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.customizeBuilder(ShellSession.java:745) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.access$700(ShellSession.java:148) > [exec] at > org.netbeans.modules.jshell.support.ShellSession$Launcher.makeBuilder(ShellSession.java:623) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.createJShellInstance(JShellLauncher.java:250) > [exec] at > org.netbeans.modules.jshell.support.ShellSession$Launcher.createJShellInstance(ShellSession.java:628) > [exec] at > org.netbeans.modules.jshell.tool.JShellTool.resetState(JShellTool.java:745) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.resetState(JShellLauncher.java:207) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.ensureLive(JShellLauncher.java:195) > [exec] at > org.netbeans.modules.jshell.tool.JShellLauncher.getJShell(JShellLauncher.java:201) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.initJShell(ShellSession.java:830) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.getJShell(ShellSession.java:314) > [exec] [catch] at > org.netbeans.modules.jshell.support.ShellSession.lambda$null$2(ShellSession.java:519) > [exec] at > org.netbeans.modules.jshell.model.ConsoleModel$ModelAccImpl.execute(ConsoleModel.java:1104) > [exec] at > org.netbeans.modules.jshell.support.ShellSession.lambda$start$3(ShellSession.java:515) > [exec] at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > [exec] at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > [exec] at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [exec] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)