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 172644 - Code formatting adds new lines
Summary: Code formatting adds new lines
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-09-21 08:23 UTC by Alexandr Scherbatiy
Modified: 2009-11-16 06:30 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-09-21 08:23:06 UTC
Steps to reproduce:

- Create 'A' JavaFX class:
-------------------------------------------------
class A {
    public var a : String;
}
-------------------------------------------------
netbeans-trunk-nightly-200909201401-javafx-full.zip 

  Product Version         = NetBeans IDE Dev (Build 200909201401) (#9477102bf2cf)
  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.


- Format the code 
The result is:
---------------------------------------------------
 class A {    // <- A space added before the class keyword
        
             //  <- New lines added      

        public var a : String;
    
}
---------------------------------------------------
Comment 1 Alexandr Scherbatiy 2009-09-21 08:47:22 UTC
netbeans-trunk-nightly-200909201401-javafx-full.zip 

  Product Version         = NetBeans IDE Dev (Build 200909201401) (#9477102bf2cf)
  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:

- Create 'A' JavaFX class:
-------------------------------------------------
class A {
    public var a : String;
}
-------------------------------------------------

- Format the code 
The result is:
---------------------------------------------------
 class A {    // <- A space added before the class keyword
        
             //  <- New lines added      

        public var a : String;
    
}
---------------------------------------------------
Comment 2 Anton Chechel 2009-09-23 13:19:27 UTC
fixed
Comment 3 Lukas Hasik 2009-09-23 14:11:35 UTC
anton, please provide changeset to all bug closed as FIXED. It will allow better track the fix. Unfortunately, the
commits messages arent added to bugs automatically as it happens for bugs in nb-main repository. Thx.
Comment 4 Anton Chechel 2009-09-23 14:16:22 UTC
Sure, sorry.
http://hg.netbeans.org/javafx/rev/a46696bab294
Comment 5 Alexandr Scherbatiy 2009-09-29 10:55:58 UTC
The issue is still reproduced in build: netbeans-6.8beta-200909281634-javafx-full.zip 

The result of the formatting is:
-------------------------------------
 class A {

       

        public var a : String;
    }
-------------------------------------
Comment 6 Anton Chechel 2009-10-13 13:58:02 UTC
The current result is:
=====
class A {

    public var a : String;
}
=====

A new line has been added since "blank lines after class header" is true in editor settings. So it is correct behavior.
Comment 7 Alexandr Scherbatiy 2009-10-27 15:03:22 UTC
In the build 200910261401 I see
---------------------------------------------------------
class A {

    public var a : String;


}
---------------------------------------------------------

Do the last two lines after the variable declaration are added by intention?
Comment 8 Anton Chechel 2009-10-27 15:11:44 UTC
Last lines - no, this is a bug.
Comment 9 Anton Chechel 2009-11-10 11:29:54 UTC
fixed by http://hg.netbeans.org/javafx/rev/2e6affd7a86e
Comment 10 Alexandr Scherbatiy 2009-11-16 06:30:17 UTC
verified in Build 200911160201