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 180146

Summary: Last curly bracket is not properly formatted
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: EditorAssignee: Adam Sotona <asotona>
Status: RESOLVED WONTFIX    
Severity: normal CC: esmithbss
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 173487    

Description Alexandr Scherbatiy 2010-02-02 05:54:48 UTC
NetBeans-JavaFX-Soma: #140

  Product Version         = NetBeans IDE Dev (Build 201001280200)
(#eeef33500a1a)
  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 javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.text.*;

public class MyText extends CustomNode {

    var content = "Hello World!";

    override function create() {
        Group {
            content: [
                Rectangle {
                    }
                Text {
                    cursor: Cursor.MOVE
                    content: bind content
                }
            ]
        }
    }

    }
------------------------------------------------------------
- Format the code

The last bracket is not properly formatted:
------------------------------------------------------------
public class MyText extends CustomNode {
     // ....
    }
------------------------------------------------------------
Comment 1 Anton Chechel 2010-02-03 07:11:18 UTC
*** Bug 180149 has been marked as a duplicate of this bug. ***
Comment 2 Alexandr Scherbatiy 2010-02-05 04:04:02 UTC
The same is for functions:

Steps to reproduce:

- Copy the code to the editor:
------------------------------------------------------------
function run() {
    } 
------------------------------------------------------------
- Format the code

The last bracket is not properly formatted:
------------------------------------------------------------
function run() {
    } 
------------------------------------------------------------
Comment 3 Anton Chechel 2010-02-10 07:12:10 UTC
Decreasing priority. It's not P2.
Comment 4 Alexandr Scherbatiy 2010-02-11 04:56:02 UTC
1. It is the regression from the previous relese
2. It is common use case. 
  Usually the JavaFX classes have methods and incorrect formatting makes it useless for using for the whole code.
Comment 5 Anton Chechel 2010-02-11 05:57:35 UTC
1. It's not regression. That bug was before.
2. It is not common, it occurs only when there is exact number of spaces as current indent (4 in example below). If you add or remove one space - it formatted correctly. And it's not in methods, it is in any block.
Comment 6 Alexandr Scherbatiy 2010-02-11 07:40:24 UTC
NetBeans-JavaFX-Soma:  #149

- Format the code
-----------------------------------
import javafx.scene.layout.HBox;

HBox {
}
-----------------------------------

The result is:
-----------------------------------
import javafx.scene.layout.HBox;

HBox {
    }
-----------------------------------
Comment 7 Alexandr Scherbatiy 2010-04-22 09:56:38 UTC
The code is not formatted:

-----------------------------------
import javafx.util.Math;

public class FXVector {

    public-init var x: Number;
    public-init var y: Number;

    public function getLength(): Number {
        return Math.sqrt(x * x + y * y);
    }

    }
-----------------------------------
Comment 8 Anton Chechel 2010-06-14 12:44:39 UTC
*** Bug 185665 has been marked as a duplicate of this bug. ***
Comment 9 Martin Ryzl 2010-10-21 11:54:59 UTC
.
Comment 10 David Strupl 2011-05-16 13:50:37 UTC
Closing all bugs filed against JavaFX 1.x as wontfix. We will support JavaFX 2.0 - please keep opened only bugs against the new release. Thanks.