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 176660 - Last curly bracket is not properly formatted in object literal
Summary: Last curly bracket is not properly formatted in object literal
Status: VERIFIED DUPLICATE of bug 175655
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-11-12 05:37 UTC by Alexandr Scherbatiy
Modified: 2009-11-16 04:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-11-12 05:37:04 UTC
Steps to reproduce:
- Copy the code to the editor:
--------------------------------------------------
Stage {
    scene: Scene {
        content: [
            Ellipse {
                fill: Color.GREEN
            },
            Circle{
                fill: Color.GREEN
            },
            Rectangle{
                fill: Color.GREEN
            }
        ]
    }
}
--------------------------------------------------
- Format the code

 The last curly brackets are shifted to the right 
--------------------------------------------------
Stage {
    scene: Scene {
        content: [
            Ellipse {
                fill: Color.GREEN
                },              // <- Shifted bracket
            Circle {
                fill: Color.GREEN
                },             // <- Shifted bracket 
            Rectangle {
                fill: Color.GREEN
                }              // <- Shifted bracket
            ]
        }       // <- Shifted bracket
    }           // <- Shifted bracket 

--------------------------------------------------
Comment 1 Alexandr Scherbatiy 2009-11-12 05:41:03 UTC
Product Version         = NetBeans IDE Dev (Build 200911091156)
(#fa9887b26708)
  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.
Comment 2 Anton Chechel 2009-11-12 05:41:39 UTC

*** This bug has been marked as a duplicate of bug 175655 ***
Comment 3 Petr Suchomel 2009-11-12 05:43:41 UTC
Alexander,
I am sorry for  myself, but I would expect formatting works correctly here,
original code is incorrectly formatted IMHO - or at least this might be on
person opinion (settings) how the brackets should be positioned. IMHO -> P4 in
worst case
Comment 4 Alexandr Scherbatiy 2009-11-12 05:53:17 UTC
Let's use the official documents.
http://java.sun.com/javafx/1/tutorials/ui/syntax/index.html

According to the tutorial this one is correct:
--------------------------------------------------------
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle; 
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;

Stage {
    title: "Declaring Is Easy!"
    scene: Scene {
        width: 300
        height: 250
        content: [
            Circle {
                centerX: 150  centerY: 120 radius: 80
                fill: Color.MAROON
                stroke: Color.INDIANRED
                strokeWidth: 10.0

            }, //Circle
            Rectangle {
                x: 25, y: 80 width: 250, height: 80
                arcWidth: 20 arcHeight: 20
                fill: Color.web("#6699ff")
                stroke: Color.web("#003399")
				strokeWidth: 5.0
            } //Rectangle
        ] //Content
    } //Scene
} //Stage 
--------------------------------------------------------


Anyway the default indentation in the object literals for the code formatting should be described in the code formatting specification.
Comment 5 Alexandr Scherbatiy 2009-11-16 04:21:32 UTC
verified in Build 200911160201