nus-yam/ex-repair huggingface dataset:
Program: 80155
Project: 80155
Buggy source:
@Override public void onUpdated(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  if (cacheEntryList == null) {
    return;
  }
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}

Fixed version (ground truth):
@Override public void onUpdated(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}
Program: 80156
Project: 80156
Buggy source:
@Override public void onExpired(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  if (cacheEntryList == null) {
    return;
  }
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    LOG.warn("String_Node_Str",event.getKey().toString());
  }
}

Fixed version (ground truth):
@Override public void onExpired(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    LOG.warn("String_Node_Str",event.getKey().toString());
  }
}
Program: 80157
Project: 80157
Buggy source:
@Override public void onRemoved(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  if (cacheEntryList == null) {
    return;
  }
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    cacheEntryList.remove(event.getKey());
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}

Fixed version (ground truth):
@Override public void onRemoved(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    cacheEntryList.remove(event.getKey());
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}
Program: 80158
Project: 80158
Buggy source:
@Override public void onCreated(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  if (cacheEntryList == null) {
    return;
  }
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    cacheEntryList.add(event.getKey());
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}

Fixed version (ground truth):
@Override public void onCreated(Iterable<CacheEntryEvent<? extends K,? extends T>> cacheEntryEvents) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends T> event : cacheEntryEvents) {
    cacheEntryList.add(event.getKey());
    LOG.info("String_Node_Str",event.getKey().toString());
  }
}
Program: 80159
Project: 80159
Buggy source:
public static <K,T extends PersistentBase>Factory<JCacheCacheLoader<K,T>> factoryOfCacheLoader(DataStore<K,T> dataStore){
  return new JCacheCacheLoaderFactory<>(new JCacheCacheLoader<>(dataStore));
}

Fixed version (ground truth):
public static <K,T extends PersistentBase>Factory<JCacheCacheLoader<K,T>> factoryOfCacheLoader(DataStore<K,T> dataStore,Class<K> keyClass,Class<T> persistentClass){
  return new JCacheCacheLoaderFactory<>(new JCacheCacheLoader<>(dataStore),keyClass,persistentClass);
}
Program: 80160
Project: 80160
Buggy source:
public static <K,T extends PersistentBase>Factory<JCacheCacheWriter<K,T>> factoryOfCacheWriter(DataStore<K,T> dataStore){
  return new JCacheCacheWriterFactory<>(new JCacheCacheWriter<>(dataStore));
}

Fixed version (ground truth):
public static <K,T extends PersistentBase>Factory<JCacheCacheWriter<K,T>> factoryOfCacheWriter(DataStore<K,T> dataStore,Class<K> keyClass,Class<T> persistentClass){
  return new JCacheCacheWriterFactory<>(new JCacheCacheWriter<>(dataStore),keyClass,persistentClass);
}
Program: 80161
Project: 80161
Buggy source:
public JCacheCacheLoaderFactory(JCacheCacheLoader<K,T> instance){
  LOG.info("String_Node_Str");
  this.instance=instance;
}

Fixed version (ground truth):
public JCacheCacheLoaderFactory(JCacheCacheLoader<K,T> instance,Class<K> keyClass,Class<T> persistentClass){
  this.keyClass=keyClass;
  this.persistentClass=persistentClass;
  LOG.info("String_Node_Str");
  this.instance=instance;
}
Program: 80162
Project: 80162
Buggy source:
public JCacheCacheLoader<K,T> create(){
  return (JCacheCacheLoader<K,T>)this.instance;
}

Fixed version (ground truth):
public JCacheCacheLoader<K,T> create(){
  if (this.instance != null) {
    return (JCacheCacheLoader<K,T>)this.instance;
  }
 else {
    try {
      this.instance=new JCacheCacheLoader<>(DataStoreFactory.getDataStore(keyClass,persistentClass,new Configuration()));
    }
 catch (    GoraException ex) {
      LOG.error("String_Node_Str",ex);
      return null;
    }
    return (JCacheCacheLoader<K,T>)this.instance;
  }
}
Program: 80163
Project: 80163
Buggy source:
public JCacheCacheWriter<K,T> create(){
  return (JCacheCacheWriter<K,T>)this.instance;
}

Fixed version (ground truth):
public JCacheCacheWriter<K,T> create(){
  if (this.instance != null) {
    return (JCacheCacheWriter<K,T>)this.instance;
  }
 else {
    try {
      this.instance=new JCacheCacheWriter<>(DataStoreFactory.getDataStore(keyClass,persistentClass,new Configuration()));
    }
 catch (    GoraException ex) {
      LOG.error("String_Node_Str",ex);
      return null;
    }
    return (JCacheCacheWriter<K,T>)this.instance;
  }
}
Program: 80164
Project: 80164
Buggy source:
public JCacheCacheWriterFactory(JCacheCacheWriter<K,T> instance){
  LOG.info("String_Node_Str");
  this.instance=instance;
}

Fixed version (ground truth):
public JCacheCacheWriterFactory(JCacheCacheWriter<K,T> instance,Class<K> keyClass,Class<T> persistentClass){
  this.keyClass=keyClass;
  this.persistentClass=persistentClass;
  LOG.info("String_Node_Str");
  this.instance=instance;
}
Program: 80165
Project: 80165
Buggy source:
private void populateLocalCacheEntrySet(ICache<K,T> cache){
  cacheEntryList=new ConcurrentSkipListSet<>();
  Iterator<Cache.Entry<K,T>> cacheEntryIterator=cache.iterator();
  while (cacheEntryIterator.hasNext()) {
    cacheEntryList.add(cacheEntryIterator.next().getKey());
  }
  cacheConfig=cache.getConfiguration(CacheConfig.class);
  Iterator<CacheEntryListenerConfiguration<K,T>> itr=cacheConfig.getCacheEntryListenerConfigurations().iterator();
  while (itr.hasNext()) {
    JCacheCacheEntryListenerFactory<K,T> listenerFac=(JCacheCacheEntryListenerFactory<K,T>)((MutableCacheEntryListenerConfiguration)itr.next()).getCacheEntryListenerFactory();
    listenerFac.create().setCacheEntryList(cacheEntryList);
    break;
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
private void populateLocalCacheEntrySet(ICache<K,T> cache){
  cacheEntryList=new ConcurrentSkipListSet<>();
  Iterator<Cache.Entry<K,T>> cacheEntryIterator=cache.iterator();
  while (cacheEntryIterator.hasNext()) {
    cacheEntryList.add(cacheEntryIterator.next().getKey());
  }
  cacheConfig=cache.getConfiguration(CacheConfig.class);
  LOG.info("String_Node_Str");
}
Program: 80166
Project: 80166
Buggy source:
@Override public void createSchema(){
  if (manager.getCache(super.getPersistentClass().getSimpleName(),keyClass,persistentClass) == null) {
    cacheEntryList.clear();
    cache=manager.createCache(persistentClass.getSimpleName(),cacheConfig).unwrap(ICache.class);
  }
  persistentDataStore.createSchema();
  LOG.info("String_Node_Str",super.getPersistentClass().getSimpleName());
}

Fixed version (ground truth):
@Override public void createSchema(){
  if (manager.getCache(super.getPersistentClass().getSimpleName(),keyClass,persistentClass) == null) {
    cacheEntryList.clear();
    cache=manager.createCache(persistentClass.getSimpleName(),cacheConfig).unwrap(ICache.class);
  }
  cache.registerCacheEntryListener(new MutableCacheEntryListenerConfiguration<>(JCacheCacheFactoryBuilder.factoryOfEntryListener(new JCacheCacheEntryListener<K,T>(cacheEntryList)),null,true,true));
  persistentDataStore.createSchema();
  LOG.info("String_Node_Str",super.getPersistentClass().getSimpleName());
}
Program: 80168
Project: 80168
Buggy source:
@Override public void setUpClass() throws Exception {
  super.setUpClass();
  log.info("String_Node_Str");
  Properties properties=new Properties();
  properties.setProperty(GORA_DEFAULT_JCACHE_PROVIDER_KEY,PROVIDER);
  properties.setProperty(GORA_DEFAULT_JCACHE_HAZELCAST_CONFIG_KEY,CONFIG);
  properties.setProperty(GORA_DEFAULT_DATASTORE_KEY,MEMSTORE);
  properties.setProperty(JCACHE_READ_THROUGH_PROPERTY_KEY,FALSE);
  properties.setProperty(JCACHE_WRITE_THROUGH_PROPERTY_KEY,FALSE);
  serverCacheProvider=new JCacheStore();
  serverCacheProvider.initialize(String.class,WebPage.class,properties);
}

Fixed version (ground truth):
@Override public void setUpClass() throws Exception {
  super.setUpClass();
  log.info("String_Node_Str");
  Config config=new ClasspathXmlConfig(CONFIG);
  hazelcastInstance=Hazelcast.newHazelcastInstance(config);
}
Program: 80169
Project: 80169
Buggy source:
@Override public void tearDownClass() throws Exception {
  super.tearDownClass();
  log.info("String_Node_Str");
  serverCacheProvider.close();
}

Fixed version (ground truth):
@Override public void tearDownClass() throws Exception {
  super.tearDownClass();
  log.info("String_Node_Str");
  hazelcastInstance.shutdown();
}
Program: 80172
Project: 80172
Buggy source:
/** 
 * Delete a row within the keyspace.
 * @param key
 * @param fieldName
 * @param columnName
 */
public void deleteColumn(K key,String familyName,ByteBuffer columnName){
synchronized (mutator) {
    HectorUtils.deleteColumn(mutator,key,familyName,columnName);
  }
}

Fixed version (ground truth):
/** 
 * Delete a row within the keyspace.
 * @param key
 * @param familyName
 * @param columnName
 */
public void deleteColumn(K key,String familyName,ByteBuffer columnName){
synchronized (mutator) {
    HectorUtils.deleteColumn(mutator,key,familyName,columnName);
  }
}
Program: 80174
Project: 80174
Buggy source:
/** 
 * Initialize is called when then the call to   {@link org.apache.gora.store.DataStoreFactory#createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, org.apache.hadoop.conf.Configuration conf)}is made. In this case, we merely delegate the store initialization to the   {@link org.apache.gora.cassandra.store.CassandraClient#initialize(Class<K> keyClass, Class<T> persistentClass)}. 
 */
public void initialize(Class<K> keyClass,Class<T> persistent,Properties properties){
  try {
    super.initialize(keyClass,persistent,properties);
    if (autoCreateSchema) {
      colFamConsLvl=DataStoreFactory.findProperty(properties,this,COL_FAM_CL,null);
      readOpConsLvl=DataStoreFactory.findProperty(properties,this,READ_OP_CL,null);
      writeOpConsLvl=DataStoreFactory.findProperty(properties,this,WRITE_OP_CL,null);
    }
    this.cassandraClient.initialize(keyClass,persistent,properties);
  }
 catch (  Exception e) {
    LOG.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Initialize is called when then the call to   {@link org.apache.gora.store.DataStoreFactory#createDataStore}is made. In this case, we merely delegate the store initialization to the   {@link org.apache.gora.cassandra.store.CassandraClient#initialize}.
 * @param keyClass
 * @param persistent
 * @param properties
 */
public void initialize(Class<K> keyClass,Class<T> persistent,Properties properties){
  try {
    super.initialize(keyClass,persistent,properties);
    if (autoCreateSchema) {
      colFamConsLvl=DataStoreFactory.findProperty(properties,this,COL_FAM_CL,null);
      readOpConsLvl=DataStoreFactory.findProperty(properties,this,READ_OP_CL,null);
      writeOpConsLvl=DataStoreFactory.findProperty(properties,this,WRITE_OP_CL,null);
    }
    this.cassandraClient.initialize(keyClass,persistent,properties);
  }
 catch (  Exception e) {
    LOG.error(e.getMessage(),e);
  }
}
Program: 80175
Project: 80175
Buggy source:
/** 
 * Recognizes camel case 
 */
public static String toUpperCase(String s){
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < s.length(); i++) {
    if (i > 0) {
      if (Character.isUpperCase(s.charAt(i)) && Character.isLowerCase(s.charAt(i - 1)) && Character.isLetter(s.charAt(i))) {
        builder.append("String_Node_Str");
      }
    }
    builder.append(Character.toUpperCase(s.charAt(i)));
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * Recognizes camel case
 * @param s converts the given input string to camel case
 * @return the converted camel case string
 */
public static String toUpperCase(String s){
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < s.length(); i++) {
    if (i > 0) {
      if (Character.isUpperCase(s.charAt(i)) && Character.isLowerCase(s.charAt(i - 1)) && Character.isLetter(s.charAt(i))) {
        builder.append("String_Node_Str");
      }
    }
    builder.append(Character.toUpperCase(s.charAt(i)));
  }
  return builder.toString();
}
Program: 80176
Project: 80176
Buggy source:
/** 
 * Construct given a path and a configuration. 
 */
public FsInput(Path path,Configuration conf) throws IOException {
  this.stream=path.getFileSystem(conf).open(path);
  this.len=path.getFileSystem(conf).getFileStatus(path).getLen();
}

Fixed version (ground truth):
/** 
 * Construct given a path and a configuration.
 * @param path a path on HDFS to construct
 * @param conf a Hadoop {@link org.apache.hadoop.conf.Configuration} object
 * @throws IOException if there is an error opening path, or obtaining a file status from the file system
 */
public FsInput(Path path,Configuration conf) throws IOException {
  this.stream=path.getFileSystem(conf).open(path);
  this.len=path.getFileSystem(conf).getFileStatus(path).getLen();
}
Program: 80177
Project: 80177
Buggy source:
/** 
 * Filter the key and persistent. Modification is possible.
 * @param key
 * @param persistent
 * @return <code>true</code> if the row is filtered out (excluded), <code>false</code> otherwise.
 */
public boolean filter(K key,T persistent);

Fixed version (ground truth):
/** 
 * Filter the key and persistent. Modification is possible.
 * @param key
 * @param persistent
 * @return <code>true</code> if the row is filtered out (excluded),<code>false</code> otherwise.
 */
public boolean filter(K key,T persistent);
Program: 80178
Project: 80178
Buggy source:
/** 
 * Sets the input parameters for the job
 * @param job the job to set the properties for
 * @param dataStoreClass the datastore class
 * @param inKeyClass Map input key class
 * @param inValueClass Map input value class
 * @param reuseObjects whether to reuse objects in serialization
 * @throws IOException
 */
public static <K1,V1 extends Persistent>void setInput(Job job,Class<? extends DataStore<K1,V1>> dataStoreClass,Class<K1> inKeyClass,Class<V1> inValueClass,boolean reuseObjects) throws IOException {
  DataStore<K1,V1> store=DataStoreFactory.getDataStore(dataStoreClass,inKeyClass,inValueClass,job.getConfiguration());
  setInput(job,store.newQuery(),reuseObjects);
}

Fixed version (ground truth):
/** 
 * Sets the input parameters for the job
 * @param job            the job to set the properties for
 * @param dataStoreClass the datastore class
 * @param inKeyClass     Map input key class
 * @param inValueClass   Map input value class
 * @param reuseObjects   whether to reuse objects in serialization
 * @param < K1 >
 * @param < V1 >
 * @throws IOException
 */
public static <K1,V1 extends Persistent>void setInput(Job job,Class<? extends DataStore<K1,V1>> dataStoreClass,Class<K1> inKeyClass,Class<V1> inValueClass,boolean reuseObjects) throws IOException {
  DataStore<K1,V1> store=DataStoreFactory.getDataStore(dataStoreClass,inKeyClass,inValueClass,job.getConfiguration());
  setInput(job,store.newQuery(),reuseObjects);
}
Program: 80179
Project: 80179
Buggy source:
/** 
 * Deletes an entry based on its key.
 * @param key
 */
public void deleteByKey(K key){
  Map<String,String> familyMap=this.cassandraMapping.getFamilyMap();
  deleteColumn(key,familyMap.values().iterator().next().toString(),null);
}

Fixed version (ground truth):
/** 
 * Deletes an entry based on its key.
 * @param key
 */
public void deleteByKey(K key){
  Map<String,String> familyMap=this.cassandraMapping.getFamilyMap();
  deleteColumn(key,familyMap.values().iterator().next(),null);
}
Program: 80180
Project: 80180
Buggy source:
public static String generateDefaultValueString(Schema schema,String fieldName){
  if (fieldName == "String_Node_Str") {
    return "String_Node_Str" + getNumberOfBytesNeededForDirtyBits(schema) + "String_Node_Str";
  }
 else {
    throw new IllegalArgumentException(fieldName + "String_Node_Str");
  }
}

Fixed version (ground truth):
public static String generateDefaultValueString(Schema schema,String fieldName){
  if (DIRTY_BYTES_FIELD_NAME.equals(fieldName)) {
    return "String_Node_Str" + getNumberOfBytesNeededForDirtyBits(schema) + "String_Node_Str";
  }
 else {
    throw new IllegalArgumentException(fieldName + "String_Node_Str");
  }
}
Program: 80181
Project: 80181
Buggy source:
public static String generateAppropriateWrapper(Schema schema,Field field){
  if (field.name() == "String_Node_Str") {
    return "String_Node_Str" + getNumberOfBytesNeededForDirtyBits(schema) + "String_Node_Str";
  }
 else {
switch (field.schema().getType()) {
case RECORD:
      return field.schema().getName() + "String_Node_Str";
case MAP:
    return "String_Node_Str" + field.pos() + "String_Node_Str";
case ARRAY:
  return "String_Node_Str" + field.pos() + "String_Node_Str";
default :
return "String_Node_Str" + field.pos() + "String_Node_Str";
}
}
}

Fixed version (ground truth):
public static String generateAppropriateWrapper(Schema schema,Field field){
  if (DIRTY_BYTES_FIELD_NAME.equals(field.name())) {
    return "String_Node_Str" + getNumberOfBytesNeededForDirtyBits(schema) + "String_Node_Str";
  }
 else {
switch (field.schema().getType()) {
case RECORD:
      return field.schema().getName() + "String_Node_Str";
case MAP:
    return "String_Node_Str" + field.pos() + "String_Node_Str";
case ARRAY:
  return "String_Node_Str" + field.pos() + "String_Node_Str";
default :
return "String_Node_Str" + field.pos() + "String_Node_Str";
}
}
}
Program: 80184
Project: 80184
Buggy source:
@Override public Result<K,T> execute(Query<K,T> query){
  K startKey=query.getStartKey();
  K endKey=query.getEndKey();
  if (startKey == null) {
    startKey=map.firstKey();
  }
  if (endKey == null) {
    endKey=map.lastKey();
  }
  query.setFields(getFieldsToQuery(query.getFields()));
  NavigableMap<K,T> submap=map.subMap(startKey,true,endKey,true);
  return new MemResult<K,T>(this,query,submap);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Result<K,T> execute(Query<K,T> query){
  K startKey=query.getStartKey();
  K endKey=query.getEndKey();
  if (startKey == null) {
    startKey=(K)map.firstKey();
  }
  if (endKey == null) {
    endKey=(K)map.lastKey();
  }
  query.setFields(getFieldsToQuery(query.getFields()));
  ConcurrentNavigableMap<K,T> submap=map.subMap(startKey,true,endKey,true);
  return new MemResult<K,T>(this,query,submap);
}
Program: 80185
Project: 80185
Buggy source:
@Override public void put(K key,T obj){
  map.put(key,obj);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void put(K key,T obj){
  map.put(key,obj);
}
Program: 80186
Project: 80186
Buggy source:
@Override public long deleteByQuery(Query<K,T> query){
  try {
    long deletedRows=0;
    Result<K,T> result=query.execute();
    while (result.next()) {
      if (delete(result.getKey()))       deletedRows++;
    }
    return 0;
  }
 catch (  Exception e) {
    return 0;
  }
}

Fixed version (ground truth):
@Override public long deleteByQuery(Query<K,T> query){
  try {
    long deletedRows=0;
    Result<K,T> result=query.execute();
    while (result.next()) {
      if (delete(result.getKey()))       deletedRows++;
    }
    return deletedRows;
  }
 catch (  Exception e) {
    return 0;
  }
}
Program: 80187
Project: 80187
Buggy source:
@Override public T get(K key,String[] fields){
  T obj=map.get(key);
  if (obj == null) {
    return null;
  }
  return getPersistent(obj,getFieldsToQuery(fields));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public T get(K key,String[] fields){
  T obj=(T)map.get(key);
  if (obj == null) {
    return null;
  }
  return getPersistent(obj,getFieldsToQuery(fields));
}
Program: 80188
Project: 80188
Buggy source:
@Override public void close(){
  map.clear();
}

Fixed version (ground truth):
@Override public void close(){
}
Program: 80189
Project: 80189
Buggy source:
/** 
 * Persist an object into the store.
 * @param key identifier of the object in the store
 * @param obj the object to be inserted
 */
@Override public void put(K key,T obj){
  if (obj.isNew() || obj.isDirty())   putUpdate(key,obj);
 else   LOG.info("String_Node_Str" + "String_Node_Str",new Object[]{obj});
  obj.clearNew();
  obj.clearDirty();
}

Fixed version (ground truth):
/** 
 * Persist an object into the store.
 * @param key identifier of the object in the store
 * @param obj the object to be inserted
 */
@Override public void put(K key,T obj){
  if (obj.isNew() || obj.isDirty()) {
    putUpdate(key,obj);
  }
 else {
    LOG.info("String_Node_Str" + "String_Node_Str",new Object[]{obj});
    obj.clearNew();
    obj.clearDirty();
  }
}
Program: 80190
Project: 80190
Buggy source:
/** 
 * Update a object that already exists in the store. The object must exist already or the update may fail.
 * @param key identifier of the object in the store
 * @param obj the object to be inserted
 */
private void putUpdate(K key,T obj){
  DBObject qSel=new BasicDBObject("String_Node_Str",key);
  BasicDBObject qUpdate=new BasicDBObject();
  BasicDBObject qUpdateSet=newUpdateSetInstance(obj);
  if (qUpdateSet.size() > 0)   qUpdate.put("String_Node_Str",qUpdateSet);
  BasicDBObject qUpdateUnset=newUpdateUnsetInstance(obj);
  if (qUpdateUnset.size() > 0)   qUpdate.put("String_Node_Str",qUpdateUnset);
  mongoClientColl.update(qSel,qUpdate,true,false);
}

Fixed version (ground truth):
/** 
 * Update a object that already exists in the store. The object must exist already or the update may fail.
 * @param key identifier of the object in the store
 * @param obj the object to be inserted
 */
private void putUpdate(K key,T obj){
  DBObject qSel=new BasicDBObject("String_Node_Str",key);
  BasicDBObject qUpdate=new BasicDBObject();
  BasicDBObject qUpdateSet=newUpdateSetInstance(obj);
  if (qUpdateSet.size() > 0) {
    qUpdate.put("String_Node_Str",qUpdateSet);
  }
  BasicDBObject qUpdateUnset=newUpdateUnsetInstance(obj);
  if (qUpdateUnset.size() > 0) {
    qUpdate.put("String_Node_Str",qUpdateUnset);
  }
  if (!qUpdate.isEmpty()) {
    mongoClientColl.update(qSel,qUpdate,true,false);
  }
 else {
    LOG.debug("String_Node_Str",key);
  }
}
Program: 80192
Project: 80192
Buggy source:
/** 
 * Build a new instance of   {@link DBObject} from the persistence classinstance in parameter. Limit the  {@link DBObject} to the fields that aredirty and not null, that is the fields that will need to be updated in the store. <p/> This implementation mainly differs from the {@link MongoStore#newInstance(org.apache.gora.persistency.impl.PersistentBase)} one from two points:<ol> <li>the restriction to fields that are dirty and then need an update</li> <li>the qualification of field names as fully qualified names</li> </ol>
 * @param persistent a persistence class instance which content is to be serialized as a  {@link DBObject} for use as parameter of a $set operator
 * @return a {@link DBObject} which content corresponds to the fields thathave to be updated... and formatted to be passed in parameter of a $set operator
 */
private BasicDBObject newUpdateSetInstance(T persistent){
  BasicDBObject result=new BasicDBObject();
  for (  Field f : persistent.getSchema().getFields()) {
    if (persistent.isReadable(f.pos()) && persistent.isDirty(f.pos()) && (persistent.get(f.pos()) != null)) {
      String docf=mapping.getDocumentField(f.name());
      Object value=persistent.get(f.pos());
      DocumentFieldType storeType=mapping.getDocumentFieldType(docf);
      result.put(docf,toDBObject(f.schema(),f.schema().getType(),storeType,value));
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Build a new instance of   {@link DBObject} from the persistence classinstance in parameter. Limit the  {@link DBObject} to the fields that aredirty and not null, that is the fields that will need to be updated in the store. <p/> This implementation mainly differs from the {@link MongoStore#newInstance(org.apache.gora.persistency.impl.PersistentBase)} one from two points:<ol> <li>the restriction to fields that are dirty and then need an update</li> <li>the qualification of field names as fully qualified names</li> </ol>
 * @param persistent a persistence class instance which content is to be serialized as a  {@link DBObject} for use as parameter of a $set operator
 * @return a {@link DBObject} which content corresponds to the fields thathave to be updated... and formatted to be passed in parameter of a $set operator
 */
private BasicDBObject newUpdateSetInstance(T persistent){
  BasicDBObject result=new BasicDBObject();
  for (  Field f : persistent.getSchema().getFields()) {
    if (persistent.isReadable(f.pos()) && persistent.isDirty(f.pos()) && (persistent.get(f.pos()) != null)) {
      String docf=mapping.getDocumentField(f.name());
      Object value=persistent.get(f.pos());
      DocumentFieldType storeType=mapping.getDocumentFieldType(docf);
      LOG.debug("String_Node_Str",new Object[]{docf,f.schema().getType(),storeType});
      result.put(docf,toDBObject(f.schema(),f.schema().getType(),storeType,value));
    }
  }
  return result;
}
Program: 80194
Project: 80194
Buggy source:
/** 
 * Build a new instance of   {@link DBObject} from the persistence classinstance in parameter. Limit the  {@link DBObject} to the fields that aredirty and null, that is the fields that will need to be updated in the store by being removed. <p/> This implementation mainly differs from the {@link MongoStore#newInstance(org.apache.gora.persistency.impl.PersistentBase)} one from two points:<ol> <li>the restriction to fields that are dirty and then need an update</li> <li>the qualification of field names as fully qualified names</li> </ol>
 * @param persistent a persistence class instance which content is to be serialized as a  {@link DBObject} for use as parameter of a $set operator
 * @return a {@link DBObject} which content corresponds to the fields thathave to be updated... and formated to be passed in parameter of a $unset operator
 */
private BasicDBObject newUpdateUnsetInstance(T persistent){
  BasicDBObject result=new BasicDBObject();
  for (  Field f : persistent.getSchema().getFields()) {
    if (persistent.isReadable(f.pos()) && persistent.isDirty(f.pos()) && (persistent.get(f.pos()) == null)) {
      String docf=mapping.getDocumentField(f.name());
      Object value=persistent.get(f.pos());
      DocumentFieldType storeType=mapping.getDocumentFieldType(docf);
      Object o=toDBObject(f.schema(),f.schema().getType(),storeType,value);
      result.put(docf,o);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Build a new instance of   {@link DBObject} from the persistence classinstance in parameter. Limit the  {@link DBObject} to the fields that aredirty and null, that is the fields that will need to be updated in the store by being removed. <p/> This implementation mainly differs from the {@link MongoStore#newInstance(org.apache.gora.persistency.impl.PersistentBase)} one from two points:<ol> <li>the restriction to fields that are dirty and then need an update</li> <li>the qualification of field names as fully qualified names</li> </ol>
 * @param persistent a persistence class instance which content is to be serialized as a  {@link DBObject} for use as parameter of a $set operator
 * @return a {@link DBObject} which content corresponds to the fields thathave to be updated... and formated to be passed in parameter of a $unset operator
 */
private BasicDBObject newUpdateUnsetInstance(T persistent){
  BasicDBObject result=new BasicDBObject();
  for (  Field f : persistent.getSchema().getFields()) {
    if (persistent.isReadable(f.pos()) && persistent.isDirty(f.pos()) && (persistent.get(f.pos()) == null)) {
      String docf=mapping.getDocumentField(f.name());
      Object value=persistent.get(f.pos());
      DocumentFieldType storeType=mapping.getDocumentFieldType(docf);
      LOG.debug("String_Node_Str",new Object[]{docf,f.schema().getType(),storeType});
      Object o=toDBObject(f.schema(),f.schema().getType(),storeType,value);
      result.put(docf,o);
    }
  }
  return result;
}
Program: 80195
Project: 80195
Buggy source:
/** 
 * Compute the projection of the query, that is the fields that will be retrieved from the database.
 * @return a {@link DBObject} corresponding to the list of field to beretrieved with the associated boolean
 */
public static DBObject toProjection(Query<?,?> query){
  BasicDBObject proj=new BasicDBObject();
  for (  String k : query.getFields())   proj.put(k,true);
  return proj;
}

Fixed version (ground truth):
/** 
 * Compute the projection of the query, that is the fields that will be retrieved from the database.
 * @return a {@link DBObject} corresponding to the list of field to beretrieved with the associated boolean
 */
public static DBObject toProjection(Query<?,?> query){
  BasicDBObject proj=new BasicDBObject();
  if (query.getFields() != null) {
    for (    String k : query.getFields())     proj.put(k,true);
  }
  return proj;
}
Program: 80196
Project: 80196
Buggy source:
/** 
 * Create a new collection in MongoDB if necessary.
 */
@Override public void createSchema(){
  if (mongoClientDB == null)   throw new IllegalStateException("String_Node_Str");
  mongoClientColl=mongoClientDB.createCollection(mapping.getCollectionName(),null);
  mongoClientColl.setDBEncoderFactory(GoraDBEncoder.FACTORY);
  LOG.info("String_Node_Str",new Object[]{mapping.getCollectionName(),mongoClientDB.getMongo()});
}

Fixed version (ground truth):
/** 
 * Create a new collection in MongoDB if necessary.
 */
@Override public void createSchema(){
  if (mongoClientDB == null)   throw new IllegalStateException("String_Node_Str");
  if (schemaExists()) {
    return;
  }
  mongoClientColl=mongoClientDB.createCollection(mapping.getCollectionName(),new BasicDBObject());
  mongoClientColl.setDBEncoderFactory(GoraDBEncoder.FACTORY);
  LOG.info("String_Node_Str",new Object[]{mapping.getCollectionName(),mongoClientDB.getMongo()});
}
Program: 80197
Project: 80197
Buggy source:
/** 
 * Create a new   {@link Query} to query the datastore.
 */
@Override public Query<K,T> newQuery(){
  return new MongoDBQuery<K,T>(this);
}

Fixed version (ground truth):
/** 
 * Create a new   {@link Query} to query the datastore.
 */
@Override public Query<K,T> newQuery(){
  MongoDBQuery<K,T> query=new MongoDBQuery<K,T>(this);
  query.setFields(getFieldsToQuery(null));
  return query;
}
Program: 80199
Project: 80199
Buggy source:
@Override public Date deserialize(JsonElement jsonElement,Type type,JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
  String date=jsonElement.getAsString();
  try {
    return DATE_FORMAT.get().parse(date);
  }
 catch (  ParseException e) {
    throw new JsonParseException(e);
  }
}

Fixed version (ground truth):
@Override public Date deserialize(JsonElement jsonElement,Type type,JsonDeserializationContext jsonDeserializationContext){
  String date=jsonElement.getAsString();
  try {
    return DATE_FORMAT.get().parse(date);
  }
 catch (  ParseException e) {
    throw new JsonParseException(e);
  }
}
Program: 80200
Project: 80200
Buggy source:
/** 
 * Star-endpoint added in Gerrit 2.8.
 */
private String createStarUrl(String id) throws RestApiException {
  return getRequestPath() + "String_Node_Str" + id;
}

Fixed version (ground truth):
/** 
 * Star-endpoint added in Gerrit 2.8.
 */
private String createStarUrl(String id){
  return getRequestPath() + "String_Node_Str" + id;
}
Program: 80201
Project: 80201
Buggy source:
public List<AccountInfo> parseAccountInfos(JsonElement result) throws RestApiException {
  if (!result.isJsonArray()) {
    return Collections.singletonList(parseAccountInfo(result));
  }
  return gson.fromJson(result,TYPE);
}

Fixed version (ground truth):
public List<AccountInfo> parseAccountInfos(JsonElement result){
  if (!result.isJsonArray()) {
    return Collections.singletonList(parseAccountInfo(result));
  }
  return gson.fromJson(result,TYPE);
}
Program: 80202
Project: 80202
Buggy source:
public AccountInfo parseAccountInfo(JsonElement result) throws RestApiException {
  return gson.fromJson(result,AccountInfo.class);
}

Fixed version (ground truth):
public AccountInfo parseAccountInfo(JsonElement result){
  return gson.fromJson(result,AccountInfo.class);
}
Program: 80203
Project: 80203
Buggy source:
public List<ChangeInfo> parseChangeInfos(JsonElement result) throws RestApiException {
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,ChangeInfo.class));
  }
  return gson.fromJson(result,TYPE);
}

Fixed version (ground truth):
public List<ChangeInfo> parseChangeInfos(JsonElement result){
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,ChangeInfo.class));
  }
  return gson.fromJson(result,TYPE);
}
Program: 80204
Project: 80204
Buggy source:
public Map<String,FileInfo> parseFileInfos(JsonElement jsonElement) throws RestApiException {
  return gson.fromJson(jsonElement,TYPE);
}

Fixed version (ground truth):
public Map<String,FileInfo> parseFileInfos(JsonElement jsonElement){
  return gson.fromJson(jsonElement,TYPE);
}
Program: 80205
Project: 80205
Buggy source:
public IncludedInInfo parseIncludedInInfos(JsonElement jsonElement) throws RestApiException {
  return gson.fromJson(jsonElement,IncludedInInfo.class);
}

Fixed version (ground truth):
public IncludedInInfo parseIncludedInInfos(JsonElement jsonElement){
  return gson.fromJson(jsonElement,IncludedInInfo.class);
}
Program: 80206
Project: 80206
Buggy source:
public List<ReviewerInfo> parseReviewerInfos(JsonElement result) throws RestApiException {
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,ReviewerInfo.class));
  }
  return gson.fromJson(result,TYPE);
}

Fixed version (ground truth):
public List<ReviewerInfo> parseReviewerInfos(JsonElement result){
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,ReviewerInfo.class));
  }
  return gson.fromJson(result,TYPE);
}
Program: 80207
Project: 80207
Buggy source:
public List<SuggestedReviewerInfo> parseSuggestReviewerInfos(JsonElement result) throws RestApiException {
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,SuggestedReviewerInfo.class));
  }
  return gson.fromJson(result,TYPE);
}

Fixed version (ground truth):
public List<SuggestedReviewerInfo> parseSuggestReviewerInfos(JsonElement result){
  if (!result.isJsonArray()) {
    return Collections.singletonList(gson.fromJson(result,SuggestedReviewerInfo.class));
  }
  return gson.fromJson(result,TYPE);
}
Program: 80208
Project: 80208
Buggy source:
public SortedMap<String,ProjectInfo> parseProjectInfos(JsonElement result) throws RestApiException {
  return gson.fromJson(result,TYPE);
}

Fixed version (ground truth):
public SortedMap<String,ProjectInfo> parseProjectInfos(JsonElement result){
  return gson.fromJson(result,TYPE);
}
Program: 80209
Project: 80209
Buggy source:
private static void setContentEncoding(HttpResponse response,BinaryResult binaryResult){
  Header contentEncoding=response.getFirstHeader("String_Node_Str");
  if (contentEncoding != null) {
    if ("String_Node_Str".equals(contentEncoding.getValue())) {
      binaryResult.base64();
    }
  }
}

Fixed version (ground truth):
private static void setContentEncoding(HttpResponse response,BinaryResult binaryResult){
  Header contentEncoding=response.getFirstHeader("String_Node_Str");
  if (contentEncoding != null && "String_Node_Str".equals(contentEncoding.getValue())) {
    binaryResult.base64();
  }
}
Program: 80210
Project: 80210
Buggy source:
public static String appendToUrlQuery(String query,String parameter){
  if (!Strings.isNullOrEmpty(query)) {
    query+='&';
  }
  query+=parameter;
  return query;
}

Fixed version (ground truth):
public static String appendToUrlQuery(String query,String parameter){
  if (!Strings.isNullOrEmpty(query)) {
    query+="String_Node_Str";
  }
  query+=parameter;
  return query;
}
Program: 80211
Project: 80211
Buggy source:
@Override protected void configure(){
  installOpenIdeDependenciesModule();
  setupSettingsProvider();
  bind(NotificationService.class);
  bind(ReviewCommentSink.class).toInstance(new ReviewCommentSink());
  bind(GerritGitUtil.class).asEagerSingleton();
  bind(GerritUtil.class).asEagerSingleton();
  bind(GerritToolWindow.class).asEagerSingleton();
  bind(GerritCheckoutProvider.class);
  bind(GerritHttpAuthDataProvider.class);
  install(new GerritActionsModule());
  install(new GerritDiffModule());
  install(new GerritRestModule());
  install(new GerritUiModule());
}

Fixed version (ground truth):
@Override protected void configure(){
  installOpenIdeDependenciesModule();
  setupSettingsProvider();
  bind(NotificationService.class);
  bind(ReviewCommentSink.class).toInstance(new ReviewCommentSink());
  bind(GerritGitUtil.class).asEagerSingleton();
  bind(GerritUtil.class).asEagerSingleton();
  bind(GerritToolWindow.class);
  bind(GerritCheckoutProvider.class);
  bind(GerritHttpAuthDataProvider.class);
  install(new GerritActionsModule());
  install(new GerritDiffModule());
  install(new GerritRestModule());
  install(new GerritUiModule());
}
Program: 80212
Project: 80212
Buggy source:
@Override public void calcData(DataKey key,DataSink sink){
  if (VcsDataKeys.CHANGES.equals(key)) {
    int[] rows=table.getSelectedRows();
    if (rows.length != 1)     return;
    int row=rows[0];
  }
}

Fixed version (ground truth):
@Override public void calcData(DataKey key,DataSink sink){
  sink.put(GerritDataKeys.TOOL_WINDOW,gerritToolWindow);
  if (VcsDataKeys.CHANGES.equals(key)) {
    int[] rows=table.getSelectedRows();
    if (rows.length != 1)     return;
    int row=rows[0];
  }
}
Program: 80213
Project: 80213
Buggy source:
public SimpleToolWindowPanel createToolWindowContent(final Project project){
  diffManager.registerDiffTool(commentsDiffTool);
  SimpleToolWindowPanel panel=new SimpleToolWindowPanel(true,true);
  ActionToolbar toolbar=createToolbar(project);
  toolbar.setTargetComponent(changeListPanel);
  panel.setToolbar(toolbar.getComponent());
  repositoryChangesBrowser=createRepositoryChangesBrowser(project);
  detailsSplitter=new Splitter(true,0.6f);
  detailsSplitter.setShowDividerControls(true);
  changeListPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.RIGHT | SideBorder.BOTTOM));
  detailsSplitter.setFirstComponent(changeListPanel);
  detailsPanel=new GerritChangeDetailsPanel(project);
  JPanel details=detailsPanel.getComponent();
  details.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.RIGHT));
  detailsSplitter.setSecondComponent(details);
  Splitter horizontalSplitter=new Splitter(false,0.7f);
  horizontalSplitter.setShowDividerControls(true);
  horizontalSplitter.setFirstComponent(detailsSplitter);
  horizontalSplitter.setSecondComponent(repositoryChangesBrowser);
  panel.setContent(horizontalSplitter);
  reloadChanges(project,false);
  return panel;
}

Fixed version (ground truth):
public SimpleToolWindowPanel createToolWindowContent(final Project project){
  changeListPanel.registerChangeListPanel(this);
  diffManager.registerDiffTool(commentsDiffTool);
  SimpleToolWindowPanel panel=new SimpleToolWindowPanel(true,true);
  ActionToolbar toolbar=createToolbar(project);
  toolbar.setTargetComponent(changeListPanel);
  panel.setToolbar(toolbar.getComponent());
  repositoryChangesBrowser=createRepositoryChangesBrowser(project);
  detailsSplitter=new Splitter(true,0.6f);
  detailsSplitter.setShowDividerControls(true);
  changeListPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.RIGHT | SideBorder.BOTTOM));
  detailsSplitter.setFirstComponent(changeListPanel);
  detailsPanel=new GerritChangeDetailsPanel(project);
  JPanel details=detailsPanel.getComponent();
  details.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.RIGHT));
  detailsSplitter.setSecondComponent(details);
  Splitter horizontalSplitter=new Splitter(false,0.7f);
  horizontalSplitter.setShowDividerControls(true);
  horizontalSplitter.setFirstComponent(detailsSplitter);
  horizontalSplitter.setSecondComponent(repositoryChangesBrowser);
  panel.setContent(horizontalSplitter);
  reloadChanges(project,false);
  return panel;
}
Program: 80214
Project: 80214
Buggy source:
private ActionToolbar createToolbar(final Project project){
  DefaultActionGroup group=(DefaultActionGroup)ActionManager.getInstance().getAction("String_Node_Str");
  DefaultActionGroup filterGroup=new DefaultActionGroup();
  Iterable<ChangesFilter> filters=changesFilters.getFilters();
  for (  ChangesFilter filter : filters) {
    filterGroup.add(filter.getAction(project));
  }
  filterGroup.add(new Separator());
  group.add(filterGroup,Constraints.FIRST);
  changesFilters.addObserver(new Observer(){
    @Override public void update(    Observable observable,    Object o){
      reloadChanges(project,true);
    }
  }
);
  return ActionManager.getInstance().createActionToolbar("String_Node_Str",group,true);
}

Fixed version (ground truth):
private ActionToolbar createToolbar(final Project project){
  DefaultActionGroup groupFromConfig=(DefaultActionGroup)ActionManager.getInstance().getAction("String_Node_Str");
  DefaultActionGroup group=new DefaultActionGroup(groupFromConfig);
  DefaultActionGroup filterGroup=new DefaultActionGroup();
  Iterable<ChangesFilter> filters=changesFilters.getFilters();
  for (  ChangesFilter filter : filters) {
    filterGroup.add(filter.getAction(project));
  }
  filterGroup.add(new Separator());
  group.add(filterGroup,Constraints.FIRST);
  changesFilters.addObserver(new Observer(){
    @Override public void update(    Observable observable,    Object o){
      reloadChanges(project,true);
    }
  }
);
  return ActionManager.getInstance().createActionToolbar("String_Node_Str",group,true);
}
Program: 80215
Project: 80215
Buggy source:
public Element getState(){
  log.assertTrue(!ProgressManager.getInstance().hasProgressIndicator(),"String_Node_Str");
  try {
    if (passwordChanged && !masterPasswordRefused) {
      PasswordSafe.getInstance().storePassword(null,GerritSettings.class,GERRIT_SETTINGS_PASSWORD_KEY,getPassword());
    }
  }
 catch (  MasterPasswordUnavailableException e) {
    log.info("String_Node_Str" + GERRIT_SETTINGS_PASSWORD_KEY + "String_Node_Str",e);
    masterPasswordRefused=true;
  }
catch (  Exception e) {
    Messages.showErrorDialog("String_Node_Str","String_Node_Str");
    log.info("String_Node_Str" + GERRIT_SETTINGS_PASSWORD_KEY + "String_Node_Str",e);
  }
  passwordChanged=false;
  final Element element=new Element(GERRIT_SETTINGS_TAG);
  element.setAttribute(LOGIN,getLogin());
  element.setAttribute(HOST,getHost());
  element.setAttribute(AUTOMATIC_REFRESH,"String_Node_Str" + getAutomaticRefresh());
  element.setAttribute(REFRESH_TIMEOUT,"String_Node_Str" + getRefreshTimeout());
  element.setAttribute(REVIEW_NOTIFICATIONS,"String_Node_Str" + getReviewNotifications());
  Element trustedHosts=new Element(TRUSTED_HOSTS);
  for (  String host : myTrustedHosts) {
    Element hostEl=new Element(TRUSTED_HOST);
    hostEl.setAttribute(TRUSTED_URL,host);
    trustedHosts.addContent(hostEl);
  }
  element.addContent(trustedHosts);
  return element;
}

Fixed version (ground truth):
public Element getState(){
  log.assertTrue(!ProgressManager.getInstance().hasProgressIndicator(),"String_Node_Str");
  try {
    if (passwordChanged && !masterPasswordRefused) {
      PasswordSafe.getInstance().storePassword(null,GerritSettings.class,GERRIT_SETTINGS_PASSWORD_KEY,getPassword());
    }
  }
 catch (  MasterPasswordUnavailableException e) {
    log.info("String_Node_Str" + GERRIT_SETTINGS_PASSWORD_KEY + "String_Node_Str",e);
    masterPasswordRefused=true;
  }
catch (  Exception e) {
    Messages.showErrorDialog("String_Node_Str","String_Node_Str");
    log.info("String_Node_Str" + GERRIT_SETTINGS_PASSWORD_KEY + "String_Node_Str",e);
  }
  passwordChanged=false;
  final Element element=new Element(GERRIT_SETTINGS_TAG);
  element.setAttribute(LOGIN,(getLogin() != null ? getLogin() : "String_Node_Str"));
  element.setAttribute(HOST,(getHost() != null ? getHost() : "String_Node_Str"));
  element.setAttribute(AUTOMATIC_REFRESH,"String_Node_Str" + getAutomaticRefresh());
  element.setAttribute(REFRESH_TIMEOUT,"String_Node_Str" + getRefreshTimeout());
  element.setAttribute(REVIEW_NOTIFICATIONS,"String_Node_Str" + getReviewNotifications());
  Element trustedHosts=new Element(TRUSTED_HOSTS);
  for (  String host : myTrustedHosts) {
    Element hostEl=new Element(TRUSTED_HOST);
    hostEl.setAttribute(TRUSTED_URL,host);
    trustedHosts.addContent(hostEl);
  }
  element.addContent(trustedHosts);
  return element;
}
Program: 80216
Project: 80216
Buggy source:
private static String getProjectName(String url){
  String path=parseUri(url).getPath();
  int index=path.indexOf('/');
  path=path.substring(index + 1);
  path=path.replace("String_Node_Str","String_Node_Str");
  return path;
}

Fixed version (ground truth):
private static String getProjectName(String repositoryUrl,String url){
  if (!repositoryUrl.endsWith("String_Node_Str"))   repositoryUrl=repositoryUrl + "String_Node_Str";
  String basePath=parseUri(repositoryUrl).getPath();
  String path=parseUri(url).getPath();
  path=path.substring(basePath.length());
  path=path.replace("String_Node_Str","String_Node_Str");
  if (path.endsWith("String_Node_Str"))   path=path.substring(0,path.length() - 1);
  return path;
}