Program: 25771
Project: 25771
Buggy source:
protected CtField fieldAccess(ASTree expr) throws CompileError {
  if (expr instanceof Member) {
    String name=((Member)expr).get();
    CtField f=null;
    try {
      f=thisClass.getField(name);
    }
 catch (    NotFoundException e) {
      throw new NoFieldException(name,expr);
    }
    boolean is_static=Modifier.isStatic(f.getModifiers());
    if (!is_static)     if (inStaticMethod)     throw new CompileError("String_Node_Str" + name);
 else     bytecode.addAload(0);
    resultStatic=is_static;
    return f;
  }
 else   if (expr instanceof Expr) {
    Expr e=(Expr)expr;
    int op=e.getOperator();
    if (op == MEMBER) {
      CtField f=resolver.lookupField(((Symbol)e.oprand1()).get(),(Symbol)e.oprand2());
      resultStatic=true;
      return f;
    }
 else     if (op == '.') {
      CtField f=null;
      try {
        e.oprand1().accept(this);
        if (exprType == CLASS && arrayDim == 0)         f=resolver.lookupFieldByJvmName(className,(Symbol)e.oprand2());
 else         badLvalue();
        boolean is_static=Modifier.isStatic(f.getModifiers());
        if (is_static)         bytecode.addOpcode(POP);
        resultStatic=is_static;
        return f;
      }
 catch (      NoFieldException nfe) {
        if (nfe.getExpr() != e.oprand1())         throw nfe;
        Symbol fname=(Symbol)e.oprand2();
        String cname=nfe.getField();
        f=resolver.lookupFieldByJvmName2(cname,fname,expr);
        resolver.recordPackage(cname);
        resultStatic=true;
        return f;
      }
    }
 else     badLvalue();
  }
 else   badLvalue();
  resultStatic=false;
  return null;
}

Fixed version (ground truth):
protected CtField fieldAccess(ASTree expr,boolean acceptLength) throws CompileError {
  if (expr instanceof Member) {
    String name=((Member)expr).get();
    CtField f=null;
    try {
      f=thisClass.getField(name);
    }
 catch (    NotFoundException e) {
      throw new NoFieldException(name,expr);
    }
    boolean is_static=Modifier.isStatic(f.getModifiers());
    if (!is_static)     if (inStaticMethod)     throw new CompileError("String_Node_Str" + name);
 else     bytecode.addAload(0);
    resultStatic=is_static;
    return f;
  }
 else   if (expr instanceof Expr) {
    Expr e=(Expr)expr;
    int op=e.getOperator();
    if (op == MEMBER) {
      CtField f=resolver.lookupField(((Symbol)e.oprand1()).get(),(Symbol)e.oprand2());
      resultStatic=true;
      return f;
    }
 else     if (op == '.') {
      CtField f=null;
      try {
        e.oprand1().accept(this);
        if (exprType == CLASS && arrayDim == 0)         f=resolver.lookupFieldByJvmName(className,(Symbol)e.oprand2());
 else         if (acceptLength && arrayDim > 0 && ((Symbol)e.oprand2()).get().equals("String_Node_Str"))         return null;
 else         badLvalue();
        boolean is_static=Modifier.isStatic(f.getModifiers());
        if (is_static)         bytecode.addOpcode(POP);
        resultStatic=is_static;
        return f;
      }
 catch (      NoFieldException nfe) {
        if (nfe.getExpr() != e.oprand1())         throw nfe;
        Symbol fname=(Symbol)e.oprand2();
        String cname=nfe.getField();
        f=resolver.lookupFieldByJvmName2(cname,fname,expr);
        resolver.recordPackage(cname);
        resultStatic=true;
        return f;
      }
    }
 else     badLvalue();
  }
 else   badLvalue();
  resultStatic=false;
  return null;
}