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 184299

Summary: Formatter mishandles function variable type declarations
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-04-15 16:26:55 UTC
The formatter doesn't handle function variable definitions well (where I specify the types of parameters expected by the function).

Consider these variations:

    var onCommit1: function(boolean: Boolean, string: String, bounds: Bounds): Void;
    var onCommit2: function(Boolean, String, Bounds): Void;
    var onCommit3: function(:Boolean, :String, :Bounds): Void;

If I format this I get

    var onCommit1: function(boolean: Boolean,string:  String,bounds:  Bounds): Void;
    var onCommit2: function(Boolean ,String  ,Bounds  ): Void;
    var onCommit3: function(: Boolean,:  String,:  Bounds): Void;

In both cases I get strange formatting.

By the way, if I select just these three lines in my code and apply a format of those three lines instead of the whole file, I get something stranger:

var onCommit1:               

      function
      

     (  boolean :  

     Boolean   
        
        ,string:  String,bounds:  Bounds): Void;
    var onCommit2: function(Boolean ,String  ,Bounds  ): Void;
    var onCommit3: function(: Boolean,:  String,:  Bounds): Void;
Comment 1 Anton Chechel 2010-04-21 17:02:41 UTC
fixed
http://hg.netbeans.org/javafx/rev/073dd94f05c4
Comment 2 Alexandr Scherbatiy 2010-05-12 13:04:07 UTC
verified in netbeans-trunk-nightly-201005112200-javafx-full-windows.exe