Bug 17127 - IllegalArgumentException in SimpleName.setIdentifier(SimpleName.java:136) in M5
Summary: IllegalArgumentException in SimpleName.setIdentifier(SimpleName.java:136) in M5
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-22 21:14 EDT by Brian Sullivan CLA
Modified: 2002-06-03 12:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Sullivan CLA 2002-05-22 21:14:28 EDT
While double-clicking a valid .java file to edit (two of them at this point),
I get the following IllegalArgumentException.  It does show the file, but
many functions are disabled (such as search).  This occurs in M5 release 
JDK 1.4, I do not yet know if it occurs in F1.  It appears to require a 
particular token at a point, yet finds another unexpected token.  It prompts
me to exit the workspace, I click Details and obtain:

java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.SimpleName.setIdentifier
(SimpleName.java:136)
	at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:463)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:290)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1423)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:754)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1844)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1602)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:646)
	at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations
(ASTConverter.java:228)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:168)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:73)
	at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:234)
	at 
org.eclipse.jdt.internal.corext.refactoring.rename.RenameTempRefactoring.initAST
(RenameTempRefactoring.java:129)
	at 
org.eclipse.jdt.internal.corext.refactoring.rename.RenameTempRefactoring.checkAc
tivation(RenameTempRefactoring.java:118)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RenameTempAction.canOperateOnCur
rentSelection(RenameTempAction.java:66)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.TextSelectionAction.canOperateOn
CurrentSelection(TextSelectionAction.java:111)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.TextSelectionAction.update
(TextSelectionAction.java:39)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringActionDelegate.findAc
tion(RefactoringActionDelegate.java:101)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringActionDelegate.handle
StructuredSelection(RefactoringActionDelegate.java:51)
	at 
org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringActionDelegate.select
ionChanged(RefactoringActionDelegate.java:77)
	at org.eclipse.ui.internal.PluginAction.refreshEnablement
(PluginAction.java:170)
	at org.eclipse.ui.internal.PluginAction.createDelegate
(PluginAction.java:86)
	at org.eclipse.ui.internal.PluginAction.selectionChanged
(PluginAction.java:222)
	at org.eclipse.ui.internal.WWinPluginAction.refreshSelection
(WWinPluginAction.java:184)
	at org.eclipse.ui.internal.WWinPluginAction.<init>
(WWinPluginAction.java:78)
	at org.eclipse.ui.internal.ActionDescriptor.createAction
(ActionDescriptor.java:160)
	at org.eclipse.ui.internal.ActionDescriptor.<init>
(ActionDescriptor.java:119)
	at org.eclipse.ui.internal.PluginActionSetBuilder.createActionDescriptor
(PluginActionSetBuilder.java:56)
	at org.eclipse.ui.internal.PluginActionBuilder.readElement
(PluginActionBuilder.java:314)
	at org.eclipse.ui.internal.PluginActionSetBuilder.readElement
(PluginActionSetBuilder.java:159)
	at org.eclipse.ui.internal.registry.RegistryReader.readElements
(RegistryReader.java:119)
	at org.eclipse.ui.internal.registry.RegistryReader.readElementChildren
(RegistryReader.java:109)
	at org.eclipse.ui.internal.PluginActionSetBuilder.readElement
(PluginActionSetBuilder.java:156)
	at org.eclipse.ui.internal.registry.RegistryReader.readElements
(RegistryReader.java:119)
	at org.eclipse.ui.internal.PluginActionSetBuilder.readActionExtensions
(PluginActionSetBuilder.java:142)
	at org.eclipse.ui.internal.PluginActionSet.init(PluginActionSet.java:73)
	at org.eclipse.ui.internal.ActionPresentation.addActionSet
(ActionPresentation.java:47)
	at org.eclipse.ui.internal.ActionPresentation.setActionSets
(ActionPresentation.java:111)
	at org.eclipse.ui.internal.WorkbenchWindow.updateActionSets
(WorkbenchWindow.java:1233)
	at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActionSets
(WorkbenchPage.java:273)
	at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActivePart
(WorkbenchPage.java:136)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart
(WorkbenchPage.java:1881)
	at org.eclipse.ui.internal.WorkbenchPage.activate
(WorkbenchPage.java:335)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1571)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1468)
	at org.eclipse.ui.actions.OpenFileAction.openFile
(OpenFileAction.java:91)
	at org.eclipse.ui.actions.OpenSystemEditorAction.run
(OpenSystemEditorAction.java:91)
	at org.eclipse.ui.views.navigator.OpenActionGroup.runDefaultAction
(OpenActionGroup.java:102)
	at 
org.eclipse.ui.views.navigator.ResourceNavigatorActionGroup.runDefaultAction
(ResourceNavigatorActionGroup.java:152)
	at org.eclipse.ui.views.navigator.ResourceNavigator.handleOpen
(ResourceNavigator.java:438)
	at org.eclipse.ui.views.navigator.ResourceNavigator$6.open
(ResourceNavigator.java:244)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen
(StructuredViewer.java:300)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen
(StructuredViewer.java:460)
	at org.eclipse.jface.viewers.AbstractTreeViewer$2.handleOpen
(AbstractTreeViewer.java:633)
	at org.eclipse.jface.util.OpenStrategy.handleOpen(OpenStrategy.java:134)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:131)
	at org.eclipse.jface.util.OpenStrategy$8.handleEvent
(OpenStrategy.java:299)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent
(OpenStrategy.java:115)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1412)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:836)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:819)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:777)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:190)
	at org.eclipse.core.launcher.Main.run(Main.java:549)
	at org.eclipse.core.launcher.Main.main(Main.java:390)

It shows refactoring and such in there, yet I am not attempting to refactor,
just edit.
Comment 1 Brian Sullivan CLA 2002-05-22 21:32:32 EDT
I just upgraded to F1 to see if that would fix it.  I just verified that it 
appears to have been solved by F1.  I would note that it probably should have
given the illegal value in the IllegalArgumentException message rather than 
just using the empty constructor.
Comment 2 Philipe Mulet CLA 2002-05-23 04:16:05 EDT
Olivier - Can you pls double check the assertion message ?
Comment 3 Olivier Thomann CLA 2002-05-23 10:31:06 EDT
The setIdentifier(...) method throws IllegalArgumentException in case the 
parameter cannot be considered as an valid Java identifier. It uses the empty 
constructor.
Comment 4 Jim des Rivieres CLA 2002-05-23 12:41:58 EDT
Most of the runtime exceptions thrown by AST/DOM have no message. Adding a 
message would make it *slightly* easier to debug internal errors like this.
However, changing the 1000+ occurrences is not a priority.
Comment 5 Olivier Thomann CLA 2002-05-23 14:33:34 EDT
I would suggest to close this PR according to the fact that the initial problem is fixed in F1 and 
open a new one for the usage of the IllegalArgumentException constructor with a 
message.
Closed.
Comment 6 Kent Johnson CLA 2002-06-03 12:04:54 EDT
Closed again.