[ 
https://issues.apache.org/jira/browse/NETBEANS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16907415#comment-16907415
 ] 

Travis edited comment on NETBEANS-2956 at 8/14/19 4:35 PM:
-----------------------------------------------------------

I am also going to try to reproduce this after doing a fresh clean installation 
of Netbeans 11.1 again, just in case that makes a difference.  And I will use 
the default Gradle plugin this time, since in other cases I believe the older 
Gradle plugin is perhaps indirectly related to some of the exceptions I was 
getting.  I had tried both Gradle plugins before, but this time I will avoid 
uninstalling or installing anything other than the default plugins that come 
with the installation, to rule out any question that the problem is related 
only to my own set of installed plugins.


was (Author: furrer):
I am also going to try to reproduce this after doing a fresh clean installation 
of Netbeans 11.1 again, just in case that makes a difference.  And I will use 
the default Gradle plugin this time, since in other cases I believe the older 
Gradle plugin is perhaps indirectly related to some of the exceptions I was 
getting.

> 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
>          Components: java - Source
>    Affects Versions: 11.0, 11.1
>         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 (both with nb-javac 1.6 installed)
> Same with new built-in Gradle plugin, or old Gradle Support plugin 2.0.0
> Gradle 5.5
>            Reporter: Travis
>            Assignee: ARUNAVA SINHA
>            Priority: Major
>
> 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-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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

Reply via email to