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.
When copying the following code snippet: List<String> a = new LinkedList<String>(); into a different source which contains no import statement for java.util.LinkedList type. After pasting the code snippet the target source will have its imports section updated correctly but the type identifiers in the pasted par will get duplicated, resulting in: ListList<StringString> a = new LinkedListLinkedList<StringString>(); I am attaching a test project where you can play by copying line 16 from the ClassB into line 19 of the ClassA. Also, it is worth noting that once you clean/build the project this error becomes rather random with cca. 70% probability of encountering it.
Created attachment 112045 [details] Test project
Problem seems to be a race condition in ClipboardHandler.runQuickly that runs the task computing imports twice sometimes.
Oops. Thanks for the pointer. I intended to do create-schedule, but did post-schedule instead, which actually runs the task twice. http://hg.netbeans.org/jet-main/rev/03bb18e2f697
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/03bb18e2f697 User: Jan Lahoda <jlahoda@netbeans.org> Log: #203702: post already scheduled the task, no need (and actually harmful) to schedule it again.
*** Bug 203692 has been marked as a duplicate of this bug. ***
verified