Program: 83127
Project: 83127
Buggy source:
/** 
 * We emulate static initializers and intance initializers as methods. As in other cases, this gives us: simpler AST, easier to optimize, more like output JavaScript.
 */
public void processType(TypeDeclaration x){
  currentClass=(JReferenceType)typeMap.get(x.binding);
  try {
    currentClassScope=x.scope;
    currentSeparatorPositions=x.compilationResult.lineSeparatorPositions;
    currentFileName=String.valueOf(x.compilationResult.fileName);
    if (x.fields != null) {
      for (int i=0, n=x.fields.length; i < n; ++i) {
        FieldDeclaration fieldDeclaration=x.fields[i];
        if (fieldDeclaration.isStatic()) {
          currentMethod=(JMethod)currentClass.methods.get(0);
          currentMethodScope=x.staticInitializerScope;
        }
 else {
          currentMethod=(JMethod)currentClass.methods.get(1);
          currentMethodScope=x.initializerScope;
        }
        if (fieldDeclaration instanceof Initializer) {
          assert(currentClass instanceof JClassType);
          processInitializer((Initializer)fieldDeclaration);
        }
 else {
          processField(fieldDeclaration);
        }
      }
    }
    currentMethodScope=null;
    currentMethod=null;
    if (x.methods != null) {
      for (int i=0, n=x.methods.length; i < n; ++i) {
        if (x.methods[i].isConstructor()) {
          assert(currentClass instanceof JClassType);
          processConstructor((ConstructorDeclaration)x.methods[i]);
        }
 else         if (x.methods[i].isClinit()) {
        }
 else {
          processMethod(x.methods[i]);
        }
      }
    }
    currentClassScope=null;
    currentClass=null;
    currentSeparatorPositions=null;
    currentFileName=null;
  }
 catch (  Throwable e) {
    throw translateException(currentClass,e);
  }
}

Fixed version (ground truth):
/** 
 * We emulate static initializers and intance initializers as methods. As in other cases, this gives us: simpler AST, easier to optimize, more like output JavaScript.
 */
public void processType(TypeDeclaration x){
  currentClass=(JReferenceType)typeMap.get(x.binding);
  try {
    currentClassScope=x.scope;
    currentSeparatorPositions=x.compilationResult.lineSeparatorPositions;
    currentFileName=String.valueOf(x.compilationResult.fileName);
    if (currentClass.extnds != null) {
      JMethod myClinit=(JMethod)currentClass.methods.get(0);
      JMethod superClinit=(JMethod)currentClass.extnds.methods.get(0);
      JMethodCall superClinitCall=new JMethodCall(program,myClinit.getSourceInfo(),null,superClinit);
      myClinit.body.statements.add(0,superClinitCall.makeStatement());
    }
    if (x.fields != null) {
      for (int i=0, n=x.fields.length; i < n; ++i) {
        FieldDeclaration fieldDeclaration=x.fields[i];
        if (fieldDeclaration.isStatic()) {
          currentMethod=(JMethod)currentClass.methods.get(0);
          currentMethodScope=x.staticInitializerScope;
        }
 else {
          currentMethod=(JMethod)currentClass.methods.get(1);
          currentMethodScope=x.initializerScope;
        }
        if (fieldDeclaration instanceof Initializer) {
          assert(currentClass instanceof JClassType);
          processInitializer((Initializer)fieldDeclaration);
        }
 else {
          processField(fieldDeclaration);
        }
      }
    }
    currentMethodScope=null;
    currentMethod=null;
    if (x.methods != null) {
      for (int i=0, n=x.methods.length; i < n; ++i) {
        if (x.methods[i].isConstructor()) {
          assert(currentClass instanceof JClassType);
          processConstructor((ConstructorDeclaration)x.methods[i]);
        }
 else         if (x.methods[i].isClinit()) {
        }
 else {
          processMethod(x.methods[i]);
        }
      }
    }
    currentClassScope=null;
    currentClass=null;
    currentSeparatorPositions=null;
    currentFileName=null;
  }
 catch (  Throwable e) {
    throw translateException(currentClass,e);
  }
}