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.
Given the following code: " private String testFunction() { final String testString = "Test"; // comment at the end of introduce function return testString; } " Marking " final String testString = "Test"; // comment at the end of introduce function " (The cursor is in the line of "return testString") and pressing "Introduce Method" (Alt+Shift+M) the following code is generated: " private String testFunction() { String testString = introducedMethod(); // comment at the end of introduce function return testString; } private String introducedMethod() { final String testString = "Test"; return testString; } " The comment should be in the introduced method, because it was in the marked area. Just as a note: After the refactoring the text is marked in these lines: " String testString = introducedMethod(); // comment at the end of introduce function return testString; } private String introducedMethod() { final String testString = "Test"; " To me, this doesn't make much sense. Maybe it would be better if there was no marked text after the refactoring.