nus-yam/ex-repair huggingface dataset:
Program: 179178
Project: 179178
Buggy source:
/** 
 * @param hostname - default <b>localhost</b>
 * @param port - default <b>27017</b>
 * @param dbName - default <b>emiregistry</b>
 * @param colName - default <b>services</b>
 */
public MongoDBServiceDatabase(String hostname,Integer port,String dbName,String colName){
  try {
    if (DSRServer.getConfiguration() == null) {
      new DSRServer(new Configuration(new Properties()));
    }
    if (connection == null) {
      connection=new Mongo(hostname,port);
    }
    database=connection.getDB(dbName);
    serviceCollection=database.getCollection(colName);
    BasicDBObject obj=new BasicDBObject(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),"String_Node_Str");
    serviceCollection.ensureIndex(obj,ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),true);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + obj);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * @param hostname - default <b>localhost</b>
 * @param port - default <b>27017</b>
 * @param dbName - default <b>emiregistry</b>
 * @param colName - default <b>services</b>
 */
public MongoDBServiceDatabase(String hostname,Integer port,String dbName,String colName){
  try {
    if (DSRServer.getConfiguration() == null) {
      Properties serverProps=new Properties();
      serverProps.put(ServerConstants.MONGODB_HOSTNAME,hostname);
      serverProps.put(ServerConstants.MONGODB_PORT,port);
      serverProps.put(ServerConstants.MONGODB_COLLECTION_NAME,colName);
      serverProps.put(ServerConstants.MONGODB_DB_NAME,dbName);
      new DSRServer(new Configuration(serverProps));
    }
    if (connection == null) {
      connection=new Mongo(hostname,port);
    }
    database=connection.getDB(dbName);
    serviceCollection=database.getCollection(colName);
    BasicDBObject obj=new BasicDBObject(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),"String_Node_Str");
    serviceCollection.ensureIndex(obj,ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),true);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + obj);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 179179
Project: 179179
Buggy source:
/** 
 * get the server's identity, or <code>null</code> if  no server keystore has been configured
 * @see #getServerCert()
 * @return an {@link X500Principal} or <code>null</code>
 */
public static X500Principal getServerIdentity(){
  ISecurityProperties secProps=DSRServer.getSecurityProperties();
  if (secProps.isSslEnabled() && secProps.getKeystore() != null) {
    return getServerCert().getSubjectX500Principal();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * get the server's identity, or <code>null</code> if  no server keystore has been configured makeAnonymousClient
 * @see #getServerCert()
 * @return an {@link X500Principal} or <code>null</code>
 */
public static X500Principal getServerIdentity(){
  ISecurityProperties secProps=DSRServer.getSecurityProperties();
  if (secProps.isSslEnabled() && secProps.getKeystore() != null) {
    return getServerCert().getSubjectX500Principal();
  }
 else {
    return null;
  }
}
Program: 179180
Project: 179180
Buggy source:
@BeforeClass public static void setUpBeforeClass() throws Exception {
  final MongoDBServiceDatabase parentDB=new MongoDBServiceDatabase("String_Node_Str",27017,"String_Node_Str","String_Node_Str");
  parentDB.deleteAll();
  final MongoDBServiceDatabase childDB=new MongoDBServiceDatabase("String_Node_Str",27017,"String_Node_Str","String_Node_Str");
  childDB.deleteAll();
}

Fixed version (ground truth):
@BeforeClass public static void setUpBeforeClass() throws Exception {
  ServiceUtil.initLogger("String_Node_Str");
  final MongoDBServiceDatabase parentDB=new MongoDBServiceDatabase("String_Node_Str",27017,"String_Node_Str","String_Node_Str");
  parentDB.deleteAll();
  final MongoDBServiceDatabase childDB=new MongoDBServiceDatabase("String_Node_Str",27017,"String_Node_Str","String_Node_Str");
  childDB.deleteAll();
}
Program: 179181
Project: 179181
Buggy source:
@Override public PDPResult checkAuthorisation(Client c,String action,ResourceDescriptor d) throws Exception {
  if (c.getRole().getName().equalsIgnoreCase("String_Node_Str") || c.getRole().getName().equalsIgnoreCase("String_Node_Str")) {
    return new PDPResult(PDPResult.Decision.PERMIT,"String_Node_Str");
  }
  return new PDPResult(PDPResult.Decision.DENY,"String_Node_Str");
}

Fixed version (ground truth):
@Override public PDPResult checkAuthorisation(Client c,String action,ResourceDescriptor d) throws Exception {
  if (d.getServiceName().equalsIgnoreCase("String_Node_Str")) {
    if (c.getRole().getName().equalsIgnoreCase("String_Node_Str") || c.getRole().getName().equalsIgnoreCase("String_Node_Str")) {
      return new PDPResult(PDPResult.Decision.PERMIT,"String_Node_Str");
    }
 else {
      return new PDPResult(PDPResult.Decision.DENY,"String_Node_Str");
    }
  }
  return new PDPResult(PDPResult.Decision.PERMIT,"String_Node_Str");
}
Program: 179182
Project: 179182
Buggy source:
@Override public ContainerRequest filter(ContainerRequest request) throws WebApplicationException {
  MultivaluedMap<String,String> map;
  Map<String,Object> m;
  try {
    map=request.getRequestHeaders();
    m=request.getProperties();
    checkAccess();
  }
 catch (  AuthorisationException e) {
    throw new WebApplicationException(e,Response.status(Status.UNAUTHORIZED).entity("String_Node_Str" + e).build());
  }
  return request;
}

Fixed version (ground truth):
@Override public ContainerRequest filter(ContainerRequest request) throws WebApplicationException {
  try {
    checkAccess();
  }
 catch (  AuthorisationException e) {
    throw new WebApplicationException(e,Response.status(Status.UNAUTHORIZED).entity("String_Node_Str" + e).build());
  }
  return request;
}
Program: 179183
Project: 179183
Buggy source:
@Test public void test() throws ClientHandlerException, UniformInterfaceException, JSONException {
  DSRClient cr1=new DSRClient(BaseURI + "String_Node_Str");
  assertTrue(cr1.getClientResource().accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class).getStatus() == Status.OK.getStatusCode());
  JSONObject jo=cr1.getClientResource().accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class).getEntity(JSONObject.class);
  System.out.println(jo);
  assertNotNull(jo);
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  DSRClient cr1=new DSRClient(BaseURI + "String_Node_Str");
  assertTrue(cr1.getClientResource().accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class).getStatus() == Status.OK.getStatusCode());
  JSONObject jo=cr1.getClientResource().accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class).getEntity(JSONObject.class);
  System.out.println(jo);
  assertNotNull(jo);
}
Program: 179184
Project: 179184
Buggy source:
/** 
 * Starts the servicereaper thread to purge the expired service entries
 */
private void startServiceExpiryCheckcer(){
  RegistryThreadPool.getScheduledExecutorService().scheduleWithFixedDelay(new ServiceReaper(),10,5,TimeUnit.SECONDS);
}

Fixed version (ground truth):
/** 
 * Starts the servicereaper thread to purge the expired service entries
 */
private void startServiceExpiryCheckcer(){
  RegistryThreadPool.getScheduledExecutorService().scheduleWithFixedDelay(new ServiceReaper(),10,1,TimeUnit.SECONDS);
}
Program: 179185
Project: 179185
Buggy source:
/** 
 * Finding a service by its url
 * @param string
 * @throws NonExistingResourceException
 * @throws MultipleResourceException
 * @throws PersistentStoreFailureException
 */
public JSONObject findServiceByUrl(String url){
  ServiceObject so=null;
  try {
    so=serviceDB.getServiceByUrl(url);
  }
 catch (  MultipleResourceException e) {
    e.printStackTrace();
  }
catch (  NonExistingResourceException e) {
    e.printStackTrace();
  }
catch (  PersistentStoreFailureException e) {
    e.printStackTrace();
  }
  if (so == null) {
    return null;
  }
  return so.toJSON();
}

Fixed version (ground truth):
/** 
 * Finding a service by its url
 * @param string
 * @throws NonExistingResourceException
 * @throws MultipleResourceException
 * @throws PersistentStoreFailureException
 */
public JSONObject findServiceByUrl(String url) throws NonExistingResourceException, PersistentStoreFailureException {
  ServiceObject so=null;
  try {
    so=serviceDB.getServiceByUrl(url);
  }
 catch (  MultipleResourceException e) {
    e.printStackTrace();
  }
  if (so == null) {
    return null;
  }
  return so.toJSON();
}
Program: 179186
Project: 179186
Buggy source:
public static ServiceAdminManager getServiceAdminManager(){
  return new ServiceAdminManager();
}

Fixed version (ground truth):
public ServiceAdminManager getServiceAdminManager(){
  return new ServiceAdminManager();
}
Program: 179187
Project: 179187
Buggy source:
public NonExistingResourceException(String message){
  super(message);
}

Fixed version (ground truth):
public NonExistingResourceException(Throwable e){
  super(e);
}
Program: 179188
Project: 179188
Buggy source:
@Override public JSONArray paginatedQuery(String query,Integer pageSize,String id){
  DBObject queryObj=(DBObject)JSON.parse(query);
  DBCursor cur=null;
  BasicDBObject idOrderBy=new BasicDBObject("String_Node_Str",1);
  if (id == null) {
    cur=serviceCollection.find(queryObj).sort(idOrderBy).limit(pageSize);
  }
 else {
    StringBuffer b=new StringBuffer();
    b.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(id).append("String_Node_Str").append("String_Node_Str");
    DBObject db=(DBObject)JSON.parse(b.toString());
    if (queryObj.keySet().size() > 0) {
      db.putAll(queryObj);
    }
    cur=serviceCollection.find(db).sort(idOrderBy).limit(pageSize);
  }
  List<DBObject> lst=cur.toArray();
  JSONArray arr=new JSONArray(lst);
  return arr;
}

Fixed version (ground truth):
@Override public JSONArray paginatedQuery(String query,Integer pageSize,String id){
  DBObject queryObj=(DBObject)JSON.parse(query);
  DBCursor cur=null;
  BasicDBObject idOrderBy=new BasicDBObject("String_Node_Str",1);
  if (id == null) {
    cur=serviceCollection.find(queryObj).sort(idOrderBy).limit(pageSize);
  }
 else {
    StringBuffer b=new StringBuffer();
    b.append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(id).append("String_Node_Str").append("String_Node_Str");
    DBObject db=(DBObject)JSON.parse(b.toString());
    if (queryObj.keySet().size() > 0) {
      db.putAll(queryObj);
    }
    cur=serviceCollection.find(db).sort(idOrderBy).limit(pageSize);
  }
  List<DBObject> lst=cur.toArray();
  cur.close();
  JSONArray arr=new JSONArray(lst);
  return arr;
}
Program: 179189
Project: 179189
Buggy source:
@Override public void deleteByUrl(String url) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),url);
  DBObject d=serviceCollection.findAndRemove(query);
  if (d == null) {
    if (logger.isDebugEnabled()) {
      String msg="String_Node_Str" + url + "String_Node_Str";
      logger.debug(msg);
    }
    throw new NonExistingResourceException("String_Node_Str" + url + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void deleteByUrl(String url) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),url);
  DBObject d=serviceCollection.findAndRemove(query);
  if (d == null) {
    if (logger.isDebugEnabled()) {
      String msg="String_Node_Str" + url + "String_Node_Str";
      logger.debug(msg);
    }
    throw new NonExistingResourceException("String_Node_Str" + url + "String_Node_Str");
  }
}
Program: 179190
Project: 179190
Buggy source:
@Override public List<ServiceObject> query(String query,Integer skip) throws QueryException, PersistentStoreFailureException {
  DBObject o=(DBObject)JSON.parse(query);
  DBCursor cur=serviceCollection.find(o).skip(skip);
  logger.debug(cur.getCursorId());
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  List<ServiceObject> resultCollection=new ArrayList<ServiceObject>();
  int i=0;
  try {
    while (cur.hasNext()) {
      ServiceObject s=new ServiceObject(cur.next().toString());
      resultCollection.add(s);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return Collections.unmodifiableList(resultCollection);
}

Fixed version (ground truth):
@Override public List<ServiceObject> query(String query,Integer skip) throws QueryException, PersistentStoreFailureException {
  DBObject o=(DBObject)JSON.parse(query);
  DBCursor cur=serviceCollection.find(o).skip(skip);
  logger.debug(cur.getCursorId());
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  List<ServiceObject> resultCollection=new ArrayList<ServiceObject>();
  int i=0;
  try {
    while (cur.hasNext()) {
      ServiceObject s=new ServiceObject(cur.next().toString());
      resultCollection.add(s);
    }
    cur.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return Collections.unmodifiableList(resultCollection);
}
Program: 179191
Project: 179191
Buggy source:
@Override public void deleteAll(){
  BasicDBObject o=new BasicDBObject(0);
  serviceCollection.remove(o);
}

Fixed version (ground truth):
@Override public void deleteAll(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  BasicDBObject o=new BasicDBObject(0);
  serviceCollection.remove(o);
}
Program: 179192
Project: 179192
Buggy source:
@Override public void insert(ServiceObject item) throws ExistingResourceException, PersistentStoreFailureException {
  List<String> lstError=new CopyOnWriteArrayList<String>();
  try {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + item.toDBObject());
    }
    DBObject db=item.toDBObject();
    db.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),new Date());
    WriteResult wr=serviceCollection.insert(db,WriteConcern.SAFE);
    EventManager.notifyRecievers(new Event(EventTypes.SERVICE_ADD,db));
  }
 catch (  MongoException e) {
    if (e instanceof DuplicateKey) {
      throw new ExistingResourceException("String_Node_Str" + item.getUrl() + "String_Node_Str",e);
    }
 else {
      throw new PersistentStoreFailureException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void insert(ServiceObject item) throws ExistingResourceException, PersistentStoreFailureException {
  List<String> lstError=new CopyOnWriteArrayList<String>();
  try {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + item.toDBObject());
    }
    DBObject db=item.toDBObject();
    db.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),new Date());
    serviceCollection.insert(db,WriteConcern.SAFE);
    EventManager.notifyRecievers(new Event(EventTypes.SERVICE_ADD,db));
  }
 catch (  MongoException e) {
    if (e instanceof DuplicateKey) {
      throw new ExistingResourceException("String_Node_Str" + item.getUrl() + "String_Node_Str",e);
    }
 else {
      throw new PersistentStoreFailureException(e);
    }
  }
}
Program: 179193
Project: 179193
Buggy source:
@Override public void update(ServiceObject sObj) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  DBObject dbObj=sObj.toDBObject();
  dbObj.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),new Date());
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),sObj.getUrl());
  serviceCollection.update(query,dbObj);
  EventManager.notifyRecievers(new Event(EventTypes.SERVICE_UPDATE,dbObj));
}

Fixed version (ground truth):
@Override public void update(ServiceObject sObj) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  DBObject dbObj=sObj.toDBObject();
  dbObj.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),new Date());
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),sObj.getUrl());
  serviceCollection.update(query,dbObj);
  EventManager.notifyRecievers(new Event(EventTypes.SERVICE_UPDATE,dbObj));
}
Program: 179194
Project: 179194
Buggy source:
/** 
 * @param hostname - default <b>localhost</b>
 * @param port - default <b>27017</b>
 * @param dbName - default <b>emiregistry</b>
 * @param colName - default <b>services</b>
 */
public MongoDBServiceDatabase(String hostname,Integer port,String dbName,String colName){
  try {
    connection=MongoConnection.get(hostname,port);
    database=connection.getDB(dbName);
    if (Boolean.parseBoolean(DSRServer.getConfiguration().getProperty(ServerConstants.MONGODB_COL_CREATE,"String_Node_Str"))) {
      serviceCollection=database.getCollection(colName);
      serviceCollection.dropIndexes();
      serviceCollection.drop();
    }
    serviceCollection=database.getCollection(colName);
    BasicDBObject obj=new BasicDBObject(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),1);
    logger.info(obj);
    serviceCollection.createIndex(obj);
    serviceCollection.ensureIndex(obj,"String_Node_Str",true);
  }
 catch (  UnknownHostException e) {
    Log.logException(e);
  }
catch (  MongoException e) {
    Log.logException(e);
  }
}

Fixed version (ground truth):
/** 
 * @param hostname - default <b>localhost</b>
 * @param port - default <b>27017</b>
 * @param dbName - default <b>emiregistry</b>
 * @param colName - default <b>services</b>
 */
public MongoDBServiceDatabase(String hostname,Integer port,String dbName,String colName){
  try {
    if (DSRServer.getConfiguration() == null) {
      DSRServer s=new DSRServer(new Configuration(new Properties()));
    }
    connection=MongoConnection.get(hostname,port);
    database=connection.getDB(dbName);
    serviceCollection=database.getCollection(colName);
    BasicDBObject obj=new BasicDBObject(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),"String_Node_Str");
    logger.info(obj);
    serviceCollection.ensureIndex(obj,ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),true);
  }
 catch (  UnknownHostException e) {
    Log.logException(e);
  }
catch (  MongoException e) {
    Log.logException(e);
  }
}
Program: 179195
Project: 179195
Buggy source:
@Override public ServiceObject getServiceByUrl(String identifier) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),identifier);
  ServiceObject so=null;
  try {
    DBCursor cur=serviceCollection.find(new BasicDBObject("String_Node_Str",identifier));
    while (cur.hasNext()) {
      so=new ServiceObject(cur.next().toString());
    }
  }
 catch (  MongoException e) {
    e.printStackTrace();
  }
catch (  JSONException e) {
    e.printStackTrace();
  }
  return so;
}

Fixed version (ground truth):
@Override public ServiceObject getServiceByUrl(String identifier) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  ServiceObject so=null;
  try {
    DBObject db=serviceCollection.findOne(new BasicDBObject(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName(),identifier));
    if (db == null) {
      return null;
    }
    so=new ServiceObject(db);
  }
 catch (  MongoException e) {
    e.printStackTrace();
  }
catch (  JSONException e) {
    throw new NonExistingResourceException(e);
  }
  return so;
}
Program: 179196
Project: 179196
Buggy source:
/** 
 * @throws JSONException
 */
public List<ServiceObject> findAll() throws JSONException {
  List<ServiceObject> lst=new CopyOnWriteArrayList<ServiceObject>();
  DBCursor c=serviceCollection.find();
  while (c.hasNext()) {
    DBObject type=(DBObject)c.next();
    ServiceObject s=new ServiceObject(type.toString());
    lst.add(s);
  }
  return Collections.unmodifiableList(lst);
}

Fixed version (ground truth):
/** 
 * @throws JSONException
 */
public List<ServiceObject> findAll() throws JSONException {
  List<ServiceObject> lst=new CopyOnWriteArrayList<ServiceObject>();
  DBCursor c=serviceCollection.find();
  while (c.hasNext()) {
    DBObject type=(DBObject)c.next();
    ServiceObject s=new ServiceObject(type.toString());
    lst.add(s);
  }
  c.close();
  return Collections.unmodifiableList(lst);
}
Program: 179197
Project: 179197
Buggy source:
@Override public JSONArray queryJSONWithLimit(String s,Integer limit){
  DBObject o=(DBObject)JSON.parse(s);
  DBCursor cur=serviceCollection.find(o).limit(limit);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  JSONArray arr=new JSONArray();
  try {
    while (cur.hasNext()) {
      arr.put(JSON.serialize(cur.next()));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return arr;
}

Fixed version (ground truth):
@Override public JSONArray queryJSONWithLimit(String s,Integer limit){
  DBObject o=(DBObject)JSON.parse(s);
  DBCursor cur=serviceCollection.find(o).limit(limit);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  JSONArray arr=new JSONArray();
  try {
    while (cur.hasNext()) {
      arr.put(JSON.serialize(cur.next()));
    }
    cur.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return arr;
}
Program: 179198
Project: 179198
Buggy source:
@Override public JSONArray queryJSON(String query,Integer skip) throws QueryException, PersistentStoreFailureException {
  DBObject o=(DBObject)JSON.parse(query);
  DBCursor cur=serviceCollection.find(o).skip(skip);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  JSONArray arr=new JSONArray();
  try {
    while (cur.hasNext()) {
      arr.put(JSON.serialize(cur.next()));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return arr;
}

Fixed version (ground truth):
@Override public JSONArray queryJSON(String query,Integer skip) throws QueryException, PersistentStoreFailureException {
  DBObject o=(DBObject)JSON.parse(query);
  DBCursor cur=serviceCollection.find(o).skip(skip);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + cur.size());
  }
  JSONArray arr=new JSONArray();
  try {
    while (cur.hasNext()) {
      arr.put(JSON.serialize(cur.next()));
    }
    cur.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return arr;
}
Program: 179199
Project: 179199
Buggy source:
public String getUrl(){
  String serviceUrl=null;
  try {
    serviceUrl=jo.get(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName()).toString();
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return serviceUrl;
}

Fixed version (ground truth):
public String getUrl(){
  String serviceUrl=null;
  try {
    serviceUrl=jo.get(ServiceBasicAttributeNames.SERVICE_ENDPOINT_URL.getAttributeName()).toString();
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  return serviceUrl;
}
Program: 179200
Project: 179200
Buggy source:
public DBObject toDBObject(){
  DBObject d=null;
  d=(DBObject)JSON.parse(toString());
  if (d.get(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),getCreationTime());
  if (d.get(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),getExpireOn());
  if (d.get(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),getUpdateSince());
  return d;
}

Fixed version (ground truth):
public DBObject toDBObject(){
  DBObject d=null;
  d=(DBObject)JSON.parse(toString());
  if (d.get(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),getCreationTime());
  if (d.get(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),getExpireOn());
  if (d.get(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName()) != null)   d.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),getUpdateSince());
  return d;
}
Program: 179201
Project: 179201
Buggy source:
/** 
 */
public ServiceReaper(){
  sm=ServiceManagerFactory.getServiceAdminManager();
}

Fixed version (ground truth):
/** 
 */
public ServiceReaper(){
  sm=new ServiceAdminManager();
}
Program: 179202
Project: 179202
Buggy source:
/** 
 * @param jo
 * @throws JSONException
 * @throws InvalidServiceDescriptionException
 * @throws NonExistingResourceException
 * @throws MultipleResourceException
 */
public void updateService(JSONObject jo) throws UnknownServiceException, InvalidServiceDescriptionException, JSONException {
  if (!ServiceUtil.isValidServiceInfo(jo)) {
    throw new InvalidServiceDescriptionException("String_Node_Str");
  }
  if (jo.get(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName()) != null) {
    jo.remove(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName());
  }
  jo.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),ServiceUtil.ServiceDateFormat.format(new Date()));
  ServiceObject sObj=new ServiceObject(jo);
  try {
    serviceDB.update(sObj);
  }
 catch (  MultipleResourceException e) {
    e.printStackTrace();
  }
catch (  NonExistingResourceException e) {
    e.printStackTrace();
  }
catch (  PersistentStoreFailureException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param jo
 * @throws JSONException
 * @throws InvalidServiceDescriptionException
 * @throws NonExistingResourceException
 * @throws MultipleResourceException
 */
public void updateService(JSONObject jo) throws UnknownServiceException, InvalidServiceDescriptionException, JSONException {
  if (!ServiceUtil.isValidServiceInfo(jo)) {
    throw new InvalidServiceDescriptionException("String_Node_Str");
  }
  if (jo.has(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName())) {
    jo.remove(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName());
  }
  jo.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),ServiceUtil.ServiceDateFormat.format(new Date()));
  ServiceObject sObj=new ServiceObject(jo);
  try {
    serviceDB.update(sObj);
  }
 catch (  MultipleResourceException e) {
    e.printStackTrace();
  }
catch (  NonExistingResourceException e) {
    e.printStackTrace();
  }
catch (  PersistentStoreFailureException e) {
    e.printStackTrace();
  }
}
Program: 179203
Project: 179203
Buggy source:
@Override public void deleteByUrl(String url) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),url);
  DBObject d=serviceCollection.findAndRemove(query);
  if (d == null) {
    throw new NonExistingResourceException();
  }
}

Fixed version (ground truth):
@Override public void deleteByUrl(String url) throws MultipleResourceException, NonExistingResourceException, PersistentStoreFailureException {
  BasicDBObject query=new BasicDBObject();
  query.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),url);
  DBObject d=serviceCollection.findAndRemove(query);
  if (d == null) {
    if (logger.isDebugEnabled()) {
      String msg="String_Node_Str" + url + "String_Node_Str";
      logger.debug(msg);
    }
  }
}
Program: 179204
Project: 179204
Buggy source:
private static JSONObject getDummyServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}

Fixed version (ground truth):
private static JSONObject getDummyServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}
Program: 179205
Project: 179205
Buggy source:
private static JSONObject getUpdatedServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}

Fixed version (ground truth):
private static JSONObject getUpdatedServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}
Program: 179206
Project: 179206
Buggy source:
private static JSONObject getDummyServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_CREATED_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_UPDATE_SINCE.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}

Fixed version (ground truth):
private static JSONObject getDummyServiceDesc(){
  Map<String,String> map=new HashMap<String,String>();
  map.put(ServiceBasicAttributeNames.SERVICE_URL.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_TYPE.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_EXPIRE_ON.getAttributeName(),"String_Node_Str");
  map.put(ServiceBasicAttributeNames.SERVICE_OWNER.getAttributeName(),"String_Node_Str");
  JSONObject jo=new JSONObject(map);
  return jo;
}
Program: 179207
Project: 179207
Buggy source:
private static List<PFile> extractUsingRegExp(PFile pFile){
  List<PFile> result=new ArrayList<PFile>();
  PArchive pArchive=pFile.getPArchive();
  Map<String,File> files=extractFilesForRegExp(pArchive.getFile(),pArchive.getType(),pFile.getRelativePath());
  for (  String relativePath : files.keySet()) {
    PFile aClone=ModelUtils.createPFile(pFile,relativePath,files.get(relativePath));
    result.add(aClone);
  }
  if (result.size() == 0) {
    result.add(pFile);
  }
  return result;
}

Fixed version (ground truth):
private static List<PFile> extractUsingRegExp(PFile pFile){
  List<PFile> result=new ArrayList<PFile>();
  PArchive pArchive=pFile.getPArchive();
  Map<String,File> files=extractFilesForRegExp(pArchive.getFile(),pArchive.getType(),pFile.getRelativePath());
  for (  String relativePath : files.keySet()) {
    PFile aClone=ModelUtils.clonePFile(pFile,relativePath,files.get(relativePath));
    result.add(aClone);
  }
  if (result.size() == 0) {
    result.add(pFile);
  }
  return result;
}
Program: 179209
Project: 179209
Buggy source:
PFileFinder(PFile pFile){
  matcher=FileSystems.getDefault().getPathMatcher("String_Node_Str" + pFile.getRelativePath());
  foundFiles=new ArrayList<String>();
  parents=new ArrayList<Path>();
}

Fixed version (ground truth):
PFileFinder(PFile pFile){
  this.pFile=pFile;
  foundFiles=new ArrayList<Path>();
}
Program: 179210
Project: 179210
Buggy source:
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs){
  evaluate(file);
  return CONTINUE;
}

Fixed version (ground truth):
@Override public FileVisitResult visitFile(Path file,BasicFileAttributes attrs){
  Path relativeFilePath=pFile.getPMarker().getFolder().toPath().relativize(file);
  if (FileUtils.matches(relativeFilePath,pFile.getRelativePath())) {
    foundFiles.add(file);
  }
  return CONTINUE;
}
Program: 179211
Project: 179211
Buggy source:
public List<String> getFiles(){
  return foundFiles;
}

Fixed version (ground truth):
public List<Path> getFiles(){
  return foundFiles;
}
Program: 179212
Project: 179212
Buggy source:
public List<PFile> resolve(){
  List<PFile> result=new ArrayList<PFile>();
  if (pFile.isUseRegExResolution()) {
    result.addAll(resolveRegExp());
  }
 else {
    if (pFile.getFile() == null) {
      pFile.setFile(new File(pFile.getPMarker().getFolder(),pFile.getRelativePath()));
    }
    result.add(pFile);
  }
  return result;
}

Fixed version (ground truth):
public List<PFile> resolve(){
  List<PFile> result=new ArrayList<PFile>();
  if (pFile.isUseRegExResolution()) {
    result.addAll(resolveRegEx());
  }
 else {
    if (pFile.getFile() == null) {
      pFile.setFile(new File(pFile.getPMarker().getFolder(),pFile.getRelativePath()));
    }
    result.add(pFile);
  }
  return result;
}
Program: 179213
Project: 179213
Buggy source:
public void addIfItDoesNotExist(PProperty pProperty){
  try {
    String xpath=pProperty.getXPath();
    Node childNode=(Node)xpathSearch.evaluate(xpath,document,XPathConstants.NODE);
    if (childNode != null) {
      return;
    }
    Node parentNode=(Node)xpathSearch.evaluate(getParentXPath(xpath),document,XPathConstants.NODE);
    Attr nameAttr=document.createAttribute("String_Node_Str");
    nameAttr.setValue(pProperty.getName());
    Element newChild=document.createElement("String_Node_Str");
    newChild.setAttributeNode(nameAttr);
    parentNode.appendChild(newChild);
  }
 catch (  Exception e) {
    logger.debug(e);
    throw new DefectRuntimeException("String_Node_Str" + pProperty.getXPath() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void addIfItDoesNotExist(PProperty pProperty){
  try {
    String xpath=pProperty.getXPath();
    Node childNode=(Node)xpathSearch.evaluate(xpath,document,XPathConstants.NODE);
    if (childNode != null) {
      return;
    }
    Node parentNode=getNode(pProperty.getPFile());
    Attr nameAttr=document.createAttribute("String_Node_Str");
    nameAttr.setValue(pProperty.getName());
    Element newChild=document.createElement("String_Node_Str");
    newChild.setAttributeNode(nameAttr);
    parentNode.appendChild(newChild);
  }
 catch (  Exception e) {
    logger.debug(e);
    throw new DefectRuntimeException("String_Node_Str" + pProperty.getXPath() + "String_Node_Str");
  }
}
Program: 179214
Project: 179214
Buggy source:
private String getParentXPath(String xpath){
  if (StringUtils.isEmpty(xpath) || xpath.lastIndexOf(SLASH) <= 0) {
    return null;
  }
  return xpath.substring(0,xpath.lastIndexOf(SLASH));
}

Fixed version (ground truth):
private String getParentXPath(String xpath){
  return xpath + "String_Node_Str";
}
Program: 179215
Project: 179215
Buggy source:
private void adjustPMarkerFile(PMarker pMarker){
  XMLUtils xmlUtils=new XMLUtils(pMarker);
  for (  PProperty pProperty : entityManager.getPPropertiesFrom(pMarker)) {
    if (pProperty.isSuccessfullyProcessed()) {
      xmlUtils.deleteExistingElement(pProperty.getXPath());
    }
 else {
      xmlUtils.addIfItDoesNotExist(pProperty);
    }
    addAllReferences(xmlUtils,pProperty);
  }
  xmlUtils.removeEntriesWithoutChilds();
  xmlUtils.writeDocument();
}

Fixed version (ground truth):
private void adjustPMarkerFile(PMarker pMarker){
  XMLUtils xmlUtils=new XMLUtils(pMarker);
  for (  PProperty pProperty : entityManager.getPPropertiesFrom(pMarker)) {
    if (pProperty.isSuccessfullyProcessed()) {
      removeEntry(xmlUtils,pProperty);
    }
 else {
      xmlUtils.addIfItDoesNotExist(pProperty);
    }
    addAllReferences(xmlUtils,pProperty);
  }
  xmlUtils.removeEntriesWithoutChilds();
  xmlUtils.writeDocument();
}
Program: 179216
Project: 179216
Buggy source:
@Test public void Bug2(){
  Logger logger=LogManager.getLogger();
  LoggingUtils.setLogLevel(logger,Level.INFO);
  File testResourceFolder=new File("String_Node_Str");
  File targetResourceFolder=new File("String_Node_Str");
  LinkedHashSet<Defect> defects=createPrepareAndExecuteValidator(testResourceFolder,targetResourceFolder);
  Assert.assertEquals("String_Node_Str",0,defects.size());
}

Fixed version (ground truth):
@Test public void Bug2(){
  File testResourceFolder=new File("String_Node_Str");
  File targetResourceFolder=new File("String_Node_Str");
  LinkedHashSet<Defect> defects=createPrepareAndExecuteValidator(testResourceFolder,targetResourceFolder);
  Assert.assertEquals("String_Node_Str",0,defects.size());
}
Program: 179217
Project: 179217
Buggy source:
@Test public void Bug1(){
  Logger logger=LogManager.getLogger();
  LoggingUtils.setLogLevel(logger,Level.INFO);
  File testResourceFolder=new File("String_Node_Str");
  File targetResourceFolder=new File("String_Node_Str");
  LinkedHashSet<Defect> defects=createPrepareAndExecuteValidator(testResourceFolder,targetResourceFolder);
  Assert.assertEquals("String_Node_Str",0,defects.size());
}

Fixed version (ground truth):
@Test public void Bug1(){
  File testResourceFolder=new File("String_Node_Str");
  File targetResourceFolder=new File("String_Node_Str");
  LinkedHashSet<Defect> defects=createPrepareAndExecuteValidator(testResourceFolder,targetResourceFolder);
  Assert.assertEquals("String_Node_Str",0,defects.size());
}
Program: 179218
Project: 179218
Buggy source:
private LinkedHashSet<Defect> createPrepareAndExecuteValidator(File testResourceFolder,File targetResourceFolder){
  TestUtil.removeOldTestResourcesAndCopyAgain(testResourceFolder,targetResourceFolder);
  File packagePath=new File(targetResourceFolder,"String_Node_Str");
  HashMapPropertyResolver hpr=new HashMapPropertyResolver();
  PropertyResolveManager prm=getPropertyResolveManager(hpr);
  EntityManager entityManager=new EntityManager(packagePath);
  LinkedHashSet<Defect> defects=entityManager.initialize();
  Validator validator=new Validator(prm);
  validator.setPackagePath(packagePath);
  validator.enableMarkerFileChecks();
  validator.enablePropertyResolveChecks();
  defects.addAll(validator.validateInternal(entityManager));
  return defects;
}

Fixed version (ground truth):
private LinkedHashSet<Defect> createPrepareAndExecuteValidator(File testResourceFolder,File targetResourceFolder){
  File packagePath=new File(targetResourceFolder,"String_Node_Str");
  TestUtil.removeOldTestResourcesAndCopyAgain(testResourceFolder,targetResourceFolder);
  PropertyResolveManager propertyResolveManager=createPropertyResolveManager();
  EntityManager entityManager=new EntityManager(packagePath);
  LinkedHashSet<Defect> defects=entityManager.initialize();
  defects.addAll(createValidator(propertyResolveManager,packagePath).validateInternal(entityManager));
  defects.addAll(createReplacer(propertyResolveManager,packagePath).doReplacement(entityManager));
  return defects;
}
Program: 179219
Project: 179219
Buggy source:
private List<String> getNotReplacedProperties(String fileContent,String beginToken,String endToken){
  List<String> result=new ArrayList<String>();
  String searchPattern=Pattern.quote(beginToken) + "String_Node_Str" + Pattern.quote(endToken)+ "String_Node_Str"+ Pattern.quote(endToken);
  Pattern pattern=Pattern.compile(searchPattern);
  Matcher matcher=pattern.matcher(fileContent);
  while (matcher.find()) {
    String propertyId=matcher.group(1);
    result.add(propertyId);
  }
  return result;
}

Fixed version (ground truth):
private List<String> getNotReplacedProperties(String fileContent,String beginToken,String endToken){
  List<String> result=new ArrayList<String>();
  Pattern pattern=RegExpUtils.getDefaultPattern(beginToken,endToken);
  Matcher matcher=pattern.matcher(fileContent);
  while (matcher.find()) {
    String propertyId=matcher.group(1);
    result.add(propertyId);
  }
  return result;
}
Program: 179220
Project: 179220
Buggy source:
private Set<String> getAllPlaceHolders(String fileContent,String encoding,String beginToken,String endToken){
  String regexp="String_Node_Str" + beginToken + "String_Node_Str";
  Matcher matcher=getPlaceHolderMatcher(fileContent,regexp,encoding,beginToken,endToken);
  Set<String> result=new TreeSet<String>();
  while (matcher.find()) {
    String placeHolder=matcher.group(1);
    result.add(placeHolder);
  }
  return result;
}

Fixed version (ground truth):
private Set<String> getAllPlaceHolders(String fileContent,String encoding,String beginToken,String endToken){
  Pattern pattern=RegExpUtils.getDefaultPattern(beginToken,endToken);
  Matcher matcher=getPlaceHolderMatcher(fileContent,pattern,encoding,beginToken,endToken);
  Set<String> result=new TreeSet<String>();
  while (matcher.find()) {
    String placeHolder=matcher.group(1);
    result.add(placeHolder);
  }
  return result;
}
Program: 179221
Project: 179221
Buggy source:
private boolean doesPropertyExistInFile(String fileContent,PProperty pProperty,String encoding,String beginToken,String endToken){
  return getPlaceHolderMatcher(fileContent,Pattern.quote(pProperty.getName()),encoding,beginToken,endToken).find();
}

Fixed version (ground truth):
private boolean doesPropertyExistInFile(String fileContent,PProperty pProperty,String encoding,String beginToken,String endToken){
  Pattern pattern=RegExpUtils.getPatternFor(beginToken,endToken,Pattern.quote(pProperty.getName()));
  return getPlaceHolderMatcher(fileContent,pattern,encoding,beginToken,endToken).find();
}
Program: 179222
Project: 179222
Buggy source:
private Matcher getPlaceHolderMatcher(String fileContent,String regexp,String encoding,String beginToken,String endToken){
  String searchPattern=Pattern.quote(beginToken) + regexp + Pattern.quote(endToken);
  Pattern pattern=Pattern.compile(searchPattern);
  Matcher matcher=pattern.matcher(fileContent);
  return matcher;
}

Fixed version (ground truth):
private Matcher getPlaceHolderMatcher(String fileContent,Pattern pattern,String encoding,String beginToken,String endToken){
  Matcher matcher=pattern.matcher(fileContent);
  return matcher;
}
Program: 179223
Project: 179223
Buggy source:
public PropertyDuplicateDefinedInPropertyFileDefect(String property,PropertyResolver propertyResolver){
  super();
}

Fixed version (ground truth):
public PropertyDuplicateDefinedInPropertyFileDefect(String property,PropertyResolver propertyResolver){
  super();
  this.property=property;
  this.propertyResolver=propertyResolver;
}
Program: 179224
Project: 179224
Buggy source:
/** 
 * Return the annotations that are present on this field.
 * @return an array of all the annotations set on the field
 * @since 1.4
 */
public Collection<Annotation> getAnnotations(){
  if (annotations == null) {
    Pair<Class<?>,String> key=new Pair<Class<?>,String>(declaringClazz,name);
    annotations=ANNOTATION_CACHE.getElement(key);
    if (annotations == null) {
      annotations=Collections.unmodifiableCollection(Arrays.asList(field.getAnnotations()));
      ANNOTATION_CACHE.addElement(key,annotations);
    }
  }
  return annotations;
}

Fixed version (ground truth):
/** 
 * Return the annotations that are present on this field.
 * @return an array of all the annotations set on the field
 * @since 1.4
 */
public Collection<Annotation> getAnnotations(){
  if (annotations == null) {
    Pair<Class<?>,String> key=new Pair<Class<?>,String>(declaringClazz,name);
    Collection<Annotation> cachedValue=ANNOTATION_CACHE.getElement(key);
    if (cachedValue == null) {
      cachedValue=Collections.unmodifiableCollection(Arrays.asList(field.getAnnotations()));
      ANNOTATION_CACHE.addElement(key,cachedValue);
    }
    annotations=cachedValue;
  }
  return annotations;
}
Program: 179225
Project: 179225
Buggy source:
JsonElement serialize(Object src,Type typeOfSrc,boolean preserveType){
  if (src == null) {
    return JsonNull.createJsonNull();
  }
  JsonSerializationVisitor visitor=new JsonSerializationVisitor(objectNavigator,fieldNamingPolicy,serializeNulls,serializers,this,ancestors);
  objectNavigator.accept(new ObjectTypePair(src,typeOfSrc,preserveType),visitor);
  return visitor.getJsonElement();
}

Fixed version (ground truth):
JsonElement serialize(Object src,Type typeOfSrc,boolean preserveType){
  if (src == null) {
    return JsonNull.createJsonNull();
  }
  JsonSerializationVisitor visitor=new JsonSerializationVisitor(objectNavigator,fieldNamingPolicy,serializeNulls,serializers,this,ancestors);
  ObjectTypePair objTypePair=new ObjectTypePair(src,typeOfSrc,preserveType);
  objectNavigator.accept(objTypePair,visitor);
  return visitor.getJsonElement();
}