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.
Summary: | Extra space when rewriting MethodInvocationTree | ||
---|---|---|---|
Product: | java | Reporter: | tronicek <tronicek> |
Component: | Source | Assignee: | Jan Lahoda <jlahoda> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | fommil, jkovalsky, ulfzibis |
Priority: | P3 | Keywords: | NETFIX |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
test cases, including a tough one with comments
test case and proposed fix |
Description
tronicek
2009-03-09 22:41:23 UTC
Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next". I am working on a refactoring module and these bugs are crucial for it to work. I'd like to NetFIX [1] this bug. Is it possible? [1] http://wiki.netbeans.org/NetFIX We're going to have to be careful about this one... ensure that comments and annotations on the parameter are also moved. I'll submit a more comprehensive test case. Created attachment 82252 [details]
test cases, including a tough one with comments
Created attachment 82354 [details]
test case and proposed fix
@moonko you're going to have to decide if this is actually a bug or not! There is precedent in the existing test cases that the extra space should be there. In fact, if you accept the patches to the .pass files then there is no need to accept the standalone test159944 method test. The proposed fix adds an extra variable tracking how many delete operations have been performed. Instead of looking to see if we are the first parameter in the old list, this patch means we check to see if we are the first parameter in the new list. I note that diffParameterList doesn't appear to be comment friendly! I will submit a bug shortly on this. I accept this bug as legitimate issue. The white space insertion is based on user defined formatting properties. If there no space allowed, the any white space inserted is bug. OK, let me know if you want me to look at this again to explicitly query user preferences. Incidentally, I don't know how to set preferences in a test case... some advice please? I find the code to deal with NOCHANGE in CasualDiff.diffParameterList to be overly complicated. Why can't we just do a simple copyTo(bounds[0], bounds[1]); and be done with it? I don't understand all this backwards/forwards token nonsense... it is certainly not dealing with whitespace or comments correctly anyway. Update on status, please? Reassigning all moonko's java/source bugs to myself. Any update on this Honzo? Thanks! *** Bug 178207 has been marked as a duplicate of this bug. *** Thanks for the patch. I have pushed a slightly modified version of the patch: http://hg.netbeans.org/jet-main/rev/43df26622ff0 I am looking into the comments-related problem. Integrated into 'main-golden', will be available in build *201004040201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/43df26622ff0 User: Jan Lahoda <jlahoda@netbeans.org> Log: #159944: when deleting leading method parameters, delete also trailing whitespaces after comma. Contributed by Sam Halliday (fommil@netbeans.org). The comments usecase should work (provided that the comments are correctly attached to the trees using GeneratorUtilities.importComments): http://hg.netbeans.org/jet-main/rev/13418ff046d9 Integrated into 'main-golden', will be available in build *201004070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/13418ff046d9 User: Jan Lahoda <jlahoda@netbeans.org> Log: #159944: More correct handling of comments inside method invocations. Partially contributed by Sam Halliday (fommil@netbeans.org). |