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.
Created attachment 150150 [details] Diff screenshot When I do Refactor > Inline..., Netbeans eats my Java comments. Example: double a = 1; //Important comment! DO NOT DELETE! <~~~~ gets deleted when inlining inlineMe double inlineMe = 2 * a; double b = 4 * inlineMe; Example diff: see attached screenshot. Is it possible to prevent this behaviour? I browsed through Tools > Options and couldn't find anything that would do this. Therefore I thought this could be a bug. See also: http://stackoverflow.com/q/26283733/119775
The comment preceding the variable declaration is attached to this variable declaration. When performing inline on a variable, this variable gets deleted together with it's associated comments. The sample you attached is a bit too artificial, do you have a good example of a comment that should remain? or a comment that should be copied to the statements using the variable? The following are examples of comments I think should be removed when performing inline on a variable. /** * The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter. */ private double PI = Math.PI; // Temporary value, should probably be inlined double temp = 7 * value; double a = 1.2; // initialize variable