Bug 5690 - refactoring: incorrect ExtractMethod on conditional return in loop
Summary: refactoring: incorrect ExtractMethod on conditional return in loop
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-08 17:21 EST by Grant Gayed CLA
Modified: 2001-11-09 08:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2001-11-08 17:21:39 EST
- load the source for swt into your workspace
- open Display, go to method disposeExec (Runnable runnable)
- select the following block:
	for (int i=0; i<disposeList.length; i++) {
		if (disposeList [i] == null) {
			disposeList [i] = runnable;
			return;
		}
	}
- Refactor -> ExtractMethod
- give the new method a name like checkForNullDispose
- Finish, it seems to assume that the extracted loop will always result in a 
return, though this is not the case here
Comment 1 Dirk Baeumer CLA 2001-11-09 08:47:39 EST
Problem is wrong transition of void return flag when merging empty condition 
statements (example has no else block).

Fixed in build > 20011107