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 41567 - Code reformatting indents incorrectly after some code
Summary: Code reformatting indents incorrectly after some code
Status: RESOLVED DUPLICATE of bug 23508
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@editor
Depends on:
Reported: 2004-03-31 22:20 UTC by twolf2919
Modified: 2007-11-05 13:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description twolf2919 2004-03-31 22:20:22 UTC
I have the following line in one of my src files:
1) float pError = (completedWithErrors == 0) ?  0 :
2)   ((float) completedWithErrors/(float)
(completedWithErrors + completedWithoutErrors));

The numbers are line numbers, since this bug form
wraps things automatically.

Anyway, when I do "Reformat Code", all lines
following line 2, until the next closing bracket,
align with the first parenthesis of line 2!
Comment 1 Miloslav Metelka 2004-04-02 15:19:51 UTC
Yes, handling of the multiline statements is clearly the deficiency of
the current java indenter. Unfortunately we were not able to handle it
appropriately yet.
 This is in fact dup of issue 6065.

*** This issue has been marked as a duplicate of 6065 ***
Comment 2 twolf2919 2004-04-02 16:45:23 UTC
I'm not sure this is a duplicate of 6065 - since (1) 6065 doesn't
mention that the code reformatter screws up subsequent indentation as
my bug report does - it only says that it fails to indent multi-line
code lines; (2) 6065 is currently marked an "Enhancement" - which this
really isn't - it's a bug.
Comment 3 Miloslav Metelka 2004-04-05 13:29:58 UTC
I see I've read it wrongly - not the lines of the multi-line statement
are wrongly indented but the lines that _follow_ it are wrongly
indented. My sincerest apologies.
Comment 4 Miloslav Metelka 2004-04-06 09:00:56 UTC
The problem is that the indenter does not recognize "? :" operator
statement properly and it incorrectly computes the indent of such
statement. We should find a fix for this into promoD.
Comment 5 Martin Roskanin 2004-08-20 16:33:31 UTC
problem already reported

*** This issue has been marked as a duplicate of 23508 ***