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 175652

Summary: Code formatting inserts spaces before a class declaration
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: EditorAssignee: Anton Chechel <manowar>
Status: VERIFIED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 173487    

Description Alexandr Scherbatiy 2009-10-29 13:24:01 UTC
Product Version         = NetBeans IDE Dev (Build 200910271401) (#32576b20b4bb)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun Microsystems Inc.


Steps to reproduce:
- Copy the code to the editor:
---------------------------------------------------------------
import java.util.HashMap;


class A {
    public var num : Number;
}

class B {

    public var text : String;
    public override function toString():String { text }
}


var a1 = A{ num: 1 };
var a2 = A{ num: 2 };

var b1 = B{ text: "One" };
var b2 = B{ text: "Two" };




var hashMap = new HashMap();

hashMap.put(a1, b1);
hashMap.put(a2, b2);

var value = hashMap.get(a1);
println(value);
---------------------------------------------------------------

- Format the code
The result is
---------------------------------------------------------------
import java.util.HashMap;


     class A {
    public var num : Number;
}

class B {

    public var text : String;
    public override function toString():String { text }
}


var a1 = A{ num: 1
     };
var a2 = A{ num: 2
     };

var b1 = B{ text: "One"
     };
var b2 = B{ text: "Two"
---------------------------------------------------------------

There are spaces before the A class declaration:

---------------------------------------------------------------
     class A {
    public var num : Number;
}
---------------------------------------------------------------
Comment 1 Anton Chechel 2009-11-02 14:24:21 UTC

*** This issue has been marked as a duplicate of 175582 ***
Comment 2 Alexandr Scherbatiy 2009-11-18 03:41:11 UTC
verified in Build 200911170201