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 201993

Summary: Java code copy between modules not correct
Product: java Reporter: gualtiero65
Component: EditorAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Picture 1
Picture 2
Picture 2
Picture 3

Description gualtiero65 2011-09-12 09:11:00 UTC
[ BUILD # : 201109110600 ]
[ JDK VERSION : 1.6.27 ]

Hi,

when I copy between Java source editor windows, the copied code in the
destination window is not complete if the SOURCE MODULE is not listed in the
DESTINATION module libraries.

In the picture 1 there is the source module window. I copy one line.

In the picture 2, the IDE ask me if I want to add the correct import. I say
yes.

In the picture 3, there is the destination module window where the copied code
has been edited to remove all references to the source module which brings to
not correct code.

Two comments:
* The copy function which cleverly detects the missing import and ask me to add
it, it should be also ask me if I want to add the source module as library for
the destination module (or it should stop the copy).
* By chance I pressed the "Undo" AFTER the copy and in the destination window I
have got the same code as in the source editor.

Gualtiero
Comment 1 gualtiero65 2011-09-12 09:11:24 UTC
Created attachment 110648 [details]
Picture 1
Comment 2 gualtiero65 2011-09-12 09:11:52 UTC
Created attachment 110649 [details]
Picture 2
Comment 3 gualtiero65 2011-09-12 09:12:29 UTC
Created attachment 110650 [details]
Picture 2
Comment 4 gualtiero65 2011-09-12 09:12:49 UTC
Created attachment 110651 [details]
Picture 3
Comment 5 Jan Lahoda 2011-09-13 16:01:14 UTC
Shouldn't try to import unresolvable elements:
http://hg.netbeans.org/jet-main/rev/ac972bec50ea
Comment 6 Quality Engineering 2011-09-14 06:25:13 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/ac972bec50ea
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #201993: do not try to import unresolvable Elements.