nus-yam/ex-repair huggingface dataset:
Program: 81590
Project: 81590
Buggy source:
public static void addGenericType(String gt,String superType) throws SalsaNotFoundException, VariableDeclarationException {
  String extendsGeneric=null, superGeneric=null;
  if (gt.contains("String_Node_Str")) {
    superGeneric=gt.substring(gt.indexOf("String_Node_Str") + "String_Node_Str".length(),gt.length());
    addGenericType(superGeneric,superType);
  }
 else   if (gt.contains("String_Node_Str")) {
    extendsGeneric=gt.substring(gt.indexOf("String_Node_Str") + "String_Node_Str".length(),gt.length());
    addGenericType(extendsGeneric,superType);
  }
  TypeSymbol genericType=null;
  try {
    genericType=SymbolTable.getTypeSymbol(gt);
  }
 catch (  SalsaNotFoundException snfe) {
    genericType=null;
  }
  if (genericType == null) {
    if (superType.equals("String_Node_Str")) {
      if (extendsGeneric != null)       genericType=new ObjectType(gt,SymbolTable.getTypeSymbol(extendsGeneric));
 else       genericType=new ObjectType(gt,SymbolTable.getTypeSymbol(superType));
    }
 else {
      if (extendsGeneric != null)       genericType=new ActorType(gt,SymbolTable.getTypeSymbol(extendsGeneric));
 else       genericType=new ActorType(gt,SymbolTable.getTypeSymbol(superType));
    }
    SymbolTable.addGenericVariableType(gt,genericType);
  }
}

Fixed version (ground truth):
public static void addGenericType(String gt,String superType) throws SalsaNotFoundException, VariableDeclarationException {
  String extendsGeneric=null, superGeneric=null;
  if (gt.contains("String_Node_Str")) {
    superGeneric=gt.substring(gt.indexOf("String_Node_Str") + "String_Node_Str".length(),gt.length());
    addGenericType(superGeneric,superType);
  }
 else   if (gt.contains("String_Node_Str")) {
    extendsGeneric=gt.substring(gt.indexOf("String_Node_Str") + "String_Node_Str".length(),gt.length());
    addGenericType(extendsGeneric,superType);
  }
  TypeSymbol genericType=null;
  try {
    genericType=SymbolTable.getTypeSymbol(gt);
    if (!SymbolTable.isGeneric(gt)) {
    }
 else {
    }
  }
 catch (  SalsaNotFoundException snfe) {
    genericType=null;
  }
  if (genericType == null) {
    if (superType.equals("String_Node_Str")) {
      if (extendsGeneric != null)       genericType=new ObjectType(gt,SymbolTable.getTypeSymbol(extendsGeneric));
 else       genericType=new ObjectType(gt,SymbolTable.getTypeSymbol(superType));
    }
 else {
      if (extendsGeneric != null)       genericType=new ActorType(gt,SymbolTable.getTypeSymbol(extendsGeneric));
 else       genericType=new ActorType(gt,SymbolTable.getTypeSymbol(superType));
    }
    SymbolTable.addGenericVariableType(gt,genericType);
  }
}
Program: 81592
Project: 81592
Buggy source:
public Object invokeMessage(int messageId,Object[] arguments) throws RemoteMessageException, TokenPassException, MessageHandlerNotFoundException {
switch (messageId) {
case 0:
    return toString();
case 1:
  return hashCode();
case 2:
setNextThread((ThreadRing)arguments[0]);
return null;
case 3:
forwardMessage((Integer)arguments[0]);
return null;
default :
throw new MessageHandlerNotFoundException(messageId,arguments);
}
}

Fixed version (ground truth):
public Object invokeMessage(int messageId,Object[] arguments) throws RemoteMessageException, TokenPassException, MessageHandlerNotFoundException {
switch (messageId) {
case 0:
    return toString();
case 1:
  return hashCode();
case 2:
return getStageId();
case 3:
setNextThread((ThreadRing)arguments[0]);
return null;
case 4:
forwardMessage((Integer)arguments[0]);
return null;
default :
throw new MessageHandlerNotFoundException(messageId,arguments);
}
}
Program: 81593
Project: 81593
Buggy source:
public String getMessageInformation(int messageId){
switch (messageId) {
case 0:
    return "String_Node_Str";
case 1:
  return "String_Node_Str";
case 2:
return "String_Node_Str";
case 3:
return "String_Node_Str";
}
return "String_Node_Str";
}

Fixed version (ground truth):
public String getMessageInformation(int messageId){
switch (messageId) {
case 0:
    return "String_Node_Str";
case 1:
  return "String_Node_Str";
case 2:
return "String_Node_Str";
case 3:
return "String_Node_Str";
case 4:
return "String_Node_Str";
}
return "String_Node_Str";
}
Program: 81594
Project: 81594
Buggy source:
public void forwardMessage(int value){
  if (value == 0) {
    System.out.println(id);
    System.exit(0);
  }
 else {
    value--;
    StageService.sendMessage(next,3,new Object[]{value});
  }
}

Fixed version (ground truth):
public void forwardMessage(int value){
  if (value == 0) {
    System.out.println(id);
    System.exit(0);
  }
 else {
    value--;
    StageService.sendMessage(next,4,new Object[]{value});
  }
}
Program: 81595
Project: 81595
Buggy source:
public final static void passToken(ContinuationDirector token,Director currentContinuation){
  if (currentContinuation == null)   return;
  token.stage.putMessageInMailbox(new Message(Message.SIMPLE_MESSAGE,token,4,new Object[]{currentContinuation},null));
}

Fixed version (ground truth):
public final static void passToken(ContinuationDirector token,Director currentContinuation){
  if (currentContinuation == null)   return;
  token.stage.putMessageInMailbox(new Message(Message.SIMPLE_MESSAGE,token,5,new Object[]{currentContinuation},null));
}
Program: 81597
Project: 81597
Buggy source:
public static final void sendMessageToRemote(String host,int port,Message message){
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,2,new Object[]{message}));
}

Fixed version (ground truth):
public static final void sendMessageToRemote(String host,int port,Message message){
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,3,new Object[]{message}));
}
Program: 81598
Project: 81598
Buggy source:
public static final void createRemotely(String host,int port,Object remoteCreator){
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,4,new Object[]{remoteCreator}));
}

Fixed version (ground truth):
public static final void createRemotely(String host,int port,Object remoteCreator){
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,5,new Object[]{remoteCreator}));
}
Program: 81599
Project: 81599
Buggy source:
public static final void migrateActor(String host,int port,MobileActor.State actor){
  actor.host=host;
  actor.port=port;
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,3,new Object[]{actor}));
}

Fixed version (ground truth):
public static final void migrateActor(String host,int port,MobileActor.State actor){
  actor.host=host;
  actor.port=port;
  OutgoingTheaterConnection out=getSocket(host,port);
  StageService.sendMessage(new Message(Message.SIMPLE_MESSAGE,out,4,new Object[]{actor}));
}
Program: 81600
Project: 81600
Buggy source:
private final synchronized Message getMessage(){
  if (mailbox.isEmpty()) {
    try {
      wait();
    }
 catch (    InterruptedException e) {
      System.err.println("String_Node_Str");
      System.err.println("String_Node_Str" + e);
      System.exit(0);
    }
  }
  return mailbox.removeFirst();
}

Fixed version (ground truth):
private final synchronized Message getMessage(){
  Message message=null;
  while (mailbox.isEmpty()) {
    try {
      wait();
    }
 catch (    InterruptedException e) {
      System.err.println("String_Node_Str");
      System.err.println("String_Node_Str" + e);
      System.exit(0);
    }
  }
  message=mailbox.removeFirst();
  return message;
}
Program: 81605
Project: 81605
Buggy source:
public String toJavaCode(){
  if (implicit_token_code != null) {
    return implicit_token_code;
  }
  String code="String_Node_Str";
  for (int i=0; i < prefixes.size(); i++)   code+=prefixes.get(i);
  code+=value.toJavaCode();
  for (int i=0; i < suffixes.size(); i++) {
    code+=suffixes.get(i);
  }
  if (operator != null) {
    code+="String_Node_Str" + operator + "String_Node_Str";
    boolean isExpressionContinuation=SymbolTable.isExpressionContinuation;
    if (operator.equals("String_Node_Str"))     SymbolTable.isExpressionContinuation=true;
    code+=operator_expression.toJavaCode();
    if (operator.equals("String_Node_Str"))     SymbolTable.isExpressionContinuation=isExpressionContinuation;
  }
  return code;
}

Fixed version (ground truth):
public String toJavaCode(){
  if (implicit_token_code != null) {
    return implicit_token_code;
  }
  String code="String_Node_Str";
  for (int i=0; i < prefixes.size(); i++)   code+=prefixes.get(i);
  code+=value.toJavaCode();
  for (int i=0; i < suffixes.size(); i++) {
    code+=suffixes.get(i);
  }
  if (operator != null) {
    code+="String_Node_Str" + operator + "String_Node_Str";
    boolean isExpressionContinuation=SymbolTable.isExpressionContinuation;
    boolean continuationTokenMessage=SymbolTable.continuationTokenMessage;
    if (value.getType().getLongSignature().equals("String_Node_Str")) {
      SymbolTable.continuationTokenMessage=true;
    }
    if (operator.equals("String_Node_Str"))     SymbolTable.isExpressionContinuation=true;
    code+=operator_expression.toJavaCode();
    SymbolTable.continuationTokenMessage=continuationTokenMessage;
    if (operator.equals("String_Node_Str"))     SymbolTable.isExpressionContinuation=isExpressionContinuation;
  }
  return code;
}
Program: 81606
Project: 81606
Buggy source:
public String toJavaCode(){
  SymbolTable.messageContinues=continues;
  String code="String_Node_Str";
  if (is_token) {
    for (int i=0; i < variables.size(); i++) {
      code+="String_Node_Str";
      code+=variables.get(i).toJavaCodeAsToken(type.name,is_token);
      try {
        SymbolTable.addVariableType(variables.get(i).name,type.name,true,false);
      }
 catch (      SalsaNotFoundException snfe) {
        CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),variables.get(i));
        throw new RuntimeException(snfe);
      }
      code+="String_Node_Str";
      if (i < variables.size() - 1)       code+="String_Node_Str" + CIndent.getIndent();
    }
  }
 else {
    for (int i=0; i < variables.size(); i++) {
      code+=type.name + "String_Node_Str";
      code+=variables.get(i).toJavaCode(type.name,is_token);
      try {
        SymbolTable.addVariableType(variables.get(i).name,type.name,false,false);
      }
 catch (      SalsaNotFoundException snfe) {
        CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),variables.get(i));
        throw new RuntimeException(snfe);
      }
      code+="String_Node_Str";
      if (i < variables.size() - 1)       code+="String_Node_Str" + CIndent.getIndent();
    }
  }
  SymbolTable.messageRequiresContinuation=continues;
  return code;
}

Fixed version (ground truth):
public String toJavaCode(){
  SymbolTable.messageContinues=continues;
  String code="String_Node_Str";
  if (is_token) {
    for (int i=0; i < variables.size(); i++) {
      if (type.name.equals("String_Node_Str")) {
        code+="String_Node_Str";
      }
 else {
        code+="String_Node_Str";
      }
      code+=variables.get(i).toJavaCodeAsToken(type.name,is_token);
      try {
        SymbolTable.addVariableType(variables.get(i).name,type.name,true,false);
      }
 catch (      SalsaNotFoundException snfe) {
        CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),variables.get(i));
        throw new RuntimeException(snfe);
      }
      code+="String_Node_Str";
      if (i < variables.size() - 1)       code+="String_Node_Str" + CIndent.getIndent();
    }
  }
 else {
    for (int i=0; i < variables.size(); i++) {
      code+=type.name + "String_Node_Str";
      code+=variables.get(i).toJavaCode(type.name,is_token);
      try {
        SymbolTable.addVariableType(variables.get(i).name,type.name,false,false);
      }
 catch (      SalsaNotFoundException snfe) {
        CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),variables.get(i));
        throw new RuntimeException(snfe);
      }
      code+="String_Node_Str";
      if (i < variables.size() - 1)       code+="String_Node_Str" + CIndent.getIndent();
    }
  }
  SymbolTable.messageRequiresContinuation=continues;
  return code;
}
Program: 81608
Project: 81608
Buggy source:
public String toJavaCodeAsToken(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (expression.getType().canMatch(ts) < 0) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (!is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str",expression);
    }
    if (expression.isToken()) {
      code+="String_Node_Str" + expression.toJavaCode();
    }
 else {
      code+="String_Node_Str" + expression.toJavaCode() + "String_Node_Str";
    }
  }
  return code;
}

Fixed version (ground truth):
public String toJavaCodeAsToken(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (expression.getType().canMatch(ts) < 0) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (!is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str",expression);
    }
    boolean previous_continues=SymbolTable.continuationTokenMessage;
    SymbolTable.continuationTokenMessage=true;
    if (expression.isToken()) {
      code+="String_Node_Str" + expression.toJavaCode();
    }
 else {
      code+="String_Node_Str" + expression.toJavaCode() + "String_Node_Str";
    }
    SymbolTable.continuationTokenMessage=previous_continues;
  }
  return code;
}
Program: 81609
Project: 81609
Buggy source:
public void set(T value){
  this.value=value;
}

Fixed version (ground truth):
public void set(T value){
  System.err.println("String_Node_Str" + value);
  this.value=value;
}
Program: 81610
Project: 81610
Buggy source:
public T get(){
  return (T)DeepCopy.deepCopy(value);
}

Fixed version (ground truth):
public T get(){
  System.err.println("String_Node_Str" + value);
  return (T)DeepCopy.deepCopy(value);
}
Program: 81611
Project: 81611
Buggy source:
public TypeSymbol getType(){
  TypeSymbol value_type=value.getType();
  if (operator == null) {
    return value_type;
  }
 else   if (operator.equals("String_Node_Str")) {
    if (!value_type.canMatch(operator_expression.getType())) {
      CompilerErrors.printErrorMessage("String_Node_Str" + operator_expression.getType().getLongSignature() + "String_Node_Str"+ value_type.getLongSignature()+ "String_Node_Str",operator_expression);
    }
    if (!value.isToken() && operator_expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",operator_expression);
    }
    return value_type;
  }
 else {
    try {
      TypeSymbol dominatingType=SymbolTable.getDominatingType(value_type,operator_expression.getType());
      return dominatingType;
    }
 catch (    SalsaNotFoundException snfe) {
      CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),this);
      throw new RuntimeException();
    }
  }
}

Fixed version (ground truth):
public TypeSymbol getType(){
  TypeSymbol value_type=value.getType();
  if (operator == null) {
    return value_type;
  }
 else   if (operator.equals("String_Node_Str")) {
    if (value_type.canMatch(operator_expression.getType()) < 0) {
      CompilerErrors.printErrorMessage("String_Node_Str" + operator_expression.getType().getLongSignature() + "String_Node_Str"+ value_type.getLongSignature()+ "String_Node_Str",operator_expression);
    }
    if (!value.isToken() && operator_expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",operator_expression);
    }
    return value_type;
  }
 else {
    try {
      TypeSymbol dominatingType=SymbolTable.getDominatingType(value_type,operator_expression.getType());
      return dominatingType;
    }
 catch (    SalsaNotFoundException snfe) {
      CompilerErrors.printErrorMessage("String_Node_Str" + snfe.toString(),this);
      throw new RuntimeException();
    }
  }
}
Program: 81612
Project: 81612
Buggy source:
public String toJavaCodeAsToken(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (!ts.canMatch(expression.getType())) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",expression);
    }
    if (expression.isToken()) {
      code+="String_Node_Str" + expression.toJavaCode();
    }
 else {
      code+="String_Node_Str" + expression.toJavaCode() + "String_Node_Str";
    }
  }
  return code;
}

Fixed version (ground truth):
public String toJavaCodeAsToken(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (ts.canMatch(expression.getType()) < 0) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",expression);
    }
    if (expression.isToken()) {
      code+="String_Node_Str" + expression.toJavaCode();
    }
 else {
      code+="String_Node_Str" + expression.toJavaCode() + "String_Node_Str";
    }
  }
  return code;
}
Program: 81613
Project: 81613
Buggy source:
public String toJavaCode(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (!ts.canMatch(expression.getType())) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",expression);
    }
    code+="String_Node_Str" + expression.toJavaCode();
  }
  return code;
}

Fixed version (ground truth):
public String toJavaCode(String type,boolean is_token){
  String code=name;
  TypeSymbol ts=null;
  try {
    ts=SymbolTable.getTypeSymbol(type);
  }
 catch (  SalsaNotFoundException snfe) {
    CompilerErrors.printErrorMessage("String_Node_Str" + type + "String_Node_Str",this);
    throw new RuntimeException(snfe);
  }
  if (expression != null) {
    if (ts.canMatch(expression.getType()) < 0) {
      CompilerErrors.printErrorMessage("String_Node_Str" + expression.getType().getLongSignature() + "String_Node_Str"+ ts.getLongSignature()+ "String_Node_Str",expression);
    }
    if (is_token && expression.isToken()) {
      CompilerErrors.printErrorMessage("String_Node_Str",expression);
    }
    code+="String_Node_Str" + expression.toJavaCode();
  }
  return code;
}
Program: 81614
Project: 81614
Buggy source:
public static Invokable matchInvokable(Invokable targetArguments,LinkedHashMap<String,? extends Invokable> invokableMap) throws SalsaNotFoundException {
  Invokable match=null;
  int matches=0;
  for (  Invokable current : new LinkedList<Invokable>(invokableMap.values())) {
    if (targetArguments.matches(current)) {
      matches++;
      if (matches == 2) {
        System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
        System.err.println("String_Node_Str" + match.getLongSignature());
      }
      match=current;
      if (matches > 1) {
        System.err.println("String_Node_Str" + match.getLongSignature());
      }
    }
  }
  if (match == null) {
    System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
    System.err.println("String_Node_Str");
    for (    Invokable current : new LinkedList<Invokable>(invokableMap.values())) {
      System.err.println("String_Node_Str" + current.getLongSignature());
    }
  }
  return match;
}

Fixed version (ground truth):
public static Invokable matchInvokable(Invokable targetArguments,LinkedHashMap<String,? extends Invokable> invokableMap) throws SalsaNotFoundException {
  Invokable match=null;
  int matches=0;
  int[] match_distance=new int[invokableMap.values().size()];
  int min_distance=Integer.MAX_VALUE;
  int i=0;
  for (  Invokable current : new LinkedList<Invokable>(invokableMap.values())) {
    match_distance[i]=targetArguments.matches(current);
    if (match_distance[i] >= 0 && match_distance[i] < min_distance) {
      matches=1;
      min_distance=match_distance[i];
      match=current;
    }
 else     if (match_distance[i] >= 0 && match_distance[i] == min_distance) {
      matches++;
    }
    i++;
  }
  if (matches > 1) {
    int min_match=match_distance[1];
    int min_match_position=1;
    int min_matches=0;
    for (i=1; i < match_distance.length; i++) {
      if (min_match >= 0 && min_match < match_distance[i]) {
        min_match_position=i;
        min_match=match_distance[i];
        min_matches=0;
      }
 else       if (min_match >= 0 && min_match == match_distance[i]) {
        min_matches++;
      }
    }
    if (min_matches > 1) {
      i=0;
      System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
      for (      Invokable current : new LinkedList<Invokable>(invokableMap.values())) {
        if (match_distance[i] == min_match) {
          System.err.println("String_Node_Str" + match_distance[i] + "String_Node_Str"+ current.getLongSignature());
        }
        i++;
      }
    }
 else {
      return match;
    }
  }
  if (match == null) {
    System.err.println("String_Node_Str" + targetArguments.getLongSignature() + "String_Node_Str");
    System.err.println("String_Node_Str");
    i=0;
    for (    Invokable current : new LinkedList<Invokable>(invokableMap.values())) {
      System.err.println("String_Node_Str" + current.getLongSignature());
    }
  }
  return match;
}
Program: 81615
Project: 81615
Buggy source:
/** 
 * The current invokable is has the arguments we're trying to send to target
 */
public boolean matches(Invokable target) throws SalsaNotFoundException {
  if (!name.equals(target.getName()))   return false;
  if (parameterTypes.length != target.parameterTypes.length)   return false;
  for (int i=0; i < parameterTypes.length; i++) {
    boolean canMatch=parameterTypes[i].canMatch(target.parameterTypes[i]);
    if (!canMatch)     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * The current invokable is has the arguments we're trying to send to target returns -1 if there is no match, otherwise it returns the distance between types (in terms of how many superclasses away it is)
 */
public int matches(Invokable target) throws SalsaNotFoundException {
  if (!name.equals(target.getName()))   return -1;
  if (parameterTypes.length != target.parameterTypes.length)   return -1;
  int match_distance;
  int total_match_distance=0;
  for (int i=0; i < parameterTypes.length; i++) {
    match_distance=this.parameterTypes[i].canMatch(target.parameterTypes[i]);
    total_match_distance+=match_distance;
    if (match_distance < 0)     return -1;
  }
  return total_match_distance;
}
Program: 81616
Project: 81616
Buggy source:
/** 
 * This type matches the target if the target is the same type, or a superclass of this type
 */
public boolean canMatch(TypeSymbol target){
  if (this.equals(target))   return true;
  if (target.getName().equals("String_Node_Str")) {
    if (this instanceof PrimitiveType)     return false;
 else     return true;
  }
  if (this instanceof PrimitiveType && !(target instanceof PrimitiveType)) {
    try {
      TypeSymbol nonPrimitive=SymbolTable.getTypeSymbol(toNonPrimitiveString());
      return nonPrimitive.canMatch(target);
    }
 catch (    SalsaNotFoundException snfe) {
      System.err.println("String_Node_Str" + toNonPrimitiveString() + "String_Node_Str");
      System.err.println("String_Node_Str");
      throw new RuntimeException();
    }
  }
  boolean canMatch=false;
  if (superType != null)   canMatch=superType.canMatch(target);
  if (canMatch)   return true;
  for (  TypeSymbol implementsType : implementsTypes) {
    canMatch=implementsType.canMatch(target);
    if (canMatch)     return true;
  }
  return false;
}

Fixed version (ground truth):
public int canMatch(TypeSymbol target,int distance){
  if (this.equals(target))   return distance;
  if (target.getName().equals("String_Node_Str")) {
    if (this instanceof PrimitiveType)     return -1;
 else     return distance;
  }
  if (this instanceof PrimitiveType && !(target instanceof PrimitiveType)) {
    try {
      TypeSymbol nonPrimitive=SymbolTable.getTypeSymbol(toNonPrimitiveString());
      return nonPrimitive.canMatch(target,distance + 1);
    }
 catch (    SalsaNotFoundException snfe) {
      System.err.println("String_Node_Str" + toNonPrimitiveString() + "String_Node_Str");
      System.err.println("String_Node_Str");
      throw new RuntimeException();
    }
  }
  int temp_distance=-1;
  if (superType != null)   temp_distance=superType.canMatch(target,distance + 1);
  if (temp_distance >= 0)   return temp_distance;
  for (  TypeSymbol implementsType : implementsTypes) {
    temp_distance=implementsType.canMatch(target,distance + 1);
    if (temp_distance >= 0)     return temp_distance;
  }
  return -1;
}
Program: 81617
Project: 81617
Buggy source:
/** 
 * Activates this buffer
 */
public void bind(){
  glBindBufferARB(GL_ARRAY_BUFFER_ARB,vboPtr);
  if (!dataTransferred) {
    dataTransferred=true;
    vertexBuffer.flip();
    serverMemoryUsage=vertexBuffer.limit();
    glBufferDataARB(GL_ARRAY_BUFFER_ARB,vertexBuffer,GL_STATIC_DRAW_ARB);
    ServerMemoryManager.arbBufferMemory+=serverMemoryUsage;
    vertexBuffer=null;
  }
  glVertexPointer(3,GL_FLOAT,use3DTextures ? 52 : 48,0);
  glNormalPointer(GL_FLOAT,use3DTextures ? 52 : 48,12);
  glTexCoordPointer(use3DTextures ? 3 : 2,GL_FLOAT,use3DTextures ? 52 : 48,24);
  glColorPointer(4,GL_FLOAT,use3DTextures ? 52 : 48,use3DTextures ? 36 : 32);
}

Fixed version (ground truth):
/** 
 * Activates this buffer
 */
public void bind(){
  glBindBufferARB(GL_ARRAY_BUFFER_ARB,vboPtr);
  if (!dataTransferred) {
    dataTransferred=true;
    vertexBuffer.flip();
    serverMemoryUsage=vertexBuffer.limit();
    glBufferDataARB(GL_ARRAY_BUFFER_ARB,vertexBuffer,GL_STATIC_DRAW_ARB);
    ServerMemoryManager.arbBufferMemory+=serverMemoryUsage;
    DirectBufferManager.free(vertexBuffer);
    vertexBuffer=null;
  }
  glVertexPointer(3,GL_FLOAT,use3DTextures ? 52 : 48,0);
  glNormalPointer(GL_FLOAT,use3DTextures ? 52 : 48,12);
  glTexCoordPointer(use3DTextures ? 3 : 2,GL_FLOAT,use3DTextures ? 52 : 48,24);
  glColorPointer(4,GL_FLOAT,use3DTextures ? 52 : 48,use3DTextures ? 36 : 32);
}
Program: 81618
Project: 81618
Buggy source:
/** 
 * Creates a new ARB geometry buffer
 * @param maxSize       Maximal amount of vertices this buffer may store
 * @param use3DTextures If the W texture coordinate should be enabled
 * @throws PglException When the card does not support ARB VBOs
 */
public ARBGeometryBuffer(int maxSize,boolean use3DTextures) throws PglException {
  if (!GLContext.getCapabilities().GL_ARB_vertex_buffer_object)   throw new PglException("String_Node_Str");
  this.use3DTextures=use3DTextures;
  vertexBuffer=BufferUtils.createByteBuffer(maxSize * (use3DTextures ? 52 : 48));
  vboPtr=glGenBuffersARB();
}

Fixed version (ground truth):
/** 
 * Creates a new ARB geometry buffer
 * @param maxSize       Maximal amount of vertices this buffer may store
 * @param use3DTextures If the W texture coordinate should be enabled
 * @throws PglException When the card does not support ARB VBOs
 */
public ARBGeometryBuffer(int maxSize,boolean use3DTextures) throws PglException {
  if (!GLContext.getCapabilities().GL_ARB_vertex_buffer_object)   throw new PglException("String_Node_Str");
  this.use3DTextures=use3DTextures;
  vertexBuffer=DirectBufferManager.alloc(maxSize * (use3DTextures ? 52 : 48));
  vboPtr=glGenBuffersARB();
}
Program: 81619
Project: 81619
Buggy source:
@Override protected void finalize() throws Throwable {
  super.finalize();
  vertexBuffer=null;
  ServerMemoryManager.requestARBBufferDeletion(vboPtr,serverMemoryUsage);
}

Fixed version (ground truth):
@Override protected void finalize() throws Throwable {
  super.finalize();
  if (vertexBuffer != null)   DirectBufferManager.free(vertexBuffer);
  vertexBuffer=null;
  ServerMemoryManager.requestARBBufferDeletion(vboPtr,serverMemoryUsage);
}
Program: 81620
Project: 81620
Buggy source:
/** 
 * Activates this buffer
 */
public void bind(){
  glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,vboPtr);
  if (!dataTransferred) {
    dataTransferred=true;
    elementBuffer.flip();
    serverMemoryUsage=elementBuffer.limit();
    glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,elementBuffer,GL_STATIC_DRAW_ARB);
    ServerMemoryManager.arbBufferMemory+=serverMemoryUsage;
    elementBuffer=null;
  }
}

Fixed version (ground truth):
/** 
 * Activates this buffer
 */
public void bind(){
  glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,vboPtr);
  if (!dataTransferred) {
    dataTransferred=true;
    elementBuffer.flip();
    serverMemoryUsage=elementBuffer.limit();
    glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,elementBuffer,GL_STATIC_DRAW_ARB);
    ServerMemoryManager.arbBufferMemory+=serverMemoryUsage;
    DirectBufferManager.free(elementBuffer);
    elementBuffer=null;
  }
}
Program: 81621
Project: 81621
Buggy source:
/** 
 * Creates a new ARB element buffer
 * @param maxSize Maximal amount of polygons this buffer may store
 * @param drawMode The OpenGL drawing mode to use
 * @throws PglException When the card does not support ARB VBOs
 */
public ArbElementBuffer(int maxSize,int drawMode) throws PglException {
  if (!GLContext.getCapabilities().GL_ARB_vertex_buffer_object)   throw new PglException("String_Node_Str");
  this.drawMode=drawMode;
  this.elementBuffer=ByteBuffer.allocateDirect(maxSize * sizeof() * 4);
  vboPtr=glGenBuffersARB();
}

Fixed version (ground truth):
/** 
 * Creates a new ARB element buffer
 * @param maxSize Maximal amount of polygons this buffer may store
 * @param drawMode The OpenGL drawing mode to use
 * @throws PglException When the card does not support ARB VBOs
 */
public ArbElementBuffer(int maxSize,int drawMode) throws PglException {
  if (!GLContext.getCapabilities().GL_ARB_vertex_buffer_object)   throw new PglException("String_Node_Str");
  this.drawMode=drawMode;
  this.elementBuffer=DirectBufferManager.alloc(maxSize * sizeof() * 4);
  vboPtr=glGenBuffersARB();
}
Program: 81622
Project: 81622
Buggy source:
@Override protected void finalize() throws Throwable {
  super.finalize();
  elementBuffer=null;
  ServerMemoryManager.requestARBBufferDeletion(vboPtr,serverMemoryUsage);
}

Fixed version (ground truth):
@Override protected void finalize() throws Throwable {
  super.finalize();
  if (elementBuffer != null)   DirectBufferManager.free(elementBuffer);
  elementBuffer=null;
  ServerMemoryManager.requestARBBufferDeletion(vboPtr,serverMemoryUsage);
}
Program: 81623
Project: 81623
Buggy source:
/** 
 * Creates a new element array
 * @param maxSize Maximal amount of polygons this buffer may store
 * @param drawMode The OpenGL drawing mode to use
 */
public ElementArray(int maxSize,int drawMode){
  this.elementBuffer=ByteBuffer.allocateDirect(maxSize * sizeof() * 4);
  this.drawMode=drawMode;
}

Fixed version (ground truth):
/** 
 * Creates a new element array
 * @param maxSize Maximal amount of polygons this buffer may store
 * @param drawMode The OpenGL drawing mode to use
 */
public ElementArray(int maxSize,int drawMode){
  this.drawMode=drawMode;
  this.elementBuffer=DirectBufferManager.alloc(maxSize * sizeof() * 4);
}
Program: 81624
Project: 81624
Buggy source:
/** 
 * Creates a new vertex array geometry buffer
 * @param maxSize       Maximal amount of vertices this buffer may store
 * @param use3DTextures If the W texture coordinate should be enabled
 */
public GeometryArray(int maxSize,boolean use3DTextures){
  this.use3DTextures=use3DTextures;
  vertexBuffer=BufferUtils.createByteBuffer(maxSize * (use3DTextures ? 52 : 48));
}

Fixed version (ground truth):
/** 
 * Creates a new vertex array geometry buffer
 * @param maxSize       Maximal amount of vertices this buffer may store
 * @param use3DTextures If the W texture coordinate should be enabled
 */
public GeometryArray(int maxSize,boolean use3DTextures){
  this.use3DTextures=use3DTextures;
  vertexBuffer=DirectBufferManager.alloc(maxSize * (use3DTextures ? 52 : 48));
}
Program: 81625
Project: 81625
Buggy source:
public TerrainLayer(Terrain terrain,int textureId){
  this.terrain=terrain;
  this.texture=terrain.getTerrainSource().getTexture(textureId);
  this.textureId=textureId;
  int[][] heightmap=terrain.getTerrainSource().getHeightMap();
  int side=terrain.getTerrainSource().getSideSize();
  int totalTiles=side * side;
  int totalPolys=(side - 1) * (side - 1);
  geometryBuffer=OpenGLBufferFactory.createGeometryBuffer(totalPolys * 4,false);
  elementBuffer=OpenGLBufferFactory.createElementBuffer(totalPolys,GL11.GL_QUADS);
  for (int x=0; x < side - 1; x++)   for (int z=0; z < side - 1; z++)   try {
    addTile(x,z);
  }
 catch (  PglException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public TerrainLayer(Terrain terrain,int textureId){
  this.terrain=terrain;
  this.texture=terrain.getTerrainSource().getTexture(textureId);
  this.textureId=textureId;
  int[][] heightmap=terrain.getTerrainSource().getHeightMap();
  int side=terrain.getTerrainSource().getSideSize();
  int totalTiles=side * side;
  int totalPolys=(side - 1) * (side - 1);
  geometryBuffer=OpenGLBufferFactory.createGeometryBuffer(totalPolys * 6,false);
  elementBuffer=OpenGLBufferFactory.createElementBuffer(totalPolys * 3,GL11.GL_TRIANGLES);
  for (int x=0; x < side - 1; x++)   for (int z=0; z < side - 1; z++)   try {
    addTile(x,z);
  }
 catch (  PglException e) {
    e.printStackTrace();
  }
}
Program: 81626
Project: 81626
Buggy source:
public void glTexParameterf(int id,float value){
}

Fixed version (ground truth):
public void glTexParameterf(int id,float value){
  bind();
  GL11.glTexParameterf(GL_TEXTURE_2D,id,value);
}
Program: 81627
Project: 81627
Buggy source:
public void glTexParameteri(int id,int value){
}

Fixed version (ground truth):
public void glTexParameteri(int id,int value){
  bind();
  GL11.glTexParameteri(GL_TEXTURE_2D,id,value);
}
Program: 81628
Project: 81628
Buggy source:
/** 
 * Renders this node and its children
 * @param cam The camera that is rendering this node.When the camera parameter is null only Camera nodes will render, this is used to have all active cameras render.
 */
@Override public void render(Camera cam){
  for (  TileNode[][] t : tileArray)   for (  TileNode[] _t : t)   for (  TileNode __t : _t) {
    if (tileLightingEnabled)     activateLightsForTile(__t.getTileY(),__t.getTileX(),__t.getTileZ());
    openGLLightManager.startLighting(cam);
    __t.render(cam);
    openGLLightManager.stopLighting();
    if (tileLightingEnabled)     deactivateLightsForTile(__t.getTileY(),__t.getTileX(),__t.getTileZ());
  }
}

Fixed version (ground truth):
/** 
 * Renders this node and its children
 * @param cam The camera that is rendering this node.When the camera parameter is null only Camera nodes will render, this is used to have all active cameras render.
 */
@Override public void render(Camera cam){
  for (  TileNode[][] t : tileArray)   for (  TileNode[] _t : t)   for (  TileNode __t : _t) {
    if (tileLightingEnabled) {
      activateLightsForTile(__t.getTileY(),__t.getTileX(),__t.getTileZ());
      openGLLightManager.startLighting(cam);
    }
    __t.render(cam);
    if (tileLightingEnabled) {
      openGLLightManager.stopLighting();
      deactivateLightsForTile(__t.getTileY(),__t.getTileX(),__t.getTileZ());
    }
  }
}
Program: 81629
Project: 81629
Buggy source:
/** 
 * Construct an simple AST representing an entire   {@link CompilationState}. Does not support deferred binding. Implementation mostly copied from  {@link JavaToJavaScriptCompiler}.
 */
public static JProgram construct(TreeLogger logger,final CompilationState state,JJSOptions options) throws UnableToCompleteException {
  InternalCompilerException.preload();
  RebindPermutationOracle rpo=new RebindPermutationOracle(){
    @Override public void clear(){
    }
    @Override public String[] getAllPossibleRebindAnswers(    TreeLogger logger,    String sourceTypeName) throws UnableToCompleteException {
      return new String[0];
    }
    public CompilationState getCompilationState(){
      return state;
    }
    public StandardGeneratorContext getGeneratorContext(){
      return null;
    }
  }
;
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  UnifyAst unifyAst=new UnifyAst(jprogram,jsProgram,options,rpo);
  unifyAst.buildEverything(logger);
  jprogram.typeOracle.computeBeforeAST();
  FixAssignmentToUnbox.exec(jprogram);
  if (options.isEnableAssertions()) {
    AssertionNormalizer.exec(jprogram);
  }
 else {
    AssertionRemover.exec(jprogram);
  }
  if (options.isRunAsyncEnabled()) {
    ReplaceRunAsyncs.exec(logger,jprogram);
  }
  ImplementClassLiteralsAsFields.exec(jprogram);
  return jprogram;
}

Fixed version (ground truth):
/** 
 * Construct an simple AST representing an entire   {@link CompilationState}. Does not support deferred binding. Implementation mostly copied from  {@link JavaToJavaScriptCompiler}.
 */
public static JProgram construct(TreeLogger logger,final CompilationState state,JJSOptions options) throws UnableToCompleteException {
  InternalCompilerException.preload();
  RebindPermutationOracle rpo=new RebindPermutationOracle(){
    @Override public void clear(){
    }
    @Override public String[] getAllPossibleRebindAnswers(    TreeLogger logger,    String sourceTypeName) throws UnableToCompleteException {
      return new String[0];
    }
    public CompilationState getCompilationState(){
      return state;
    }
    public StandardGeneratorContext getGeneratorContext(){
      return null;
    }
  }
;
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  UnifyAst unifyAst=new UnifyAst(logger,jprogram,jsProgram,options,rpo);
  unifyAst.buildEverything();
  jprogram.typeOracle.computeBeforeAST();
  FixAssignmentToUnbox.exec(jprogram);
  if (options.isEnableAssertions()) {
    AssertionNormalizer.exec(jprogram);
  }
 else {
    AssertionRemover.exec(jprogram);
  }
  if (options.isRunAsyncEnabled()) {
    ReplaceRunAsyncs.exec(logger,jprogram);
  }
  ImplementClassLiteralsAsFields.exec(jprogram);
  return jprogram;
}
Program: 81631
Project: 81631
Buggy source:
/** 
 * Special AST construction, useful for tests. Everything is resolved, translated, and unified.
 */
public void buildEverything(TreeLogger logger) throws UnableToCompleteException {
  this.logger=logger;
  for (  String internalName : classFileMap.keySet()) {
    String typeName=InternalName.toBinaryName(internalName);
    searchForTypeByBinary(typeName);
  }
  for (  JDeclaredType type : program.getDeclaredTypes()) {
    instantiate(type);
    for (    JField field : type.getFields()) {
      flowInto(field);
    }
    for (    JMethod method : type.getMethods()) {
      flowInto(method);
    }
  }
  mainLoop();
  computeOverrides();
  if (errorsFound) {
    throw new UnableToCompleteException();
  }
}

Fixed version (ground truth):
/** 
 * Special AST construction, useful for tests. Everything is resolved, translated, and unified.
 */
public void buildEverything() throws UnableToCompleteException {
  for (  String internalName : classFileMap.keySet()) {
    String typeName=InternalName.toBinaryName(internalName);
    searchForTypeByBinary(typeName);
  }
  for (  JDeclaredType type : program.getDeclaredTypes()) {
    instantiate(type);
    for (    JField field : type.getFields()) {
      flowInto(field);
    }
    for (    JMethod method : type.getMethods()) {
      flowInto(method);
    }
  }
  mainLoop();
  computeOverrides();
  if (errorsFound) {
    throw new UnableToCompleteException();
  }
}
Program: 81632
Project: 81632
Buggy source:
public UnifyAst(JProgram program,JsProgram jsProgram,JJSOptions options,RebindPermutationOracle rpo){
  this.program=program;
  this.jsProgram=jsProgram;
  this.options=options;
  this.rpo=rpo;
  this.classFileMap=rpo.getCompilationState().getClassFileMap();
  this.classFileMapBySource=rpo.getCompilationState().getClassFileMapBySource();
}

Fixed version (ground truth):
public UnifyAst(TreeLogger logger,JProgram program,JsProgram jsProgram,JJSOptions options,RebindPermutationOracle rpo){
  this.logger=logger;
  this.program=program;
  this.jsProgram=jsProgram;
  this.options=options;
  this.rpo=rpo;
  this.classFileMap=rpo.getCompilationState().getClassFileMap();
  this.classFileMapBySource=rpo.getCompilationState().getClassFileMapBySource();
}
Program: 81634
Project: 81634
Buggy source:
private Entry<K,V> implFindEntry(Object key,boolean remove){
  for (Iterator<Entry<K,V>> iter=entrySet().iterator(); iter.hasNext(); ) {
    Entry<K,V> entry=iter.next();
    K k=entry.getKey();
    if (key == null ? k == null : key.equals(k)) {
      if (remove) {
        iter.remove();
      }
      return entry;
    }
  }
  return null;
}

Fixed version (ground truth):
private Entry<K,V> implFindEntry(Object key,boolean remove){
  for (Iterator<Entry<K,V>> iter=entrySet().iterator(); iter.hasNext(); ) {
    Entry<K,V> entry=iter.next();
    K k=entry.getKey();
    if (key == null ? k == null : key.equals(k)) {
      if (remove) {
        entry=new MapEntryImpl<K,V>(entry.getKey(),entry.getValue());
        iter.remove();
      }
      return entry;
    }
  }
  return null;
}
Program: 81637
Project: 81637
Buggy source:
@Override public boolean hasSideEffects(){
  return false;
}

Fixed version (ground truth):
@Override public boolean hasSideEffects(){
  return expr.hasSideEffects();
}
Program: 81638
Project: 81638
Buggy source:
@Override protected boolean optimizeMethod(JProgram program,JMethod method){
  MethodCallTightener.exec(program);
  OptimizerStats result=DeadCodeElimination.exec(program,method);
  if (result.didChange()) {
    assertFalse(DeadCodeElimination.exec(program,method).didChange());
  }
  return result.didChange();
}

Fixed version (ground truth):
@Override protected boolean optimizeMethod(JProgram program,JMethod method){
  MethodCallTightener.exec(program);
  if (runMethodInliner) {
    MethodInliner.exec(program);
  }
  OptimizerStats result=DeadCodeElimination.exec(program,method);
  if (result.didChange()) {
    assertFalse(DeadCodeElimination.exec(program,method).didChange());
  }
  return result.didChange();
}
Program: 81639
Project: 81639
Buggy source:
@Override public void setUp() throws Exception {
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
}

Fixed version (ground truth):
@Override public void setUp() throws Exception {
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  runMethodInliner=false;
}
Program: 81640
Project: 81640
Buggy source:
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}

Fixed version (ground truth):
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
  JType leafType=array.getLeafType();
  JWildcardType leafWild=leafType.isWildcard();
  if (leafWild != null) {
    JArrayType arrayType=getArrayType(typeOracle,array.getRank(),leafWild.getUpperBound());
    return checkArrayInstantiable(logger,arrayType,path,problems);
  }
  TypeInfoComputed tic=ensureTypeInfoComputed(array,path);
  if (tic.isDone() || tic.isPendingInstantiable()) {
    return tic;
  }
  tic.setPendingInstantiable();
  JTypeParameter isLeafTypeParameter=leafType.isTypeParameter();
  if (isLeafTypeParameter != null && !typeParametersInRootTypes.contains(isLeafTypeParameter)) {
    tic.setInstantiableSubtypes(true);
    tic.setInstantiable(false);
    return tic;
  }
  if (!isAllowedByFilter(array,problems)) {
    tic.setInstantiable(false);
    return tic;
  }
  TreeLogger branch=logger.branch(TreeLogger.DEBUG,"String_Node_Str",null);
  TypeInfoComputed leafTic=computeTypeInstantiability(branch,leafType,TypePaths.createArrayComponentPath(array,path),problems);
  boolean succeeded=leafTic.hasInstantiableSubtypes();
  tic.setInstantiable(succeeded);
  return tic;
}
Program: 81642
Project: 81642
Buggy source:
public CfgOptionalThrowNode(CfgNode<?> parent,JMethodCall node){
  super(parent,node);
}

Fixed version (ground truth):
public CfgOptionalThrowNode(CfgNode<?> parent,JExpression node){
  super(parent,node);
}
Program: 81643
Project: 81643
Buggy source:
@Override public String toDebugString(){
  return "String_Node_Str" + getJNode().getTarget().getName() + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toDebugString(){
  if (getJNode() instanceof JMethodCall) {
    return "String_Node_Str" + ((JMethodCall)getJNode()).getTarget().getName() + "String_Node_Str";
  }
  return "String_Node_Str" + getJNode().toSource() + "String_Node_Str";
}
Program: 81646
Project: 81646
Buggy source:
static String extractNameFromToString(String fnToString){
  String toReturn="String_Node_Str";
  fnToString=fnToString.trim();
  int index=fnToString.indexOf("String_Node_Str");
  if (index != -1) {
    int start=fnToString.startsWith("String_Node_Str") ? 8 : 0;
    toReturn=fnToString.substring(start,index).trim();
  }
  return toReturn.length() > 0 ? toReturn : "String_Node_Str";
}

Fixed version (ground truth):
static String extractNameFromToString(String fnToString){
  String toReturn="String_Node_Str";
  fnToString=fnToString.trim();
  int index=fnToString.indexOf("String_Node_Str");
  int start=fnToString.startsWith("String_Node_Str") ? 8 : 0;
  if (index == -1) {
    index=fnToString.indexOf('@');
    start=fnToString.startsWith("String_Node_Str") ? 9 : 0;
  }
  if (index != -1) {
    toReturn=fnToString.substring(start,index).trim();
  }
  return toReturn.length() > 0 ? toReturn : "String_Node_Str";
}