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: | Organize Members deletes annotations and comments | ||
---|---|---|---|
Product: | java | Reporter: | _ gtzabari <gtzabari> |
Component: | Source | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P1 | ||
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Windows 10 x64 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
_ gtzabari
2016-01-16 14:00:52 UTC
Sorry, the code sniplet I posted was incorrect. Here is an easier way to reproduce code sniplet that will work: --------- package somepackage; /** * Some block comment. */ @SuppressWarnings("unchecked") // Some line comment @Deprecated public class Test { private int test; public int getTest() { return test; } } --------- After Organize Members you will end up with: --------- package somepackage; @Deprecated public class Test { private int test; public int getTest() { return test; } } --------- Notice that the block comment, @SuppressWarnings, and line comment were all deleted. Reproducible The cause is the comment between annotations Seems like the // comment gets incorrectly assigned to TWO trees (annotation, class) instead of just annotation tree. I've made adjustments so that comments are assigned to the nearby annotations. Fixed in jet-main#bb79176c8f8f Integrated into 'main-silver', will be available in build *201603030002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/bb79176c8f8f User: Svata Dedic <sdedic@netbeans.org> Log: #257599: dive into ModifiersTree to assign comments to annotations |