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 176043 - Code formatting breaks line for the while condition statement
Summary: Code formatting breaks line for the while condition statement
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-11-05 12:38 UTC by Alexandr Scherbatiy
Modified: 2009-11-18 04:10 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-05 12:38:00 UTC
Product Version         = NetBeans IDE Dev (Build 200911041401) (#85cd8ef6b75c)
  Operating System        = Windows Vista version 6.0 running on x86
  Java; VM; Vendor        = 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16; Sun Microsystems Inc.

Steps to reproduce:

- Copy the code to the editor:
--------------------------------------------------------
import java.sql.DriverManager;

class Contact{
    public var name:String;
    public var email:String;

    override function toString():String{
        "[contact] name: {name}, email: {email}"
    }
}


function getContacts():Contact[]{

    var driver = "org.apache.derby.jdbc.EmbeddedDriver";
    var connectionURL = "jdbc:derby://localhost:1527/sample;user=app;password=app";
    var sqlQuery = "select * from APP.CUSTOMER";

    java.lang.Class.forName(driver);

    var connection = DriverManager.getConnection(connectionURL);

    var stmt = connection.createStatement();
    var rs = stmt.executeQuery(sqlQuery);


    var contacts:Contact[];

    while (rs.next()) {

        var name = rs.getString("NAME");
        var email = rs.getString("EMAIL");

        insert Contact{ name: name email: email } into contacts;

    }

    rs.close();

    return contacts;

}

var contacts = getContacts();

for(contact in contacts){
    println(contact);
}
--------------------------------------------------------

- Format the code
The result is:
--------------------------------------------------------
    while ( 
        rs  .next()
          )
          {
--------------------------------------------------------
Comment 1 Alexandr Scherbatiy 2009-11-05 12:40:39 UTC
The line for the method invocation is also broken in this case:
----------------------------------------------------
    while ( 
        rs  .next()
          )
          {
                   
    
    
    

var name = rs

.getString("NAME");
        var email = rs.getString("EMAIL");

        insert Contact {name : name email : email} into contacts;

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

See the 'name' variable 
Comment 2 Anton Chechel 2009-11-12 08:04:25 UTC
Missing parenthesized javafx parser bug strikes back!
But noble warrior Manowar is not afraid of it!

===
Stand and fight
Live by your heart
Always one more try
I'm not afraid to die
Stand and fight
say what you feel
Born with a heart of steel...
===

fixed
http://hg.netbeans.org/javafx/rev/2f0d5150a142
Comment 3 Alexandr Scherbatiy 2009-11-18 04:10:36 UTC
verified in Build 200911170201