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

Summary: Code reformatting indents incorrectly after some code
Product: editor Reporter: twolf2919 <twolf2919>
Component: Formatting & IndentationAssignee: issues@editor <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:

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));
3)...

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
Milo,
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 ***