nus-yam/ex-repair huggingface dataset:
Program: 172546
Project: 172546
Buggy source:
@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(MockServerException.class) public void internalServerError(MockServerException ex){
}

Fixed version (ground truth):
@ExceptionHandler(MockServerException.class) public ResponseEntity<String> internalServerError(MockServerException ex){
  return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
Program: 172547
Project: 172547
Buggy source:
@RequestMapping(path="String_Node_Str",method=RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ResponseEntity<?> postJms(@RequestBody final JmsProxiedDTO dto) throws ValidationException, MockServerException {
  jmsProxyService.pushToQueue(dto.getQueueName(),dto.getBody());
  return new ResponseEntity<String>(HttpStatus.NO_CONTENT);
}

Fixed version (ground truth):
@RequestMapping(path="String_Node_Str",method=RequestMethod.POST,consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ResponseEntity<?> postJms(@RequestBody final JmsProxiedDTO dto) throws ValidationException {
  jmsProxyService.pushToQueue(dto.getQueueName(),dto.getBody());
  return new ResponseEntity<String>(HttpStatus.NO_CONTENT);
}
Program: 172548
Project: 172548
Buggy source:
public void sendTextMessage(final String queueName,final String textBody) throws MockServerException {
  if (!getCurrentState().isRunning()) {
    return;
  }
  Connection connection=null;
  Session session=null;
  MessageProducer producer=null;
  try {
    connection=connectionFactory.createConnection();
    session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    producer=session.createProducer(session.createQueue(queueName));
    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    producer.send(session.createTextMessage(textBody));
  }
 catch (  JMSException ex) {
    logger.error("String_Node_Str" + queueName,ex);
  }
 finally {
    if (producer != null) {
      try {
        producer.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
    if (session != null) {
      try {
        session.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
  }
}

Fixed version (ground truth):
public void sendTextMessage(final String queueName,final String textBody){
  Connection connection=null;
  Session session=null;
  MessageProducer producer=null;
  try {
    if (!getCurrentState().isRunning()) {
      return;
    }
    connection=connectionFactory.createConnection();
    session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    producer=session.createProducer(session.createQueue(queueName));
    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    producer.send(session.createTextMessage(textBody));
  }
 catch (  MockServerException|JMSException ex) {
    logger.error("String_Node_Str" + queueName,ex);
  }
 finally {
    if (producer != null) {
      try {
        producer.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
    if (session != null) {
      try {
        session.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
    if (connection != null) {
      try {
        connection.close();
      }
 catch (      JMSException ex) {
        logger.error("String_Node_Str",ex);
      }
    }
  }
}
Program: 172549
Project: 172549
Buggy source:
void pushToQueue(final String queueName,final String body) throws ValidationException, MockServerException ;

Fixed version (ground truth):
void pushToQueue(final String queueName,final String body) throws ValidationException ;
Program: 172550
Project: 172550
Buggy source:
@Override public void pushToQueue(final String queueName,final String body) throws ValidationException, MockServerException {
  logger.debug("String_Node_Str");
  if (StringUtils.isBlank(queueName)) {
    throw new ValidationException("String_Node_Str");
  }
  if (StringUtils.isBlank(body)) {
    throw new ValidationException("String_Node_Str");
  }
  mockedJmsServerEngine.sendTextMessage(queueName,body);
}

Fixed version (ground truth):
@Override public void pushToQueue(final String queueName,final String body) throws ValidationException {
  logger.debug("String_Node_Str");
  if (StringUtils.isBlank(queueName)) {
    throw new ValidationException("String_Node_Str");
  }
  if (StringUtils.isBlank(body)) {
    throw new ValidationException("String_Node_Str");
  }
  mockedJmsServerEngine.sendTextMessage(queueName,body);
}
Program: 172551
Project: 172551
Buggy source:
void clearState(){
  webSocketService.clearSession();
  proxyService.clearSession();
}

Fixed version (ground truth):
void clearState(){
  webSocketService.clearSession();
  proxyService.clearSession();
  mockOrderingCounterService.clearState();
}
Program: 172552
Project: 172552
Buggy source:
@Transactional void buildEndpoints(final List<RestfulMock> mocks) throws MockServerException {
  logger.debug("String_Node_Str");
  invokeAndDetachData(mocks);
  buildWebSocketEndpoints(mocks);
  buildHttpEndpoints(mocks);
}

Fixed version (ground truth):
@Transactional void buildEndpoints(final List<RestfulMock> mocks) throws MockServerException {
  logger.debug("String_Node_Str");
  invokeAndDetachData(mocks);
  buildWebSocketEndpoints(mocks);
  enableCORS("String_Node_Str","String_Node_Str","String_Node_Str");
  buildHttpEndpoints(mocks);
}
Program: 172553
Project: 172553
Buggy source:
RestfulMockDefinitionOrder getNextInSequence(final RestfulMock restfulMock){
  final long mockId=restfulMock.getId();
  Long mockDefinitionId=null;
synchronized (monitor) {
    final List<DefinitionCounter> definitionCounterList=synchronizedCounter.getOrDefault(mockId,new ArrayList<DefinitionCounter>(){
{
        restfulMock.getDefinitions().forEach(d -> add(new DefinitionCounter(d.getId(),(d.getFrequencyCount() > 0) ? d.getFrequencyCount() : 1)));
      }
    }
);
    for (    DefinitionCounter d : definitionCounterList) {
      if (d.getFrequencyCount() > d.getCurrentTally()) {
        mockDefinitionId=d.getDefinitionId();
        d.setCurrentTally(d.getCurrentTally() + 1);
        break;
      }
    }
    if (mockDefinitionId == null) {
      for (      DefinitionCounter d : definitionCounterList) {
        if (mockDefinitionId == null) {
          mockDefinitionId=d.getDefinitionId();
          d.setCurrentTally(1);
        }
 else {
          d.setCurrentTally(0);
        }
      }
    }
    synchronizedCounter.put(mockId,definitionCounterList);
  }
  for (  RestfulMockDefinitionOrder d : restfulMock.getDefinitions()) {
    if (d.getId() == mockDefinitionId) {
      return d;
    }
  }
  throw new NullPointerException("String_Node_Str");
}

Fixed version (ground truth):
RestfulMockDefinitionOrder getNextInSequence(final RestfulMock restfulMock){
  final String mockExtId=restfulMock.getExtId();
  String mockDefinitionId=null;
synchronized (monitor) {
    final List<DefinitionCounter> definitionCounterList=synchronizedCounter.getOrDefault(mockExtId,new ArrayList<DefinitionCounter>(){
{
        restfulMock.getDefinitions().forEach(d -> add(new DefinitionCounter(d.getExtId(),(d.getFrequencyCount() > 0) ? d.getFrequencyCount() : 1)));
      }
    }
);
    for (    DefinitionCounter d : definitionCounterList) {
      if (d.getFrequencyCount() > d.getCurrentTally()) {
        mockDefinitionId=d.getDefinitionExtId();
        d.setCurrentTally(d.getCurrentTally() + 1);
        break;
      }
    }
    if (mockDefinitionId == null) {
      for (      DefinitionCounter d : definitionCounterList) {
        if (mockDefinitionId == null) {
          mockDefinitionId=d.getDefinitionExtId();
          d.setCurrentTally(1);
        }
 else {
          d.setCurrentTally(0);
        }
      }
    }
    synchronizedCounter.put(mockExtId,definitionCounterList);
  }
  for (  RestfulMockDefinitionOrder d : restfulMock.getDefinitions()) {
    if (d.getExtId().equals(mockDefinitionId)) {
      return d;
    }
  }
  throw new NullPointerException("String_Node_Str");
}
Program: 172554
Project: 172554
Buggy source:
DefinitionCounter(long definitionId,int frequencyCount){
  this.definitionId=definitionId;
  this.frequencyCount=frequencyCount;
}

Fixed version (ground truth):
DefinitionCounter(String definitionExtId,int frequencyCount){
  this.definitionExtId=definitionExtId;
  this.frequencyCount=frequencyCount;
}
Program: 172555
Project: 172555
Buggy source:
@Before public void setUp(){
  mockOrderingCounterService=new MockOrderingCounterServiceImpl();
  restfulMock1=new RestfulMock();
  restfulMock1.setId(1);
  order1=new RestfulMockDefinitionOrder(restfulMock1,200,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",1,0,false,0,0);
  order1.setId(1);
  order2=new RestfulMockDefinitionOrder(restfulMock1,201,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",2,0,false,0,0);
  order2.setId(2);
  order3=new RestfulMockDefinitionOrder(restfulMock1,202,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",3,0,false,0,0);
  order3.setId(3);
  order4=new RestfulMockDefinitionOrder(restfulMock1,204,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",4,0,false,0,0);
  order4.setId(4);
  restfulMock1.getDefinitions().add(order1);
  restfulMock1.getDefinitions().add(order2);
  restfulMock1.getDefinitions().add(order3);
  restfulMock1.getDefinitions().add(order4);
  restfulMock2=new RestfulMock();
  restfulMock2.setId(2);
  order5=new RestfulMockDefinitionOrder(restfulMock2,400,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",1,0,false,0,0);
  order5.setId(5);
  order6=new RestfulMockDefinitionOrder(restfulMock2,500,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",2,0,false,0,0);
  order6.setId(6);
  restfulMock2.getDefinitions().add(order5);
  restfulMock2.getDefinitions().add(order6);
}

Fixed version (ground truth):
@Before public void setUp(){
  mockOrderingCounterService=new MockOrderingCounterServiceImpl();
  restfulMock1=new RestfulMock();
  restfulMock1.setExtId(GeneralUtils.generateUUID());
  order1=new RestfulMockDefinitionOrder(restfulMock1,200,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",1,0,false,0,0);
  order1.setExtId(GeneralUtils.generateUUID());
  order2=new RestfulMockDefinitionOrder(restfulMock1,201,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",2,0,false,0,0);
  order2.setExtId(GeneralUtils.generateUUID());
  order3=new RestfulMockDefinitionOrder(restfulMock1,202,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",3,0,false,0,0);
  order3.setExtId(GeneralUtils.generateUUID());
  order4=new RestfulMockDefinitionOrder(restfulMock1,204,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",4,0,false,0,0);
  order4.setExtId(GeneralUtils.generateUUID());
  restfulMock1.getDefinitions().add(order1);
  restfulMock1.getDefinitions().add(order2);
  restfulMock1.getDefinitions().add(order3);
  restfulMock1.getDefinitions().add(order4);
  restfulMock2=new RestfulMock();
  restfulMock2.setExtId(GeneralUtils.generateUUID());
  order5=new RestfulMockDefinitionOrder(restfulMock2,400,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",1,0,false,0,0);
  order5.setExtId(GeneralUtils.generateUUID());
  order6=new RestfulMockDefinitionOrder(restfulMock2,500,MediaType.APPLICATION_JSON_VALUE,"String_Node_Str",2,0,false,0,0);
  order6.setExtId(GeneralUtils.generateUUID());
  restfulMock2.getDefinitions().add(order5);
  restfulMock2.getDefinitions().add(order6);
}
Program: 172556
Project: 172556
Buggy source:
@Override public RestfulResponse waitForResponse(final RestfulMock mock){
  final long timeOut=(mock.getProxyTimeOutInMillis() > 0) ? mock.getProxyTimeOutInMillis() : Long.MAX_VALUE;
  try {
    while (true) {
      boolean foundOne=signal.tryAcquire(signalPermitCount,timeOut,TimeUnit.MILLISECONDS);
      if (!foundOne) {
        return null;
      }
      lock.acquire();
      final List<ProxiedDTO> responses=responsesQueueMap.get(new ProxiedKey(mock.getPath(),mock.getMethod()));
      if (responses == null || responses.isEmpty()) {
        lock.release();
        continue;
      }
 else {
        final ProxiedDTO proxiedResponse=responses.remove(0);
        lock.release();
        return new RestfulResponse(proxiedResponse.getHttpStatusCode(),proxiedResponse.getResponseContentType(),proxiedResponse.getBody(),new HashSet<Map.Entry<String,String>>());
      }
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public RestfulResponse waitForResponse(final RestfulMock mock){
  final long timeOut=(mock.getProxyTimeOutInMillis() > 0) ? mock.getProxyTimeOutInMillis() : MAX_TIMEOUT_MILLIS;
  try {
    while (true) {
      boolean foundOne=signal.tryAcquire(SIGNAL_PERMIT_COUNT,timeOut,TimeUnit.MILLISECONDS);
      if (!foundOne) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str" + mock.getMethod() + "String_Node_Str"+ mock.getPath()+ "String_Node_Str");
          logger.debug("String_Node_Str");
        }
        return lookUpResponse(mock);
      }
      final RestfulResponse restfulResponse=lookUpResponse(mock);
      if (restfulResponse == null) {
        continue;
      }
      return restfulResponse;
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
  return null;
}
Program: 172557
Project: 172557
Buggy source:
@Override public void addResponse(final ProxiedDTO dto){
  try {
    lock.acquire();
    final List<ProxiedDTO> responses=responsesQueueMap.getOrDefault(dto.getPath(),new ArrayList<ProxiedDTO>());
    responses.add(dto);
    responsesQueueMap.put(new ProxiedKey(dto.getPath(),dto.getMethod()),responses);
    lock.release();
    signal.release(signalPermitCount);
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
@Override public void addResponse(final ProxiedDTO dto){
  try {
    lock.acquire();
    final ProxiedKey key=new ProxiedKey(dto.getPath(),dto.getMethod());
    final List<ProxiedDTO> responses=synchronizedProxyResponsesMap.getOrDefault(key,new ArrayList<ProxiedDTO>());
    responses.add(dto);
    synchronizedProxyResponsesMap.put(key,responses);
    lock.release();
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + dto.getPath() + "String_Node_Str"+ responses.size());
    signal.release(SIGNAL_PERMIT_COUNT);
  }
 catch (  Throwable ex) {
    logger.error("String_Node_Str",ex);
  }
}
Program: 172558
Project: 172558
Buggy source:
/** 
 * Returns the request parameter value for the given name. Look up is case insensitive (as Java Spark handles request parameter look ups with case sensitivity. Unclear on what the standard is for this...)
 * @param request
 * @param pathVarName
 * @returns String
 */
public static String findPathVarIgnoreCase(final Request request,final String pathVarName){
  for (  Map.Entry<String,String> pv : request.params().entrySet()) {
    if (pv.getKey().equalsIgnoreCase(pathVarName)) {
      return pv.getValue();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the request parameter value for the given name. Look up is case insensitive (as Java Spark handles request parameter look ups with case sensitivity. Unclear on what the standard is for this...)
 * @param request
 * @param pathVarName
 * @returns String
 */
public static String findPathVarIgnoreCase(final Request request,final String pathVarName){
  for (  Map.Entry<String,String> pv : request.params().entrySet()) {
    if (pv.getKey().equalsIgnoreCase((pathVarName.startsWith("String_Node_Str")) ? pathVarName : ("String_Node_Str" + pathVarName))) {
      return pv.getValue();
    }
  }
  return null;
}
Program: 172559
Project: 172559
Buggy source:
String processRequest(final RestfulMock mock,final Request req,final Response res){
  RestfulResponse outcome;
switch (mock.getMockType()) {
case RULE:
    outcome=ruleEngine.process(req,mock.getRules());
  break;
case PROXY:
outcome=proxyService.waitForResponse(mock);
break;
case SEQ:
default :
outcome=mockOrderingCounterService.getNextInSequence(mock);
break;
}
if (outcome == null) {
outcome=getDefault(mock);
}
res.status(outcome.getHttpStatusCode());
res.type(outcome.getResponseContentType());
for (Map.Entry<String,String> e : outcome.getHeaders().entrySet()) {
res.header(e.getKey(),e.getValue());
}
final String response=inboundParamMatchService.enrichWithInboundParamMatches(req,outcome.getResponseBody());
return StringUtils.defaultIfBlank(response,"String_Node_Str");
}

Fixed version (ground truth):
String processRequest(final RestfulMock mock,final Request req,final Response res){
  RestfulResponse outcome;
switch (mock.getMockType()) {
case RULE:
    outcome=ruleEngine.process(req,mock.getRules());
  break;
case PROXY:
outcome=proxyService.waitForResponse(req.pathInfo(),mock);
break;
case SEQ:
default :
outcome=mockOrderingCounterService.getNextInSequence(mock);
break;
}
if (outcome == null) {
outcome=getDefault(mock);
}
res.status(outcome.getHttpStatusCode());
res.type(outcome.getResponseContentType());
for (Map.Entry<String,String> e : outcome.getHeaders().entrySet()) {
res.header(e.getKey(),e.getValue());
}
final String response=inboundParamMatchService.enrichWithInboundParamMatches(req,outcome.getResponseBody());
return StringUtils.defaultIfBlank(response,"String_Node_Str");
}
Program: 172560
Project: 172560
Buggy source:
RestfulResponse waitForResponse(final RestfulMock mock);

Fixed version (ground truth):
RestfulResponse waitForResponse(final String requestPath,final RestfulMock mock);
Program: 172561
Project: 172561
Buggy source:
@Override public RestfulResponse waitForResponse(final RestfulMock mock){
  try {
    lock.lock();
    final List<ProxiedDTO> responses=synchronizedProxyResponsesMap.get(new ProxiedKey(mock.getPath(),mock.getMethod()));
    if (responses == null || responses.isEmpty()) {
      final long timeOut=(mock.getProxyTimeOutInMillis() > 0) ? mock.getProxyTimeOutInMillis() : MAX_TIMEOUT_MILLIS;
      if (!condition.await(timeOut,TimeUnit.MILLISECONDS)) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str" + mock.getMethod() + "String_Node_Str"+ mock.getPath()+ "String_Node_Str");
        }
        return null;
      }
      return waitForResponse(mock);
    }
 else {
      final ProxiedDTO proxiedResponse=responses.remove(0);
      return new RestfulResponse(proxiedResponse.getHttpStatusCode(),proxiedResponse.getResponseContentType(),proxiedResponse.getBody(),new HashSet<Map.Entry<String,String>>());
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
 finally {
    lock.unlock();
  }
  return null;
}

Fixed version (ground truth):
@Override public RestfulResponse waitForResponse(final String requestPath,final RestfulMock mock){
  try {
    lock.lock();
    final List<ProxiedDTO> responses=synchronizedProxyResponsesMap.get(new ProxiedKey(requestPath,mock.getMethod()));
    if (responses == null || responses.isEmpty()) {
      final long timeOut=(mock.getProxyTimeOutInMillis() > 0) ? mock.getProxyTimeOutInMillis() : MAX_TIMEOUT_MILLIS;
      if (!condition.await(timeOut,TimeUnit.MILLISECONDS)) {
        if (logger.isDebugEnabled()) {
          logger.debug("String_Node_Str" + mock.getMethod() + "String_Node_Str"+ requestPath+ "String_Node_Str");
        }
        return null;
      }
      return waitForResponse(requestPath,mock);
    }
 else {
      final ProxiedDTO proxiedResponse=responses.remove(0);
      return new RestfulResponse(proxiedResponse.getHttpStatusCode(),proxiedResponse.getResponseContentType(),proxiedResponse.getBody(),new HashSet<Map.Entry<String,String>>());
    }
  }
 catch (  InterruptedException ex) {
    logger.error("String_Node_Str",ex);
  }
 finally {
    lock.unlock();
  }
  return null;
}
Program: 172562
Project: 172562
Buggy source:
@SideOnly(Side.CLIENT) public static String translatePageText(int pageNumber){
  String langFile=Minecraft.getMinecraft().gameSettings.language;
  langFile=langFile.substring(0,langFile.indexOf("String_Node_Str")) + langFile.substring(langFile.indexOf("String_Node_Str")).toUpperCase();
  InputStream in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  try {
    for (    String s : IOUtils.readLines(in,"String_Node_Str")) {
      if (s.indexOf("String_Node_Str") == -1) {
        continue;
      }
      if (s.substring(0,s.indexOf("String_Node_Str")).equals("String_Node_Str" + pageNumber + "String_Node_Str")) {
        return s.substring(s.indexOf("String_Node_Str") + 1);
      }
    }
  }
 catch (  IOException e) {
  }
  return "String_Node_Str" + pageNumber;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public static String translatePageText(int pageNumber){
  String langFile=Minecraft.getMinecraft().gameSettings.language;
  langFile=langFile.substring(0,langFile.indexOf("String_Node_Str")) + langFile.substring(langFile.indexOf("String_Node_Str")).toUpperCase();
  InputStream in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  if (in == null) {
    langFile="String_Node_Str";
    in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  }
  try {
    for (    String s : IOUtils.readLines(in,"String_Node_Str")) {
      if (s.indexOf("String_Node_Str") == -1) {
        continue;
      }
      if (s.substring(0,s.indexOf("String_Node_Str")).equals("String_Node_Str" + pageNumber + "String_Node_Str")) {
        return s.substring(s.indexOf("String_Node_Str") + 1);
      }
    }
  }
 catch (  IOException e) {
  }
  return "String_Node_Str" + pageNumber;
}
Program: 172563
Project: 172563
Buggy source:
@SideOnly(Side.CLIENT) public static String translateTitle(int pageNumber){
  String langFile=Minecraft.getMinecraft().gameSettings.language;
  langFile=langFile.substring(0,langFile.indexOf("String_Node_Str")) + langFile.substring(langFile.indexOf("String_Node_Str")).toUpperCase();
  InputStream in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  try {
    for (    String s : IOUtils.readLines(in,"String_Node_Str")) {
      if (s.indexOf("String_Node_Str") == -1) {
        continue;
      }
      if (s.substring(0,s.indexOf("String_Node_Str")).equals("String_Node_Str" + pageNumber + "String_Node_Str")) {
        return s.substring(s.indexOf("String_Node_Str") + 1);
      }
    }
  }
 catch (  IOException e) {
  }
  return "String_Node_Str" + pageNumber;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public static String translateTitle(int pageNumber){
  String langFile=Minecraft.getMinecraft().gameSettings.language;
  langFile=langFile.substring(0,langFile.indexOf("String_Node_Str")) + langFile.substring(langFile.indexOf("String_Node_Str")).toUpperCase();
  InputStream in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  if (in == null) {
    langFile="String_Node_Str";
    in=Geolosys.class.getResourceAsStream("String_Node_Str" + langFile + "String_Node_Str");
  }
  try {
    for (    String s : IOUtils.readLines(in,"String_Node_Str")) {
      if (s.indexOf("String_Node_Str") == -1) {
        continue;
      }
      if (s.substring(0,s.indexOf("String_Node_Str")).equals("String_Node_Str" + pageNumber + "String_Node_Str")) {
        return s.substring(s.indexOf("String_Node_Str") + 1);
      }
    }
  }
 catch (  IOException e) {
  }
  return "String_Node_Str" + pageNumber;
}
Program: 172564
Project: 172564
Buggy source:
private void returnToScanningStatus(){
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      setStatus(R.string.fingerprint_state_scanning,R.color.fingerprint_circle,R.color.fingerprint_auth_scanning,R.drawable.fingerprint);
    }
  }
,1200);
}

Fixed version (ground truth):
private void returnToScanningStatus(){
  handler.postDelayed(returnToScanning,1200);
}
Program: 172566
Project: 172566
Buggy source:
@Override public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result){
  super.onAuthenticationSucceeded(result);
  setStatus(R.string.fingerprint_state_success,successColor,successColor,R.drawable.fingerprint_success);
  new Handler().postDelayed(new Runnable(){
    @Override public void run(){
      dialog.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onAuthenticationSuccess();
      }
    }
  }
,delayAfterSuccess);
  tryCounter=0;
}

Fixed version (ground truth):
@Override public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result){
  super.onAuthenticationSucceeded(result);
  handler.removeCallbacks(returnToScanning);
  setStatus(R.string.fingerprint_state_success,successColor,successColor,R.drawable.fingerprint_success);
  handler.postDelayed(new Runnable(){
    @Override public void run(){
      dialog.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onAuthenticationSuccess();
      }
    }
  }
,delayAfterSuccess);
  tryCounter=0;
}
Program: 172567
Project: 172567
Buggy source:
private void init(String KEY_NAME){
  this.keyStoreHelper=new KeyStoreHelper(KEY_NAME);
  this.layoutInflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.fingerprintCallback=null;
  this.fingerprintSecureCallback=null;
  this.counterCallback=null;
  this.successColor=R.color.fingerprint_auth_success;
  this.errorColor=R.color.fingerprint_auth_failed;
  this.delayAfterSuccess=1200;
  this.cancelOnTouchOutside=false;
  this.cancelOnPressBack=false;
  this.dimBackground=true;
  this.enterAnimation=DialogAnimation.NO_ANIMATION;
  this.exitAnimation=DialogAnimation.NO_ANIMATION;
  this.cryptoObject=null;
  this.tryCounter=0;
}

Fixed version (ground truth):
private void init(String KEY_NAME){
  this.keyStoreHelper=new KeyStoreHelper(KEY_NAME);
  this.layoutInflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.handler=new Handler();
  this.fingerprintCallback=null;
  this.fingerprintSecureCallback=null;
  this.counterCallback=null;
  this.successColor=R.color.fingerprint_auth_success;
  this.errorColor=R.color.fingerprint_auth_failed;
  this.delayAfterSuccess=1200;
  this.cancelOnTouchOutside=false;
  this.cancelOnPressBack=false;
  this.dimBackground=true;
  this.enterAnimation=DialogAnimation.NO_ANIMATION;
  this.exitAnimation=DialogAnimation.NO_ANIMATION;
  this.cryptoObject=null;
  this.tryCounter=0;
}
Program: 172568
Project: 172568
Buggy source:
private void showDialog(){
  view=layoutInflater.inflate(R.layout.fingerprint_dialog,null);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_message)).setText(message);
  builder.setPositiveButton(R.string.fingerprint_cancel_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      cancellationSignal.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onAuthenticationCancel();
      }
    }
  }
);
  builder.setView(view);
  dialog=builder.create();
  if (dialog.getWindow() != null && (enterAnimation != NO_ANIMATION || exitAnimation != NO_ANIMATION)) {
    int style=getStyle(enterAnimation,exitAnimation);
    if (style == -1) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      dialog.getWindow().getAttributes().windowAnimations=style;
    }
    if (!darkBackground) {
      dialog.getWindow().setDimAmount(0.0f);
    }
  }
  dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
  dialog.setCancelable(cancelOnPressBack);
  dialog.show();
  auth();
}

Fixed version (ground truth):
private void showDialog(){
  view=layoutInflater.inflate(R.layout.fingerprint_dialog,null);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_message)).setText(message);
  builder.setPositiveButton(R.string.fingerprint_cancel_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      cancellationSignal.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onAuthenticationCancel();
      }
    }
  }
);
  builder.setView(view);
  dialog=builder.create();
  if (dialog.getWindow() != null) {
    if (enterAnimation != NO_ANIMATION || exitAnimation != NO_ANIMATION) {
      int style=getStyle(enterAnimation,exitAnimation);
      if (style == -1) {
        Log.w(TAG,"String_Node_Str");
      }
 else {
        dialog.getWindow().getAttributes().windowAnimations=style;
      }
    }
    if (!darkBackground) {
      dialog.getWindow().setDimAmount(0.0f);
    }
  }
  dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
  dialog.setCancelable(cancelOnPressBack);
  dialog.show();
  auth();
}
Program: 172570
Project: 172570
Buggy source:
@Override public void onNewFingerprintEnrolled(FingerprintToken token){
  PasswordDialog.initialize(FingerprintSecureExample.this,token).title(R.string.password_title).message(R.string.password_message).callback(FingerprintSecureExample.this).passwordType(PasswordDialog.PASSWORD_TYPE_TEXT).show();
}

Fixed version (ground truth):
@Override public void onNewFingerprintEnrolled(FingerprintToken token){
  Log.e("String_Node_Str","String_Node_Str");
  PasswordDialog.initialize(FingerprintSecureExample.this,token).title(R.string.password_title).message(R.string.password_message).callback(FingerprintSecureExample.this).passwordType(PasswordDialog.PASSWORD_TYPE_TEXT).show();
}
Program: 172571
Project: 172571
Buggy source:
private int getStyle(){
switch (enterAnimation) {
case ENTER_FROM_BOTTOM:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
      return R.style.BottomBottomAnimation;
case EXIT_TO_TOP:
    return R.style.BottomTopAnimation;
case NO_ANIMATION:
  return R.style.EnterFromBottomAnimation;
}
break;
case ENTER_FROM_TOP:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
return R.style.TopBottomAnimation;
case EXIT_TO_TOP:
return R.style.TopTopAnimation;
case NO_ANIMATION:
return R.style.EnterFromTopAnimation;
}
break;
case ENTER_FROM_LEFT:
switch (exitAnimation) {
case EXIT_TO_LEFT:
return R.style.LeftLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.LeftRightAnimation;
case NO_ANIMATION:
return R.style.EnterFromLeftAnimation;
}
break;
case ENTER_FROM_RIGHT:
switch (exitAnimation) {
case EXIT_TO_LEFT:
return R.style.RightLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.RightRightAnimation;
case NO_ANIMATION:
return R.style.EnterFromRightAnimation;
}
break;
case NO_ANIMATION:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
return R.style.ExitToBottomAnimation;
case EXIT_TO_TOP:
return R.style.ExitToTopAnimation;
case EXIT_TO_LEFT:
return R.style.ExitToLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.ExitToRightAnimation;
}
break;
}
return -1;
}

Fixed version (ground truth):
public static int getStyle(int enterAnimation,int exitAnimation){
switch (enterAnimation) {
case ENTER_FROM_BOTTOM:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
      return R.style.BottomBottomAnimation;
case EXIT_TO_TOP:
    return R.style.BottomTopAnimation;
case NO_ANIMATION:
  return R.style.EnterFromBottomAnimation;
}
break;
case ENTER_FROM_TOP:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
return R.style.TopBottomAnimation;
case EXIT_TO_TOP:
return R.style.TopTopAnimation;
case NO_ANIMATION:
return R.style.EnterFromTopAnimation;
}
break;
case ENTER_FROM_LEFT:
switch (exitAnimation) {
case EXIT_TO_LEFT:
return R.style.LeftLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.LeftRightAnimation;
case NO_ANIMATION:
return R.style.EnterFromLeftAnimation;
}
break;
case ENTER_FROM_RIGHT:
switch (exitAnimation) {
case EXIT_TO_LEFT:
return R.style.RightLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.RightRightAnimation;
case NO_ANIMATION:
return R.style.EnterFromRightAnimation;
}
break;
case NO_ANIMATION:
switch (exitAnimation) {
case EXIT_TO_BOTTOM:
return R.style.ExitToBottomAnimation;
case EXIT_TO_TOP:
return R.style.ExitToTopAnimation;
case EXIT_TO_LEFT:
return R.style.ExitToLeftAnimation;
case EXIT_TO_RIGHT:
return R.style.ExitToRightAnimation;
}
break;
}
return -1;
}
Program: 172572
Project: 172572
Buggy source:
private void showDialog(){
  view=layoutInflater.inflate(R.layout.fingerprint_dialog,null);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_message)).setText(message);
  builder.setPositiveButton(R.string.fingerprint_cancel_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      cancellationSignal.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onCancelled();
      }
    }
  }
);
  builder.setView(view);
  dialog=builder.create();
  if (dialog.getWindow() != null && (enterAnimation != NO_ANIMATION || exitAnimation != NO_ANIMATION)) {
    int style=getStyle();
    if (style == -1) {
      Log.e(TAG,"String_Node_Str");
    }
 else {
      dialog.getWindow().getAttributes().windowAnimations=style;
    }
  }
  dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
  dialog.show();
  auth();
}

Fixed version (ground truth):
private void showDialog(){
  view=layoutInflater.inflate(R.layout.fingerprint_dialog,null);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.fingerprint_dialog_message)).setText(message);
  builder.setPositiveButton(R.string.fingerprint_cancel_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      cancellationSignal.cancel();
      if (fingerprintCallback != null) {
        fingerprintCallback.onCancelled();
      }
    }
  }
);
  builder.setView(view);
  dialog=builder.create();
  if (dialog.getWindow() != null && (enterAnimation != NO_ANIMATION || exitAnimation != NO_ANIMATION)) {
    int style=getStyle(enterAnimation,exitAnimation);
    if (style == -1) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      dialog.getWindow().getAttributes().windowAnimations=style;
    }
  }
  dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
  dialog.show();
  auth();
}
Program: 172573
Project: 172573
Buggy source:
private void init(String KEY_NAME){
  this.keyStoreHelper=new KeyStoreHelper(KEY_NAME);
  this.layoutInflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.fingerprintCallback=null;
  this.fingerprintSecureCallback=null;
  this.successColor=R.color.auth_success;
  this.errorColor=R.color.auth_failed;
  this.delayAfterSuccess=1200;
  this.cancelOnTouchOutside=false;
  this.enterAnimation=ENTER_FROM_BOTTOM;
  this.exitAnimation=EXIT_TO_BOTTOM;
  this.cryptoObject=null;
}

Fixed version (ground truth):
private void init(String KEY_NAME){
  this.keyStoreHelper=new KeyStoreHelper(KEY_NAME);
  this.layoutInflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.fingerprintCallback=null;
  this.fingerprintSecureCallback=null;
  this.successColor=R.color.auth_success;
  this.errorColor=R.color.auth_failed;
  this.delayAfterSuccess=1200;
  this.cancelOnTouchOutside=false;
  this.enterAnimation=NO_ANIMATION;
  this.exitAnimation=NO_ANIMATION;
  this.cryptoObject=null;
}
Program: 172574
Project: 172574
Buggy source:
private PasswordDialog(Context context,FingerprintToken token){
  this.context=context;
  this.token=token;
  this.inflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.passwordType=PASSWORD_TYPE_TEXT;
  this.callback=null;
}

Fixed version (ground truth):
private PasswordDialog(Context context,FingerprintToken token){
  this.context=context;
  this.token=token;
  this.inflater=LayoutInflater.from(context);
  this.builder=new AlertDialog.Builder(context);
  this.passwordType=PASSWORD_TYPE_TEXT;
  this.enterAnimation=NO_ANIMATION;
  this.exitAnimation=NO_ANIMATION;
  this.cancelOnTouchOutside=false;
  this.callback=null;
}
Program: 172575
Project: 172575
Buggy source:
@Override public void onClick(DialogInterface dialogInterface,int i){
  if (callback != null) {
    callback.onCancel();
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (callback != null) {
    String password=input.getText().toString();
    if (callback.onPasswordCheck(password)) {
      dialog.dismiss();
      token.continueAuthentication();
    }
 else {
      input.setError(context.getResources().getString(R.string.password_incorrect));
    }
  }
}
Program: 172576
Project: 172576
Buggy source:
public PasswordDialog show(){
  if (title == null || message == null) {
    throw new RuntimeException("String_Node_Str");
  }
  View view=inflater.inflate(R.layout.password_dialog,null);
  ((TextView)view.findViewById(R.id.password_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.password_dialog_message)).setText(message);
  final EditText input=view.findViewById(R.id.password_dialog_input);
  input.setInputType(passwordType);
  builder.setView(view).setPositiveButton(R.string.password_confirm,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      if (callback != null) {
        String password=input.getText().toString();
        if (callback.onPasswordCheck(password)) {
          dialogInterface.cancel();
          token.continueAuthentication();
        }
 else {
          callback.onPasswordWrong();
        }
      }
    }
  }
).setNegativeButton(R.string.password_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      if (callback != null) {
        callback.onCancel();
      }
    }
  }
).setCancelable(false).show();
  return this;
}

Fixed version (ground truth):
public PasswordDialog show(){
  if (title == null || message == null) {
    throw new RuntimeException("String_Node_Str");
  }
  View view=inflater.inflate(R.layout.password_dialog,null);
  ((TextView)view.findViewById(R.id.password_dialog_title)).setText(title);
  ((TextView)view.findViewById(R.id.password_dialog_message)).setText(message);
  final EditText input=view.findViewById(R.id.password_dialog_input);
  input.setInputType(passwordType);
  dialog=builder.setView(view).setPositiveButton(R.string.password_confirm,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
    }
  }
).setNegativeButton(R.string.password_cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialogInterface,    int i){
      if (callback != null) {
        callback.onCancel();
      }
    }
  }
).create();
  if (dialog.getWindow() != null && (enterAnimation != NO_ANIMATION || exitAnimation != NO_ANIMATION)) {
    int style=FingerprintDialog.getStyle(enterAnimation,exitAnimation);
    if (style == -1) {
      Log.w(TAG,"String_Node_Str");
    }
 else {
      dialog.getWindow().getAttributes().windowAnimations=style;
    }
  }
  dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
  dialog.show();
  dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (callback != null) {
        String password=input.getText().toString();
        if (callback.onPasswordCheck(password)) {
          dialog.dismiss();
          token.continueAuthentication();
        }
 else {
          input.setError(context.getResources().getString(R.string.password_incorrect));
        }
      }
    }
  }
);
  return this;
}
Program: 172577
Project: 172577
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean removeFilter(FilterDescriptorBase removeFilter){
  if (filters == null) {
    filters=new FilterDescriptorBase[]{};
  }
  List<FilterDescriptorBase> filtersCopy=new ArrayList<>(Arrays.asList(filters));
  boolean result=filtersCopy.remove(removeFilter);
  this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean removeFilter(FilterDescriptorBase removeFilter){
  List<FilterDescriptorBase> filtersCopy=filters == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(filters));
  boolean result=filtersCopy.remove(removeFilter);
  this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  return result;
}
Program: 172578
Project: 172578
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean addFilters(FilterDescriptorBase... newFilters){
  if (filters == null) {
    filters=new FilterDescriptorBase[]{};
  }
  List<FilterDescriptorBase> filtersCopy=new ArrayList<>(Arrays.asList(filters));
  List<FilterDescriptorBase> newFilterList=Arrays.asList(newFilters);
  boolean result=filtersCopy.addAll(newFilterList);
  this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean addFilters(FilterDescriptorBase... newFilters){
  List<FilterDescriptorBase> filtersCopy=filters == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(filters));
  List<FilterDescriptorBase> newFilterList=Arrays.asList(newFilters);
  boolean result=filtersCopy.addAll(newFilterList);
  this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  return result;
}
Program: 172579
Project: 172579
Buggy source:
public boolean removeSort(SortDescriptor sort){
  if (sorts == null) {
    sorts=new SortDescriptor[]{};
  }
  List<SortDescriptor> sortsCopy=new ArrayList<>(Arrays.asList(sorts));
  boolean result=sortsCopy.remove(sort);
  if (result) {
    this.setSorts(sortsCopy.toArray(new SortDescriptor[sortsCopy.size()]));
  }
  return result;
}

Fixed version (ground truth):
public boolean removeSort(SortDescriptor sort){
  List<SortDescriptor> sortsCopy=sorts == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(sorts));
  boolean result=sortsCopy.remove(sort);
  if (result) {
    this.setSorts(sortsCopy.toArray(new SortDescriptor[sortsCopy.size()]));
  }
  return result;
}
Program: 172580
Project: 172580
Buggy source:
public boolean addSorts(SortDescriptor... newFilters){
  if (sorts == null) {
    sorts=new SortDescriptor[]{};
  }
  List<SortDescriptor> sortsCopy=new ArrayList<>(Arrays.asList(sorts));
  List<SortDescriptor> newSortLists=Arrays.asList(newFilters);
  boolean result=sortsCopy.addAll(newSortLists);
  if (result) {
    this.setSorts(sortsCopy.toArray(new SortDescriptor[sortsCopy.size()]));
  }
  return result;
}

Fixed version (ground truth):
public boolean addSorts(SortDescriptor... newFilters){
  List<SortDescriptor> sortsCopy=sorts == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(sorts));
  List<SortDescriptor> newSortLists=Arrays.asList(newFilters);
  boolean result=sortsCopy.addAll(newSortLists);
  if (result) {
    this.setSorts(sortsCopy.toArray(new SortDescriptor[sortsCopy.size()]));
  }
  return result;
}
Program: 172581
Project: 172581
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean addFilters(FilterDescriptorBase... newFilters){
  if (filters == null) {
    filters=new FilterDescriptorBase[]{};
  }
  List<FilterDescriptorBase> filtersCopy=new ArrayList<>(Arrays.asList(filters));
  List<FilterDescriptorBase> newFilterList=Arrays.asList(newFilters);
  boolean result=filtersCopy.addAll(newFilterList);
  if (result) {
    this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean addFilters(FilterDescriptorBase... newFilters){
  List<FilterDescriptorBase> filtersCopy=filters == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(filters));
  List<FilterDescriptorBase> newFilterList=Arrays.asList(newFilters);
  boolean result=filtersCopy.addAll(newFilterList);
  if (result) {
    this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  }
  return result;
}
Program: 172582
Project: 172582
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean removeFilter(FilterDescriptorBase removeFilter){
  if (filters == null) {
    filters=new FilterDescriptorBase[]{};
  }
  List<FilterDescriptorBase> filtersCopy=new ArrayList<>(Arrays.asList(filters));
  boolean result=filtersCopy.remove(removeFilter);
  if (result) {
    this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean removeFilter(FilterDescriptorBase removeFilter){
  List<FilterDescriptorBase> filtersCopy=filters == null ? new ArrayList<>() : new ArrayList<>(Arrays.asList(filters));
  boolean result=filtersCopy.remove(removeFilter);
  if (result) {
    this.setFilters(filtersCopy.toArray(new FilterDescriptorBase[filtersCopy.size()]));
  }
  return result;
}
Program: 172583
Project: 172583
Buggy source:
@Test public void multiFilterDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  FilterDescriptor priceFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,15);
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter,priceFilter);
  Product productView=northwindDao.getProductByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Integer.valueOf(2),productView.getProductID());
}

Fixed version (ground truth):
@Test public void multiFilterDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor("String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  FilterDescriptor priceFilter=new FilterDescriptor("String_Node_Str",FilterOperator.LESS_THAN,15);
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter,priceFilter);
  Product productView=northwindDao.getProductByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Integer.valueOf(2),productView.getProductID());
}
Program: 172584
Project: 172584
Buggy source:
public Object[] getParams(){
  return params.toArray();
}

Fixed version (ground truth):
public Object[] getParams(){
  return params;
}
Program: 172585
Project: 172585
Buggy source:
@DeleteProvider(type=DynamicQueryProvider.class,method="String_Node_Str") int deleteByDynamicQuery(@Param(MapperConstants.DYNAMIC_QUERY) DynamicQuery dynamicQuery);

Fixed version (ground truth):
@DeleteProvider(type=DynamicQueryProvider.class,method="String_Node_Str") int deleteByDynamicQuery(@Param(MapperConstants.DYNAMIC_QUERY) DynamicQuery<T> dynamicQuery);
Program: 172586
Project: 172586
Buggy source:
@Test public void testIn() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.IN,new int[]{2,4});
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(Long.valueOf(2),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(4),productViews.get(1).getProductID());
}

Fixed version (ground truth):
@Test public void testIn() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.IN,new int[]{2,4});
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(Long.valueOf(2),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(4),productViews.get(1).getProductID());
}