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 239487 - Improve comment handling for hints and refactorings
Summary: Improve comment handling for hints and refactorings
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: 8.0_WAIVER_APPROVED
Depends on: 245348
Blocks: 165451 230832 239609 241883 241969 242152 243035 244170 244174 245103 245318
  Show dependency tree
 
Reported: 2013-12-13 19:25 UTC by Svata Dedic
Modified: 2014-07-17 02:17 UTC (History)
4 users (show)

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 Svata Dedic 2013-12-13 19:25:15 UTC
see discussion in issue #237072; currently one must use GeneratorUtilities to import comments, then manually copy comments from Trees being replaced to new trees.

To improve behaviour in hints, comments should be imported automatically for HintContext.getPath() subtree (if the hint modifies something else, it still needs to import the other locations). 
Comments should be automatically copied from a tree being replaced to the replacement ("comments should not disappear").
There should be a way how to 'alias' nodes which are not directly replaced, to indicate the node is a transformed original one. This is stronger than just copying the source comments to the target as it allows the infrastructure to also collect comments from the obsolete subtree and preserve them in the source. All the above will allow not to loose comments.
Comment 1 Jesse Glick 2013-12-13 19:40:47 UTC
As noted in issue #237072 comment #22, I have seen a class annotation get deleted during Introduce Comment, so this may not be limited to comments.
Comment 2 _ gtzabari 2014-02-01 04:40:56 UTC
The "Add Constructor" hint deletes the class Javadoc as of build 201401270001. Should I file a separate bug report or will you fix it as part of this issue?
Comment 3 _ gtzabari 2014-03-05 14:36:36 UTC
Ugh.

Guys, we've been experiencing data loss due to this bug for over 2 releases now. If you avoid fixing it for 8.0, then please please please make it a must-fix in the subsequent release.
Comment 4 Svata Dedic 2014-07-10 14:00:07 UTC
Adapted to API changes introduced by issue #245348 in jet-main#dc9a3b874239
Comment 5 Quality Engineering 2014-07-17 02:17:51 UTC
Integrated into 'main-silver', will be available in build *201407170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dc9a3b874239
User: Svata Dedic <sdedic@netbeans.org>
Log: #239487: code adapted to API change introduced by #245348