Bug 18708 - DOM AST - IllegalArgumentException organizing imports
Summary: DOM AST - IllegalArgumentException organizing imports
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 19851 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-03 09:50 EDT by Philipe Mulet CLA
Modified: 2002-06-13 09:44 EDT (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 Philipe Mulet CLA 2002-06-03 09:50:11 EDT
Build F2

On following incorrect unit p/Test.java:

[package p;

public class Test {
	void () {
		InputStream i= null;
		while(true) 
			;
	}
}
 ]

Activate organize imports, doesn't work, following trace is dumped in the log.

Unhandled exception caught in event loop.
Reason:
!ENTRY org.eclipse.ui 4 0 Jun 03, 2002 15:57:45.366
!MESSAGE java.lang.IllegalArgumentException
!STACK 0
java.lang.IllegalArgumentException
        at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:1452)
        at 
org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleFieldDeclaration
(ASTConverter.java:233)
        at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations
(ASTConverter.java:211)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:157)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:62)
        at org.eclipse.jdt.core.dom.AST.parseCompilationUnit(AST.java:227)
        at 
org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation.findTy
peReferences(OrganizeImportsOperation.java:569)
        at 
org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation.run
(OrganizeImportsOperation.java:516)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1361)
        at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run
(WorkbenchRunnableAdapter.java:32)
        at 
org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext$BusyRunnable.inter
nalRun(BusyIndicatorRunnableContext.java:107)
        at 
org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext$BusyRunnable.run
(BusyIndicatorRunnableContext.java:74)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:64)
        at org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext.run
(BusyIndicatorRunnableContext.java:120)
        at org.eclipse.jdt.ui.actions.OrganizeImportsAction.runOnSingle
(OrganizeImportsAction.java:280)
        at org.eclipse.jdt.ui.actions.OrganizeImportsAction.run
(OrganizeImportsAction.java:164)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun
(SelectionDispatchAction.java:180)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run
(SelectionDispatchAction.java:156)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:749)
        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:75)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1177)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1160)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:739)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
        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:244)
        at org.eclipse.core.launcher.Main.run(Main.java:693)
        at org.eclipse.core.launcher.Main.main(Main.java:526)
java.lang.IllegalArgumentException
Comment 1 Philipe Mulet CLA 2002-06-03 11:19:06 EDT
Such an internal failure should not occur since the API wasn't directly invoked 
from the outside.
Comment 2 Philipe Mulet CLA 2002-06-03 11:54:10 EDT
Initializer recovery may have left #sourceEnd set to 0 (instead of defaulting 
to #declarationSourceEnd).

Fixed
Comment 3 Olivier Thomann CLA 2002-06-04 14:04:31 EDT
I got a dialog saying that the compilation unit has some syntax errors and no 
changes has been applied.
Verified.
Comment 4 Olivier Thomann CLA 2002-06-11 11:18:24 EDT
*** Bug 19851 has been marked as a duplicate of this bug. ***
Comment 5 David Audel CLA 2002-06-13 09:44:03 EDT
Verified.