Community
Participate
Working Groups
20030715 inline method loses comments that are places before call sites. example: package p; public class A { private void helper1(int startLine, int startColumn, int endLine, int endColumn, boolean replaceAll, boolean makeFinal, String tempName) throws Exception{ helper1(startLine, startColumn, endLine, endColumn, replaceAll, makeFinal, tempName, tempName); } private void helper1(int startLine, int startColumn, int endLine, int endColumn, boolean replaceAll, boolean makeFinal, String tempName, String tempName2) { } public void test0() throws Exception{ // regression test for bug XYZ helper1(4, 16, 4, 17, false, false, "temp"); } } inline the first helper1 the all-important (for me) comment is gone!
This is done by the AST rewriter. Have to check with Martin what we can do here.
This seems rather high-priority to me; I just lost a comment of several dozen lines but fortunately noticed it immediately. Let me know whether anyone is working on this or whether it would help if I take a look at it.
No one is working on this right now (fixing it will not be simple because this is automatically done by the AST rewriter).
Martin, is there anything I can do to control this when I replace helper1(4, 16, 4, 17, false, false, "temp"); with the method body using the AST rewriter ?
replace or delete alwasy include comments mapped to the node. Theres no trick here to prevent this.
Fixed.
Marking as fixed.
Verified in I20050217-2000 that the initial scenerio is fixed however, if the remaining helper1 is inlined as well we end up without comment: public void test0() throws Exception{ } Filed bug 85806 for this.