Bug 28954

Summary: Internal compiler error -- assert statements in inner class
Product: [Eclipse Project] JDT Reporter: Andreas Kollegger <andreas.kollegger>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Andreas Kollegger CLA 2003-01-02 14:46:10 EST
Using the v2.1.0 M4 Eclipse Linux/GTK (Build Id: 200212181304) and Java 1.4
compliant compiling, the JavaBuilder fails with a NullPointerException when
trying to process a java source file with an inner class which uses assert
statements.

The exception is thrown down in...

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)
...

Produced by as trivial an example as...
public class Foo
{
  public Foo()
  {
    super();
    assert (true) : "always true"; // no problem here
  }

  public class Bar
  {
    public Bar()
    {
      super();
      assert (true) : "always true"; // build fails here
    }
  }
}
Comment 1 Olivier Thomann CLA 2003-01-02 19:34:49 EST

*** This bug has been marked as a duplicate of 28750 ***