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.
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 A { var currentSlide: String; public function jump(cur: Integer): Void { } public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } } ----------------------------------------- The result is: ----------------------------------------- public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } -----------------------------------------
How it should be formatted?
The if statement is written on one line in this case: ----------------------------------------------------------------------- public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } ----------------------------------------------------------------------- But the issue editor does not allow to put one long string in a line. It usually breaks the end of the string to the next line. Just format this code: ----------------------------------------------------------------------- class A { var currentSlide: String; public function jump(cur: Integer): Void { } public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } } ----------------------------------------------------------------------- The point is to not break block that is written on one line.
The same is for the for the loop. Format the code --------------------------------------------------------------- import javax.swing.JTable; import javax.swing.JComponent; import javax.swing.table.DefaultTableModel; import javafx.ext.swing.SwingComponent; package class TableColumn{ public var text: String; } package class SwingTable extends SwingComponent{ var table: JTable; var model: DefaultTableModel; public var selection: Integer; public var columns: TableColumn[] on replace{ model = new DefaultTableModel(for(column in columns) column.text, 0); table.setModel(model); }; override protected function createJComponent () : JComponent { return new JTable(model); } } --------------------------------------------------------------- The result is: --------------------------------------------------------------- public var columns: TableColumn[] on replace { model = new DefaultTableModel(for (column in columns) column.text, 0); table.setModel(model); }; ---------------------------------------------------------------
fixed http://hg.netbeans.org/javafx/rev/2b8c064da945
verified in NetBeans-JavaFX-Soma: #62
Fixed in release68_fixes http://hg.netbeans.org/javafx/rev/d51b517f64ae
Verified in NB 6.8 patch1 2010-01-25_21-27-59