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 116324

Summary: Pasted source put "return null;" inside {}
Product: java Reporter: Lark Fitzgerald <lfitzgerald>
Component: EditorAssignee: Max Sauer <msauer>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Lark Fitzgerald 2007-09-21 14:57:11 UTC
Product Version: NetBeans 6 IDE Dev (Build beta1: 200709191200
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b02
Glassfish: 58g
Woodstock 4.1: 200709201029

Found by automation.

Steps that cause failure:
1. Create visualweb project
2. drag/drop basic > button onto designer.
3. click designer to deselect button
4. double click button to open action() method
5. go up 3 lines and paste this source and press return:
static int lightState; 
6. go down 4 lines (end up on same line as return null; but at position 0).
7. paste the following source (you MUST copy/paste) and press return;
switch (++lightState) { 

you end up with:
    public String button1_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
switch (++lightState) { 
    return null;
}
    }

I can work around this issue by adding in a blank line BEFORE return null; and pasting to that line.
Comment 1 Jan Lahoda 2007-09-24 17:16:04 UTC
I do not think this relates to paste: to reproduce, place caret at the place denoted by '|' and press enter:
package javaapplication5;

public class B {

    public B() {}
    
    Object test(int a) {
while (a-- > 0) { | return null;
    }
}
Comment 2 David Strupl 2009-03-31 15:53:09 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that
it should be implemented please reopen and set the target milestone to "next".
Comment 3 Quality Engineering 2009-11-02 10:58:17 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX