nus-yam/ex-repair huggingface dataset:
Program: 49453
Project: 49453
Buggy source:
/** 
 * Process the event received. (second phase) In this phase we do any more complex processing of the event in a separate transaction from the one where we first stored the event. Exceptions here should always be caught and never bubble up. The transaction will never be committed and the event will be left in the database with an initial state that indicates there was some kind of failure in processing. This allows us to identify problem events and eventually re-try processing them.
 * @param event Event to be processed.
 */
private void processEvent(Event event){
  try {
    unitOfWork.begin();
    eventManager.handle(event);
    eventCurator.merge(event);
    unitOfWork.end();
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
}

Fixed version (ground truth):
/** 
 * Process the event received. (second phase) In this phase we do any more complex processing of the event in a separate transaction from the one where we first stored the event. Exceptions here should always be caught and never bubble up. The transaction will never be committed and the event will be left in the database with an initial state that indicates there was some kind of failure in processing. This allows us to identify problem events and eventually re-try processing them.
 * @param event Event to be processed.
 */
private void processEvent(Event event){
  try {
    unitOfWork.begin();
    eventManager.handle(event);
    eventCurator.merge(event);
    unitOfWork.end();
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
 finally {
    unitOfWork.end();
  }
}
Program: 49454
Project: 49454
Buggy source:
@Test public void testEventManagerNullTarget(){
  Event toHandle=new Event();
  eventManager.handle(toHandle);
  verify(eventCurator).create(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}

Fixed version (ground truth):
@Test public void testEventManagerNullTarget(){
  Event toHandle=new Event();
  eventManager.handle(toHandle);
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}
Program: 49455
Project: 49455
Buggy source:
public TestingEventManager(Map<String,EventHandler> handlers,EventCurator curator){
  super(handlers,curator);
}

Fixed version (ground truth):
public TestingEventManager(Map<String,EventHandler> handlers){
  super(handlers);
}
Program: 49456
Project: 49456
Buggy source:
@Before public void before(){
  ObjectMapper mapper=new ObjectMapper();
  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  Map<String,EventHandler> handlers=new HashMap<String,EventHandler>();
  handlers.put(TEST_HANDLER_TARGET,handler);
  eventManager=new TestingEventManager(handlers,eventCurator);
}

Fixed version (ground truth):
@Before public void before(){
  ObjectMapper mapper=new ObjectMapper();
  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  Map<String,EventHandler> handlers=new HashMap<String,EventHandler>();
  handlers.put(TEST_HANDLER_TARGET,handler);
  eventManager=new TestingEventManager(handlers);
}
Program: 49457
Project: 49457
Buggy source:
@Test public void verifyHandleCreated(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.CREATED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(eventCurator).create(eq(toHandle));
  verify(handler).handleCreated(eq(toHandle));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}

Fixed version (ground truth):
@Test public void verifyHandleCreated(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.CREATED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(handler).handleCreated(eq(toHandle));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}
Program: 49458
Project: 49458
Buggy source:
@Test public void testEventManagerUnknown(){
  Event toHandle=new Event();
  toHandle.setTarget("String_Node_Str");
  eventManager.handle(toHandle);
  verify(eventCurator).create(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}

Fixed version (ground truth):
@Test public void testEventManagerUnknown(){
  Event toHandle=new Event();
  toHandle.setTarget("String_Node_Str");
  eventManager.handle(toHandle);
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}
Program: 49459
Project: 49459
Buggy source:
@Test public void verifyHandleUpdated(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.MODIFIED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(eventCurator).create(eq(toHandle));
  verify(handler).handleUpdated(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}

Fixed version (ground truth):
@Test public void verifyHandleUpdated(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.MODIFIED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(handler).handleUpdated(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleDeleted(any(Event.class));
}
Program: 49460
Project: 49460
Buggy source:
@Test public void verifyHandleDeleted(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.DELETED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(eventCurator).create(eq(toHandle));
  verify(handler).handleDeleted(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
}

Fixed version (ground truth):
@Test public void verifyHandleDeleted(){
  Event toHandle=new Event();
  toHandle.setTarget(TEST_HANDLER_TARGET);
  toHandle.setType(EventManager.DELETED_EVENT_TYPE);
  eventManager.handle(toHandle);
  verify(handler).handleDeleted(eq(toHandle));
  verify(handler,never()).handleCreated(any(Event.class));
  verify(handler,never()).handleUpdated(any(Event.class));
}
Program: 49461
Project: 49461
Buggy source:
/** 
 * Check whether   {@link #consumed} is greater than {@link #quantity}
 * @return true if consumed>quantity else false.
 */
@XmlTransient public boolean isOverflowing(){
  return getConsumed() > this.quantity;
}

Fixed version (ground truth):
/** 
 * Check whether   {@link #consumed} is greater than {@link #quantity}
 * @return true if consumed>quantity else false.
 */
@XmlTransient public boolean isOverflowing(){
  if (this.quantity == -1) {
    return false;
  }
  return getConsumed() > this.quantity;
}
Program: 49462
Project: 49462
Buggy source:
public void testMultiplePoolsForOwnerProductAllowed(){
  Pool duplicatePool=createPoolAndSub(owner,prod1,-1L,TestUtil.createDate(2009,11,30),TestUtil.createDate(2050,11,30));
  poolCurator.create(duplicatePool);
}

Fixed version (ground truth):
@Test public void testMultiplePoolsForOwnerProductAllowed(){
  Pool duplicatePool=createPoolAndSub(owner,prod1,-1L,TestUtil.createDate(2009,11,30),TestUtil.createDate(2050,11,30));
  poolCurator.create(duplicatePool);
}
Program: 49463
Project: 49463
Buggy source:
/** 
 * @return the passphrase
 */
public String getPassphrase(){
  log.info("String_Node_Str" + passphrase);
  return passphrase;
}

Fixed version (ground truth):
/** 
 * @return the passphrase
 */
public String getPassphrase(){
  log.info("String_Node_Str",passphrase);
  return passphrase;
}
Program: 49464
Project: 49464
Buggy source:
public String decryptValue(String toDecrypt,String passphrase){
  log.info("String_Node_Str");
  if (!toDecrypt.startsWith("String_Node_Str")) {
    log.debug("String_Node_Str");
    return toDecrypt;
  }
  toDecrypt=toDecrypt.substring(3);
  try {
    Cipher cipher=Cipher.getInstance("String_Node_Str");
    String ivString=passphrase + passphrase;
    String iv=DigestUtils.sha256Hex(ivString);
    String passphraseDigest=DigestUtils.sha256Hex(passphrase);
    SecretKeySpec spec=new SecretKeySpec(Arrays.copyOfRange(passphraseDigest.getBytes(),0,32),"String_Node_Str");
    cipher.init(Cipher.DECRYPT_MODE,spec,new IvParameterSpec(iv.getBytes(),0,16));
    byte[] b64bytes=Base64.decodeBase64(toDecrypt);
    return new String(cipher.doFinal(b64bytes));
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + toDecrypt,e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public String decryptValue(String toDecrypt,String passphrase){
  log.info("String_Node_Str");
  if (!toDecrypt.startsWith("String_Node_Str")) {
    log.debug("String_Node_Str");
    return toDecrypt;
  }
  toDecrypt=toDecrypt.substring(3);
  try {
    Cipher cipher=Cipher.getInstance("String_Node_Str");
    String ivString=passphrase + passphrase;
    String iv=DigestUtils.sha256Hex(ivString);
    String passphraseDigest=DigestUtils.sha256Hex(passphrase);
    SecretKeySpec spec=new SecretKeySpec(Arrays.copyOfRange(passphraseDigest.getBytes(),0,32),"String_Node_Str");
    cipher.init(Cipher.DECRYPT_MODE,spec,new IvParameterSpec(iv.getBytes(),0,16));
    byte[] b64bytes=Base64.decodeBase64(toDecrypt);
    return new String(cipher.doFinal(b64bytes));
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + toDecrypt,e);
    throw new RuntimeException(e);
  }
}
Program: 49465
Project: 49465
Buggy source:
public Properties parseConfig(Map<String,String> inputConfiguration){
  readSecretFile((String)inputConfiguration.get("String_Node_Str"));
  Properties toReturn=new Properties();
  Properties toDecrypt=super.parseConfig(inputConfiguration);
  if (getEncryptedConfigKeys() != null) {
    for (    String encConfigKey : getEncryptedConfigKeys()) {
      String passwordString=toDecrypt.getProperty(encConfigKey);
      if (passwordString != null) {
        toReturn.setProperty(encConfigKey,decryptValue(passwordString,getPassphrase()));
      }
    }
  }
  return toReturn;
}

Fixed version (ground truth):
@Override public Properties parseConfig(Map<String,String> inputConfiguration){
  readSecretFile((String)inputConfiguration.get(PASSPHRASE_PROPERTY));
  Properties properties=super.parseConfig(inputConfiguration);
  Set<String> encryptedProperties=getEncryptedConfigKeys();
  if (encryptedProperties != null) {
    for (    String key : encryptedProperties) {
      String encryptedValue=properties.getProperty(key);
      properties.setProperty(key,decryptValue(encryptedValue,getPassphrase()));
    }
  }
  return properties;
}
Program: 49466
Project: 49466
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void getStringMethods(){
  Configuration localconf=new MapConfiguration(new HashMap<String,String>(){
{
      put("String_Node_Str",plainPassword);
    }
  }
);
  assertEquals(plainPassword,localconf.getString("String_Node_Str"));
  assertNull(localconf.getString("String_Node_Str",null));
}

Fixed version (ground truth):
@Test public void getStringMethods(){
  Configuration localconf=new MapConfiguration(new HashMap<String,String>(){
{
      put("String_Node_Str",plainPassword);
    }
  }
);
  assertEquals(plainPassword,localconf.getString("String_Node_Str"));
  assertNull(localconf.getString("String_Node_Str",null));
}
Program: 49467
Project: 49467
Buggy source:
public GutterballObjectMapper(){
  super();
  configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  SimpleModule module=new SimpleModule();
  module.addDeserializer(Entitlement.class,new EntitlementDeserializer(this));
  this.registerModule(module);
}

Fixed version (ground truth):
public GutterballObjectMapper(){
  super();
  configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  SimpleModule module=new SimpleModule();
  module.addDeserializer(Entitlement.class,new EntitlementDeserializer());
  this.registerModule(module);
}
Program: 49468
Project: 49468
Buggy source:
public void setGuestIds(List<GuestId> guestIds){
  this.guestIds=guestIds;
  for (  GuestId gid : this.guestIds) {
    gid.setConsumer(this);
  }
}

Fixed version (ground truth):
public void setGuestIds(List<GuestId> ids){
  if (ids == null) {
    ids=new LinkedList<GuestId>();
  }
  this.guestIds=ids;
  for (  GuestId gid : this.guestIds) {
    gid.setConsumer(this);
  }
}
Program: 49469
Project: 49469
Buggy source:
public void setInstalledProducts(Set<ConsumerInstalledProduct> installedProducts){
  this.installedProducts=installedProducts;
  for (  ConsumerInstalledProduct p : this.installedProducts) {
    p.setConsumer(this);
  }
}

Fixed version (ground truth):
public void setInstalledProducts(Set<ConsumerInstalledProduct> installed){
  if (installed == null) {
    installed=new HashSet<ConsumerInstalledProduct>();
  }
  this.installedProducts=installed;
  for (  ConsumerInstalledProduct p : this.installedProducts) {
    p.setConsumer(this);
  }
}
Program: 49470
Project: 49470
Buggy source:
public Consumer getConsumer(){
  return consumer;
}

Fixed version (ground truth):
@XmlTransient public Consumer getConsumer(){
  return consumer;
}
Program: 49471
Project: 49471
Buggy source:
public Consumer getConsumer(){
  return consumer;
}

Fixed version (ground truth):
@XmlTransient public Consumer getConsumer(){
  return consumer;
}
Program: 49472
Project: 49472
Buggy source:
/** 
 * @param i18nProvider
 * @param key
 * @param description
 */
@Inject public ConsumerTrendReport(I18nProvider i18nProvider,ComplianceSnapshotCurator complianceSnapshotCurator){
  super(i18nProvider,"String_Node_Str",i18nProvider.get().tr("String_Node_Str"));
  this.complianceSnapshotCurator=complianceSnapshotCurator;
}

Fixed version (ground truth):
/** 
 * @param i18nProvider
 * @param key
 * @param description
 */
@Inject public ConsumerTrendReport(I18nProvider i18nProvider,ComplianceSnapshotCurator snapshotCurator){
  super(i18nProvider,"String_Node_Str",i18nProvider.get().tr("String_Node_Str"));
  this.snapshotCurator=snapshotCurator;
}
Program: 49473
Project: 49473
Buggy source:
@Override protected ConsumerTrendReportResult execute(MultivaluedMap<String,String> queryParams){
  List<String> consumerIds=queryParams.get("String_Node_Str");
  List<String> ownerFilters=queryParams.get("String_Node_Str");
  Date startDate=null;
  Date endDate=null;
  if (queryParams.containsKey("String_Node_Str")) {
    Calendar cal=Calendar.getInstance();
    endDate=cal.getTime();
    int hours=Integer.parseInt(queryParams.getFirst("String_Node_Str"));
    cal.add(Calendar.HOUR,hours * -1);
    startDate=cal.getTime();
  }
 else   if (queryParams.containsKey("String_Node_Str") && queryParams.containsKey("String_Node_Str")) {
    startDate=parseDate(queryParams.getFirst("String_Node_Str"));
    endDate=parseDate(queryParams.getFirst("String_Node_Str"));
  }
  ConsumerTrendReportResult result=new ConsumerTrendReportResult();
  Set<ComplianceSnapshot> forTimeSpan=complianceSnapshotCurator.getComplianceForTimespan(startDate,endDate,consumerIds,ownerFilters);
  for (  ComplianceSnapshot cs : forTimeSpan) {
    result.add(cs.getConsumer().getUuid(),cs);
  }
  return result;
}

Fixed version (ground truth):
@Override protected ConsumerTrendReportResult execute(MultivaluedMap<String,String> queryParams){
  List<String> consumerIds=queryParams.get("String_Node_Str");
  List<String> ownerFilters=queryParams.get("String_Node_Str");
  Date startDate=null;
  Date endDate=null;
  if (queryParams.containsKey("String_Node_Str")) {
    Calendar cal=Calendar.getInstance();
    endDate=cal.getTime();
    int hours=Integer.parseInt(queryParams.getFirst("String_Node_Str"));
    cal.add(Calendar.HOUR,hours * -1);
    startDate=cal.getTime();
  }
 else   if (queryParams.containsKey("String_Node_Str") && queryParams.containsKey("String_Node_Str")) {
    startDate=parseDate(queryParams.getFirst("String_Node_Str"));
    endDate=parseDate(queryParams.getFirst("String_Node_Str"));
  }
  ConsumerTrendReportResult result=new ConsumerTrendReportResult();
  Set<ComplianceSnapshot> forTimeSpan=snapshotCurator.getComplianceForTimespan(startDate,endDate,consumerIds,ownerFilters);
  for (  ComplianceSnapshot cs : forTimeSpan) {
    result.add(cs.getConsumer().getUuid(),cs);
  }
  return result;
}
Program: 49474
Project: 49474
Buggy source:
/** 
 * Adds an event to the queue. Event will not be sent until sendEvents is called, typically after a successful request or job execution.
 */
@Override public void queueEvent(Event event){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + event);
  }
  getEventQueue().add(event);
}

Fixed version (ground truth):
/** 
 * Adds an event to the queue. Event will not be sent until sendEvents is called, typically after a successful request or job execution.
 */
@Override public void queueEvent(Event event){
  log.debug("String_Node_Str" + event);
  getEventQueue().add(event);
}
Program: 49475
Project: 49475
Buggy source:
@Inject public HornetqEventDispatcher(ObjectMapper mapper,Config config){
  this.mapper=mapper;
  try {
    largeMsgSize=config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE);
    factory=createClientSessionFactory();
  }
 catch (  HornetQException e) {
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Inject public HornetqEventDispatcher(ObjectMapper mapper,Config config){
  this.mapper=mapper;
  try {
    largeMsgSize=config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE);
    factory=createClientSessionFactory();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 49476
Project: 49476
Buggy source:
public void sendEvent(Event event){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + event);
  }
  try {
    ClientMessage message=getClientSession().createMessage(true);
    String eventString=mapper.writeValueAsString(event);
    message.getBodyBuffer().writeString(eventString);
    getClientProducer().send(message);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
}

Fixed version (ground truth):
public void sendEvent(Event event){
  log.debug("String_Node_Str" + event);
  try {
    ClientMessage message=getClientSession().createMessage(true);
    String eventString=mapper.writeValueAsString(event);
    message.getBodyBuffer().writeString(eventString);
    getClientProducer().send(message);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
}
Program: 49477
Project: 49477
Buggy source:
@Override public void execute(JobExecutionContext context) throws JobExecutionException {
  pinsetterJobScope.enter();
  candlepinSingletonScope.enter();
  boolean startedUow=startUnitOfWork();
  try {
    decorated=injector.getInstance(decoratedJobClass);
    decorated.execute(context);
  }
  finally {
    candlepinSingletonScope.exit();
    pinsetterJobScope.exit();
    if (startedUow) {
      endUnitOfWork();
    }
  }
}

Fixed version (ground truth):
@Override public void execute(JobExecutionContext context) throws JobExecutionException {
  pinsetterJobScope.enter();
  candlepinSingletonScope.enter();
  boolean startedUow=startUnitOfWork();
  try {
    decorated=injector.getInstance(decoratedJobClass);
  }
  finally {
    candlepinSingletonScope.exit();
    if (startedUow) {
      endUnitOfWork();
    }
  }
  try {
    decorated.execute(context);
  }
  finally {
    pinsetterJobScope.exit();
  }
}
Program: 49478
Project: 49478
Buggy source:
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  chain.doFilter(request,response);
  TeeHttpServletResponse resp=new TeeHttpServletResponse((HttpServletResponse)response);
  if (resp.getStatus() >= 200 && resp.getStatus() < 300) {
    eventSinkProvider.get().sendEvents();
  }
 else {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  TeeHttpServletResponse resp=new TeeHttpServletResponse((HttpServletResponse)response);
  chain.doFilter(request,resp);
  if (resp.getStatus() >= 200 && resp.getStatus() < 300) {
    eventSinkProvider.get().sendEvents();
  }
 else {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + resp.getStatus());
    }
  }
}
Program: 49479
Project: 49479
Buggy source:
public Iterable<DBObject> getComplianceForTimespan(Date startDate,Date endDate,List<String> consumerIds,List<String> owners){
  BasicDBObjectBuilder queryBuilder=BasicDBObjectBuilder.start();
  if (owners != null && !owners.isEmpty()) {
    queryBuilder.add("String_Node_Str",new BasicDBObject("String_Node_Str",owners));
  }
  BasicDBObjectBuilder dateQueryBuilder=BasicDBObjectBuilder.start();
  if (startDate != null) {
    dateQueryBuilder.add("String_Node_Str",startDate);
  }
  if (endDate != null) {
    dateQueryBuilder.add("String_Node_Str",endDate);
  }
  if (startDate != null || endDate != null) {
    queryBuilder.add("String_Node_Str",dateQueryBuilder.get());
  }
  BasicDBObject projections=new BasicDBObject("String_Node_Str",1);
  BasicDBObject project=new BasicDBObject("String_Node_Str",projections);
  DBObject query=new BasicDBObject("String_Node_Str",queryBuilder.get());
  DBObject sort=new BasicDBObject("String_Node_Str",new BasicDBObject("String_Node_Str",1));
  AggregationOutput output=collection.aggregate(Arrays.asList(query,project,sort));
  List<ObjectId> resultIds=new LinkedList<ObjectId>();
  for (  DBObject dbo : output.results()) {
    resultIds.add((ObjectId)dbo.get("String_Node_Str"));
  }
  projections=new BasicDBObject("String_Node_Str",0).append("String_Node_Str",1).append("String_Node_Str",1);
  return collection.find(new BasicDBObject("String_Node_Str",new BasicDBObject("String_Node_Str",resultIds)),projections);
}

Fixed version (ground truth):
public DBCursor getComplianceForTimespan(Date startDate,Date endDate,List<String> consumerIds,List<String> owners){
  BasicDBObjectBuilder queryBuilder=BasicDBObjectBuilder.start();
  if (owners != null && !owners.isEmpty()) {
    queryBuilder.add("String_Node_Str",new BasicDBObject("String_Node_Str",owners));
  }
  BasicDBObjectBuilder dateQueryBuilder=BasicDBObjectBuilder.start();
  if (startDate != null) {
    dateQueryBuilder.add("String_Node_Str",startDate);
  }
  if (endDate != null) {
    dateQueryBuilder.add("String_Node_Str",endDate);
  }
  if (startDate != null || endDate != null) {
    queryBuilder.add("String_Node_Str",dateQueryBuilder.get());
  }
  BasicDBObject projections=new BasicDBObject("String_Node_Str",1);
  BasicDBObject project=new BasicDBObject("String_Node_Str",projections);
  DBObject query=new BasicDBObject("String_Node_Str",queryBuilder.get());
  DBObject sort=new BasicDBObject("String_Node_Str",new BasicDBObject("String_Node_Str",1));
  AggregationOutput output=collection.aggregate(Arrays.asList(query,project,sort));
  List<ObjectId> resultIds=getObjectIds(output.results());
  return collection.find(new BasicDBObject("String_Node_Str",new BasicDBObject("String_Node_Str",resultIds)));
}
Program: 49480
Project: 49480
Buggy source:
@Inject public ComplianceDataCurator(MongoConnection mongo,ConsumerCurator consumerCurator){
  super(BasicDBObject.class,mongo);
  this.consumerCurator=consumerCurator;
}

Fixed version (ground truth):
@Inject public ComplianceDataCurator(MongoConnection mongo,ConsumerCurator consumerCurator){
  super(BasicDBObject.class,mongo);
  this.consumerCurator=consumerCurator;
  this.collection.createIndex(new BasicDBObject("String_Node_Str",1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",-1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",1));
}
Program: 49482
Project: 49482
Buggy source:
@Inject public ConsumerCurator(MongoConnection mongo){
  super(Consumer.class,mongo);
}

Fixed version (ground truth):
@Inject public ConsumerCurator(MongoConnection mongo){
  super(Consumer.class,mongo);
  this.collection.createIndex(new BasicDBObject("String_Node_Str",-1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",-1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",1));
  this.collection.createIndex(new BasicDBObject("String_Node_Str",1));
}
Program: 49483
Project: 49483
Buggy source:
@Override protected MultiRowResult<DBObject> execute(MultivaluedMap<String,String> queryParams){
  MultiRowResult<DBObject> result=new MultiRowResult<DBObject>();
  List<String> consumerIds=queryParams.get("String_Node_Str");
  List<String> statusFilters=queryParams.get("String_Node_Str");
  List<String> ownerFilters=queryParams.get("String_Node_Str");
  Date targetDate=queryParams.containsKey("String_Node_Str") ? parseDate(queryParams.getFirst("String_Node_Str")) : new Date();
  Iterable<DBObject> complianceSnapshots=complianceDataCurator.getComplianceOnDate(targetDate,consumerIds,ownerFilters,statusFilters);
  for (  DBObject snapshot : complianceSnapshots) {
    result.add(snapshot);
  }
  return result;
}

Fixed version (ground truth):
@Override protected MultiRowResult<DBObject> execute(MultivaluedMap<String,String> queryParams){
  MultiRowResult<DBObject> result=new MultiRowResult<DBObject>();
  List<String> consumerIds=queryParams.get("String_Node_Str");
  List<String> statusFilters=queryParams.get("String_Node_Str");
  List<String> ownerFilters=queryParams.get("String_Node_Str");
  Date targetDate=queryParams.containsKey("String_Node_Str") ? parseDate(queryParams.getFirst("String_Node_Str")) : new Date();
  DBCursor complianceSnapshots=complianceDataCurator.getComplianceOnDate(targetDate,consumerIds,ownerFilters,statusFilters);
  while (complianceSnapshots.hasNext()) {
    result.add(complianceSnapshots.next());
  }
  return result;
}
Program: 49484
Project: 49484
Buggy source:
@Test public void testGetByConsumerUuid(){
  MultivaluedMap<String,String> params=mock(MultivaluedMap.class);
  when(params.containsKey("String_Node_Str")).thenReturn(true);
  when(params.get("String_Node_Str")).thenReturn(Arrays.asList("String_Node_Str","String_Node_Str"));
  MultiRowResult<DBObject> results=report.run(params);
  assertEquals(1,results.size());
  DBObject row=results.get(0);
  DBObject consumer=(DBObject)row.get("String_Node_Str");
  assertEquals("String_Node_Str",consumer.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testGetByConsumerUuid(){
  MultivaluedMap<String,String> params=mock(MultivaluedMap.class);
  when(params.containsKey("String_Node_Str")).thenReturn(true);
  when(params.get("String_Node_Str")).thenReturn(Arrays.asList("String_Node_Str","String_Node_Str"));
  MultiRowResult<DBObject> results=report.run(params);
  assertEquals(1,results.size());
  DBObject snap=results.get(0);
  DBObject consumer=(DBObject)snap.get("String_Node_Str");
  assertEquals("String_Node_Str",consumer.get("String_Node_Str"));
}
Program: 49485
Project: 49485
Buggy source:
@Test public void testGetByOwner(){
  MultivaluedMap<String,String> params=mock(MultivaluedMap.class);
  when(params.containsKey("String_Node_Str")).thenReturn(true);
  when(params.get("String_Node_Str")).thenReturn(Arrays.asList("String_Node_Str"));
  MultiRowResult<DBObject> results=report.run(params);
  assertEquals(1,results.size());
  DBObject r=results.get(0);
  DBObject consumer=(DBObject)r.get("String_Node_Str");
  DBObject owner=(DBObject)consumer.get("String_Node_Str");
  assertEquals("String_Node_Str",owner.get("String_Node_Str"));
  assertEquals("String_Node_Str",consumer.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testGetByOwner(){
  MultivaluedMap<String,String> params=mock(MultivaluedMap.class);
  when(params.containsKey("String_Node_Str")).thenReturn(true);
  when(params.get("String_Node_Str")).thenReturn(Arrays.asList("String_Node_Str"));
  MultiRowResult<DBObject> results=report.run(params);
  assertEquals(1,results.size());
  DBObject snap=results.get(0);
  DBObject consumer=(DBObject)snap.get("String_Node_Str");
  DBObject owner=(DBObject)consumer.get("String_Node_Str");
  assertEquals("String_Node_Str",owner.get("String_Node_Str"));
  assertEquals("String_Node_Str",consumer.get("String_Node_Str"));
}
Program: 49486
Project: 49486
Buggy source:
@Test public void test() throws AMQException, JMSException, URISyntaxException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  String connstr="String_Node_Str";
  Connection conn=new AMQConnection(connstr);
  conn.start();
  Session sess=conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
  Destination dest=new AMQAnyDestination("String_Node_Str");
  MessageConsumer consumer=sess.createConsumer(dest);
  Message msg;
  while ((msg=consumer.receive(-1)) != null) {
    System.out.println("String_Node_Str");
    System.out.println(msg);
    System.out.println("String_Node_Str");
  }
  consumer.close();
  sess.close();
  conn.close();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Test public void test() throws AMQException, JMSException, URISyntaxException {
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  String connstr="String_Node_Str" + "String_Node_Str";
  Connection conn=new AMQConnection(connstr);
  conn.start();
  Session sess=conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
  Destination dest=new AMQAnyDestination("String_Node_Str");
  MessageConsumer consumer=sess.createConsumer(dest);
  Message msg;
  while ((msg=consumer.receive(-1)) != null) {
    System.out.println("String_Node_Str");
    System.out.println(msg);
    System.out.println("String_Node_Str");
  }
  consumer.close();
  sess.close();
  conn.close();
  System.out.println("String_Node_Str");
}
Program: 49487
Project: 49487
Buggy source:
@Inject public EventSinkImpl(EventFactory eventFactory,ObjectMapper mapper,Config config){
  this.eventFactory=eventFactory;
  this.mapper=mapper;
  try {
    largeMsgSize=config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE);
    factory=createClientSessionFactory();
    clientSession=factory.createSession();
    clientProducer=clientSession.createProducer(EventSource.QUEUE_ADDRESS);
  }
 catch (  HornetQException e) {
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Inject public EventSinkImpl(EventFactory eventFactory,ObjectMapper mapper,Config config){
  this.eventFactory=eventFactory;
  this.mapper=mapper;
  try {
    largeMsgSize=config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE);
    factory=createClientSessionFactory();
  }
 catch (  HornetQException e) {
    throw new RuntimeException(e);
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 49488
Project: 49488
Buggy source:
@Override public void sendEvent(Event event){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + event);
  }
  try {
    ClientMessage message=clientSession.createMessage(true);
    String eventString=mapper.writeValueAsString(event);
    message.getBodyBuffer().writeString(eventString);
    clientProducer.send(message);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
}

Fixed version (ground truth):
@Override public void sendEvent(Event event){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + event);
  }
  try {
    ClientMessage message=getClientSession().createMessage(true);
    String eventString=mapper.writeValueAsString(event);
    message.getBodyBuffer().writeString(eventString);
    getClientProducer().send(message);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + event,e);
  }
}
Program: 49491
Project: 49491
Buggy source:
public boolean updatePoolFromStack(Pool pool,Consumer consumer,String stackId){
  return poolRules.updatePoolFromStack(pool,consumer,stackId);
}

Fixed version (ground truth):
public PoolUpdate updatePoolFromStack(Pool pool,Consumer consumer,String stackId){
  return poolRules.updatePoolFromStack(pool,consumer,stackId);
}
Program: 49493
Project: 49493
Buggy source:
/** 
 * Updates the pool based on the entitlements in the specified stack.
 * @param pool
 * @param consumer
 * @param stackId
 * @return true if the pool was successfully updated by another entitlementin the stack, false otherwise.
 */
boolean updatePoolFromStack(Pool pool,Consumer consumer,String stackId);

Fixed version (ground truth):
/** 
 * Updates the pool based on the entitlements in the specified stack.
 * @param pool
 * @param consumer
 * @param stackId
 * @return pool update specifics
 */
PoolUpdate updatePoolFromStack(Pool pool,Consumer consumer,String stackId);
Program: 49495
Project: 49495
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testRefreshPoolsSortsStackDerivedPools(){
  List<Subscription> subscriptions=Util.newList();
  List<Pool> pools=Util.newList();
  Pool p=TestUtil.createPool(TestUtil.createProduct());
  p.setLinkedStackId("String_Node_Str");
  pools.add(p);
  when(mockSubAdapter.getSubscriptions(any(Owner.class))).thenReturn(subscriptions);
  when(mockPoolCurator.listAvailableEntitlementPools(any(Consumer.class),any(Owner.class),anyString(),any(Date.class),anyBoolean(),anyBoolean())).thenReturn(pools);
  this.manager.getRefresher().add(getOwner()).run();
  ArgumentCaptor<List> poolCaptor=ArgumentCaptor.forClass(List.class);
  verify(this.poolRulesMock).updatePools(poolCaptor.capture());
  assertEquals(1,poolCaptor.getValue().size());
  assertEquals(p,poolCaptor.getValue().get(0));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testRefreshPoolsSortsStackDerivedPools(){
  List<Subscription> subscriptions=Util.newList();
  List<Pool> pools=Util.newList();
  Pool p=TestUtil.createPool(TestUtil.createProduct());
  p.setLinkedStackId("String_Node_Str");
  pools.add(p);
  when(mockSubAdapter.getSubscriptions(any(Owner.class))).thenReturn(subscriptions);
  Page page=mock(Page.class);
  when(page.getPageData()).thenReturn(pools);
  when(mockPoolCurator.listAvailableEntitlementPools(any(Consumer.class),any(Owner.class),anyString(),any(Date.class),anyBoolean(),any(PageRequest.class))).thenReturn(page);
  this.manager.getRefresher().add(getOwner()).run();
  ArgumentCaptor<List> poolCaptor=ArgumentCaptor.forClass(List.class);
  verify(this.poolRulesMock).updatePools(poolCaptor.capture());
  assertEquals(1,poolCaptor.getValue().size());
  assertEquals(p,poolCaptor.getValue().get(0));
}
Program: 49497
Project: 49497
Buggy source:
protected Integer getLastPage(Page page){
  PageRequest pageRequest=page.getPageRequest();
  return (page.getMaxRecords() / pageRequest.getPerPage()) + 1;
}

Fixed version (ground truth):
protected Integer getLastPage(Page page){
  PageRequest pageRequest=page.getPageRequest();
  int lastPage=page.getMaxRecords() / pageRequest.getPerPage();
  if (page.getMaxRecords() % pageRequest.getPerPage() != 0) {
    lastPage++;
  }
  return lastPage;
}
Program: 49498
Project: 49498
Buggy source:
public void setMessage(Consumer c,ComplianceReason reason){
  String base=KEYS.get(reason.getKey());
  if (base == null) {
    base=KEYS.get("String_Node_Str");
  }
  String marketingName, id;
  if (reason.isStacked()) {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getStackedMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName,reason.getAttributes().get("String_Node_Str"),reason.getAttributes().get("String_Node_Str")));
  }
 else   if (reason.isNonCovered()) {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getInstalledMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName));
  }
 else {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName,reason.getAttributes().get("String_Node_Str"),reason.getAttributes().get("String_Node_Str")));
  }
}

Fixed version (ground truth):
public void setMessage(Consumer c,ComplianceReason reason){
  String base=KEYS.get(reason.getKey());
  if (base == null) {
    base=KEYS.get("String_Node_Str");
  }
  String marketingName, id;
  if (reason.isStacked()) {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getStackedMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName,reason.getAttributes().get("String_Node_Str"),reason.getAttributes().get("String_Node_Str"),reason.getKey()));
  }
 else   if (reason.isNonCovered()) {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getInstalledMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName));
  }
 else {
    id=reason.getAttributes().get("String_Node_Str");
    marketingName=getMarketingName(id,c);
    reason.setMessage(i18n.tr(base,marketingName,reason.getAttributes().get("String_Node_Str"),reason.getAttributes().get("String_Node_Str"),reason.getKey()));
  }
}
Program: 49500
Project: 49500
Buggy source:
private void buildSegments(Map<String,Integer> segments,Set<PathNode> nodes,PathNode parent){
  if (!nodes.contains(parent)) {
    nodes.add(parent);
    for (    NodePair np : parent.getChildren()) {
      Integer count=segments.get(np.getName());
      if (count == null) {
        count=new Integer(0);
      }
      segments.put(np.getName(),++count);
      buildSegments(segments,nodes,np.getConnection());
    }
  }
}

Fixed version (ground truth):
private void buildSegments(Map<String,Integer> segments,Set<PathNode> nodes,PathNode parent){
  if (!nodes.contains(parent)) {
    nodes.add(parent);
    for (    NodePair np : parent.getChildren()) {
      Integer count=segments.get(np.getName());
      if (count == null) {
        count=0;
      }
      segments.put(np.getName(),++count);
      buildSegments(segments,nodes,np.getConnection());
    }
  }
}
Program: 49503
Project: 49503
Buggy source:
private void verifyPersonConsumer(Consumer consumer,ConsumerType type,Owner owner,String username){
  User user=null;
  try {
    user=userService.findByLogin(username);
  }
 catch (  UnsupportedOperationException e) {
    log.warn("String_Node_Str" + "String_Node_Str");
  }
  if (!user.hasOwnerAccess(owner,Access.ALL) && !user.isSuperAdmin()) {
    throw new ForbiddenException(i18n.tr("String_Node_Str",user.getUsername(),owner.getKey()));
  }
  if (type.isType(ConsumerTypeEnum.PERSON)) {
    Consumer existing=consumerCurator.findByUser(user);
    if (existing != null && existing.getType().isType(ConsumerTypeEnum.PERSON)) {
      throw new BadRequestException(i18n.tr("String_Node_Str",user.getUsername()));
    }
    consumer.setName(user.getUsername());
  }
}

Fixed version (ground truth):
private void verifyPersonConsumer(Consumer consumer,ConsumerType type,Owner owner,String username){
  User user=null;
  try {
    user=userService.findByLogin(username);
  }
 catch (  UnsupportedOperationException e) {
    log.warn("String_Node_Str" + "String_Node_Str");
  }
  if (user == null) {
    throw new NotFoundException(i18n.tr("String_Node_Str"));
  }
  if (!user.hasOwnerAccess(owner,Access.ALL) && !user.isSuperAdmin()) {
    throw new ForbiddenException(i18n.tr("String_Node_Str",user.getUsername(),owner.getKey()));
  }
  if (type.isType(ConsumerTypeEnum.PERSON)) {
    Consumer existing=consumerCurator.findByUser(user);
    if (existing != null && existing.getType().isType(ConsumerTypeEnum.PERSON)) {
      throw new BadRequestException(i18n.tr("String_Node_Str",user.getUsername()));
    }
    consumer.setName(user.getUsername());
  }
}
Program: 49505
Project: 49505
Buggy source:
public ProductImporter(ProductCurator curator,ContentCurator contentCurator,PoolManager poolManager){
  this.curator=curator;
  this.contentCurator=contentCurator;
  this.poolManager=poolManager;
}

Fixed version (ground truth):
public ProductImporter(ProductCurator curator,ContentCurator contentCurator){
  this.curator=curator;
  this.contentCurator=contentCurator;
}
Program: 49506
Project: 49506
Buggy source:
@Before public void setUp() throws IOException {
  mapper=SyncUtils.getObjectMapper(new Config(new HashMap<String,String>()));
  productCuratorMock=mock(ProductCurator.class);
  contentCuratorMock=mock(ContentCurator.class);
  poolManagerMock=mock(CandlepinPoolManager.class);
  importer=new ProductImporter(productCuratorMock,contentCuratorMock,poolManagerMock);
}

Fixed version (ground truth):
@Before public void setUp() throws IOException {
  mapper=SyncUtils.getObjectMapper(new Config(new HashMap<String,String>()));
  productCuratorMock=mock(ProductCurator.class);
  contentCuratorMock=mock(ContentCurator.class);
  importer=new ProductImporter(productCuratorMock,contentCuratorMock);
}
Program: 49507
Project: 49507
Buggy source:
@Override protected boolean removeEldestEntry(Entry<String,ProductReference> eldest){
  return this.size() > max;
}

Fixed version (ground truth):
@Override protected boolean removeEldestEntry(Entry<String,ProductReference> eldest){
  return super.size() > max;
}
Program: 49508
Project: 49508
Buggy source:
/** 
 * Update entitlement only works for the quantity.
 * @httpcode 404
 * @httpcode 200
 */
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public void updateEntitlement(@PathParam("String_Node_Str") @Verify(Entitlement.class) String id,Entitlement update){
  if (update.getQuantity() <= 0) {
    throw new BadRequestException(i18n.tr("String_Node_Str"));
  }
  Entitlement entitlement=entitlementCurator.find(id);
  if (entitlement != null) {
    if (entitlement.getQuantity() != update.getQuantity()) {
      Consumer consumer=entitlement.getConsumer();
      entitler.adjustEntitlementQuantity(consumer,entitlement,update.getQuantity());
    }
  }
 else {
    throw new NotFoundException(i18n.tr("String_Node_Str",id));
  }
}

Fixed version (ground truth):
/** 
 * Update entitlement only works for the quantity.
 * @httpcode 404
 * @httpcode 200
 */
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("String_Node_Str") public void updateEntitlement(@PathParam("String_Node_Str") @Verify(Entitlement.class) String id,Entitlement update){
  if (update.getQuantity() <= 0) {
    throw new BadRequestException(i18n.tr("String_Node_Str"));
  }
  Entitlement entitlement=entitlementCurator.find(id);
  if (entitlement != null) {
    if (entitlement.getQuantity().equals(update.getQuantity())) {
      Consumer consumer=entitlement.getConsumer();
      entitler.adjustEntitlementQuantity(consumer,entitlement,update.getQuantity());
    }
  }
 else {
    throw new NotFoundException(i18n.tr("String_Node_Str",id));
  }
}
Program: 49510
Project: 49510
Buggy source:
protected final boolean hasProductChanged(Product existingProd,Product importedProd){
  if (!existingProd.getName().equals(importedProd.getName())) {
    return true;
  }
  if (existingProd.getMultiplier() != importedProd.getMultiplier()) {
    return true;
  }
  if (existingProd.getAttributes().size() != importedProd.getAttributes().size()) {
    return true;
  }
  if (Sets.intersection(existingProd.getAttributes(),importedProd.getAttributes()).size() != existingProd.getAttributes().size()) {
    return true;
  }
  if (existingProd.getProductContent().size() != importedProd.getProductContent().size()) {
    return true;
  }
  if (Sets.intersection(existingProd.getProductContent(),importedProd.getProductContent()).size() != existingProd.getProductContent().size()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
protected final boolean hasProductChanged(Product existingProd,Product importedProd){
  if (!existingProd.getName().equals(importedProd.getName())) {
    return true;
  }
  if (!existingProd.getMultiplier().equals(importedProd.getMultiplier())) {
    return true;
  }
  if (existingProd.getAttributes().size() != importedProd.getAttributes().size()) {
    return true;
  }
  if (Sets.intersection(existingProd.getAttributes(),importedProd.getAttributes()).size() != existingProd.getAttributes().size()) {
    return true;
  }
  if (existingProd.getProductContent().size() != importedProd.getProductContent().size()) {
    return true;
  }
  if (Sets.intersection(existingProd.getProductContent(),importedProd.getProductContent()).size() != existingProd.getProductContent().size()) {
    return true;
  }
  return false;
}
Program: 49511
Project: 49511
Buggy source:
/** 
 * @param nRulesSource the rulesSource to set
 */
public void setRulesSource(Rules.RulesSource rulesSource){
  this.rulesSource=Rules.rulesSourceToString(rulesSource);
}

Fixed version (ground truth):
/** 
 * @param rulesSource the rulesSource to set
 */
public void setRulesSource(Rules.RulesSource rulesSource){
  this.rulesSource=Rules.rulesSourceToString(rulesSource);
}
Program: 49512
Project: 49512
Buggy source:
/** 
 * Check compliance status for a consumer on a specific date.
 * @param c Consumer to check.
 * @param date Date to check compliance status for.
 * @return Compliance status.
 */
public ComplianceStatus getStatus(Consumer c,Date date){
  List<Entitlement> ents=entCurator.listByConsumer(c);
  JsonJsContext args=new JsonJsContext();
  args.put("String_Node_Str",c);
  args.put("String_Node_Str",ents);
  args.put("String_Node_Str",date);
  args.put("String_Node_Str",new ComplianceRulesHelper(entCurator),false);
  args.put("String_Node_Str",log,false);
  String json=runJsFunction(String.class,"String_Node_Str",args);
  log.warn(json);
  try {
    ComplianceStatus status=mapper.readValue(json,ComplianceStatus.class);
    return status;
  }
 catch (  Exception e) {
    throw new RuleExecutionException(e);
  }
}

Fixed version (ground truth):
/** 
 * Check compliance status for a consumer on a specific date.
 * @param c Consumer to check.
 * @param date Date to check compliance status for.
 * @return Compliance status.
 */
public ComplianceStatus getStatus(Consumer c,Date date){
  List<Entitlement> ents=entCurator.listByConsumer(c);
  JsonJsContext args=new JsonJsContext();
  args.put("String_Node_Str",c);
  args.put("String_Node_Str",ents);
  args.put("String_Node_Str",date);
  args.put("String_Node_Str",new ComplianceRulesHelper(entCurator),false);
  args.put("String_Node_Str",log,false);
  String json=runJsFunction(String.class,"String_Node_Str",args);
  log.debug("String_Node_Str" + json);
  try {
    ComplianceStatus status=mapper.readValue(json,ComplianceStatus.class);
    return status;
  }
 catch (  Exception e) {
    throw new RuleExecutionException(e);
  }
}
Program: 49514
Project: 49514
Buggy source:
@Override public Serializable getId(){
  return null;
}

Fixed version (ground truth):
@Override @XmlTransient public Serializable getId(){
  return null;
}
Program: 49515
Project: 49515
Buggy source:
void addDefaultEntitlementsConsumedByFamily(int physical,int virtual){
  for (  String key : entitlementsConsumedByFamily.keySet()) {
    ConsumptionTypeCounts count=entitlementsConsumedByFamily.get(key);
    physical-=count.physical;
    virtual-=count.guest;
  }
  if (physical > 0 || virtual > 0) {
    addToEntitlementsConsumedByFamily("String_Node_Str",physical,virtual);
  }
}

Fixed version (ground truth):
public void addDefaultEntitlementsConsumedByFamily(int physical,int virtual){
  for (  String key : entitlementsConsumedByFamily.keySet()) {
    ConsumptionTypeCounts count=entitlementsConsumedByFamily.get(key);
    physical-=count.physical;
    virtual-=count.guest;
  }
  if (physical > 0 || virtual > 0) {
    addToEntitlementsConsumedByFamily("String_Node_Str",physical,virtual);
  }
}