netbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis (JIRA)" <j...@apache.org>
Subject [jira] [Created] (NETBEANS-2956) NullPointerException during Import Classes operation after pasting Java code into Editor
Date Mon, 05 Aug 2019 18:33:00 GMT
Travis created NETBEANS-2956:
--------------------------------

             Summary: NullPointerException during Import Classes operation after pasting Java
code into Editor
                 Key: NETBEANS-2956
                 URL: https://issues.apache.org/jira/browse/NETBEANS-2956
             Project: NetBeans
          Issue Type: Bug
         Environment: Project is being built using OpenJDK 12

Same on Windows 10 and Linux
Same when Netbeans is running on either JDK 8 or OpenJDK 12
Same on Netbeans 11.0 and Netbeans 11.1
Same with new built-in Gradle plugin, or old Gradle Support plugin 2.0.0
Gradle 5.5
            Reporter: Travis


I'm building my Java project using OpenJDK 12 and Netbeans 11.1.  Everything was working
fine with the same project when it was built on JDK 8.  We recently updated to JDK 12 and
this problem appeared immediately at that time.

 

The problem happens reliably whenever I copy-paste code from one file to another, and the
code requires several imports to be added to the destination file.  This causes the "Import
Classes" dialog to appear.  When I hit "OK" button there, I immediately get the NullPointerException
shown below.  After the exception, the code is still pasted, but the necessary import lines
do not get added.  Furthermore, manually running "Source:Fix Imports..." afterward also fails
to add the necessary imports.

This bug makes the IDE pretty unusable for ongoing development work.  This is forcing me
and others on my team, sadly, to use a different IDE for now, as we have found no workaround
yet.

 

java.lang.NullPointerException
 at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:334)
 at org.netbeans.lib.nbjavac.services.NBResolve.isAccessible(NBResolve.java:72)
 at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:379)
 at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:441)
 at org.netbeans.lib.nbjavac.services.NBResolve.isAccessible(NBResolve.java:66)
 at com.sun.tools.javac.api.JavacTrees.isAccessible(JavacTrees.java:913)
 at org.netbeans.api.java.source.GeneratorUtilities.getImportedElement(GeneratorUtilities.java:1826)
 at org.netbeans.api.java.source.GeneratorUtilities.addImports(GeneratorUtilities.java:1173)
 at org.netbeans.modules.java.editor.imports.ClipboardHandler$1.run(ClipboardHandler.java:159)
 at org.netbeans.modules.java.editor.imports.ClipboardHandler$1.run(ClipboardHandler.java:126)
 at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:673)
 at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:663)
 at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:502)
 at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
 at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130)
 at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
 at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
 at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
 at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
 at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
 at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
 at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
 at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
 at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81)
 at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:452)
 at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:423)
 at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:684)
 at org.netbeans.modules.java.editor.imports.ClipboardHandler.doImport(ClipboardHandler.java:126)
 at org.netbeans.modules.java.editor.imports.ClipboardHandler.access$100(ClipboardHandler.java:113)
 at org.netbeans.modules.java.editor.imports.ClipboardHandler$4$1.run(ClipboardHandler.java:216)
 at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
 at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
 at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
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


Mime
View raw message