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 177918 - Code formatting mess up code if variable declaration include package qualifier
Summary: Code formatting mess up code if variable declaration include package qualifier
Status: VERIFIED WORKSFORME
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-12-01 07:33 UTC by geekycoder
Modified: 2011-11-16 16:41 UTC (History)
1 user (show)

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 geekycoder 2009-12-01 07:33:39 UTC
Although the "Format" from latest Netbeans Rc1 is now working. It is now able to format the code. However, there is still a bug in it. When the type of variable declaration is qualified by the package, the JavaFX Code formatter will format the code incorrectly.

For example, 

public class TestClass {
    public var myDate:java.util.Date = new java.util.Date(); // myDate:java.util.Date will cause problem to formatter 

   public var myString:java.lang.String = "Still buggy";
} 

will be formatted incorrectly as 

public class TestClass {

    public var myDate: java   
        
.util.Date = new Date();
    public var myString:java.lang.String = "Still buggy";
}

The JavaFX Script Code formatter will mess up the first occurrence of the declaration line with package qualifier (eg myDate:java.util.Date) .
Comment 1 Alexandr Scherbatiy 2009-12-02 02:28:13 UTC
It is possible to use class importing as a workaround:
-------------------------------------------------------
import java.util.Date;

public class TestClass {

    public var myDate: Date = new Date(); //
    public var myString: String = "Still buggy";
}
-------------------------------------------------------
Comment 2 Lukas Hasik 2009-12-02 02:33:14 UTC
I tried your test sample and the result for me is

public class TestClass {

    public var myDate: java  .util.Date 
       = 
new java.util.Date();
    public var myString:java.lang.String = "Still buggy";
}

I agree that it's bug but definitelly not P1. I need to check it on different OS
Comment 3 Lukas Hasik 2009-12-02 04:30:27 UTC
the code remains compilable
Comment 4 Anton Chechel 2009-12-02 06:19:25 UTC
This bug was already fixed.
Comment 5 Alexandr Scherbatiy 2009-12-09 03:03:02 UTC
Verified in the developers build 6.8.1 
NetBeans-JavaFX-Soma  #60