Bug 34802

Summary: instanceof produce InternalCompilerError on MacOSX with JDK1.4.1
Product: [Eclipse Project] JDT Reporter: ulrich köster <ulrich>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC3   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
stack trace none

Description ulrich köster CLA 2003-03-12 07:56:27 EST
Hi

to test it launch Eclipse with JDK 1.4.1. It makes no difference if you compile against JDK 
1.3.1 or 1.4.1.

Create this class. Save will fail with an InternalCompilerError until you remove the first 
method.

package a.hfhf.fdha.g;
/*
 * Created on 12.03.2003
 *
 * To change this generated comment go to 
 * Window>Preferences>Java>Code Generation>Code Template
 */
/**
 * @author uli
 *
 * To change this generated comment go to 
 * Window>Preferences>Java>Code Generation>Code Template
 */
public class Test {
	//this will fail
	public void test(String string) {
		if ((Object) string instanceof Test)
			return;
	}
	//this work
	public void test(String string) {
		Object object = (Object)string;
		if (object instanceof Test)
			return;
	}
}
Comment 1 Jerome Lanneluc CLA 2003-03-12 09:03:25 EST
Could you please attach the stack trace that you would find in the .log file?
Comment 2 Mike Wilson CLA 2003-03-12 09:46:57 EST
java.lang.ArrayIndexOutOfBoundsException: 1808101808
	at org.eclipse.jdt.internal.compiler.parser.Parser.check(Parser.java:616)
	at org.eclipse.jdt.internal.compiler.parser.Parser.tAction(Parser.java:7564)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:6845)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:7070)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.parseStatements(MethodDeclaration.java:95)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.parseMethod(TypeDeclaration.java:725)
	at org.eclipse.jdt.internal.compiler.Compiler.getMethodBodies(Compiler.java:391)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:576)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:208)
	at org.eclipse.jdt.internal.core.WorkingCopy.makeConsistent(WorkingCopy.java:345)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:48)
	at org.eclipse.jdt.internal.core.JavaModelOperation.execute(JavaModelOperation.java:365)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:681)
	at org.eclipse.jdt.internal.core.JavaElement.runOperation(JavaElement.java:540)
	at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:438)
	at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:429)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.doSaveDocument(CompilationUnitDocumentProvider.java:906)
	at org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument(AbstractDocumentProvider.java:455)
	at org.eclipse.ui.texteditor.AbstractTextEditor$11.execute(AbstractTextEditor.java:2906)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:65)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1591)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:79)
	at org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation(AbstractTextEditor.java:2926)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperation(CompilationUnitEditor.java:742)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:806)
	at org.eclipse.ui.internal.EditorManager$11.run(EditorManager.java:1083)
	at org.eclipse.ui.internal.EditorManager$8.run(EditorManager.java:954)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:296)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:431)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:428)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1385)
	at org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation(EditorManager.java:960)
	at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:1088)
	at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage.java:2350)
	at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:2362)
	at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:57)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
	at org.eclipse.ui.internal.WWinKeyBindingService.pressed(WWinKeyBindingService.java:214)
	at org.eclipse.ui.internal.WWinKeyBindingService$5.widgetSelected(WWinKeyBindingService.java:328)
	at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(AcceleratorMenu.java:55)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:984)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1787)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1497)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1400)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1383)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	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:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
	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 apple.launcher.LaunchRunner.run(LaunchRunner.java:88)
	at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
	at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Comment 3 Olivier Thomann CLA 2003-03-12 09:48:37 EST
This is a duplicate of bug 34658.

*** This bug has been marked as a duplicate of 34658 ***
Comment 4 ulrich köster CLA 2003-03-12 11:18:19 EST
Created attachment 4054 [details]
stack trace
Comment 5 ulrich köster CLA 2003-03-12 11:18:50 EST
stack trace added