Project: JDT
Bug 40243 inline method: loses comments [refactoring]
Reported: 2003-07-16 13:14:49 | Status: verified fixed

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!

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestArray.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestFieldReference.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLiteralReferenceRead.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLiteralReferenceWrite.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferenceLoop.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferencePrefix.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferenceRead.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferenceRead2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferenceUnused.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestLocalReferenceWrite.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestOneRead.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUnused1.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUnused2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUnused3.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUsed1.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUsed2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUsed3.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestParameterNameUsed4.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestTwoReads.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestVarargs.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestVarargs2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestVarargs3.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestVarargs4.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestVarargs5.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/argument_in/TestWrite.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/call_in/TestParenthesis.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/call_out/TestParenthesis.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/cast_in/TestNoCast.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/enum_in/TestAnonymousEnum.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/enum_in/TestBasic.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/expression_in/TestConditionalExpression.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/generic_in/TestClassInstance.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/generic_in/TestMethodInstance1.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/generic_in/TestMethodInstance2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/generic_in/TestSubClass1.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/generic_in/TestSubClass2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/import_in/TestStaticImport.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/import_in/TestStaticImport2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestBlocks.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestFieldInType.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestLocalInType.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestSameLocal.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestSameType.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestSameTypeAfter.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestSameTypeInSibling.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/nameconflict_in/TestSwitchStatement.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/receiver_in/TestFieldReceiver.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestBasic1.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestBasic2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestCatchClause.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestEmptyBody.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestInitializer.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestLabeledStatement.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestPrimitiveArray.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestSuper.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/simple_in/TestTypeArray.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/AbstractSelectionTestCase.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/SurroundWithTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/NoCommentSourceRangeComputer.java