Project: JDT
Bug 28942 "Extract method" refactoring error [refactoring]
Reported: 2003-01-02 07:33:53 | Status: resolved fixed

When using the "extract method" refactoring, there seems to be a bug with the return statements if the return type is void. When extracting the following code for example: if (error == true) return; doSomething(); He complaints that not all execution paths contain a return statement. This is not necessary as the return type is void.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test192.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/return_in/A_test727.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/return_in/A_test728.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/return_out/A_test700.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/return_out/A_test727.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/return_out/A_test728.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java