This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build: NetBeans IDE Dev (Build NetBeans-911-on-20151204) VM: Java HotSpot(TM) 64-Bit Server VM, 25.65-b01, Java(TM) SE Runtime Environment, 1.8.0_65-b17 OS: Mac OS X User Comments: GUEST: I was copying an example code into my java.swing application when the error ocured. tboudreau: Pasted in code GUEST: paste and failed zmirc: Pressing Enter to accept imports after copying in a Java class from another one. zmirc: Copy pasting in a Java class from another Java class zmirc: Copy paste into a Java class, then pressing Enter to accept the imports (if I remember well) Stacktrace: java.lang.NullPointerException at com.sun.tools.javac.code.Scope$NamedImportScope.importType(Scope.java:763) at org.netbeans.api.java.source.SourceUtils.resolveImport(SourceUtils.java:441) at org.netbeans.modules.java.editor.imports.ClipboardHandler$1.run(ClipboardHandler.java:171) at org.netbeans.modules.java.editor.imports.ClipboardHandler$1.run(ClipboardHandler.java:143) at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:636) at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:626)
Created attachment 157732 [details] stacktrace
Created attachment 157735 [details] stacktrace When pasting a piece of Java code & the dialog came up to accept the suggested imports
Created attachment 157769 [details] stacktrace Pasting code
Seems to be some kind of race condition - happens when the dialog to fix imports appears. Maybe source attribution hasn't completed yet when the import updating code tries to use the results of it?
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=220959
Created attachment 158360 [details] full IDE log + stacktrace
Created attachment 158472 [details] stacktrace copy statement from one class to another
Created attachment 158569 [details] stacktrace Happened during copy and paste Executor -> ExecutorService
Created attachment 158646 [details] stacktrace Confirming import suggestion.
Created attachment 158736 [details] stacktrace fix import
Created attachment 158866 [details] stacktrace pase line of code
Created attachment 158868 [details] stacktrace paste code (import needed)
Created attachment 158869 [details] stacktrace Copied line from another source file.
Created attachment 158918 [details] stacktrace Edit the code
Created attachment 158943 [details] stacktrace Copied LOGGER field from other class.
Created attachment 159128 [details] stacktrace Inserted Code (over clipboard).
Created attachment 159131 [details] stacktrace Copy and paste text from one Junit test to other
This bug already has 50 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=220959
Created attachment 159168 [details] stacktrace Copy and paste annotation from one class to another and click OK in Import Classes dialog
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/4f36ea65afd0
Integrated into 'main-silver', will be available in build *201604100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4f36ea65afd0 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #257075 - NullPointerException at com.sun.tools.javac.code.Scope$NamedImportScope.importType - fixed.