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 173368

Summary: Triggers are not properly formatted
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: EditorAssignee: Anton Chechel <manowar>
Status: VERIFIED FIXED    
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-09-30 10:39:46 UTC
Product Version         = NetBeans IDE 6.8 Beta (Build 200909281634) (#066b555e5ecf)
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:
--------------------------------------------------
var a = 3 on replace{
    println(a);
}
--------------------------------------------------

- Format the code
The result is:
--------------------------------------------------
     var a  =  3 

on replace{
    println(a);
}
--------------------------------------------------
Comment 1 Alexandr Scherbatiy 2009-10-01 10:22:55 UTC
The same is for the class triggers.

Format the code:
------------------------------------------------- 
class Foo {
    var x : Integer on replace = newV { println("x: =>{newV}={x}"); };
    var y : Integer on replace { println("y: {y}"); };
    var z : String = "Ralph" on replace { println("z: {z}"); };
}
------------------------------------------------- 

The result is:
------------------------------------------------- 
 class Foo {

       

        var x : Integer 
          
            on replace = newV { println("x: =>{newV}={x}"); };
    var y : Integer on replace { println("y: {y}"); };
    var z : String = "Ralph" 
    

on replace { println("z: {z}"); };
}
------------------------------------------------- 
Comment 2 Anton Chechel 2009-11-11 06:52:26 UTC
Formatting it-self has been fixed: http://hg.netbeans.org/javafx/rev/87263c31d320

Formatting of block expression in the "on replace" clause depends on wrapping "Brace Placement" settings. If wrapping is incorrect, then it's another issue, not P2 for sure. Formatting settings are not implemented yet, but should be asap.
Comment 3 Alexandr Scherbatiy 2009-11-17 07:31:51 UTC
verified in Build 200911170201