Bug 7923 - Extract Local Variable should be more robust against syntax errors
Summary: Extract Local Variable should be more robust against syntax errors
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-21 05:26 EST by Erich Gamma CLA
Modified: 2002-03-28 05:34 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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