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 177090 - Sequence slice in trigger is not properly formatted
Summary: Sequence slice in trigger is not properly formatted
Status: VERIFIED FIXED
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-18 07:26 UTC by Alexandr Scherbatiy
Modified: 2010-02-02 03:42 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-18 07:26:20 UTC
Product Version         = NetBeans IDE Dev (Build 200911171401) (#d7b3ad6247f5)
  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
-----------------------------------------
class Foo {
    var seq: String[] on replace oldSlice[a..b] = newSlice{ for(s in seq[a..b]){ println(s) } };
}
-----------------------------------------

The result is
-----------------------------------------
class Foo {

    var seq: String[] on replace oldSlice 
                [a..b]  
            
= newSlice{ for(s in seq[a..b]){ println(s) } };
}
-----------------------------------------
Comment 1 Alexandr Scherbatiy 2009-11-23 07:19:48 UTC
One more sample.

Format the code:
-------------------------------------------------------------------
import javax.swing.JTable;
import javax.swing.JComponent;
import javax.swing.table.DefaultTableModel;

import javafx.ext.swing.SwingComponent;

package class TableCell{
    public var text: String;
}

package class TableRow{
    public var cells: TableCell[];
}


package class SwingTable extends SwingComponent {

    var table: JTable;
    var model: DefaultTableModel;

    public var rows: TableRow[] on replace oldValue[lo..hi] = newVals{
        for(index in [hi..lo step -1]){
            model.removeRow(index);
        }

        for(row in newVals){
            model.addRow(for(cell in row.cells) cell.text);
        }
    };

    override protected function createJComponent(): JComponent {
        return new JTable(model);
    }
}
-------------------------------------------------------------------

The result is:
-------------------------------------------------------------------
    public var rows: TableRow[] on replace oldValue 
                [lo..hi  ]  
                  
            

        
         
    
= newVals{
        for(index in [hi..lo step -1]){
            model.removeRow(index);
        }

        for(row in newVals){
            model.addRow(for(cell in row.cells) cell.text);
        }
    };
-------------------------------------------------------------------
Comment 2 Anton Chechel 2009-11-25 07:29:08 UTC
Compiler issue: http://javafx-jira.kenai.com/browse/JFXC-3718
Comment 3 Anton Chechel 2010-01-25 09:26:48 UTC
fixed
http://hg.netbeans.org/javafx/rev/f06f3e2776f6
Comment 4 Alexandr Scherbatiy 2010-02-02 03:42:16 UTC
verified in NetBeans-JavaFX-Soma: #140