Community
Participate
Working Groups
I want to compile a java class file, and i get a NullPointerException and the message "Internal compiler error". Compile the same file with ant build on command line no problem. The complete project will build. In Eclipse no chance. Deleted the file and checked it out from CVS same problem. Changed the file, same problem. Using Eclipse Stable Build 14. Feb 2002 Can anyone help?? thx Michael The complete traceoutput : Report for 1 markers: Marker 1: Resource:/gui/panels/ProcessingPanel.java, Line: 0 Message: Internal compiler error java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.BlockScope.emulateOuterAccess (BlockScope.java:347) at org.eclipse.jdt.internal.compiler.ast.MessageSend.manageEnclosingInstanceAccessI fNecessary(MessageSend.java:130) at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode (MessageSend.java:43) at org.eclipse.jdt.internal.compiler.ast.Block.analyseCode (Block.java:36) at org.eclipse.jdt.internal.compiler.ast.TryStatement.analyseCode (TryStatement.java:96) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode (AbstractMethodDeclaration.java:77) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode (TypeDeclaration.java:147) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.analyseCode (QualifiedAllocationExpression.java:41) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode (LocalDeclaration.java:43) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode (AbstractMethodDeclaration.java:77) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode (TypeDeclaration.java:147) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.analyseCode (QualifiedAllocationExpression.java:41) at org.eclipse.jdt.internal.compiler.ast.FieldDeclaration.analyseCode (FieldDeclaration.java:55) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode (TypeDeclaration.java:335) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode (CompilationUnitDeclaration.java:67) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:527) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:332) at org.eclipse.jdt.internal.core.newbuilder.AbstractImageBuilder.compile (AbstractImageBuilder.java:209) at org.eclipse.jdt.internal.core.newbuilder.AbstractImageBuilder.compile (AbstractImageBuilder.java:156) at org.eclipse.jdt.internal.core.newbuilder.BatchImageBuilder.build (BatchImageBuilder.java:49) at org.eclipse.jdt.internal.core.newbuilder.JavaBuilder.buildAll (JavaBuilder.java:139) at org.eclipse.jdt.internal.core.newbuilder.JavaBuilder.build (JavaBuilder.java:87) at org.eclipse.core.internal.events.BuildManager$2.run (BuildManager.java:351) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:817) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:109) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:174) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:184) at org.eclipse.core.internal.events.BuildManager$1.run (BuildManager.java:133) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:817) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.core.internal.events.BuildManager.basicBuild (BuildManager.java:147) at org.eclipse.core.internal.events.BuildManager.build (BuildManager.java:209) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java:701) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1237) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation (AbstractTextEditor.java:1546) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperatio n(CompilationUnitEditor.java:609) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave (CompilationUnitEditor.java:657) at org.eclipse.ui.internal.EditorManager$9.run(EditorManager.java:785) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:296) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:335) at org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation (EditorManager.java:643) at org.eclipse.ui.internal.EditorManager.saveEditor (EditorManager.java:790) at org.eclipse.ui.internal.WorkbenchPage.saveEditor (WorkbenchPage.java:1380) at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:32) 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:74) 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:788) at org.eclipse.ui.internal.Workbench.run(Workbench.java:771) 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:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362) Marker type: org.eclipse.jdt.core.problem Priority: Normal
Could you please send us (as an attachment) the source of the file ProcessingPanel.java? We need a reproducable test case in order to be able to fix it. Thanks for the report.
Fixed. Their was a call of private method in the main class from a thread was running in an sub class. Removed that line, an no problem to compile it anymore. Test the same in an other class (same construct) no problem. Thanks Michael
This isn't fixed from our standpoint. The compiler needs to be fixed.
Could you please provide a more complete test case? The sole source file you sent is not enough. I could not reproduce it. For example it would greatly help if you could give us the source that fails and then the changes you made to compile it successfully. Thanks for your help. This is a bug that needs to be resolved.
Created attachment 503 [details] Zip file containing the test case
The attachement contains a small test case that points to the problem. If the class A is defined in the Test.java (both classes are in the same package), the problem disappears. The NPE is due to the fact that the compatibleType is null when calling: currentScope.emulateOuterAccess((SourceTypeBinding) compatibleType, false); in MessageSend.manageEnclosingInstanceAccessIfNecessary(BlockScope).
Removing jbInit(); on line 10 fixes the error. I think the compiler wants to report a ambiguity between the jbInit() defined in A and jbInit() defined in Test.
Created attachment 505 [details] testcase2.zip
Forgot my second attachement. It was a test for Brian about an error I got when I tried to add the first attachement. It is exactly the same test case than the fiorst one.
Actually the test should compile. The problem comes from the fact that we incorrectly record the relative depth of the target method which should be 2, but we compute 3 (one level too far --> null target enclosing type). Fixed the depth bit encoding (forgot to reset depth when reassigning it). Fixed