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 186038 - Formatting Breaks and Aborts?
Summary: Formatting Breaks and Aborts?
Status: RESOLVED WONTFIX
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2010-05-12 16:45 UTC by Torbjorn Norbye
Modified: 2011-05-16 13:51 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 Torbjorn Norbye 2010-05-12 16:45:12 UTC
In formatting my files, I ran into some strange formatting near the end of a large file.

I started filing a bug on these two cases -- but then I noticed that the rest of the file hadn't been formatted (I noticed this because most of the file has diffs where blank lines have been removed, but not the last third of the file).

It looks like formatting breaks down on this AST, because the formatting errors I see are errors I can't reproduce in a small file.

Try formatting the Frame.fx file in the Authoring Tool codebase (my tip is changeset ece0b82e9600).

Then open the file in the diff viewer and go to the showMessage(...) function. I'll notice 

        if (duration <= 0s) {

gets formatted into

        if (duration <= 0s
              ) {

Then look at the next function -- onAbout -- and there are bigger problems here, huge blocks of blank lines, etc, and the end of the function is completely misformatted.

And from then on I don't see any diff markers so I'm assuming it gave up.
Comment 1 Torbjorn Norbye 2010-05-12 17:12:26 UTC
I discovered that if I comment out the onAbout method then the bug goes away and the entire file is formatted.

So there is something about the onAbout method that makes the formatter unhappy.
Comment 2 Anton Chechel 2010-05-17 14:06:50 UTC
First of all I want to ask: is that source compilable in nb editor? I mean sure it is compilable by external compiler in ant but maybe not by internal nb fx compiler. Do you have red error badges in editor? We have issues with calsspathes and if source is not compilable I can't predict behavior of formatter.

Second I can't invoke formatter at the current build by my self since there com.sun.tools.mjavac.util.Abort thrown by compiler. Do you also have this Abort?
Comment 3 Torbjorn Norbye 2010-05-17 18:19:01 UTC
I *think* it's compiling fine; I don't see an error badge, and the navigator is populated with a correct list of members...  Also, when I try formatting it, it doesn't abort for me; it formats (mostly correct except all my readability-newlines are removed (separate bug) and then this issue in the About-method.
Comment 4 Torbjorn Norbye 2010-05-20 18:11:53 UTC
I just tried with the latest bits and saw similar formatting problems on a smaller file; try formatting the file ToolFx/src/com/sun/javafx/designer/fx/main/DesignerTool.fx

Code completion was working on the file before formatting so I don't think there's any compiler abort here. It seems related to mixing code and strings.
Comment 5 Anton Chechel 2010-05-26 12:59:11 UTC
During debugging I see compiler behaves weird. Generated AST is incomplete in some nodes. For example ClassDeclarationTree.getExtends() returns null for Frame class what is wrong. Also I am getting permanently Abort errors. So it looks like we need to fix runtime with correct classpathes and other environment itself. It is not an issue of formatter as far as I see. Aborts will be fixed in 6.9.1.
Comment 6 Martin Ryzl 2010-10-21 11:56:07 UTC
.
Comment 7 David Strupl 2011-05-16 13:51:55 UTC
Closing all bugs filed against JavaFX 1.x as wontfix. We will support JavaFX 2.0 - please keep opened only bugs against the new release. Thanks.