Program: 54528
Project: 54528
Buggy source:
private byte[] findClassBytes(String className){
  if (JavaScriptHost.class.getName().equals(className)) {
    return javaScriptHostBytes;
  }
  if (classRewriter != null && classRewriter.isJsoIntf(className)) {
    byte[] newBytes=classRewriter.writeJsoIntf(className);
    if (CLASS_DUMP) {
      classDump(className,newBytes);
    }
    return newBytes;
  }
  String lookupClassName=canonicalizeClassName(className);
  CompiledClass compiledClass=compilationState.getClassFileMap().get(lookupClassName);
  CompilationUnit unit=(compiledClass == null) ? getUnitForClassName(lookupClassName) : compiledClass.getUnit();
  if (emmaAvailable) {
    List<JsniMethod> jsniMethods=(unit == null) ? null : unit.getJsniMethods();
    if (unit != null && !unit.isSuperSource() && !unit.isGenerated() && unit.hasAnonymousClasses() && jsniMethods != null && jsniMethods.size() > 0 && !unit.createdClassMapping()) {
      if (!unit.constructAnonymousClassMappings(logger)) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ className);
        return null;
      }
    }
  }
  byte classBytes[]=null;
  if (compiledClass != null) {
    classBytes=compiledClass.getBytes();
    if (!compiledClass.getUnit().isSuperSource()) {
      classBytes=emmaStrategy.getEmmaClassBytes(classBytes,lookupClassName,compiledClass.getUnit().getLastModified());
    }
 else {
      logger.log(TreeLogger.SPAM,"String_Node_Str" + lookupClassName + "String_Node_Str");
    }
  }
 else   if (emmaAvailable) {
    if (typeHasCompilationUnit(lookupClassName) && isClassnameGenerated(className)) {
      logger.log(TreeLogger.DEBUG,"String_Node_Str" + lookupClassName + "String_Node_Str");
      classBytes=emmaStrategy.getEmmaClassBytes(null,lookupClassName,0);
    }
  }
  if (classBytes != null && classRewriter != null) {
    Map<String,String> anonymousClassMap=Collections.emptyMap();
    if (unit != null) {
      anonymousClassMap=unit.getAnonymousClassMap();
    }
    byte[] newBytes=classRewriter.rewrite(this,className,classBytes,anonymousClassMap);
    if (CLASS_DUMP) {
      if (!Arrays.equals(classBytes,newBytes)) {
        classDump(className,newBytes);
      }
    }
    classBytes=newBytes;
  }
  return classBytes;
}

Fixed version (ground truth):
private byte[] findClassBytes(String className){
  if (JavaScriptHost.class.getName().equals(className)) {
    return javaScriptHostBytes;
  }
  if (classRewriter != null && classRewriter.isJsoIntf(className)) {
    byte[] newBytes=classRewriter.writeJsoIntf(className);
    if (CLASS_DUMP) {
      classDump(className,newBytes);
    }
    return newBytes;
  }
  String lookupClassName=canonicalizeClassName(className);
  CompiledClass compiledClass=compilationState.getClassFileMap().get(lookupClassName);
  CompilationUnit unit=(compiledClass == null) ? getUnitForClassName(lookupClassName) : compiledClass.getUnit();
  if (emmaAvailable) {
    List<JsniMethod> jsniMethods=(unit == null) ? null : unit.getJsniMethods();
    if (unit != null && !unit.isSuperSource() && !unit.isGenerated() && unit.hasAnonymousClasses() && jsniMethods != null && jsniMethods.size() > 0 && !unit.createdClassMapping()) {
      if (!unit.constructAnonymousClassMappings(logger)) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ className);
        return null;
      }
    }
  }
  byte classBytes[]=null;
  if (compiledClass != null) {
    classBytes=compiledClass.getBytes();
    if (!compiledClass.getUnit().isSuperSource()) {
      classBytes=emmaStrategy.getEmmaClassBytes(classBytes,lookupClassName,compiledClass.getUnit().getLastModified());
    }
 else {
      logger.log(TreeLogger.SPAM,"String_Node_Str" + lookupClassName + "String_Node_Str");
    }
  }
 else   if (emmaAvailable) {
    if (typeHasCompilationUnit(lookupClassName) && isClassnameGenerated(className)) {
      logger.log(TreeLogger.DEBUG,"String_Node_Str" + lookupClassName + "String_Node_Str");
      classBytes=emmaStrategy.getEmmaClassBytes(null,lookupClassName,0);
    }
  }
  if (classBytes != null && classRewriter != null) {
    Map<String,String> anonymousClassMap=Collections.emptyMap();
    if (unit != null) {
      anonymousClassMap=unit.getAnonymousClassMap();
    }
    byte[] newBytes=classRewriter.rewrite(typeOracle,className,classBytes,anonymousClassMap);
    if (CLASS_DUMP) {
      if (!Arrays.equals(classBytes,newBytes)) {
        classDump(className,newBytes);
      }
    }
    classBytes=newBytes;
  }
  return classBytes;
}