Community
Participate
Working Groups
One particular Java source file in my project causes a null pointer exception whenever it tries to build. Not only does this file not compile, but the exception prevents any other files not yet processed to not be compiled either. The dialog box says: ----------------------------- Build problems Errors during build. java.lang.NullPointerException encountered while running org.eclipse.jdt.internal.core.builder.JavaBuilder. ------------------------------------ The task list has this additional information: ---------------------------------------------------- Error Internal compiler error java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.ClassFile.addFieldInfo(ClassFile.java:434) at org.eclipse.jdt.internal.compiler.ClassFile.addFieldInfos(ClassFile.java:579) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:694) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:762) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:709) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:770) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:158) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:543) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:337) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:194) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:144) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:49) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:179) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:102) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:384) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:852) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:120) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:176) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:186) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:146) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:852) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:160) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:211) at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:173) at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:156) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:95) <source file name and location was here> line 0
Could you please provide a test case to reproduce it? Which build are you using?
It looks like a duplicate of bug 28934. This has been fixed a while ago. Which build are you using? If you are using 2.1, then provide a test case.
Here's the Eclipse Platform information: Version: 2.1 Build id: 200212181304 I'll see about putting together a test case. The file that fails right now has proprietary code in it, so I'll have to do some scrubbing before I can submit it. Bill
Then this is the same problem. You should move to a release 2.1 build. The one you were using was an intermediate build and this problem got addressed since then.
should have closed as duplicate
*** This bug has been marked as a duplicate of 28934 ***