nus-yam/ex-repair huggingface dataset:
Program: 29515
Project: 29515
Buggy source:
@Override protected final SoyExpression visitConditionalOpNode(ConditionalOpNode node){
  final SoyExpression condition=visit(node.getChild(0)).coerceToBoolean();
  SoyExpression trueBranch=visit(node.getChild(1));
  SoyExpression falseBranch=visit(node.getChild(2));
  boolean typesEqual=trueBranch.soyType().equals(falseBranch.soyType());
  if (typesEqual) {
    if (trueBranch.isBoxed() == falseBranch.isBoxed()) {
      return trueBranch.withSource(ternary(condition,trueBranch,falseBranch));
    }
    Optional<SoyExpression> unboxedTrue=trueBranch.tryUnbox();
    Optional<SoyExpression> unboxedFalse=falseBranch.tryUnbox();
    if (unboxedTrue.isPresent() && unboxedFalse.isPresent()) {
      return unboxedTrue.get().withSource(ternary(condition,unboxedTrue.get(),unboxedFalse.get()));
    }
  }
  if (trueBranch.isKnownInt() && falseBranch.isKnownInt()) {
    final SoyExpression trueAsLong=trueBranch.unboxAs(long.class);
    final SoyExpression falseAsLong=falseBranch.unboxAs(long.class);
    return SoyExpression.forInt(ternary(condition,trueAsLong,falseAsLong));
  }
  if (trueBranch.isKnownFloat() && falseBranch.isKnownFloat()) {
    final SoyExpression trueAsFloat=trueBranch.unboxAs(double.class);
    final SoyExpression falseAsFloat=falseBranch.unboxAs(double.class);
    return SoyExpression.forFloat(ternary(condition,trueAsFloat,falseAsFloat));
  }
  if (typesEqual && trueBranch.isKnownStringOrSanitizedContent() && falseBranch.isKnownStringOrSanitizedContent()) {
    final SoyExpression trueAsString=trueBranch.coerceToString();
    final SoyExpression falseAsString=falseBranch.coerceToString();
    Expression ternary=ternary(condition,trueAsString,falseAsString);
    if (trueBranch.isKnownSanitizedContent()) {
      return SoyExpression.forSanitizedString(ternary,((SanitizedType)trueBranch.soyType()).getContentKind());
    }
    return SoyExpression.forString(ternary);
  }
  final Expression trueBoxed=trueBranch.box().cast(SoyValue.class);
  final Expression falseBoxed=falseBranch.box().cast(SoyValue.class);
  return SoyExpression.forSoyValue(UnknownType.getInstance(),ternary(condition,trueBoxed,falseBoxed));
}

Fixed version (ground truth):
@Override protected final SoyExpression visitConditionalOpNode(ConditionalOpNode node){
  final SoyExpression condition=visit(node.getChild(0)).coerceToBoolean();
  SoyExpression trueBranch=visit(node.getChild(1));
  SoyExpression falseBranch=visit(node.getChild(2));
  boolean typesEqual=trueBranch.soyType().equals(falseBranch.soyType());
  if (typesEqual) {
    if (trueBranch.isBoxed() == falseBranch.isBoxed()) {
      return trueBranch.withSource(ternary(condition,trueBranch,falseBranch));
    }
    return trueBranch.withSource(ternary(condition,trueBranch.box(),falseBranch.box()));
  }
  return SoyExpression.forSoyValue(UnknownType.getInstance(),ternary(condition,trueBranch.box().cast(SoyValue.class),falseBranch.box().cast(SoyValue.class)));
}
Program: 29517
Project: 29517
Buggy source:
@Override protected final SoyExpression visitMinusOpNode(MinusOpNode node){
  final SoyExpression left=visit(node.getChild(0));
  final SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return applyBinaryIntOperator(Opcodes.LSUB,left,right);
  }
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    return applyBinaryFloatOperator(Opcodes.DSUB,left,right);
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_MINUS.invoke(left.box(),right.box()));
}

Fixed version (ground truth):
@Override protected final SoyExpression visitMinusOpNode(MinusOpNode node){
  final SoyExpression left=visit(node.getChild(0));
  final SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
      return applyBinaryIntOperator(Opcodes.LSUB,left,right);
    }
    if (left.assignableToNullableFloat() || right.assignableToNullableFloat()) {
      return applyBinaryFloatOperator(Opcodes.DSUB,left,right);
    }
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_MINUS.invoke(left.box(),right.box()));
}
Program: 29518
Project: 29518
Buggy source:
@Override protected final SoyExpression visitPlusOpNode(PlusOpNode node){
  SoyExpression left=visit(node.getChild(0));
  SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return applyBinaryIntOperator(Opcodes.LADD,left,right);
  }
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    return applyBinaryFloatOperator(Opcodes.DADD,left,right);
  }
  if (left.isKnownString() || right.isKnownString()) {
    SoyExpression leftString=left.coerceToString();
    SoyExpression rightString=right.coerceToString();
    return SoyExpression.forString(leftString.invoke(MethodRef.STRING_CONCAT,rightString));
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_PLUS.invoke(left.box(),right.box()));
}

Fixed version (ground truth):
@Override protected final SoyExpression visitPlusOpNode(PlusOpNode node){
  SoyExpression left=visit(node.getChild(0));
  SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
      return applyBinaryIntOperator(Opcodes.LADD,left,right);
    }
    if (left.assignableToNullableFloat() || right.assignableToNullableFloat()) {
      return applyBinaryFloatOperator(Opcodes.DADD,left,right);
    }
  }
  if (left.isKnownString() || right.isKnownString()) {
    SoyExpression leftString=left.coerceToString();
    SoyExpression rightString=right.coerceToString();
    return SoyExpression.forString(leftString.invoke(MethodRef.STRING_CONCAT,rightString));
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_PLUS.invoke(left.box(),right.box()));
}
Program: 29519
Project: 29519
Buggy source:
@Override protected final SoyExpression visitTimesOpNode(TimesOpNode node){
  final SoyExpression left=visit(node.getChild(0));
  final SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return applyBinaryIntOperator(Opcodes.LMUL,left,right);
  }
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    return applyBinaryFloatOperator(Opcodes.DMUL,left,right);
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_TIMES.invoke(left.box(),right.box()));
}

Fixed version (ground truth):
@Override protected final SoyExpression visitTimesOpNode(TimesOpNode node){
  final SoyExpression left=visit(node.getChild(0));
  final SoyExpression right=visit(node.getChild(1));
  if (left.assignableToNullableNumber() && right.assignableToNullableNumber()) {
    if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
      return applyBinaryIntOperator(Opcodes.LMUL,left,right);
    }
    if (left.assignableToNullableFloat() || right.assignableToNullableFloat()) {
      return applyBinaryFloatOperator(Opcodes.DMUL,left,right);
    }
  }
  return SoyExpression.forSoyValue(SoyTypes.NUMBER_TYPE,MethodRef.RUNTIME_TIMES.invoke(left.box(),right.box()));
}
Program: 29520
Project: 29520
Buggy source:
/** 
 * @see com.google.template.soy.basicfunctions.MinFunction
 */
private SoyExpression invokeMinFunction(SoyExpression left,SoyExpression right){
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return SoyExpression.forInt(MATH_MIN_LONG.invoke(left.unboxAs(long.class),right.unboxAs(long.class)));
  }
 else   if (left.assignableToNullableFloat() && right.assignableToNullableFloat()) {
    return SoyExpression.forInt(MATH_MIN_DOUBLE.invoke(left.unboxAs(double.class),right.unboxAs(double.class)));
  }
 else {
    return SoyExpression.forSoyValue(NUMBER_TYPE,MIN_FN.invoke(left.box(),right.box()));
  }
}

Fixed version (ground truth):
/** 
 * @see com.google.template.soy.basicfunctions.MinFunction
 */
private SoyExpression invokeMinFunction(SoyExpression left,SoyExpression right){
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return SoyExpression.forInt(MATH_MIN_LONG.invoke(left.unboxAs(long.class),right.unboxAs(long.class)));
  }
 else   if (left.assignableToNullableFloat() && right.assignableToNullableFloat()) {
    return SoyExpression.forFloat(MATH_MIN_DOUBLE.invoke(left.unboxAs(double.class),right.unboxAs(double.class)));
  }
 else {
    return SoyExpression.forSoyValue(NUMBER_TYPE,MIN_FN.invoke(left.box(),right.box()));
  }
}
Program: 29521
Project: 29521
Buggy source:
/** 
 * @see com.google.template.soy.basicfunctions.MaxFunction
 */
private SoyExpression invokeMaxFunction(SoyExpression left,SoyExpression right){
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return SoyExpression.forInt(MATH_MAX_LONG.invoke(left.unboxAs(long.class),right.unboxAs(long.class)));
  }
 else   if (left.assignableToNullableFloat() && right.assignableToNullableFloat()) {
    return SoyExpression.forInt(MATH_MAX_DOUBLE.invoke(left.unboxAs(double.class),right.unboxAs(double.class)));
  }
 else {
    return SoyExpression.forSoyValue(NUMBER_TYPE,MAX_FN.invoke(left.box(),right.box()));
  }
}

Fixed version (ground truth):
/** 
 * @see com.google.template.soy.basicfunctions.MaxFunction
 */
private SoyExpression invokeMaxFunction(SoyExpression left,SoyExpression right){
  if (left.assignableToNullableInt() && right.assignableToNullableInt()) {
    return SoyExpression.forInt(MATH_MAX_LONG.invoke(left.unboxAs(long.class),right.unboxAs(long.class)));
  }
 else   if (left.assignableToNullableFloat() && right.assignableToNullableFloat()) {
    return SoyExpression.forFloat(MATH_MAX_DOUBLE.invoke(left.unboxAs(double.class),right.unboxAs(double.class)));
  }
 else {
    return SoyExpression.forSoyValue(NUMBER_TYPE,MAX_FN.invoke(left.box(),right.box()));
  }
}
Program: 29522
Project: 29522
Buggy source:
@Override protected Statement visitSwitchNode(SwitchNode node){
  SoyExpression expression=exprCompiler.compile(node.getExpr());
  Statement init;
  List<IfBlock> cases=new ArrayList<>();
  Optional<Statement> defaultBlock=Optional.absent();
  Scope scope=variables.enterScope();
  Variable variable=scope.createSynthetic(SyntheticVarName.forSwitch(node),expression,STORE);
  init=variable.initializer();
  expression=expression.withSource(variable.local());
  for (  SoyNode child : node.getChildren()) {
    if (child instanceof SwitchCaseNode) {
      SwitchCaseNode caseNode=(SwitchCaseNode)child;
      Label reattachPoint=new Label();
      List<Expression> comparisons=new ArrayList<>();
      for (      ExprRootNode caseExpr : caseNode.getExprList()) {
        comparisons.add(compareSoyEquals(expression,exprCompiler.compile(caseExpr,reattachPoint)));
      }
      Expression condition=BytecodeUtils.logicalOr(comparisons).labelStart(reattachPoint);
      Statement block=visitChildrenInNewScope(caseNode);
      cases.add(IfBlock.create(condition,block));
    }
 else {
      SwitchDefaultNode defaultNode=(SwitchDefaultNode)child;
      defaultBlock=Optional.of(visitChildrenInNewScope(defaultNode));
    }
  }
  Statement exitScope=scope.exitScope();
  return Statement.concat(init,ControlFlow.ifElseChain(cases,defaultBlock),exitScope).withSourceLocation(node.getSourceLocation());
}

Fixed version (ground truth):
@Override protected Statement visitSwitchNode(SwitchNode node){
  List<SoyNode> children=node.getChildren();
  if (children.isEmpty()) {
    return Statement.NULL_STATEMENT;
  }
  if (children.size() == 1 && children.get(0) instanceof SwitchDefaultNode) {
    return visitChildrenInNewScope((SwitchDefaultNode)children.get(0));
  }
  SoyExpression expression=exprCompiler.compile(node.getExpr());
  Statement init;
  List<IfBlock> cases=new ArrayList<>();
  Optional<Statement> defaultBlock=Optional.absent();
  Scope scope=variables.enterScope();
  Variable variable=scope.createSynthetic(SyntheticVarName.forSwitch(node),expression,STORE);
  init=variable.initializer();
  expression=expression.withSource(variable.local());
  for (  SoyNode child : children) {
    if (child instanceof SwitchCaseNode) {
      SwitchCaseNode caseNode=(SwitchCaseNode)child;
      Label reattachPoint=new Label();
      List<Expression> comparisons=new ArrayList<>();
      for (      ExprRootNode caseExpr : caseNode.getExprList()) {
        comparisons.add(compareSoyEquals(expression,exprCompiler.compile(caseExpr,reattachPoint)));
      }
      Expression condition=BytecodeUtils.logicalOr(comparisons).labelStart(reattachPoint);
      Statement block=visitChildrenInNewScope(caseNode);
      cases.add(IfBlock.create(condition,block));
    }
 else {
      SwitchDefaultNode defaultNode=(SwitchDefaultNode)child;
      defaultBlock=Optional.of(visitChildrenInNewScope(defaultNode));
    }
  }
  Statement exitScope=scope.exitScope();
  return Statement.concat(init,ControlFlow.ifElseChain(cases,defaultBlock),exitScope).withSourceLocation(node.getSourceLocation());
}
Program: 29524
Project: 29524
Buggy source:
/** 
 * Runs this pass on the given template.
 */
public boolean exec(TemplateNode template){
  List<TemplateParam> params=template.getParams();
  for (  TemplateParam param : params) {
    if (param.isRequired()) {
      return false;
    }
  }
  ExistsRegDataRefInExprVisitor helperVisitor=new ExistsRegDataRefInExprVisitor(errorReporter);
  SoytreeUtils.execOnAllV2ExprsShortcircuitably(template,helperVisitor,new Shortcircuiter<Void>(){
    @Override public boolean shouldShortcircuit(    AbstractNodeVisitor<ExprNode,Void> exprNodeVisitor){
      return ((ExistsRegDataRefInExprVisitor)exprNodeVisitor).foundRegDataRef();
    }
  }
,errorReporter);
  return helperVisitor.foundRegDataRef();
}

Fixed version (ground truth):
@Override public Boolean exec(Node node){
  visit(node);
  return shouldEnsureDataIsDefined;
}
Program: 29525
Project: 29525
Buggy source:
private Statement putPlaceholderIntoMap(Expression mapExpression,MsgPlaceholderNode placeholder) throws AssertionError {
  StandaloneNode initialNode=placeholder.getChild(0);
  String mapKey=placeholder.getBaseVarName();
  Statement putEntyInMap;
  if (initialNode instanceof MsgHtmlTagNode) {
    putEntyInMap=addHtmlTagNodeToPlaceholderMap(mapExpression,mapKey,(MsgHtmlTagNode)initialNode);
  }
 else   if (initialNode instanceof CallNode) {
    putEntyInMap=addCallNodeToPlaceholderMap(mapExpression,mapKey,(CallNode)initialNode);
  }
 else   if (initialNode instanceof PrintNode) {
    putEntyInMap=addPrintNodeToPlaceholderMap(mapExpression,mapKey,(PrintNode)initialNode);
  }
 else {
    throw new AssertionError();
  }
  return putEntyInMap;
}

Fixed version (ground truth):
private void putPlaceholderIntoMap(Expression mapExpression,MsgNode originalMsg,Map<String,Statement> placeholderNameToPutStatement,SoyMsgPlaceholderPart placeholder) throws AssertionError {
  MsgPlaceholderNode repPlaceholderNode=originalMsg.getRepPlaceholderNode(placeholder.getPlaceholderName());
  String placeholderName=placeholder.getPlaceholderName();
  if (!placeholderNameToPutStatement.containsKey(placeholderName)) {
    StandaloneNode initialNode=repPlaceholderNode.getChild(0);
    Statement putEntyInMap;
    if (initialNode instanceof MsgHtmlTagNode) {
      putEntyInMap=addHtmlTagNodeToPlaceholderMap(mapExpression,placeholderName,(MsgHtmlTagNode)initialNode);
    }
 else     if (initialNode instanceof CallNode) {
      putEntyInMap=addCallNodeToPlaceholderMap(mapExpression,placeholderName,(CallNode)initialNode);
    }
 else     if (initialNode instanceof PrintNode) {
      putEntyInMap=addPrintNodeToPlaceholderMap(mapExpression,placeholderName,(PrintNode)initialNode);
    }
 else {
      throw new AssertionError();
    }
    placeholderNameToPutStatement.put(placeholder.getPlaceholderName(),putEntyInMap);
  }
}
Program: 29527
Project: 29527
Buggy source:
/** 
 * Compiles the given   {@link MsgNode} to a statement with the given escaping directives applied.<p>The returned statement must be written to a location with a stack depth of zero.
 * @param id The computed msg id
 * @param msg The msg node
 * @param escapingDirectives The set of escaping directives to apply.
 */
Statement compileMessage(long id,MsgNode msg,List<String> escapingDirectives){
  Expression soyMsg=variableLookup.getRenderContext().invoke(MethodRef.RENDER_CONTEXT_GET_SOY_MSG,constant(id));
  Statement printMsg;
  if (msg.isRawTextMsg()) {
    printMsg=handleBasicTranslation(escapingDirectives,soyMsg);
  }
 else {
    printMsg=handleTranslationWithPlaceholders(msg,escapingDirectives,soyMsg);
  }
  return Statement.concat(printMsg.withSourceLocation(msg.getSourceLocation()),detachState.detachLimited(appendableExpression));
}

Fixed version (ground truth):
/** 
 * Compiles the given   {@link MsgNode} to a statement with the given escaping directives applied.<p>The returned statement must be written to a location with a stack depth of zero.
 * @param partsAndId The computed msg id
 * @param msg The msg node
 * @param escapingDirectives The set of escaping directives to apply.
 */
Statement compileMessage(MsgPartsAndIds partsAndId,MsgNode msg,List<String> escapingDirectives){
  Expression soyMsg=variableLookup.getRenderContext().invoke(MethodRef.RENDER_CONTEXT_GET_SOY_MSG,constant(partsAndId.id));
  Statement printMsg;
  if (msg.isRawTextMsg()) {
    printMsg=handleBasicTranslation(escapingDirectives,soyMsg);
  }
 else {
    printMsg=handleTranslationWithPlaceholders(msg,escapingDirectives,soyMsg,partsAndId.parts);
  }
  return Statement.concat(printMsg.withSourceLocation(msg.getSourceLocation()),detachState.detachLimited(appendableExpression));
}
Program: 29528
Project: 29528
Buggy source:
/** 
 * Adds a   {@link Statement} to {@link Map#put} every msg placeholder, plural variable and selectcase value into  {@code mapExpression}
 */
private void putPlaceholdersIntoMap(Expression mapExpression,ParentSoyNode<?> msg,Map<String,Statement> placeholderNameToPutStatement){
  for (  SoyNode child : msg.getChildren()) {
    String varName;
    boolean addPlaceholder=true;
    if (child instanceof MsgSubstUnitNode) {
      varName=((MsgSubstUnitNode)child).getBaseVarName();
      if (placeholderNameToPutStatement.containsKey(varName)) {
        addPlaceholder=false;
      }
    }
 else {
      continue;
    }
    if (child instanceof MsgPluralNode) {
      MsgPluralNode plural=(MsgPluralNode)child;
      if (addPlaceholder) {
        Label reattachPoint=new Label();
        Expression value=soyNodeCompiler.compileToInt(plural.getExpr(),reattachPoint);
        placeholderNameToPutStatement.put(varName,putToMap(mapExpression,varName,value).labelStart(reattachPoint));
      }
      for (      CaseOrDefaultNode caseOrDefault : plural.getChildren()) {
        putPlaceholdersIntoMap(mapExpression,caseOrDefault,placeholderNameToPutStatement);
      }
    }
 else     if (child instanceof MsgSelectNode) {
      MsgSelectNode select=(MsgSelectNode)child;
      if (addPlaceholder) {
        Label reattachPoint=new Label();
        Expression value=soyNodeCompiler.compileToString(select.getExpr(),reattachPoint);
        placeholderNameToPutStatement.put(varName,putToMap(mapExpression,varName,value).labelStart(reattachPoint));
      }
      for (      CaseOrDefaultNode caseOrDefault : select.getChildren()) {
        putPlaceholdersIntoMap(mapExpression,caseOrDefault,placeholderNameToPutStatement);
      }
    }
 else     if (child instanceof MsgPlaceholderNode) {
      if (addPlaceholder) {
        placeholderNameToPutStatement.put(varName,putPlaceholderIntoMap(mapExpression,(MsgPlaceholderNode)child));
      }
    }
 else {
      throw new AssertionError("String_Node_Str" + child);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a   {@link Statement} to {@link Map#put} every msg placeholder, plural variable and selectcase value into  {@code mapExpression}
 */
private void putPlaceholdersIntoMap(Expression mapExpression,MsgNode originalMsg,Iterable<? extends SoyMsgPart> parts,Map<String,Statement> placeholderNameToPutStatement){
  for (  SoyMsgPart child : parts) {
    if (child instanceof SoyMsgRawTextPart || child instanceof SoyMsgPluralRemainderPart) {
      continue;
    }
    if (child instanceof SoyMsgPluralPart) {
      putPluralPartIntoMap(mapExpression,originalMsg,placeholderNameToPutStatement,(SoyMsgPluralPart)child);
    }
 else     if (child instanceof SoyMsgSelectPart) {
      putSelectPartIntoMap(mapExpression,originalMsg,placeholderNameToPutStatement,(SoyMsgSelectPart)child);
    }
 else     if (child instanceof SoyMsgPlaceholderPart) {
      putPlaceholderIntoMap(mapExpression,originalMsg,placeholderNameToPutStatement,(SoyMsgPlaceholderPart)child);
    }
 else {
      throw new AssertionError("String_Node_Str" + child);
    }
  }
}
Program: 29529
Project: 29529
Buggy source:
/** 
 * MsgFallbackGroupNodes have either one or two children.  In the 2 child case the second child is the   {@code} fallbackmsg}} entry.  For this we generate code that looks like: <pre>  {@code}if (renderContext.hasMsg(primaryId))  <render primary msg> } else { <render fallback msg> } }</pre> <p>All of the logic for actually rendering   {@code msg} nodes is handled by the{@link MsgCompiler}.
 */
@Override protected Statement visitMsgFallbackGroupNode(MsgFallbackGroupNode node){
  MsgNode msg=node.getMsg();
  long id=MsgUtils.computeMsgIdForDualFormat(msg);
  ImmutableList<String> escapingDirectives=node.getEscapingDirectiveNames();
  Statement renderDefault=getMsgCompiler().compileMessage(id,msg,escapingDirectives);
  if (node.hasFallbackMsg()) {
    MsgNode fallback=node.getFallbackMsg();
    long fallbackId=MsgUtils.computeMsgIdForDualFormat(node.getChild(1));
    IfBlock ifAvailableRenderDefault=IfBlock.create(variableLookup.getRenderContext().invoke(MethodRef.RENDER_CONTEXT_USE_PRIMARY_MSG,constant(id),constant(fallbackId)),renderDefault);
    return ControlFlow.ifElseChain(ImmutableList.of(ifAvailableRenderDefault),Optional.of(getMsgCompiler().compileMessage(fallbackId,fallback,escapingDirectives)));
  }
 else {
    return renderDefault;
  }
}

Fixed version (ground truth):
/** 
 * MsgFallbackGroupNodes have either one or two children.  In the 2 child case the second child is the   {@code} fallbackmsg}} entry.  For this we generate code that looks like: <pre>  {@code}if (renderContext.hasMsg(primaryId))  <render primary msg> } else { <render fallback msg> } }</pre> <p>All of the logic for actually rendering   {@code msg} nodes is handled by the{@link MsgCompiler}.
 */
@Override protected Statement visitMsgFallbackGroupNode(MsgFallbackGroupNode node){
  MsgNode msg=node.getMsg();
  MsgPartsAndIds idAndParts=MsgUtils.buildMsgPartsAndComputeMsgIdForDualFormat(msg);
  ImmutableList<String> escapingDirectives=node.getEscapingDirectiveNames();
  Statement renderDefault=getMsgCompiler().compileMessage(idAndParts,msg,escapingDirectives);
  if (node.hasFallbackMsg()) {
    MsgNode fallback=node.getFallbackMsg();
    MsgPartsAndIds fallbackIdAndParts=MsgUtils.buildMsgPartsAndComputeMsgIdForDualFormat(fallback);
    IfBlock ifAvailableRenderDefault=IfBlock.create(variableLookup.getRenderContext().invoke(MethodRef.RENDER_CONTEXT_USE_PRIMARY_MSG,constant(idAndParts.id),constant(fallbackIdAndParts.id)),renderDefault);
    return ControlFlow.ifElseChain(ImmutableList.of(ifAvailableRenderDefault),Optional.of(getMsgCompiler().compileMessage(fallbackIdAndParts,fallback,escapingDirectives)));
  }
 else {
    return renderDefault;
  }
}
Program: 29530
Project: 29530
Buggy source:
/** 
 * Return a   {@link SanitizedContent} valued continuation.  Rendering logic is delegated to the {@link WriteContinuation}, but it is assumed that the builder is the render target.
 */
static Continuation<SanitizedContent> strictContinuation(WriteContinuation delegate,AdvisingStringBuilder builder,final ContentKind kind){
  if (delegate.result().isDone()) {
    return new ResultContinuation<>(UnsafeSanitizedContentOrdainer.ordainAsSafe(builder.toString(),kind));
  }
  return new AbstractContinuation<SanitizedContent>(delegate,builder){
    @Override Continuation<SanitizedContent> nextContinuation(    WriteContinuation next){
      return strictContinuation(delegate,builder,kind);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Return a   {@link SanitizedContent} valued continuation.  Rendering logic is delegated to the {@link WriteContinuation}, but it is assumed that the builder is the render target.
 */
static Continuation<SanitizedContent> strictContinuation(WriteContinuation delegate,AdvisingStringBuilder builder,final ContentKind kind){
  if (delegate.result().isDone()) {
    return new ResultContinuation<>(UnsafeSanitizedContentOrdainer.ordainAsSafe(builder.toString(),kind));
  }
  return new AbstractContinuation<SanitizedContent>(delegate,builder){
    @Override Continuation<SanitizedContent> nextContinuation(    WriteContinuation next){
      return strictContinuation(next,builder,kind);
    }
  }
;
}
Program: 29531
Project: 29531
Buggy source:
private VarRefNode(VarRefNode orig){
  super(orig);
  this.name=orig.name;
  this.isInjected=orig.isInjected;
  this.isNullSafeInjected=orig.isNullSafeInjected;
  this.defn=orig.defn;
}

Fixed version (ground truth):
private VarRefNode(VarRefNode orig){
  super(orig);
  this.name=orig.name;
  this.isInjected=orig.isInjected;
  this.isNullSafeInjected=orig.isNullSafeInjected;
  this.subtituteType=orig.subtituteType;
  this.defn=orig.defn;
}
Program: 29532
Project: 29532
Buggy source:
private void compile(){
  if (classData == null) {
    SoyFileSetNode fileSet=SoyFileSetParserBuilder.forFileContents(getSubject()).typeRegistry(typeRegistry).parse();
    new UnsupportedFeatureReporter(ExplodingErrorReporter.get()).check(fileSet);
    SoyMsgBundle messages=new ExtractMsgsVisitor(ExplodingErrorReporter.get()).exec(fileSet);
    SoyMsgBundle defaultBundle=messages;
    if (this.msgBundle != null) {
      messages=this.msgBundle;
    }
    defaultContext=defaultContext.toBuilder().withMessageBundles(messages,defaultBundle).build();
    TemplateRegistry registry=new TemplateRegistry(fileSet,ExplodingErrorReporter.get());
    CompiledTemplateRegistry compilerRegistry=new CompiledTemplateRegistry(registry);
    String templateName=Iterables.getOnlyElement(registry.getBasicTemplatesMap().keySet());
    CompiledTemplateMetadata classInfo=compilerRegistry.getTemplateInfo(templateName);
    classData=new TemplateCompiler(compilerRegistry,classInfo,ExplodingErrorReporter.get()).compile();
    checkClasses(classData);
    factory=BytecodeCompiler.loadFactory(classInfo,new MemoryClassLoader.Builder().addAll(classData).build());
  }
}

Fixed version (ground truth):
private void compile(){
  if (classData == null) {
    SoyFileSetNode fileSet=SoyFileSetParserBuilder.forFileContents(getSubject()).typeRegistry(typeRegistry).parse();
    new UnsupportedFeatureReporter(ExplodingErrorReporter.get()).check(fileSet);
    fileSet=SoytreeUtils.cloneNode(fileSet);
    SoyMsgBundle messages=new ExtractMsgsVisitor(ExplodingErrorReporter.get()).exec(fileSet);
    SoyMsgBundle defaultBundle=messages;
    if (this.msgBundle != null) {
      messages=this.msgBundle;
    }
    defaultContext=defaultContext.toBuilder().withMessageBundles(messages,defaultBundle).build();
    TemplateRegistry registry=new TemplateRegistry(fileSet,ExplodingErrorReporter.get());
    CompiledTemplateRegistry compilerRegistry=new CompiledTemplateRegistry(registry);
    String templateName=Iterables.getOnlyElement(registry.getBasicTemplatesMap().keySet());
    CompiledTemplateMetadata classInfo=compilerRegistry.getTemplateInfo(templateName);
    classData=new TemplateCompiler(compilerRegistry,classInfo,ExplodingErrorReporter.get()).compile();
    checkClasses(classData);
    factory=BytecodeCompiler.loadFactory(classInfo,new MemoryClassLoader.Builder().addAll(classData).build());
  }
}
Program: 29533
Project: 29533
Buggy source:
public void testFloatExpressions(){
  SoyExpression expr=SoyExpression.forFloat(constant(12.34D));
  assertThatExpression(expr).evaluatesTo(12.34D);
  assertThatExpression(expr.box()).evaluatesTo(FloatData.forValue(12.34D));
  assertThatExpression(expr.box().convert(double.class)).evaluatesTo(12.34D);
  assertThatExpression(expr.convert(boolean.class)).evaluatesTo(true);
  assertThatExpression(SoyExpression.forFloat(constant(0D)).convert(boolean.class)).evaluatesTo(false);
  assertThatExpression(expr.convert(String.class)).evaluatesTo("String_Node_Str");
}

Fixed version (ground truth):
public void testFloatExpressions(){
  SoyExpression expr=SoyExpression.forFloat(constant(12.34D));
  assertThatExpression(expr).evaluatesTo(12.34D);
  assertThatExpression(expr.box()).evaluatesTo(FloatData.forValue(12.34D));
  assertThatExpression(expr.box().convert(double.class)).evaluatesTo(12.34D);
  assertThatExpression(SoyExpression.forSoyValue(FloatType.getInstance(),expr.box()).convert(String.class)).evaluatesTo("String_Node_Str");
  assertThatExpression(expr.convert(boolean.class)).evaluatesTo(true);
  assertThatExpression(SoyExpression.forFloat(constant(0D)).convert(boolean.class)).evaluatesTo(false);
  assertThatExpression(expr.convert(String.class)).evaluatesTo("String_Node_Str");
}
Program: 29534
Project: 29534
Buggy source:
public void testIntExpressions(){
  SoyExpression expr=SoyExpression.forInt(constant(12L));
  assertThatExpression(expr).evaluatesTo(12L);
  assertThatExpression(expr.box()).evaluatesTo(IntegerData.forValue(12));
  assertThatExpression(expr.box().convert(long.class)).evaluatesTo(12L);
  assertThatExpression(expr.convert(boolean.class)).evaluatesTo(true);
  assertThatExpression(SoyExpression.forInt(constant(0L)).convert(boolean.class)).evaluatesTo(false);
  assertThatExpression(expr.convert(String.class)).evaluatesTo("String_Node_Str");
}

Fixed version (ground truth):
public void testIntExpressions(){
  SoyExpression expr=SoyExpression.forInt(constant(12L));
  assertThatExpression(expr).evaluatesTo(12L);
  assertThatExpression(expr.box()).evaluatesTo(IntegerData.forValue(12));
  assertThatExpression(expr.box().convert(long.class)).evaluatesTo(12L);
  assertThatExpression(expr.convert(double.class)).evaluatesTo(12D);
  assertThatExpression(SoyExpression.forSoyValue(AnyType.getInstance(),expr.box()).convert(double.class)).evaluatesTo(12D);
  assertThatExpression(expr.convert(boolean.class)).evaluatesTo(true);
  assertThatExpression(SoyExpression.forInt(constant(0L)).convert(boolean.class)).evaluatesTo(false);
  assertThatExpression(expr.convert(String.class)).evaluatesTo("String_Node_Str");
}
Program: 29535
Project: 29535
Buggy source:
@Override public Expression resolveSoyValueProvider(final Expression soyValueProvider){
  soyValueProvider.checkAssignableTo(Type.getType(SoyValueProvider.class));
  return new SimpleExpression(Type.getType(SoyValue.class),false){
    @Override void doGen(    GeneratorAdapter adapter){
      soyValueProvider.gen(adapter);
      adapter.dup();
      MethodRef.SOY_VALUE_PROVIDER_STATUS.invokeUnchecked(adapter);
      adapter.dup();
      MethodRef.RENDER_RESULT_IS_DONE.invokeUnchecked(adapter);
      adapter.ifZCmp(Opcodes.IFEQ,detachPoint);
      adapter.pop();
      MethodRef.SOY_VALUE_PROVIDER_RESOLVE.invokeUnchecked(adapter);
    }
  }
;
}

Fixed version (ground truth):
@Override public Expression resolveSoyValueProvider(final Expression soyValueProvider){
  soyValueProvider.checkAssignableTo(Type.getType(SoyValueProvider.class));
  return new SimpleExpression(Type.getType(SoyValue.class),false){
    @Override void doGen(    GeneratorAdapter adapter){
      soyValueProvider.gen(adapter);
      adapter.dup();
      MethodRef.SOY_VALUE_PROVIDER_STATUS.invokeUnchecked(adapter);
      adapter.dup();
      MethodRef.RENDER_RESULT_IS_DONE.invokeUnchecked(adapter);
      Label resolve=new Label();
      adapter.ifZCmp(Opcodes.IFNE,resolve);
      saveOperation.gen(adapter);
      adapter.returnValue();
      adapter.mark(resolve);
      adapter.pop();
      MethodRef.SOY_VALUE_PROVIDER_RESOLVE.invokeUnchecked(adapter);
    }
  }
;
}
Program: 29536
Project: 29536
Buggy source:
@Override public Expression makeDetachable(final Expression exp){
  return new SimpleExpression(exp.resultType(),exp.isConstant()){
    @Override void doGen(    GeneratorAdapter adapter){
      adapter.mark(reattachPoint);
      exp.gen(adapter);
      Label skip=new Label();
      adapter.goTo(skip);
      adapter.mark(detachPoint);
      saveOperation.gen(adapter);
      adapter.returnValue();
      adapter.mark(skip);
    }
  }
;
}

Fixed version (ground truth):
@Override public Expression makeDetachable(final Expression exp){
  return new SimpleExpression(exp.resultType(),exp.isConstant()){
    @Override void doGen(    GeneratorAdapter adapter){
      adapter.mark(reattachPoint);
      exp.gen(adapter);
    }
  }
;
}
Program: 29537
Project: 29537
Buggy source:
@Override public String apply(String singleQuoted){
  if (singleQuoted.length() < 2 || singleQuoted.charAt(0) != '\'' || singleQuoted.charAt(singleQuoted.length() - 1) != '\'') {
    throw new IllegalArgumentException(String.format("String_Node_Str" + "String_Node_Str",singleQuoted));
  }
  return singleQuoted.substring(1,singleQuoted.length() - 1);
}

Fixed version (ground truth):
@Override public String apply(TargetExpr expr){
  return expr.getText();
}
Program: 29538
Project: 29538
Buggy source:
/** 
 * Converts a list of TargetExpr's into a list of safe tags as an argument for the supported backends. This will iterate over the expressions, ensure they're valid safe tags, and convert them into an array of Strings. <p>The generated output is valid for JS and Python. Any other languages should reevaluate if they require changes.
 * @param args A list of possible safe tags.
 * @return A string containing the safe tags argument.
 */
private String generateOptionalSafeTagsArg(List<? extends TargetExpr> args){
  String optionalSafeTagsArg="String_Node_Str";
  if (!args.isEmpty()) {
    Iterable<String> optionalSafeTagExprs=Iterables.transform(args,TARGET_EXPR_TO_STRING);
    FluentIterable.from(optionalSafeTagExprs).transform(SINGLE_QUOTED_TO_UNQUOTED).transform(OptionalSafeTag.FROM_TAG_NAME).toSet();
    optionalSafeTagsArg="String_Node_Str" + ARG_JOINER.join(optionalSafeTagExprs) + "String_Node_Str";
  }
  return optionalSafeTagsArg;
}

Fixed version (ground truth):
/** 
 * Converts a list of TargetExpr's into a list of safe tags as an argument for the supported backends. This will iterate over the expressions, ensure they're valid safe tags, and convert them into an array of Strings. <p>The generated output is valid for JS and Python. Any other languages should reevaluate if they require changes.
 * @param args A list of possible safe tags.
 * @return A string containing the safe tags argument.
 */
private String generateOptionalSafeTagsArg(List<? extends TargetExpr> args){
  String optionalSafeTagsArg="String_Node_Str";
  if (!args.isEmpty()) {
    Iterable<String> optionalSafeTagExprs=Iterables.transform(args,TARGET_EXPR_TO_STRING);
    for (    String singleQuoted : optionalSafeTagExprs) {
      if (singleQuoted.length() < 2 || singleQuoted.charAt(0) != '\'' || singleQuoted.charAt(singleQuoted.length() - 1) != '\'') {
        throw new IllegalArgumentException(String.format("String_Node_Str" + "String_Node_Str",singleQuoted));
      }
      String tagName=singleQuoted.substring(1,singleQuoted.length() - 1);
      OptionalSafeTag.fromTagName(tagName);
    }
    optionalSafeTagsArg="String_Node_Str" + ARG_JOINER.join(optionalSafeTagExprs) + "String_Node_Str";
  }
  return optionalSafeTagsArg;
}
Program: 29540
Project: 29540
Buggy source:
public DelegateTemplateDivision(int delPriority,Map<String,TemplateDelegateNode> delPackageNameToDelTemplateMap){
  this.delPriority=delPriority;
  this.delPackageNameToDelTemplateMap=Collections.unmodifiableMap(Maps.newHashMap(delPackageNameToDelTemplateMap));
}

Fixed version (ground truth):
public DelegateTemplateDivision(int delPriority,Map<String,TemplateDelegateNode> delPackageNameToDelTemplateMap){
  this.delPriority=delPriority;
  this.delPackageNameToDelTemplateMap=Collections.unmodifiableMap(Maps.newLinkedHashMap(delPackageNameToDelTemplateMap));
}
Program: 29542
Project: 29542
Buggy source:
public void testNullableIndirectParams(){
  assertValidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
public void testNullableIndirectParams(){
  assertValidSoyFiles("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 29543
Project: 29543
Buggy source:
public void testNoArgumentTypeMismatch(){
  assertValidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertValidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
public void testNoArgumentTypeMismatch(){
  assertValidSoyFiles("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertValidSoyFiles("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 29544
Project: 29544
Buggy source:
public void testIndirectParams(){
  assertInvalidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertValidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
public void testIndirectParams(){
  assertInvalidSoyFiles("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  assertValidSoyFiles("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 29545
Project: 29545
Buggy source:
public final void testOutputPathFormatFlag() throws Exception {
  File soyFile=getTempFile("String_Node_Str");
  Files.write("String_Node_Str",soyFile,UTF_8);
  String dir=soyFile.getParent().toString();
  String name=soyFile.getName();
  File xmlFile=new File(dir,name.substring(0,name.length() - 4) + "String_Node_Str");
  SoyMsgExtractor.main("String_Node_Str","String_Node_Str",soyFile.toString());
  String xmlContent=Files.toString(xmlFile,UTF_8);
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
}

Fixed version (ground truth):
public final void testOutputPathFormatFlag() throws Exception {
  File soyFile=getTempFile("String_Node_Str");
  Files.write("String_Node_Str" + "String_Node_Str",soyFile,UTF_8);
  String dir=soyFile.getParent().toString();
  String name=soyFile.getName();
  File xmlFile=new File(dir,name.substring(0,name.length() - 4) + "String_Node_Str");
  SoyMsgExtractor.main("String_Node_Str","String_Node_Str",soyFile.toString());
  String xmlContent=Files.toString(xmlFile,UTF_8);
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
}
Program: 29546
Project: 29546
Buggy source:
public final void testOutputFileFlag() throws Exception {
  File soyFile1=getTempFile("String_Node_Str");
  Files.write("String_Node_Str",soyFile1,UTF_8);
  File soyFile2=getTempFile("String_Node_Str");
  Files.write("String_Node_Str",soyFile2,UTF_8);
  File xmlFile=getTempFile("String_Node_Str");
  SoyMsgExtractor.main("String_Node_Str",xmlFile.toString(),soyFile1.toString(),soyFile2.toString());
  String xmlContent=Files.toString(xmlFile,UTF_8);
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
}

Fixed version (ground truth):
public final void testOutputFileFlag() throws Exception {
  File soyFile1=getTempFile("String_Node_Str");
  Files.write("String_Node_Str" + "String_Node_Str",soyFile1,UTF_8);
  File soyFile2=getTempFile("String_Node_Str");
  Files.write("String_Node_Str" + "String_Node_Str",soyFile2,UTF_8);
  File xmlFile=getTempFile("String_Node_Str");
  SoyMsgExtractor.main("String_Node_Str",xmlFile.toString(),soyFile1.toString(),soyFile2.toString());
  String xmlContent=Files.toString(xmlFile,UTF_8);
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
  assertTrue(xmlContent,xmlContent.contains("String_Node_Str"));
}
Program: 29547
Project: 29547
Buggy source:
/** 
 * @return The original error message from the Soy compiler without anymetadata about the location where the error appears.  
 */
public String getOriginalMessage(){
  return super.getMessage();
}

Fixed version (ground truth):
/** 
 * @return The original error message from the Soy compiler without anymetadata about the location where the error appears.
 */
public String getOriginalMessage(){
  return super.getMessage();
}
Program: 29548
Project: 29548
Buggy source:
/** 
 * Parses a response from the network or cache and delivers it. The provided Runnable will be executed after delivery.
 */
public void postResponse(Request<?> request,Response<?> response,Runnable runnable);

Fixed version (ground truth):
/** 
 * Parses a response from the network or cache and delivers it. The provided Runnable will be executed after delivery.
 */
void postResponse(Request<?> request,Response<?> response,Runnable runnable);
Program: 29549
Project: 29549
Buggy source:
/** 
 * Posts an error for the given request.
 */
public void postError(Request<?> request,NetroidError error);

Fixed version (ground truth):
/** 
 * Posts an error for the given request.
 */
void postError(Request<?> request,NetroidError error);
Program: 29550
Project: 29550
Buggy source:
/** 
 * Set the request delivery that use to post http networking callbacks.
 */
public void setDelivery(Delivery delivery);

Fixed version (ground truth):
/** 
 * Set the request delivery that use to post http networking callbacks.
 */
void setDelivery(Delivery delivery);
Program: 29551
Project: 29551
Buggy source:
/** 
 * Performs the specified request.
 * @param request Request to process
 * @return A {@link NetworkResponse} with data and caching metadata; will never be null
 * @throws NetroidError on errors
 */
public NetworkResponse performRequest(Request<?> request) throws NetroidError ;

Fixed version (ground truth):
/** 
 * Performs the specified request.
 * @param request Request to process
 * @return A {@link NetworkResponse} with data and caching metadata; will never be null
 * @throws NetroidError on errors
 */
NetworkResponse performRequest(Request<?> request) throws NetroidError ;
Program: 29552
Project: 29552
Buggy source:
/** 
 * Returns the current timeout (used for logging).
 */
public int getCurrentTimeout();

Fixed version (ground truth):
/** 
 * Returns the current timeout (used for logging).
 */
int getCurrentTimeout();
Program: 29553
Project: 29553
Buggy source:
/** 
 * Returns the current retry count (used for logging).
 */
public int getCurrentRetryCount();

Fixed version (ground truth):
/** 
 * Returns the current retry count (used for logging).
 */
int getCurrentRetryCount();
Program: 29554
Project: 29554
Buggy source:
/** 
 * Prepares for the next retry by applying a backoff to the timeout.
 * @param error The error code of the last attempt.
 * @throws NetroidError In the event that the retry could not be performed (for example if weran out of attempts), the passed in error is thrown.
 */
public void retry(NetroidError error) throws NetroidError ;

Fixed version (ground truth):
/** 
 * Prepares for the next retry by applying a backoff to the timeout.
 * @param error The error code of the last attempt.
 * @throws NetroidError In the event that the retry could not be performed (for example if weran out of attempts), the passed in error is thrown.
 */
void retry(NetroidError error) throws NetroidError ;
Program: 29555
Project: 29555
Buggy source:
/** 
 * Initializes the DiskCache by scanning for all files currently in the specified root directory. Creates the root directory if necessary.
 */
public synchronized void initialize(){
  if (!mRootDirectory.exists()) {
    if (!mRootDirectory.mkdirs()) {
      NetroidLog.e("String_Node_Str",mRootDirectory.getAbsolutePath());
    }
    return;
  }
  File[] files=mRootDirectory.listFiles();
  if (files == null) {
    return;
  }
  for (  File file : files) {
    FileInputStream fis=null;
    try {
      fis=new FileInputStream(file);
      CacheHeader entry=CacheHeader.readHeader(fis);
      if (entry.isExpired()) {
        file.delete();
      }
 else {
        entry.size=file.length();
        putEntry(entry.key,entry);
      }
    }
 catch (    IOException e) {
      if (file != null) {
        file.delete();
      }
    }
 finally {
      try {
        if (fis != null) {
          fis.close();
        }
      }
 catch (      IOException ignored) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes the DiskCache by scanning for all files currently in the specified root directory. Creates the root directory if necessary.
 */
public synchronized void initialize(){
  if (!mRootDirectory.exists()) {
    if (!mRootDirectory.mkdirs()) {
      NetroidLog.e("String_Node_Str",mRootDirectory.getAbsolutePath());
    }
    return;
  }
  File[] files=mRootDirectory.listFiles();
  if (files == null) {
    return;
  }
  for (  File file : files) {
    FileInputStream fis=null;
    try {
      fis=new FileInputStream(file);
      CacheHeader entry=CacheHeader.readHeader(fis);
      if (entry.isExpired()) {
        file.delete();
      }
 else {
        entry.size=file.length();
        putEntry(entry.key,entry);
      }
    }
 catch (    IOException e) {
      file.delete();
    }
 finally {
      try {
        if (fis != null) {
          fis.close();
        }
      }
 catch (      IOException ignored) {
      }
    }
  }
}