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 178569 - Code formating split 'if' statement on some lines
Summary: Code formating split 'if' statement on some lines
Status: VERIFIED WONTFIX
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-12-14 03:11 UTC by Alexandr Scherbatiy
Modified: 2009-12-18 04:55 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-12-14 03:11:26 UTC
NetBeans-JavaFX-Soma: #65

  Product Version         = NetBeans IDE 6.8 RC1 (Build 200911252200)
(#3c4d4f8d3d55)
  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:

- Format the code:
----------------------------------------------------
public function sign(x:Number):Integer {
    if( x <0 ) { -1 } else if(0 < x) { 1 } else { 0 }
}
----------------------------------------------------

The result is:
----------------------------------------------------
public function sign(x: Number): Integer {
    if (x < 0) {
        -1
    } else if (0 < x) {
        1
    } else {
        0
    }
}
----------------------------------------------------
Comment 1 Anton Chechel 2009-12-16 07:51:46 UTC
That's correct.
If user wants all on one line then he should write expression not in block (without curly braces):
-----
    if (x < 0) -1 else if (0 < x) 1 else 0
-----
Comment 2 Alexandr Scherbatiy 2009-12-18 04:55:48 UTC
verified