nus-yam/ex-repair huggingface dataset:
Program: 52345
Project: 52345
Buggy source:
/** 
 * Find the list of the IDs of all users a user has permission to. The access type is defined by permissionType.
 * @param userID The ID of the user to check.
 * @param permissionType The type of permission to check for.
 * @return A list of all user IDs this user has the specified access to.
 */
public List<Integer> retrieveUserIDs(int userID,String permissionType){
  if (checkSystemAdministratorAccess(userID)) {
    return userService.getAllUserIDs();
  }
  UserPermissionExample example=new UserPermissionExample();
  example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType);
  example.setDistinct(true);
  List<UserPermissionKey> userPermissions=userPermissionDAO.selectByExample(example);
  List<Integer> userIDs=new ArrayList<Integer>(userPermissions.size());
  for (  UserPermissionKey permission : userPermissions)   userIDs.add(permission.getAffected_user_id());
  return userIDs;
}

Fixed version (ground truth):
/** 
 * Find the list of the IDs of all users a user has permission to. The access type is defined by permissionType.
 * @param userID The ID of the user to check.
 * @param permissionType The type of permission to check for.
 * @return A list of all user IDs this user has the specified access to.
 */
public List<Integer> retrieveUserIDs(int userID,String permissionType){
  if (checkSystemAdministratorAccess(userID))   return userService.getAllUserIDs();
  UserPermissionExample example=new UserPermissionExample();
  example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType);
  example.setDistinct(true);
  List<UserPermissionKey> userPermissions=userPermissionDAO.selectByExample(example);
  List<Integer> userIDs=new ArrayList<Integer>(userPermissions.size());
  for (  UserPermissionKey permission : userPermissions)   userIDs.add(permission.getAffected_user_id());
  return userIDs;
}
Program: 52346
Project: 52346
Buggy source:
/** 
 * Retrieves a map of all usernames for the given IDs.
 * @param ids The IDs of the users to retrieve the usernames of.
 * @return A map containing the names of all users and their correspondingIDs.
 */
public Map<Integer,String> retrieveUsernames(Collection<Integer> ids){
  if (ids.isEmpty())   return Collections.EMPTY_MAP;
  Map<Integer,String> names=new HashMap<Integer,String>();
  UserExample example=new UserExample();
  example.createCriteria().andUser_idIn(Lists.newArrayList(ids));
  List<net.sourceforge.guacamole.net.auth.mysql.model.User> users=userDAO.selectByExample(example);
  for (  net.sourceforge.guacamole.net.auth.mysql.model.User user : users)   names.put(user.getUser_id(),user.getUsername());
  return names;
}

Fixed version (ground truth):
/** 
 * Retrieves a map of all usernames for the given IDs.
 * @param ids The IDs of the users to retrieve the usernames of.
 * @return A map containing the names of all users and their correspondingIDs.
 */
public Map<Integer,String> retrieveUsernames(Collection<Integer> ids){
  if (ids.isEmpty())   return Collections.EMPTY_MAP;
  Map<Integer,String> names=new HashMap<Integer,String>();
  UserExample example=new UserExample();
  example.createCriteria().andUser_idIn(Lists.newArrayList(ids));
  List<User> users=userDAO.selectByExample(example);
  for (  User user : users)   names.put(user.getUser_id(),user.getUsername());
  return names;
}
Program: 52347
Project: 52347
Buggy source:
/** 
 * Retrieves a translation map of usernames to their corresponding IDs.
 * @param ids The IDs of the users to retrieve the usernames of.
 * @return A map containing the names of all users and their correspondingIDs.
 */
public Map<String,Integer> translateUsernames(List<Integer> ids){
  if (ids.isEmpty())   return Collections.EMPTY_MAP;
  Map<String,Integer> names=new HashMap<String,Integer>();
  UserExample example=new UserExample();
  example.createCriteria().andUser_idIn(ids);
  List<net.sourceforge.guacamole.net.auth.mysql.model.User> users=userDAO.selectByExample(example);
  for (  net.sourceforge.guacamole.net.auth.mysql.model.User user : users)   names.put(user.getUsername(),user.getUser_id());
  return names;
}

Fixed version (ground truth):
/** 
 * Retrieves a translation map of usernames to their corresponding IDs.
 * @param ids The IDs of the users to retrieve the usernames of.
 * @return A map containing the names of all users and their correspondingIDs.
 */
public Map<String,Integer> translateUsernames(List<Integer> ids){
  if (ids.isEmpty())   return Collections.EMPTY_MAP;
  Map<String,Integer> names=new HashMap<String,Integer>();
  UserExample example=new UserExample();
  example.createCriteria().andUser_idIn(ids);
  List<User> users=userDAO.selectByExample(example);
  for (  User user : users)   names.put(user.getUsername(),user.getUser_id());
  return names;
}
Program: 52348
Project: 52348
Buggy source:
/** 
 * Get the IDs of all the user defined in the system.
 * @return A list of IDs of all the users defined in the system.
 */
public List<Integer> getAllUserIDs(){
  List<Integer> userIDs=new ArrayList<Integer>();
  for (  MySQLUser user : getAllUsers()) {
    userIDs.add(user.getUserID());
  }
  return userIDs;
}

Fixed version (ground truth):
/** 
 * Get the user IDs of all the users defined in the system.
 * @return A list of user IDs of all the users defined in the system.
 */
public List<Integer> getAllUserIDs(){
  List<Integer> userIDs=new ArrayList<Integer>();
  List<User> users=userDAO.selectByExample(new UserExample());
  for (  User user : users)   userIDs.add(user.getUser_id());
  return userIDs;
}
Program: 52349
Project: 52349
Buggy source:
/** 
 * Produces a String containing the bytes provided in hexadecimal notation.
 * @param bytes The bytes to convert into hex.
 * @return A String containing the hex representation of the given bytes.
 */
private static String getHexString(byte[] bytes){
  if (bytes == null)   return null;
  StringBuilder hex=new StringBuilder(2 * bytes.length);
  for (  byte b : bytes) {
    hex.append(HEX_CHARS[(b & 0xF0) >> 4]).append(HEX_CHARS[(b & 0x0F)]);
  }
  return hex.toString();
}

Fixed version (ground truth):
/** 
 * Produces a String containing the bytes provided in hexadecimal notation.
 * @param bytes The bytes to convert into hex.
 * @return A String containing the hex representation of the given bytes.
 */
private static String getHexString(byte[] bytes){
  if (bytes == null)   return null;
  StringBuilder hex=new StringBuilder(2 * bytes.length);
  for (  byte b : bytes) {
    hex.append(HEX_CHARS[(b & 0xF0) >> 4]).append(HEX_CHARS[b & 0x0F]);
  }
  return hex.toString();
}
Program: 52350
Project: 52350
Buggy source:
@Override public GuacamoleInstruction readInstruction() throws GuacamoleException {
  char[] instructionBuffer=read();
  if (instructionBuffer == null)   return null;
  int elementStart=0;
  LinkedList<String> elements=new LinkedList<String>();
  while (elementStart < instructionBuffer.length) {
    int lengthEnd=-1;
    for (int i=elementStart; i < instructionBuffer.length; i++) {
      if (instructionBuffer[i] == '.') {
        lengthEnd=i;
        break;
      }
    }
    if (lengthEnd == -1)     throw new GuacamoleServerException("String_Node_Str");
    int length=Integer.parseInt(new String(instructionBuffer,elementStart,lengthEnd - elementStart));
    elementStart=lengthEnd + 1;
    String element=new String(instructionBuffer,elementStart,length);
    elements.addLast(element);
    elementStart+=length;
    char terminator=instructionBuffer[elementStart];
    elementStart++;
    if (terminator == ';')     break;
  }
  String opcode=elements.removeFirst();
  GuacamoleInstruction instruction=new GuacamoleInstruction(opcode,elements.toArray(new String[elements.size()]));
  return instruction;
}

Fixed version (ground truth):
@Override public GuacamoleInstruction readInstruction() throws GuacamoleException {
  char[] instructionBuffer=read();
  if (instructionBuffer == null)   return null;
  int elementStart=0;
  Deque<String> elements=new LinkedList<String>();
  while (elementStart < instructionBuffer.length) {
    int lengthEnd=-1;
    for (int i=elementStart; i < instructionBuffer.length; i++) {
      if (instructionBuffer[i] == '.') {
        lengthEnd=i;
        break;
      }
    }
    if (lengthEnd == -1)     throw new GuacamoleServerException("String_Node_Str");
    int length=Integer.parseInt(new String(instructionBuffer,elementStart,lengthEnd - elementStart));
    elementStart=lengthEnd + 1;
    String element=new String(instructionBuffer,elementStart,length);
    elements.addLast(element);
    elementStart+=length;
    char terminator=instructionBuffer[elementStart];
    elementStart++;
    if (terminator == ';')     break;
  }
  String opcode=elements.removeFirst();
  GuacamoleInstruction instruction=new GuacamoleInstruction(opcode,elements.toArray(new String[elements.size()]));
  return instruction;
}
Program: 52351
Project: 52351
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  final UserPermission other=(UserPermission)obj;
  if (this.type != other.type)   return false;
  if (identifier == null)   return other.identifier != null;
  return identifier.equals(other.identifier);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  final UserPermission other=(UserPermission)obj;
  if (this.type != other.type)   return false;
  if (identifier == null)   return other.identifier == null;
  return identifier.equals(other.identifier);
}
Program: 52352
Project: 52352
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  final ConnectionPermission other=(ConnectionPermission)obj;
  if (this.type != other.type)   return false;
  if (identifier == null)   return other.identifier != null;
  return identifier.equals(other.identifier);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  final ConnectionPermission other=(ConnectionPermission)obj;
  if (this.type != other.type)   return false;
  if (identifier == null)   return other.identifier == null;
  return identifier.equals(other.identifier);
}
Program: 52353
Project: 52353
Buggy source:
@Override protected Class<?> findClass(String name) throws ClassNotFoundException {
  if (classLoader == null)   return super.findClass(name);
  return classLoader.loadClass(name);
}

Fixed version (ground truth):
@Override protected Class<?> findClass(String name) throws ClassNotFoundException {
  if (classLoader == null)   return Class.forName(name);
  return classLoader.loadClass(name);
}
Program: 52354
Project: 52354
Buggy source:
@Override public File parseValue(String value) throws GuacamoleException {
  return new File(value);
}

Fixed version (ground truth):
@Override public File parseValue(String value) throws GuacamoleException {
  if (value != null)   return new File(value);
 else   return null;
}
Program: 52355
Project: 52355
Buggy source:
@Override public char[] read() throws GuacamoleException {
  try {
    for (; ; ) {
      if (usedLength > buffer.length / 2) {
        char[] biggerBuffer=new char[buffer.length * 2];
        System.arraycopy(buffer,0,biggerBuffer,0,usedLength);
        buffer=biggerBuffer;
      }
      int numRead=input.read(buffer,usedLength,buffer.length - usedLength);
      if (numRead == -1)       return null;
      int prevLength=usedLength;
      usedLength+=numRead;
      for (int i=usedLength - 1; i >= prevLength; i--) {
        char readChar=buffer[i];
        if (readChar == ';') {
          char[] chunk=new char[i + 1];
          System.arraycopy(buffer,0,chunk,0,i + 1);
          usedLength-=i + 1;
          System.arraycopy(buffer,i + 1,buffer,0,usedLength);
          return chunk;
        }
      }
    }
  }
 catch (  IOException e) {
    throw new GuacamoleException(e);
  }
}

Fixed version (ground truth):
@Override public char[] read() throws GuacamoleException {
  if (instructionBuffer != null) {
    char[] chunk=new char[instructionBuffer.length - instructionStart];
    System.arraycopy(instructionBuffer,instructionStart,chunk,0,chunk.length);
    instructionBuffer=null;
    return chunk;
  }
  try {
    for (; ; ) {
      if (usedLength > buffer.length / 2) {
        char[] biggerBuffer=new char[buffer.length * 2];
        System.arraycopy(buffer,0,biggerBuffer,0,usedLength);
        buffer=biggerBuffer;
      }
      int numRead=input.read(buffer,usedLength,buffer.length - usedLength);
      if (numRead == -1)       return null;
      int prevLength=usedLength;
      usedLength+=numRead;
      for (int i=usedLength - 1; i >= prevLength; i--) {
        char readChar=buffer[i];
        if (readChar == ';') {
          char[] chunk=new char[i + 1];
          System.arraycopy(buffer,0,chunk,0,i + 1);
          usedLength-=i + 1;
          System.arraycopy(buffer,i + 1,buffer,0,usedLength);
          return chunk;
        }
      }
    }
  }
 catch (  IOException e) {
    throw new GuacamoleException(e);
  }
}
Program: 52356
Project: 52356
Buggy source:
protected void doWrite(HttpServletRequest request,HttpServletResponse response) throws GuacamoleException {
  HttpSession httpSession=request.getSession(false);
  GuacamoleSession session=new GuacamoleSession(httpSession);
  try {
    Reader input=request.getReader();
    char[] buffer=new char[8192];
    int length;
    while ((length=input.read(buffer,0,buffer.length)) != -1)     session.getClient().write(buffer,0,length);
  }
 catch (  IOException e) {
    throw new GuacamoleException("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected void doWrite(HttpServletRequest request,HttpServletResponse response) throws GuacamoleException {
  HttpSession httpSession=request.getSession(false);
  GuacamoleSession session=new GuacamoleSession(httpSession);
  response.setContentType("String_Node_Str");
  response.setContentLength(0);
  try {
    Reader input=request.getReader();
    char[] buffer=new char[8192];
    int length;
    while ((length=input.read(buffer,0,buffer.length)) != -1)     session.getClient().write(buffer,0,length);
  }
 catch (  IOException e) {
    throw new GuacamoleException("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 52357
Project: 52357
Buggy source:
@Override protected void handleRequest(GuacamoleSession session,HttpServletRequest request,HttpServletResponse response) throws GuacamoleException {
  ReentrantLock instructionStreamLock=session.getInstructionStreamLock();
  instructionStreamLock.lock();
  try {
    response.setContentType("String_Node_Str");
    Writer out=response.getWriter();
    try {
      Client client=session.getClient();
      char[] message;
      while ((message=client.read()) != null) {
        out.write(message,0,message.length);
        out.flush();
        response.flushBuffer();
        if (instructionStreamLock.hasQueuedThreads())         break;
      }
    }
 catch (    GuacamoleException e) {
      out.write("String_Node_Str" + e.getMessage() + "String_Node_Str");
      out.flush();
      response.flushBuffer();
    }
    out.write(';');
    out.flush();
    response.flushBuffer();
  }
 catch (  UnsupportedEncodingException e) {
    throw new GuacamoleException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new GuacamoleException("String_Node_Str",e);
  }
 finally {
    instructionStreamLock.unlock();
  }
}

Fixed version (ground truth):
@Override protected void handleRequest(GuacamoleSession session,HttpServletRequest request,HttpServletResponse response) throws GuacamoleException {
  ReentrantLock instructionStreamLock=session.getInstructionStreamLock();
  instructionStreamLock.lock();
  try {
    response.setContentType("String_Node_Str");
    Writer out=response.getWriter();
    try {
      Client client=session.getClient();
      char[] message;
      while ((message=client.read()) != null) {
        out.write(message,0,message.length);
        out.flush();
        response.flushBuffer();
        if (instructionStreamLock.hasQueuedThreads())         break;
      }
      if (message == null) {
        session.disconnect();
        throw new GuacamoleException("String_Node_Str");
      }
    }
 catch (    GuacamoleException e) {
      out.write("String_Node_Str" + e.getMessage() + "String_Node_Str");
      out.flush();
      response.flushBuffer();
    }
    out.write(';');
    out.flush();
    response.flushBuffer();
  }
 catch (  UnsupportedEncodingException e) {
    throw new GuacamoleException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new GuacamoleException("String_Node_Str",e);
  }
 finally {
    instructionStreamLock.unlock();
  }
}
Program: 52358
Project: 52358
Buggy source:
public Instruction nextInstruction(boolean blocking) throws GuacamoleException {
  try {
    while (blocking || input.ready()) {
      if (usedLength > buffer.length / 2) {
        char[] newbuffer=new char[buffer.length * 2];
        System.arraycopy(newbuffer,0,buffer,0,usedLength);
        buffer=newbuffer;
      }
      int numRead=input.read(buffer,usedLength,buffer.length - usedLength);
      if (numRead == -1)       return null;
      int prevLength=usedLength;
      usedLength+=numRead;
      for (int i=usedLength - 1; i >= prevLength; i--) {
        char readChar=buffer[i];
        if (readChar == ';') {
          final String instruction=new String(buffer,0,i + 1);
          usedLength-=i + 1;
          System.arraycopy(buffer,i + 1,buffer,0,usedLength);
          return new Instruction(){
            public String toString(){
              return instruction;
            }
          }
;
        }
      }
    }
  }
 catch (  IOException e) {
    throw new GuacamoleException(e);
  }
  return null;
}

Fixed version (ground truth):
public Instruction nextInstruction(boolean blocking) throws GuacamoleException {
  try {
    do {
      if (usedLength > buffer.length / 2) {
        char[] biggerBuffer=new char[buffer.length * 2];
        System.arraycopy(buffer,0,biggerBuffer,0,usedLength);
        buffer=biggerBuffer;
      }
      int numRead=input.read(buffer,usedLength,buffer.length - usedLength);
      if (numRead == -1)       return null;
      int prevLength=usedLength;
      usedLength+=numRead;
      for (int i=usedLength - 1; i >= prevLength; i--) {
        char readChar=buffer[i];
        if (readChar == ';') {
          final String instruction=new String(buffer,0,i + 1);
          usedLength-=i + 1;
          System.arraycopy(buffer,i + 1,buffer,0,usedLength);
          return new Instruction(){
            public String toString(){
              return instruction;
            }
          }
;
        }
      }
    }
 while (input.ready());
  }
 catch (  IOException e) {
    throw new GuacamoleException(e);
  }
  return null;
}
Program: 52363
Project: 52363
Buggy source:
public void performTest() throws Exception {
  PGPPublicKeyRing pubKeyRing=new PGPPublicKeyRing(testPubKey,new JcaKeyFingerprintCalculator());
  doBasicKeyRingCheck(pubKeyRing);
  PGPSecretKeyRing secretKeyRing=new PGPSecretKeyRing(testPrivKey,new JcaKeyFingerprintCalculator());
  testDecrypt(secretKeyRing);
  encryptDecryptTest();
  encryptDecryptBCTest();
  generate();
}

Fixed version (ground truth):
public void performTest() throws Exception {
  PGPPublicKeyRing pubKeyRing=new PGPPublicKeyRing(testPubKey,new JcaKeyFingerprintCalculator());
  doBasicKeyRingCheck(pubKeyRing);
  PGPSecretKeyRing secretKeyRing=new PGPSecretKeyRing(testPrivKey,new JcaKeyFingerprintCalculator());
  testDecrypt(secretKeyRing);
  encryptDecryptTest();
  encryptDecryptBCTest("String_Node_Str");
  encryptDecryptBCTest("String_Node_Str");
  generate();
}
Program: 52364
Project: 52364
Buggy source:
public static String getCurveName(ASN1ObjectIdentifier oid){
  String name=X962NamedCurves.getName(oid);
  if (name == null) {
    name=SECNamedCurves.getName(oid);
    if (name == null) {
      name=NISTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=TeleTrusTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECGOST3410NamedCurves.getName(oid);
    }
    if (name == null) {
      name=ANSSINamedCurves.getName(oid);
    }
    if (name == null) {
      name=GMNamedCurves.getName(oid);
    }
  }
  return name;
}

Fixed version (ground truth):
public static String getCurveName(ASN1ObjectIdentifier oid){
  String name=X962NamedCurves.getName(oid);
  if (name == null) {
    name=SECNamedCurves.getName(oid);
    if (name == null) {
      name=NISTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=TeleTrusTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECGOST3410NamedCurves.getName(oid);
    }
    if (name == null) {
      name=ANSSINamedCurves.getName(oid);
    }
    if (name == null) {
      name=GMNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECNamedCurveTable.getName(oid);
    }
  }
  return name;
}
Program: 52365
Project: 52365
Buggy source:
public static X9ECParameters getNamedCurveByOid(ASN1ObjectIdentifier oid){
  X9ECParameters params=CustomNamedCurves.getByOID(oid);
  if (params == null) {
    params=X962NamedCurves.getByOID(oid);
    if (params == null) {
      params=SECNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=NISTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=GMNamedCurves.getByOID(oid);
    }
  }
  return params;
}

Fixed version (ground truth):
public static X9ECParameters getNamedCurveByOid(ASN1ObjectIdentifier oid){
  X9ECParameters params=CustomNamedCurves.getByOID(oid);
  if (params == null) {
    params=X962NamedCurves.getByOID(oid);
    if (params == null) {
      params=SECNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=NISTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=GMNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ECNamedCurveTable.getByOID(oid);
    }
  }
  return params;
}
Program: 52366
Project: 52366
Buggy source:
public static X9ECParameters getNamedCurveByName(String curveName){
  X9ECParameters params=CustomNamedCurves.getByName(curveName);
  if (params == null) {
    params=X962NamedCurves.getByName(curveName);
    if (params == null) {
      params=SECNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=NISTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=GMNamedCurves.getByName(curveName);
    }
  }
  return params;
}

Fixed version (ground truth):
public static X9ECParameters getNamedCurveByName(String curveName){
  X9ECParameters params=CustomNamedCurves.getByName(curveName);
  if (params == null) {
    params=X962NamedCurves.getByName(curveName);
    if (params == null) {
      params=SECNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=NISTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=GMNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ECNamedCurveTable.getByName(curveName);
    }
  }
  return params;
}
Program: 52367
Project: 52367
Buggy source:
private static ASN1ObjectIdentifier lookupOidByName(String name){
  ASN1ObjectIdentifier oid=X962NamedCurves.getOID(name);
  if (oid == null) {
    oid=SECNamedCurves.getOID(name);
    if (oid == null) {
      oid=NISTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=TeleTrusTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECGOST3410NamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ANSSINamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=GMNamedCurves.getOID(name);
    }
  }
  return oid;
}

Fixed version (ground truth):
private static ASN1ObjectIdentifier lookupOidByName(String name){
  ASN1ObjectIdentifier oid=X962NamedCurves.getOID(name);
  if (oid == null) {
    oid=SECNamedCurves.getOID(name);
    if (oid == null) {
      oid=NISTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=TeleTrusTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECGOST3410NamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ANSSINamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=GMNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECNamedCurveTable.getOID(name);
    }
  }
  return oid;
}
Program: 52372
Project: 52372
Buggy source:
public void performTest() throws Exception {
  PGPPublicKeyRing pubKeyRing=new PGPPublicKeyRing(testPubKey,new JcaKeyFingerprintCalculator());
  doBasicKeyRingCheck(pubKeyRing);
  PGPSecretKeyRing secretKeyRing=new PGPSecretKeyRing(testPrivKey,new JcaKeyFingerprintCalculator());
  testDecrypt(secretKeyRing);
  encryptDecryptTest();
  encryptDecryptBCTest();
  generate();
}

Fixed version (ground truth):
public void performTest() throws Exception {
  PGPPublicKeyRing pubKeyRing=new PGPPublicKeyRing(testPubKey,new JcaKeyFingerprintCalculator());
  doBasicKeyRingCheck(pubKeyRing);
  PGPSecretKeyRing secretKeyRing=new PGPSecretKeyRing(testPrivKey,new JcaKeyFingerprintCalculator());
  testDecrypt(secretKeyRing);
  encryptDecryptTest();
  encryptDecryptBCTest("String_Node_Str");
  encryptDecryptBCTest("String_Node_Str");
  generate();
}
Program: 52373
Project: 52373
Buggy source:
public static String getCurveName(ASN1ObjectIdentifier oid){
  String name=X962NamedCurves.getName(oid);
  if (name == null) {
    name=SECNamedCurves.getName(oid);
    if (name == null) {
      name=NISTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=TeleTrusTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECGOST3410NamedCurves.getName(oid);
    }
    if (name == null) {
      name=ANSSINamedCurves.getName(oid);
    }
    if (name == null) {
      name=GMNamedCurves.getName(oid);
    }
  }
  return name;
}

Fixed version (ground truth):
public static String getCurveName(ASN1ObjectIdentifier oid){
  String name=X962NamedCurves.getName(oid);
  if (name == null) {
    name=SECNamedCurves.getName(oid);
    if (name == null) {
      name=NISTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=TeleTrusTNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECGOST3410NamedCurves.getName(oid);
    }
    if (name == null) {
      name=ANSSINamedCurves.getName(oid);
    }
    if (name == null) {
      name=GMNamedCurves.getName(oid);
    }
    if (name == null) {
      name=ECNamedCurveTable.getName(oid);
    }
  }
  return name;
}
Program: 52374
Project: 52374
Buggy source:
public static X9ECParameters getNamedCurveByOid(ASN1ObjectIdentifier oid){
  X9ECParameters params=CustomNamedCurves.getByOID(oid);
  if (params == null) {
    params=X962NamedCurves.getByOID(oid);
    if (params == null) {
      params=SECNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=NISTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=GMNamedCurves.getByOID(oid);
    }
  }
  return params;
}

Fixed version (ground truth):
public static X9ECParameters getNamedCurveByOid(ASN1ObjectIdentifier oid){
  X9ECParameters params=CustomNamedCurves.getByOID(oid);
  if (params == null) {
    params=X962NamedCurves.getByOID(oid);
    if (params == null) {
      params=SECNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=NISTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=GMNamedCurves.getByOID(oid);
    }
    if (params == null) {
      params=ECNamedCurveTable.getByOID(oid);
    }
  }
  return params;
}
Program: 52375
Project: 52375
Buggy source:
public static X9ECParameters getNamedCurveByName(String curveName){
  X9ECParameters params=CustomNamedCurves.getByName(curveName);
  if (params == null) {
    params=X962NamedCurves.getByName(curveName);
    if (params == null) {
      params=SECNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=NISTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=GMNamedCurves.getByName(curveName);
    }
  }
  return params;
}

Fixed version (ground truth):
public static X9ECParameters getNamedCurveByName(String curveName){
  X9ECParameters params=CustomNamedCurves.getByName(curveName);
  if (params == null) {
    params=X962NamedCurves.getByName(curveName);
    if (params == null) {
      params=SECNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=NISTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=TeleTrusTNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ANSSINamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=GMNamedCurves.getByName(curveName);
    }
    if (params == null) {
      params=ECNamedCurveTable.getByName(curveName);
    }
  }
  return params;
}
Program: 52376
Project: 52376
Buggy source:
private static ASN1ObjectIdentifier lookupOidByName(String name){
  ASN1ObjectIdentifier oid=X962NamedCurves.getOID(name);
  if (oid == null) {
    oid=SECNamedCurves.getOID(name);
    if (oid == null) {
      oid=NISTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=TeleTrusTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECGOST3410NamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ANSSINamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=GMNamedCurves.getOID(name);
    }
  }
  return oid;
}

Fixed version (ground truth):
private static ASN1ObjectIdentifier lookupOidByName(String name){
  ASN1ObjectIdentifier oid=X962NamedCurves.getOID(name);
  if (oid == null) {
    oid=SECNamedCurves.getOID(name);
    if (oid == null) {
      oid=NISTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=TeleTrusTNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECGOST3410NamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ANSSINamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=GMNamedCurves.getOID(name);
    }
    if (oid == null) {
      oid=ECNamedCurveTable.getOID(name);
    }
  }
  return oid;
}
Program: 52377
Project: 52377
Buggy source:
public static boolean isValidNameMatch(String name,String dnsName,Set<String> suffixes) throws IOException {
  if (dnsName.contains("String_Node_Str")) {
    int wildIndex=dnsName.indexOf('*');
    if (wildIndex == dnsName.lastIndexOf("String_Node_Str")) {
      if (dnsName.contains("String_Node_Str") || dnsName.charAt(dnsName.length() - 1) == '*') {
        return false;
      }
      int dnsDotIndex=dnsName.indexOf('.',wildIndex);
      if (suffixes != null && suffixes.contains(Strings.toLowerCase(dnsName.substring(dnsDotIndex)))) {
        throw new IOException("String_Node_Str" + dnsName + "String_Node_Str");
      }
      String end=Strings.toLowerCase(dnsName.substring(wildIndex + 1));
      String loweredName=Strings.toLowerCase(name);
      if (loweredName.equals(end)) {
        return false;
      }
      if (end.length() > loweredName.length()) {
        return false;
      }
      if (wildIndex > 0) {
        if (loweredName.startsWith(dnsName.substring(0,wildIndex - 1)) && loweredName.endsWith(end)) {
          return loweredName.substring(wildIndex,loweredName.length() - end.length()).indexOf('.') < 0;
        }
 else {
          return false;
        }
      }
      String prefix=loweredName.substring(0,loweredName.length() - end.length());
      if (prefix.indexOf('.') > 0) {
        return false;
      }
      return loweredName.endsWith(end);
    }
    return false;
  }
  return name.equalsIgnoreCase(dnsName);
}

Fixed version (ground truth):
public static boolean isValidNameMatch(String name,String dnsName,Set<String> suffixes) throws IOException {
  if (dnsName.contains("String_Node_Str")) {
    int wildIndex=dnsName.indexOf('*');
    if (wildIndex == dnsName.lastIndexOf("String_Node_Str")) {
      if (dnsName.contains("String_Node_Str") || dnsName.charAt(dnsName.length() - 1) == '*') {
        return false;
      }
      int dnsDotIndex=dnsName.indexOf('.',wildIndex);
      if (suffixes != null && suffixes.contains(Strings.toLowerCase(dnsName.substring(dnsDotIndex)))) {
        throw new IOException("String_Node_Str" + dnsName + "String_Node_Str");
      }
      String end=Strings.toLowerCase(dnsName.substring(wildIndex + 1));
      String loweredName=Strings.toLowerCase(name);
      if (loweredName.equals(end)) {
        return false;
      }
      if (end.length() > loweredName.length()) {
        return false;
      }
      if (wildIndex > 0) {
        if (loweredName.startsWith(dnsName.substring(0,wildIndex)) && loweredName.endsWith(end)) {
          return loweredName.substring(wildIndex,loweredName.length() - end.length()).indexOf('.') < 0;
        }
 else {
          return false;
        }
      }
      String prefix=loweredName.substring(0,loweredName.length() - end.length());
      if (prefix.indexOf('.') > 0) {
        return false;
      }
      return loweredName.endsWith(end);
    }
    return false;
  }
  return name.equalsIgnoreCase(dnsName);
}
Program: 52378
Project: 52378
Buggy source:
public void testWildcardMatcher() throws Exception {
  Object[][] v=new Object[][]{{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false}};
  for (  Object[] j : v) {
    assertEquals(j[0].toString(),j[3],JsseDefaultHostnameAuthorizer.isValidNameMatch((String)j[1],(String)j[2],null));
  }
}

Fixed version (ground truth):
public void testWildcardMatcher() throws Exception {
  Object[][] v=new Object[][]{{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",false},{"String_Node_Str","String_Node_Str","String_Node_Str",true}};
  for (  Object[] j : v) {
    assertEquals(j[0].toString(),j[3],JsseDefaultHostnameAuthorizer.isValidNameMatch((String)j[1],(String)j[2],null));
  }
}
Program: 52379
Project: 52379
Buggy source:
private byte[] decrypt(byte[] in,int inOff,int inLen) throws InvalidCipherTextException {
  byte[] c1=new byte[curveLength * 2 + 1];
  System.arraycopy(in,inOff,c1,0,c1.length);
  ECPoint c1P=ecParams.getCurve().decodePoint(c1);
  ECPoint s=c1P.multiply(ecParams.getH());
  if (s.isInfinity()) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  c1P=c1P.multiply(((ECPrivateKeyParameters)ecKey).getD()).normalize();
  byte[] c2=new byte[inLen - c1.length - digest.getDigestSize()];
  System.arraycopy(in,inOff + c1.length,c2,0,c2.length);
  kdf(digest,c1P,c2);
  byte[] c3=new byte[digest.getDigestSize()];
  addFieldElement(digest,c1P.getAffineXCoord());
  digest.update(c2,0,c2.length);
  addFieldElement(digest,c1P.getAffineYCoord());
  digest.doFinal(c3,0);
  int check=0;
  for (int i=0; i != c3.length; i++) {
    check|=c3[i] ^ in[c1.length + c2.length + i];
  }
  Arrays.fill(c1,(byte)0);
  Arrays.fill(c3,(byte)0);
  if (check != 0) {
    Arrays.fill(c2,(byte)0);
    throw new InvalidCipherTextException("String_Node_Str");
  }
  return c2;
}

Fixed version (ground truth):
private byte[] decrypt(byte[] in,int inOff,int inLen) throws InvalidCipherTextException {
  byte[] c1=new byte[curveLength * 2 + 1];
  System.arraycopy(in,inOff,c1,0,c1.length);
  ECPoint c1P=ecParams.getCurve().decodePoint(c1);
  ECPoint s=c1P.multiply(ecParams.getH());
  if (s.isInfinity()) {
    throw new InvalidCipherTextException("String_Node_Str");
  }
  c1P=c1P.multiply(((ECPrivateKeyParameters)ecKey).getD()).normalize();
  byte[] c2=new byte[inLen - c1.length - digest.getDigestSize()];
  System.arraycopy(in,inOff + c1.length,c2,0,c2.length);
  kdf(digest,c1P,c2);
  byte[] c3=new byte[digest.getDigestSize()];
  addFieldElement(digest,c1P.getAffineXCoord());
  digest.update(c2,0,c2.length);
  addFieldElement(digest,c1P.getAffineYCoord());
  digest.doFinal(c3,0);
  int check=0;
  for (int i=0; i != c3.length; i++) {
    check|=c3[i] ^ in[inOff + c1.length + c2.length+ i];
  }
  Arrays.fill(c1,(byte)0);
  Arrays.fill(c3,(byte)0);
  if (check != 0) {
    Arrays.fill(c2,(byte)0);
    throw new InvalidCipherTextException("String_Node_Str");
  }
  return c2;
}
Program: 52380
Project: 52380
Buggy source:
/** 
 * Generate a key using the scrypt key derivation function.
 * @param P     the bytes of the pass phrase.
 * @param S     the salt to use for this invocation.
 * @param N     CPU/Memory cost parameter. Must be larger than 1, a power of 2 and less than<code>2^(128 * r / 8)</code>.
 * @param r     the block size, must be &gt;= 1.
 * @param p     Parallelization parameter. Must be a positive integer less than or equal to<code>Integer.MAX_VALUE / (128 * r * 8)</code>.
 * @param dkLen the length of the key to generate.
 * @return the generated key.
 */
public static byte[] generate(byte[] P,byte[] S,int N,int r,int p,int dkLen){
  if (P == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (S == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (N <= 1 || !isPowerOf2(N)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (r == 1 && N > 65536) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (r < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int maxParallel=Integer.MAX_VALUE / (128 * r * 8);
  if (p < 1 || p > maxParallel) {
    throw new IllegalArgumentException("String_Node_Str" + maxParallel + "String_Node_Str"+ r+ "String_Node_Str");
  }
  if (dkLen < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return MFcrypt(P,S,N,r,p,dkLen);
}

Fixed version (ground truth):
/** 
 * Generate a key using the scrypt key derivation function.
 * @param P     the bytes of the pass phrase.
 * @param S     the salt to use for this invocation.
 * @param N     CPU/Memory cost parameter. Must be larger than 1, a power of 2 and less than<code>2^(128 * r / 8)</code>.
 * @param r     the block size, must be &gt;= 1.
 * @param p     Parallelization parameter. Must be a positive integer less than or equal to<code>Integer.MAX_VALUE / (128 * r * 8)</code>.
 * @param dkLen the length of the key to generate.
 * @return the generated key.
 */
public static byte[] generate(byte[] P,byte[] S,int N,int r,int p,int dkLen){
  if (P == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (S == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (N <= 1 || !isPowerOf2(N)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (r == 1 && N >= 65536) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (r < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int maxParallel=Integer.MAX_VALUE / (128 * r * 8);
  if (p < 1 || p > maxParallel) {
    throw new IllegalArgumentException("String_Node_Str" + maxParallel + "String_Node_Str"+ r+ "String_Node_Str");
  }
  if (dkLen < 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return MFcrypt(P,S,N,r,p,dkLen);
}
Program: 52381
Project: 52381
Buggy source:
public void testParameters(){
  checkOK("String_Node_Str",new byte[0],new byte[0],2,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],1,1,1,1);
  checkOK("String_Node_Str",new byte[0],new byte[0],65536,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],65537,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,0,2,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,1,0,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,32,65536,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,1,1,0);
}

Fixed version (ground truth):
public void testParameters(){
  checkOK("String_Node_Str",new byte[0],new byte[0],2,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],1,1,1,1);
  checkOK("String_Node_Str",new byte[0],new byte[0],65536,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],65536,1,1,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,0,2,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,1,0,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,32,65536,1);
  checkIllegal("String_Node_Str",new byte[0],new byte[0],2,1,1,0);
}
Program: 52382
Project: 52382
Buggy source:
/** 
 * return the time - always in the form of YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). <p> Normally in a certificate we would expect "Z" rather than "GMT", however adding the "GMT" means we can just use: <pre> dateF = new SimpleDateFormat("yyyyMMddHHmmssz"); </pre> To read in the time and get a date which is compatible with our local time zone. </p>
 * @return a String representation of the time.
 */
public String getTime(){
  String stime=Strings.fromByteArray(time);
  if (stime.charAt(stime.length() - 1) == 'Z') {
    return stime.substring(0,stime.length() - 1) + "String_Node_Str";
  }
 else {
    int signPos=stime.length() - 5;
    char sign=stime.charAt(signPos);
    if (sign == '-' || sign == '+') {
      return stime.substring(0,signPos) + "String_Node_Str" + stime.substring(signPos,signPos + 3)+ "String_Node_Str"+ stime.substring(signPos + 3);
    }
 else {
      signPos=stime.length() - 3;
      sign=stime.charAt(signPos);
      if (sign == '-' || sign == '+') {
        return stime.substring(0,signPos) + "String_Node_Str" + stime.substring(signPos)+ "String_Node_Str";
      }
    }
  }
  return stime + calculateGMTOffset();
}

Fixed version (ground truth):
/** 
 * return the time - always in the form of YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). <p> Normally in a certificate we would expect "Z" rather than "GMT", however adding the "GMT" means we can just use: <pre> dateF = new SimpleDateFormat("yyyyMMddHHmmssz"); </pre> To read in the time and get a date which is compatible with our local time zone.
 * @return a String representation of the time.
 */
public String getTime(){
  String stime=Strings.fromByteArray(time);
  if (stime.charAt(stime.length() - 1) == 'Z') {
    return stime.substring(0,stime.length() - 1) + "String_Node_Str";
  }
 else {
    int signPos=stime.length() - 5;
    char sign=stime.charAt(signPos);
    if (sign == '-' || sign == '+') {
      return stime.substring(0,signPos) + "String_Node_Str" + stime.substring(signPos,signPos + 3)+ "String_Node_Str"+ stime.substring(signPos + 3);
    }
 else {
      signPos=stime.length() - 3;
      sign=stime.charAt(signPos);
      if (sign == '-' || sign == '+') {
        return stime.substring(0,signPos) + "String_Node_Str" + stime.substring(signPos)+ "String_Node_Str";
      }
    }
  }
  return stime + calculateGMTOffset();
}
Program: 52383
Project: 52383
Buggy source:
/** 
 * Return an instance of ASN.1 NULL from the passed in object. <p> Accepted inputs: <ul> <li> null &rarr; null <li>   {@link ASN1Null} object<li> a byte[] containing ASN.1 NULL object </ul> </p>
 * @param o object to be converted.
 * @return an instance of ASN1Null, or null.
 * @exception IllegalArgumentException if the object cannot be converted.
 */
public static ASN1Null getInstance(Object o){
  if (o instanceof ASN1Null) {
    return (ASN1Null)o;
  }
  if (o != null) {
    try {
      return ASN1Null.getInstance(ASN1Primitive.fromByteArray((byte[])o));
    }
 catch (    IOException e) {
      throw new IllegalArgumentException("String_Node_Str" + e.getMessage());
    }
catch (    ClassCastException e) {
      throw new IllegalArgumentException("String_Node_Str" + o.getClass().getName());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return an instance of ASN.1 NULL from the passed in object. <p> Accepted inputs: <ul> <li> null &rarr; null <li>   {@link ASN1Null} object<li> a byte[] containing ASN.1 NULL object </ul>
 * @param o object to be converted.
 * @return an instance of ASN1Null, or null.
 * @exception IllegalArgumentException if the object cannot be converted.
 */
public static ASN1Null getInstance(Object o){
  if (o instanceof ASN1Null) {
    return (ASN1Null)o;
  }
  if (o != null) {
    try {
      return ASN1Null.getInstance(ASN1Primitive.fromByteArray((byte[])o));
    }
 catch (    IOException e) {
      throw new IllegalArgumentException("String_Node_Str" + e.getMessage());
    }
catch (    ClassCastException e) {
      throw new IllegalArgumentException("String_Node_Str" + o.getClass().getName());
    }
  }
  return null;
}
Program: 52384
Project: 52384
Buggy source:
/** 
 * return the MAC used as the basis for the function
 */
public Mac getMac();

Fixed version (ground truth):
/** 
 * return the MAC used as the basis for the function
 * @return the Mac.
 */
public Mac getMac();
Program: 52385
Project: 52385
Buggy source:
/** 
 * which generates the p and g values from the given parameters, returning the DHParameters object. <p> Note: can take a while...
 */
public DHParameters generateParameters(){
  BigInteger[] safePrimes=DHParametersHelper.generateSafePrimes(size,certainty,random);
  BigInteger p=safePrimes[0];
  BigInteger q=safePrimes[1];
  BigInteger g=DHParametersHelper.selectGenerator(p,q,random);
  return new DHParameters(p,g,q,TWO,null);
}

Fixed version (ground truth):
/** 
 * which generates the p and g values from the given parameters, returning the DHParameters object. <p> Note: can take a while...
 * @return a generated Diffie-Hellman parameters object.
 */
public DHParameters generateParameters(){
  BigInteger[] safePrimes=DHParametersHelper.generateSafePrimes(size,certainty,random);
  BigInteger p=safePrimes[0];
  BigInteger q=safePrimes[1];
  BigInteger g=DHParametersHelper.selectGenerator(p,q,random);
  return new DHParameters(p,g,q,TWO,null);
}