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 186030

Summary: Sequence Init Brackets: Don't insert spaces when it's empty!
Product: javafx Reporter: Torbjorn Norbye <tor>
Component: EditorAssignee: Anton Chechel <manowar>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 173487    

Description Torbjorn Norbye 2010-05-12 16:06:30 UTC
I want to have spaces inside the sequence initialization brackets just like around braces, e.g.
    def y = [ foo, bar ];

When I formatted my file I ended up with
    def y = [foo, bar];

I discovered that this is controlled by a formatting option, under Spaces -- "Sequence Init Brackets".  

So I changed it from false to true, but that had one huge problem:

Now I get spaces everywhere I have a "[]", such as in type initializations:

    function bar(bar: Bar[]): Void {
        var foo: Foo[];

gets formatted as

    function bar(bar: Bar[ ]): Void {
        var foo: Foo[ ];
Comment 1 Anton Chechel 2010-05-13 15:16:10 UTC
fixed
http://hg.netbeans.org/javafx/rev/0e3131f48660
Comment 2 Alexandr Scherbatiy 2010-05-18 09:16:25 UTC
The issue is still reproduced in build netbeans-trunk-nightly-201005170932-javafx-windows.exe 

- Select the Spaces -> "Sequence Init Brackets" option
- Format the code 
------------------------------------------------
class Bar {}

class Foo {}

function bar(bar: Bar[]): Void {
    var foo: Foo[];
}
------------------------------------------------

The result is:
------------------------------------------------
function bar(bar: Bar[ ]): Void {
    var foo: Foo[ ];
}
------------------------------------------------
Comment 3 Torbjorn Norbye 2010-05-20 18:12:32 UTC
Yes, this still happens in my files too.
Comment 4 Anton Chechel 2010-05-25 09:30:03 UTC
fixed
http://hg.netbeans.org/javafx/rev/99cdedefe47e
Comment 5 Alexandr Scherbatiy 2010-05-26 12:30:07 UTC
verified in netbeans-trunk-nightly-201005260001-javafx-windows.exe