Bug 7923

Summary: Extract Local Variable should be more robust against syntax errors
Product: [Eclipse Project] JDT Reporter: Erich Gamma <erich_gamma>
Component: UIAssignee: Adam Kiezun <akiezun>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: dirk_baeumer
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Erich Gamma CLA 2002-01-21 05:26:02 EST
When another method has a syntax error then the extract local variable 
refactoring fails. It should be able to handle this case
Comment 1 Adam Kiezun CLA 2002-01-21 06:31:54 EST
exactly the same it true for all other our sub-cu refactorings:

Extract Method, Inline Temp etc.

they're all not allowed od cus with compile errors - let alone syntax errors.


Comment 2 Adam Kiezun CLA 2002-01-21 06:41:00 EST
fixed for ExtractTemp, RenameTemp, InlineTemp

SelfEncaplulateField still throws an exception,

java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.refactoring.util.AST.accept
(AST.java:70)
	at 
org.eclipse.jdt.internal.corext.refactoring.util.JavaElementMapper.<init>
(JavaElementMapper.java:38)
	at 
org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring.
checkActivation(SelfEncapsulateFieldRefactoring.java:116)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate
(RefactoringStarter.java:79)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.SelfEncapsulateFieldAction.run
(SelfEncapsulateFieldAction.java:29)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:822)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:805)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:878)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321)
	at SlimLauncher.main(SlimLauncher.java:14)
Comment 3 Erich Gamma CLA 2002-01-21 07:42:21 EST
Dirk is working on making Extrace Method more fault tolerant.
Comment 4 Adam Kiezun CLA 2002-01-21 12:35:51 EST
fixed SEF
closing
Comment 5 Andre Weinand CLA 2002-03-28 05:34:49 EST
Verified