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.

Bug 257075 - NullPointerException at com.sun.tools.javac.code.Scope$NamedImportScope.importType
Summary: NullPointerException at com.sun.tools.javac.code.Scope$NamedImportScope.impor...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-09 10:46 UTC by _ tboudreau
Modified: 2016-04-10 01:47 UTC (History)
17 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 220959


Attachments
stacktrace (2.56 KB, text/plain)
2015-12-09 10:46 UTC, _ tboudreau
Details
stacktrace (2.56 KB, text/plain)
2015-12-09 13:04 UTC, terje7601
Details
stacktrace (2.56 KB, text/plain)
2015-12-12 03:37 UTC, _ tboudreau
Details
full IDE log + stacktrace (468.67 KB, text/plain)
2016-02-03 08:47 UTC, zmirc
Details
stacktrace (2.56 KB, text/plain)
2016-02-12 10:43 UTC, Alexander Simon
Details
stacktrace (2.56 KB, text/plain)
2016-02-19 13:31 UTC, abien
Details
stacktrace (2.56 KB, text/plain)
2016-02-26 06:47 UTC, Jiri Skrivanek
Details
stacktrace (2.56 KB, text/plain)
2016-03-04 09:05 UTC, muellermi
Details
stacktrace (2.56 KB, text/plain)
2016-03-15 08:53 UTC, muellermi
Details
stacktrace (2.56 KB, text/plain)
2016-03-15 09:08 UTC, muellermi
Details
stacktrace (2.56 KB, text/plain)
2016-03-15 10:14 UTC, Jiri Skrivanek
Details
stacktrace (2.56 KB, text/plain)
2016-03-18 13:47 UTC, Alexandr Scherbatiy
Details
stacktrace (2.56 KB, text/plain)
2016-03-21 11:32 UTC, Jiri Skrivanek
Details
stacktrace (2.56 KB, text/plain)
2016-04-06 07:11 UTC, stefan79
Details
stacktrace (2.56 KB, text/plain)
2016-04-06 12:38 UTC, Maksim Khramov
Details
stacktrace (2.56 KB, text/plain)
2016-04-08 14:08 UTC, Maksim Khramov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2015-12-09 10:46:31 UTC
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)
Comment 1 _ tboudreau 2015-12-09 10:46:33 UTC
Created attachment 157732 [details]
stacktrace
Comment 2 terje7601 2015-12-09 13:04:15 UTC
Created attachment 157735 [details]
stacktrace

When pasting a piece of Java code & the dialog came up to accept the suggested imports
Comment 3 _ tboudreau 2015-12-12 03:37:19 UTC
Created attachment 157769 [details]
stacktrace

Pasting code
Comment 4 _ tboudreau 2015-12-12 03:41:06 UTC
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?
Comment 5 Exceptions Reporter 2015-12-19 22:35:04 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=220959
Comment 6 zmirc 2016-02-03 08:47:07 UTC
Created attachment 158360 [details]
full IDE log + stacktrace
Comment 7 Alexander Simon 2016-02-12 10:43:48 UTC
Created attachment 158472 [details]
stacktrace

copy statement from one class to another
Comment 8 abien 2016-02-19 13:31:50 UTC
Created attachment 158569 [details]
stacktrace

Happened during copy and paste Executor -> ExecutorService
Comment 9 Jiri Skrivanek 2016-02-26 06:47:20 UTC
Created attachment 158646 [details]
stacktrace

Confirming import suggestion.
Comment 10 muellermi 2016-03-04 09:05:21 UTC
Created attachment 158736 [details]
stacktrace

fix import
Comment 11 muellermi 2016-03-15 08:53:25 UTC
Created attachment 158866 [details]
stacktrace

pase line of code
Comment 12 muellermi 2016-03-15 09:08:26 UTC
Created attachment 158868 [details]
stacktrace

paste code (import needed)
Comment 13 Jiri Skrivanek 2016-03-15 10:14:25 UTC
Created attachment 158869 [details]
stacktrace

Copied line from another source file.
Comment 14 Alexandr Scherbatiy 2016-03-18 13:47:27 UTC
Created attachment 158918 [details]
stacktrace

Edit the code
Comment 15 Jiri Skrivanek 2016-03-21 11:32:27 UTC
Created attachment 158943 [details]
stacktrace

Copied LOGGER field from other class.
Comment 16 stefan79 2016-04-06 07:11:38 UTC
Created attachment 159128 [details]
stacktrace

Inserted Code (over clipboard).
Comment 17 Maksim Khramov 2016-04-06 12:38:39 UTC
Created attachment 159131 [details]
stacktrace

Copy and paste text from one Junit test to other
Comment 18 Exceptions Reporter 2016-04-06 12:38:45 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=220959
Comment 19 Maksim Khramov 2016-04-08 14:08:42 UTC
Created attachment 159168 [details]
stacktrace

Copy and paste annotation from one class to another and click OK in Import Classes dialog
Comment 20 Dusan Balek 2016-04-08 19:50:54 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/4f36ea65afd0
Comment 21 Quality Engineering 2016-04-10 01:47:54 UTC
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.