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 115622 - indent.reindent does nothing until file is modified
Summary: indent.reindent does nothing until file is modified
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-15 05:28 UTC by err
Modified: 2009-11-02 11:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
arguments to reindent method (9.22 KB, image/png)
2007-09-15 05:29 UTC, err
Details
code that calls reindent, another failing example (2.27 KB, text/plain)
2007-09-15 05:30 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2007-09-15 05:28:04 UTC
Build 200709140000

reindent starting line 2 for 7 lines (first file line is line 1), see attachment for argument details

Second attachment has code used to call reindent. And another example of failure. 

To reproduce with jVi, put caret on "{" of class declaration, enter two characters "=%" which means
"reindent-toMatchingBrace". Note that arguments are from beginning of first line to after end of last line.

This has been going on for a while, when it fails it is always lines at the end of the specified range. Several '}' in a
row is typically part of the failure.
===================================
package javaapplication1;
class e {
void f() {
int x = 0;
if(x > 0) {
}
}
}
//
//
// 2 chars per line for 11 lines
===================================
class e {
    void f() {
        int x = 0;
        if(x > 0) {
}
}
}
===================================
Comment 1 err 2007-09-15 05:29:07 UTC
Created attachment 48875 [details]
arguments to reindent method
Comment 2 err 2007-09-15 05:30:22 UTC
Created attachment 48876 [details]
code that calls reindent, another failing example
Comment 3 err 2007-09-15 05:46:39 UTC
Additional bizzare behavior.

With the example file the only file opened, close the IDE, then restart. Then do the indent operation and *nothing*
happens. Seems that in o.n.m.e.indent.IndentImpl.reindent indentHandler.hasItems() is false and then there is no default
formatter.

Modify the file by adding a space after one of the "//". Now do the indent operation, and it modifies the file in the
typical failing way. After modifying the file, there is a defaultFormatter.
Comment 4 Miloslav Metelka 2007-09-19 15:58:22 UTC
The original problem could be in fact the same like issue 116018.
Comment 5 err 2007-09-19 17:52:31 UTC
As expected, this issues main problem is fixed with this mornings sources; no doubt because of fix for issue 116018.
(which also explains several other observations about the failure)

Changing the summary to reflect the less important issue I ran into:

Seems that in o.n.m.e.indent.IndentImpl.reindent there is no default formatter until after the file is modified. See
comment of Sat Sep 15 04:46:39 +0000 2007
Comment 6 Jiri Prox 2008-04-11 00:43:32 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 7 Max Sauer 2008-11-14 09:20:49 UTC
Will be resolved LATER.
Comment 8 Quality Engineering 2009-11-02 11:00:34 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX