Program: 37320
Project: 37320
Buggy source:
public void visitClassDef(JCClassDecl tree){
  Symbol owner=env.info.scope.owner;
  Scope enclScope=enterScope(env);
  ClassSymbol c;
  if (owner.kind == PCK) {
    PackageSymbol packge=(PackageSymbol)owner;
    for (Symbol q=packge; q != null && q.kind == PCK; q=q.owner)     q.flags_field|=EXISTS;
    c=reader.enterClass(tree.name,packge);
    packge.members().enterIfAbsent(c);
    if ((tree.mods.flags & PUBLIC) != 0 && !classNameMatchesFileName(c,env)) {
      log.error(tree.pos(),"String_Node_Str",tree.name);
    }
  }
 else {
    if (!tree.name.isEmpty() && !chk.checkUniqueClassName(tree.pos(),tree.name,enclScope)) {
      result=null;
      return;
    }
    if (owner.kind == TYP) {
      c=reader.enterClass(tree.name,(TypeSymbol)owner);
      if ((owner.flags_field & INTERFACE) != 0) {
        tree.mods.flags|=PUBLIC | STATIC;
      }
    }
 else {
      c=reader.defineClass(tree.name,owner);
      c.flatname=chk.localClassName(c);
      if (!c.name.isEmpty())       chk.checkTransparentClass(tree.pos(),c,env.info.scope);
    }
  }
  tree.sym=c;
  if (chk.compiled.get(c.flatname) != null) {
    duplicateClass(tree.pos(),c);
    result=types.createErrorType(tree.name,(TypeSymbol)owner,Type.noType);
    tree.sym=(ClassSymbol)result.tsym;
    return;
  }
  chk.compiled.put(c.flatname,c);
  enclScope.enter(c);
  Env<AttrContext> localEnv=classEnv(tree,env);
  typeEnvs.put(c,localEnv);
  c.completer=memberEnter;
  c.flags_field=chk.checkFlags(tree.pos(),tree.mods.flags,c,tree);
  c.sourcefile=env.toplevel.sourcefile;
  c.members_field=new Scope(c);
  ClassType ct=(ClassType)c.type;
  if (owner.kind != PCK && (c.flags_field & STATIC) == 0) {
    Symbol owner1=owner;
    while ((owner1.kind & (VAR | MTH)) != 0 && (owner1.flags_field & STATIC) == 0) {
      owner1=owner1.owner;
    }
    if (owner1.kind == TYP) {
      ct.setEnclosingType(owner1.type);
    }
  }
  ct.typarams_field=classEnter(tree.typarams,localEnv);
  if (!c.isLocal() && uncompleted != null)   uncompleted.append(c);
  classEnter(tree.defs,localEnv);
  result=c.type;
}

Fixed version (ground truth):
@Override public void visitClassDef(JCClassDecl tree){
  Symbol owner=env.info.scope.owner;
  Scope enclScope=enterScope(env);
  ClassSymbol c;
  if (owner.kind == PCK) {
    PackageSymbol packge=(PackageSymbol)owner;
    for (Symbol q=packge; q != null && q.kind == PCK; q=q.owner)     q.flags_field|=EXISTS;
    c=reader.enterClass(tree.name,packge);
    packge.members().enterIfAbsent(c);
    if ((tree.mods.flags & PUBLIC) != 0 && !classNameMatchesFileName(c,env)) {
      log.error(tree.pos(),"String_Node_Str",tree.name);
    }
  }
 else {
    if (!tree.name.isEmpty() && !chk.checkUniqueClassName(tree.pos(),tree.name,enclScope)) {
      result=null;
      return;
    }
    if (owner.kind == TYP) {
      c=reader.enterClass(tree.name,(TypeSymbol)owner);
      if ((owner.flags_field & INTERFACE) != 0) {
        tree.mods.flags|=PUBLIC | STATIC;
      }
    }
 else {
      c=reader.defineClass(tree.name,owner);
      c.flatname=chk.localClassName(c);
      if (!c.name.isEmpty())       chk.checkTransparentClass(tree.pos(),c,env.info.scope);
    }
  }
  tree.sym=c;
  if (chk.compiled.get(c.flatname) != null) {
    duplicateClass(tree.pos(),c);
    result=types.createErrorType(tree.name,(TypeSymbol)owner,Type.noType);
    tree.sym=(ClassSymbol)result.tsym;
    return;
  }
  chk.compiled.put(c.flatname,c);
  enclScope.enter(c);
  Env<AttrContext> localEnv=classEnv(tree,env);
  typeEnvs.put(c,localEnv);
  c.completer=memberEnter;
  c.flags_field=chk.checkFlags(tree.pos(),tree.mods.flags,c,tree);
  c.sourcefile=env.toplevel.sourcefile;
  c.members_field=new Scope(c);
  ClassType ct=(ClassType)c.type;
  if (owner.kind != PCK && (c.flags_field & STATIC) == 0) {
    Symbol owner1=owner;
    while ((owner1.kind & (VAR | MTH)) != 0 && (owner1.flags_field & STATIC) == 0) {
      owner1=owner1.owner;
    }
    if (owner1.kind == TYP) {
      ct.setEnclosingType(owner1.type);
    }
  }
  ct.typarams_field=classEnter(tree.typarams,localEnv);
  if (!c.isLocal() && uncompleted != null)   uncompleted.append(c);
  classEnter(tree.defs,localEnv);
  result=c.type;
}