Project: JDT
Bug 78880 [refactoring] self encapsulate field: exception on name 'fPackage'
Reported: 2004-11-17 14:54:07 | Status: resolved fixed

3.0 i have a field called fPackage (prefixes set to 'f') i wanted to encapsulate it. i accepted the default getter setter names, set 'refs in same class - use field direct references' and i got: (seems like the name has something to do with it.) java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:284) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run (RefactoringWizardDialog2.java:282) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange (RefactoringWizard.java:565) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage (RefactoringWizard.java:408) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage (UserInputWizardPage.java:74) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage (UserInputWizardPage.java:114) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.previewPressed (RefactoringWizardDialog2.java:429) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.access$3 (RefactoringWizardDialog2.java:427) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2 $1.widgetSelected(RefactoringWizardDialog2.java:563) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431) at org.eclipse.jface.window.Window.runEventLoop(Window.java:668) at org.eclipse.jface.window.Window.open(Window.java:648) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run (RefactoringWizardOpenOperation.java:125) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run (RefactoringWizardOpenOperation.java:138) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:40) at org.eclipse.jdt.ui.actions.SelfEncapsulateFieldAction.run (SelfEncapsulateFieldAction.java:159) at org.eclipse.jdt.ui.actions.SelfEncapsulateFieldAction.run (SelfEncapsulateFieldAction.java:142) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:212) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:188) at org.eclipse.jface.action.Action.runWithEvent(Action.java:881) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:915) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:866) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent (ActionContributionItem.java:785) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628) Caused by: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:185) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1204) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .createSetterMethod(SelfEncapsulateFieldRefactoring.java:496) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .addGetterSetterChanges(SelfEncapsulateFieldRefactoring.java:455) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .checkFinalConditions(SelfEncapsulateFieldRefactoring.java:335) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run (CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run (WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101) Root exception: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:185) at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1204) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .createSetterMethod(SelfEncapsulateFieldRefactoring.java:496) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .addGetterSetterChanges(SelfEncapsulateFieldRefactoring.java:455) at org.eclipse.jdt.internal.corext.refactoring.sef.SelfEncapsulateFieldRefactoring .checkFinalConditions(SelfEncapsulateFieldRefactoring.java:335) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run (CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run (WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101) ---------------------------------------------- eclipse.buildId=I200406251208 java.version=1.4.1_02 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java