nus-yam/ex-repair huggingface dataset:
Program: 5894
Project: 5894
Buggy source:
public String doGet(String url,Bundle params){
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    boolean first=true;
    for (    String key : params.keySet()) {
      if (first) {
        first=false;
      }
 else {
        sb.append("String_Node_Str");
      }
      sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
    }
    url=url + "String_Node_Str" + sb.toString();
  }
  HttpGet httpRequest=new HttpGet(url);
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
public static String doGet(String url,Bundle params){
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    boolean first=true;
    for (    String key : params.keySet()) {
      if (first) {
        first=false;
      }
 else {
        sb.append("String_Node_Str");
      }
      sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
    }
    url=url + "String_Node_Str" + sb.toString();
  }
  HttpGet httpRequest=new HttpGet(url);
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}
Program: 5895
Project: 5895
Buggy source:
public List<Dish> parseDishes(String dishesRespStr) throws JSONException {
  List<Dish> resultList=null;
  JSONObject dishes=new JSONObject(dishesRespStr);
  resultList=new ArrayList<Dish>();
  Dish tempDish=null;
  JSONArray dishArray=dishes.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDish=new Dish();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDish.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempDish.setName(dishObj.getString("String_Node_Str"));
    tempDish.setPrice(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempDish.setDescription(dishObj.getString("String_Node_Str"));
    tempDish.setImageServer(dishObj.getString("String_Node_Str"));
    long createTimeValue=Long.parseLong(dishObj.getString("String_Node_Str"));
    long updateTimeValue=Long.parseLong(dishObj.getString("String_Node_Str"));
    Date createTime=new Date();
    Date updateTime=new Date();
    createTime.setTime(createTimeValue);
    updateTime.setTime(updateTimeValue);
    tempDish.setCreateTime(createTime);
    tempDish.setUpdateTime(updateTime);
    resultList.add(tempDish);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<Dish> parseDishes(String dishesRespStr) throws JSONException {
  if (dishesRespStr == null) {
    return null;
  }
  List<Dish> resultList=null;
  JSONObject dishes=new JSONObject(dishesRespStr);
  resultList=new ArrayList<Dish>();
  Dish tempDish=null;
  JSONArray dishArray=dishes.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDish=new Dish();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDish.setId(dishObj.getInt("String_Node_Str"));
    tempDish.setName(dishObj.getString("String_Node_Str"));
    tempDish.setPrice(dishObj.getInt("String_Node_Str"));
    tempDish.setDescription(dishObj.getString("String_Node_Str"));
    tempDish.setImageServer(dishObj.getString("String_Node_Str"));
    long createTimeValue=dishObj.getLong("String_Node_Str");
    long updateTimeValue=dishObj.getLong("String_Node_Str");
    Date createTime=new Date();
    Date updateTime=new Date();
    createTime.setTime(createTimeValue);
    updateTime.setTime(updateTimeValue);
    tempDish.setCreateTime(createTime);
    tempDish.setUpdateTime(updateTime);
    resultList.add(tempDish);
  }
  return resultList;
}
Program: 5896
Project: 5896
Buggy source:
public List<Order> parseOrders(String orderRespStr) throws JSONException {
  List<Order> resultList=null;
  JSONObject orders=new JSONObject(orderRespStr);
  resultList=new ArrayList<Order>();
  Order tempOrder=null;
  JSONArray dishArray=orders.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrder=new Order();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrder.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrder.setStatus(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrder.setOrderTotal(Integer.parseInt(dishObj.getString("String_Node_Str")));
    long createTimeValue=Long.parseLong(dishObj.getString("String_Node_Str"));
    long payTimeValue=Long.parseLong(dishObj.getString("String_Node_Str"));
    Date createTime=new Date();
    Date payTime=new Date();
    createTime.setTime(createTimeValue);
    payTime.setTime(payTimeValue);
    tempOrder.setCreateTime(createTime);
    tempOrder.setPayTime(payTime);
    resultList.add(tempOrder);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<Order> parseOrders(String orderRespStr) throws JSONException {
  if (orderRespStr == null) {
    return null;
  }
  List<Order> resultList=null;
  JSONObject orders=new JSONObject(orderRespStr);
  resultList=new ArrayList<Order>();
  Order tempOrder=null;
  JSONArray dishArray=orders.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrder=new Order();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrder.setId(dishObj.getInt("String_Node_Str"));
    tempOrder.setStatus(dishObj.getInt("String_Node_Str"));
    tempOrder.setOrderTotal(dishObj.getInt("String_Node_Str"));
    long createTimeValue=dishObj.getLong("String_Node_Str");
    long payTimeValue=dishObj.getLong("String_Node_Str");
    Date createTime=new Date();
    Date payTime=new Date();
    createTime.setTime(createTimeValue);
    payTime.setTime(payTimeValue);
    tempOrder.setCreateTime(createTime);
    tempOrder.setPayTime(payTime);
    resultList.add(tempOrder);
  }
  return resultList;
}
Program: 5897
Project: 5897
Buggy source:
public List<OrderDetail> parseOrderDetail(String orderDetailRespStr) throws JSONException {
  List<OrderDetail> resultList=null;
  JSONObject orderDetail=new JSONObject(orderDetailRespStr);
  resultList=new ArrayList<OrderDetail>();
  OrderDetail tempOrderDetail=null;
  JSONArray dishArray=orderDetail.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrderDetail=new OrderDetail();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrderDetail.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrderDetail.setOrderId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrderDetail.setTableId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrderDetail.setDishId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempOrderDetail.setNumber(Integer.parseInt(dishObj.getString("String_Node_Str")));
    resultList.add(tempOrderDetail);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<OrderDetail> parseOrderDetail(String orderDetailRespStr) throws JSONException {
  if (orderDetailRespStr == null) {
    return null;
  }
  List<OrderDetail> resultList=null;
  JSONObject orderDetail=new JSONObject(orderDetailRespStr);
  resultList=new ArrayList<OrderDetail>();
  OrderDetail tempOrderDetail=null;
  JSONArray dishArray=orderDetail.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempOrderDetail=new OrderDetail();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempOrderDetail.setId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setOrderId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setTableId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setDishId(dishObj.getInt("String_Node_Str"));
    tempOrderDetail.setNumber(dishObj.getInt("String_Node_Str"));
    resultList.add(tempOrderDetail);
  }
  return resultList;
}
Program: 5898
Project: 5898
Buggy source:
public List<DishCategory> parseDishCategory(String dishCategoryRespStr) throws JSONException {
  List<DishCategory> resultList=null;
  JSONObject dishCategory=new JSONObject(dishCategoryRespStr);
  resultList=new ArrayList<DishCategory>();
  DishCategory tempDishCategory=null;
  JSONArray dishArray=dishCategory.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDishCategory=new DishCategory();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDishCategory.setDishId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempDishCategory.setCategoryId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    resultList.add(tempDishCategory);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<DishCategory> parseDishCategory(String dishCategoryRespStr) throws JSONException {
  if (dishCategoryRespStr == null) {
    return null;
  }
  List<DishCategory> resultList=null;
  JSONObject dishCategory=new JSONObject(dishCategoryRespStr);
  resultList=new ArrayList<DishCategory>();
  DishCategory tempDishCategory=null;
  JSONArray dishArray=dishCategory.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDishCategory=new DishCategory();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDishCategory.setDishId(dishObj.getInt("String_Node_Str"));
    tempDishCategory.setCategoryId(dishObj.getInt("String_Node_Str"));
    resultList.add(tempDishCategory);
  }
  return resultList;
}
Program: 5899
Project: 5899
Buggy source:
public List<DiningTable> parseDiningTables(String diningTablesRespStr) throws JSONException {
  List<DiningTable> resultList=null;
  JSONObject diningTables=new JSONObject(diningTablesRespStr);
  resultList=new ArrayList<DiningTable>();
  DiningTable tempDiningTable=null;
  JSONArray dishArray=diningTables.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDiningTable=new DiningTable();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDiningTable.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempDiningTable.setName(dishObj.getString("String_Node_Str"));
    tempDiningTable.setMaxPeople(Integer.parseInt(dishObj.getString("String_Node_Str")));
    int free=Integer.parseInt(dishObj.getString("String_Node_Str"));
    tempDiningTable.setFree(free == 0 ? true : false);
    resultList.add(tempDiningTable);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<DiningTable> parseDiningTables(String diningTablesRespStr) throws JSONException {
  if (diningTablesRespStr == null) {
    return null;
  }
  List<DiningTable> resultList=null;
  JSONObject diningTables=new JSONObject(diningTablesRespStr);
  resultList=new ArrayList<DiningTable>();
  DiningTable tempDiningTable=null;
  JSONArray dishArray=diningTables.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempDiningTable=new DiningTable();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempDiningTable.setId(dishObj.getInt("String_Node_Str"));
    tempDiningTable.setName(dishObj.getString("String_Node_Str"));
    tempDiningTable.setMaxPeople(dishObj.getInt("String_Node_Str"));
    int free=dishObj.getInt("String_Node_Str");
    tempDiningTable.setFree(free == 0 ? true : false);
    resultList.add(tempDiningTable);
  }
  return resultList;
}
Program: 5900
Project: 5900
Buggy source:
public List<Config> parseConfigs(String configsRespStr) throws JSONException {
  List<Config> resultList=null;
  JSONObject configs=new JSONObject(configsRespStr);
  resultList=new ArrayList<Config>();
  Config tempConfig=null;
  JSONArray dishArray=configs.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempConfig=new Config();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempConfig.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempConfig.setName(dishObj.getString("String_Node_Str"));
    tempConfig.setValue(dishObj.getString("String_Node_Str"));
    tempConfig.setDescription(dishObj.getString("String_Node_Str"));
    resultList.add(tempConfig);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<Config> parseConfigs(String configsRespStr) throws JSONException {
  if (configsRespStr == null) {
    return null;
  }
  List<Config> resultList=null;
  JSONObject configs=new JSONObject(configsRespStr);
  resultList=new ArrayList<Config>();
  Config tempConfig=null;
  JSONArray dishArray=configs.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempConfig=new Config();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempConfig.setId(dishObj.getInt("String_Node_Str"));
    tempConfig.setName(dishObj.getString("String_Node_Str"));
    tempConfig.setValue(dishObj.getString("String_Node_Str"));
    tempConfig.setDescription(dishObj.getString("String_Node_Str"));
    resultList.add(tempConfig);
  }
  return resultList;
}
Program: 5901
Project: 5901
Buggy source:
public List<Category> parseCategories(String categoryRespStr) throws JSONException {
  List<Category> resultList=null;
  JSONObject categories=new JSONObject(categoryRespStr);
  resultList=new ArrayList<Category>();
  Category tempCategory=null;
  JSONArray dishArray=categories.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempCategory=new Category();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempCategory.setId(Integer.parseInt(dishObj.getString("String_Node_Str")));
    tempCategory.setName(dishObj.getString("String_Node_Str"));
    tempCategory.setDescription(dishObj.getString("String_Node_Str"));
    tempCategory.setSortOrder(Integer.parseInt(dishObj.getString("String_Node_Str")));
    resultList.add(tempCategory);
  }
  return resultList;
}

Fixed version (ground truth):
public static List<Category> parseCategories(String categoryRespStr) throws JSONException {
  if (categoryRespStr == null) {
    return null;
  }
  List<Category> resultList=null;
  JSONObject categories=new JSONObject(categoryRespStr);
  resultList=new ArrayList<Category>();
  Category tempCategory=null;
  JSONArray dishArray=categories.getJSONArray("String_Node_Str");
  for (int i=0; i < dishArray.length(); i++) {
    tempCategory=new Category();
    JSONObject dishObj=dishArray.getJSONObject(i);
    tempCategory.setId(dishObj.getInt("String_Node_Str"));
    tempCategory.setName(dishObj.getString("String_Node_Str"));
    tempCategory.setDescription(dishObj.getString("String_Node_Str"));
    tempCategory.setSortOrder(dishObj.getInt("String_Node_Str"));
    resultList.add(tempCategory);
  }
  return resultList;
}
Program: 5902
Project: 5902
Buggy source:
@Override public EntityManagerFactory createEntityManagerFactory(String emName,Map map){
  try {
    Map integration=map == null ? CollectionHelper.EMPTY_MAP : Collections.unmodifiableMap(map);
    Enumeration<URL> persistenceXml=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
    if (!persistenceXml.hasMoreElements()) {
      LOG.warn("String_Node_Str" + "String_Node_Str" + (emName != null ? emName : "String_Node_Str"));
    }
    while (persistenceXml.hasMoreElements()) {
      URL url=persistenceXml.nextElement();
      List<PersistenceMetadata> metadataFiles=PersistenceXmlLoader.deploy(url,integration,new EJB3DTDEntityResolver(),PersistenceUnitTransactionType.RESOURCE_LOCAL);
      for (      PersistenceMetadata metadata : metadataFiles) {
        if (metadata.getProvider() == null || IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getProvider())) {
          Map<Object,Object> protectiveCopy=new HashMap<Object,Object>(map);
          enforceOgmConfig(protectiveCopy);
          protectiveCopy.put(HibernatePersistence.PROVIDER,delegate.getClass().getName());
          return delegate.createEntityManagerFactory(emName,protectiveCopy);
        }
      }
    }
    return null;
  }
 catch (  Exception e) {
    if (e instanceof PersistenceException) {
      throw (PersistenceException)e;
    }
 else {
      throw new PersistenceException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public EntityManagerFactory createEntityManagerFactory(String emName,Map map){
  try {
    Map integration=map == null ? CollectionHelper.EMPTY_MAP : Collections.unmodifiableMap(map);
    Enumeration<URL> persistenceXml=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
    if (!persistenceXml.hasMoreElements()) {
      LOG.warn("String_Node_Str" + "String_Node_Str" + (emName != null ? emName : "String_Node_Str"));
    }
    while (persistenceXml.hasMoreElements()) {
      URL url=persistenceXml.nextElement();
      List<PersistenceMetadata> metadataFiles=PersistenceXmlLoader.deploy(url,integration,new EJB3DTDEntityResolver(),PersistenceUnitTransactionType.RESOURCE_LOCAL);
      for (      PersistenceMetadata metadata : metadataFiles) {
        if (metadata.getProvider() == null || IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getProvider())) {
          Map<Object,Object> protectiveCopy=new HashMap<Object,Object>(integration);
          enforceOgmConfig(protectiveCopy);
          protectiveCopy.put(HibernatePersistence.PROVIDER,delegate.getClass().getName());
          return delegate.createEntityManagerFactory(emName,protectiveCopy);
        }
      }
    }
    return null;
  }
 catch (  Exception e) {
    if (e instanceof PersistenceException) {
      throw (PersistenceException)e;
    }
 else {
      throw new PersistenceException("String_Node_Str",e);
    }
  }
}
Program: 5903
Project: 5903
Buggy source:
private void enforceOgmConfig(Map<Object,Object> map){
  map.put(AvailableSettings.SESSION_FACTORY_OBSERVER,GridMetadataManager.class.getName());
  map.put(AvailableSettings.NAMING_STRATEGY,OgmNamingStrategy.class.getName());
  map.put(Environment.CONNECTION_PROVIDER,NoopConnectionProvider.class);
  map.put(Environment.DIALECT,NoopDialect.class);
}

Fixed version (ground truth):
private void enforceOgmConfig(Map<Object,Object> map){
  map.put(AvailableSettings.SESSION_FACTORY_OBSERVER,GridMetadataManager.class.getName());
  map.put(AvailableSettings.NAMING_STRATEGY,OgmNamingStrategy.class.getName());
  map.put(Environment.CONNECTION_PROVIDER,NoopConnectionProvider.class.getName());
  map.put(Environment.DIALECT,NoopDialect.class.getName());
}
Program: 5904
Project: 5904
Buggy source:
@Test public void doTest() throws Exception {
  getTransactionManager().begin();
  final EntityManager em=getFactory().createEntityManager();
  Poem poem=new Poem();
  poem.setName("String_Node_Str");
  em.persist(poem);
  getTransactionManager().commit();
  em.clear();
  getTransactionManager().begin();
  poem=em.find(Poem.class,poem.getId());
  assertThat(poem).isNotNull();
  assertThat(poem.getName()).isEqualTo("String_Node_Str");
  em.remove(poem);
  getTransactionManager().commit();
}

Fixed version (ground truth):
@Test public void doTest() throws Exception {
  getTransactionManager().begin();
  final EntityManager em=getFactory().createEntityManager();
  Poem poem=new Poem();
  poem.setName("String_Node_Str");
  em.persist(poem);
  getTransactionManager().commit();
  em.clear();
  getTransactionManager().begin();
  poem=em.find(Poem.class,poem.getId());
  assertThat(poem).isNotNull();
  assertThat(poem.getName()).isEqualTo("String_Node_Str");
  em.remove(poem);
  getTransactionManager().commit();
  em.close();
}
Program: 5905
Project: 5905
Buggy source:
@Before public void createFactory() throws MalformedURLException {
  GetterPersistenceUnitInfo info=new GetterPersistenceUnitInfo();
  info.setClassLoader(Thread.currentThread().getContextClassLoader());
  info.setExcludeUnlistedClasses(true);
  info.setJtaDataSource(null);
  List<String> classNames=new ArrayList<String>();
  for (  Class<?> clazz : getEntities()) {
    classNames.add(clazz.getName());
  }
  info.setManagedClassNames(classNames);
  info.setNonJtaDataSource(null);
  info.setPersistenceProviderClassName(HibernateOgmPersistence.class.getName());
  info.setPersistenceUnitName("String_Node_Str");
  final URL persistenceUnitRootUrl=new File("String_Node_Str").toURI().toURL();
  info.setPersistenceUnitRootUrl(persistenceUnitRootUrl);
  info.setPersistenceXMLSchemaVersion("String_Node_Str");
  info.setProperties(new Properties());
  info.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
  info.setTransactionType(PersistenceUnitTransactionType.JTA);
  info.setValidationMode(ValidationMode.AUTO);
  info.getProperties().setProperty(Environment.TRANSACTION_MANAGER_STRATEGY,JBossTSStandaloneTransactionManagerLookup.class.getName());
  factory=new HibernateOgmPersistence().createContainerEntityManagerFactory(info,Collections.EMPTY_MAP);
  transactionManager=new JBossTSStandaloneTransactionManagerLookup().getTransactionManager(null);
}

Fixed version (ground truth):
@Before public void createFactory() throws MalformedURLException {
  arjPropertyManager.getCoordinatorEnvironmentBean().setActionStore(VolatileStore.class.getName());
  transactionManager=new JBossTSStandaloneTransactionManagerLookup().getTransactionManager(null);
  GetterPersistenceUnitInfo info=new GetterPersistenceUnitInfo();
  info.setClassLoader(Thread.currentThread().getContextClassLoader());
  info.setExcludeUnlistedClasses(true);
  info.setJtaDataSource(null);
  List<String> classNames=new ArrayList<String>();
  for (  Class<?> clazz : getEntities()) {
    classNames.add(clazz.getName());
  }
  info.setManagedClassNames(classNames);
  info.setNonJtaDataSource(null);
  info.setPersistenceProviderClassName(HibernateOgmPersistence.class.getName());
  info.setPersistenceUnitName("String_Node_Str");
  final URL persistenceUnitRootUrl=new File("String_Node_Str").toURI().toURL();
  info.setPersistenceUnitRootUrl(persistenceUnitRootUrl);
  info.setPersistenceXMLSchemaVersion("String_Node_Str");
  info.setProperties(new Properties());
  info.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
  info.setTransactionType(PersistenceUnitTransactionType.JTA);
  info.setValidationMode(ValidationMode.AUTO);
  info.getProperties().setProperty(Environment.TRANSACTION_MANAGER_STRATEGY,JBossTSStandaloneTransactionManagerLookup.class.getName());
  factory=new HibernateOgmPersistence().createContainerEntityManagerFactory(info,Collections.EMPTY_MAP);
}
Program: 5907
Project: 5907
Buggy source:
/** 
 * copied from Loader#endCollectionLoad
 */
private void endCollectionLoad(final Object resultSetId,final SessionImplementor session,final CollectionPersister collectionPersister){
  session.getPersistenceContext().getLoadContexts().getCollectionLoadContext(null).endLoadingCollections(collectionPersister);
}

Fixed version (ground truth):
/** 
 * copied from Loader#endCollectionLoad
 */
private void endCollectionLoad(final Object resultSetId,final SessionImplementor session,final CollectionPersister collectionPersister){
  session.getPersistenceContext().getLoadContexts().getCollectionLoadContext(resultSetId).endLoadingCollections(collectionPersister);
}
Program: 5908
Project: 5908
Buggy source:
/** 
 * Execute the physical query and initialize the various entities and collections
 */
private Object doQuery(SessionImplementor session,Serializable id,Type identifierType,Object optionalObject,String optionalEntityName,Serializable optionalId,LockOptions lockOptions,boolean returnProxies){
  int entitySpan=1;
  final List<Object> hydratedObjects=entitySpan == 0 ? null : new ArrayList<Object>(entitySpan * 10);
  TupleAsMapResultSet resultset=getResultSet(id,session);
  QueryParameters qp=new QueryParameters();
  qp.setPositionalParameterTypes(new Type[]{identifierType});
  qp.setPositionalParameterValues(new Object[]{id});
  qp.setOptionalObject(optionalObject);
  qp.setOptionalEntityName(optionalEntityName);
  qp.setOptionalId(optionalId);
  qp.setLockOptions(lockOptions);
  handleEmptyCollections(qp.getCollectionKeys(),resultset,session);
  final org.hibernate.engine.EntityKey[] keys=new org.hibernate.engine.EntityKey[entitySpan];
  Object result=null;
  try {
    while (resultset.next()) {
      result=getRowFromResultSet(resultset,session,qp,optionalId,hydratedObjects,keys,returnProxies);
    }
  }
 catch (  SQLException e) {
  }
  initializeEntitiesAndCollections(hydratedObjects,resultset,session,qp.isReadOnly(session));
  return result;
}

Fixed version (ground truth):
/** 
 * Execute the physical query and initialize the various entities and collections
 */
private Object doQuery(SessionImplementor session,Serializable id,Type identifierType,Object optionalObject,String optionalEntityName,Serializable optionalId,LockOptions lockOptions,boolean returnProxies){
  int entitySpan=entityPersisters.length;
  final List<Object> hydratedObjects=entitySpan == 0 ? null : new ArrayList<Object>(entitySpan * 10);
  TupleAsMapResultSet resultset=getResultSet(id,session);
  QueryParameters qp=new QueryParameters();
  qp.setPositionalParameterTypes(new Type[]{identifierType});
  qp.setPositionalParameterValues(new Object[]{id});
  qp.setOptionalObject(optionalObject);
  qp.setOptionalEntityName(optionalEntityName);
  qp.setOptionalId(optionalId);
  qp.setLockOptions(lockOptions);
  handleEmptyCollections(qp.getCollectionKeys(),resultset,session);
  final org.hibernate.engine.EntityKey[] keys=new org.hibernate.engine.EntityKey[entitySpan];
  Object result=null;
  try {
    while (resultset.next()) {
      result=getRowFromResultSet(resultset,session,qp,optionalId,hydratedObjects,keys,returnProxies);
    }
  }
 catch (  SQLException e) {
  }
  initializeEntitiesAndCollections(hydratedObjects,resultset,session,qp.isReadOnly(session));
  return result;
}
Program: 5911
Project: 5911
Buggy source:
public SyncableDatastoreBackgroundWorker(final SyncableDatastoreBackgroundWorkerConfiguration configuration){
  super(configuration);
  this.datastore=Preconditions.checkNotNull(configuration.datastore);
  this.syncReadTimeout=Preconditions.checkNotNull((configuration.syncReadTimeout != null) ? configuration.syncReadTimeout.longValue() : SyncableDatastoreBackgroundWorkerConfiguration.defaultSyncReadTimeout);
  Preconditions.checkArgument((this.syncReadTimeout == -1) || (this.syncReadTimeout > 0));
  this.syncWriteTimeout=Preconditions.checkNotNull((configuration.syncWriteTimeout != null) ? configuration.syncWriteTimeout.longValue() : SyncableDatastoreBackgroundWorkerConfiguration.defaultSyncWriteTimeout);
  Preconditions.checkArgument((this.syncWriteTimeout == -1) || (this.syncWriteTimeout > 0));
  if (this.syncReadTimeout != -1)   this.syncReadDatastore=SyncableImmutableDatastore.class.cast(this.datastore);
 else   this.syncReadDatastore=null;
  if (this.syncWriteTimeout != -1)   this.syncWriteDatastore=SyncableMutableDatastore.class.cast(this.datastore);
 else   this.syncWriteDatastore=null;
  this.cancel=false;
  this.gracefull=false;
}

Fixed version (ground truth):
public SyncableDatastoreBackgroundWorker(final SyncableDatastoreBackgroundWorkerConfiguration configuration){
  super(configuration);
  this.datastore=Preconditions.checkNotNull(configuration.datastore);
  this.syncReadTimeout=Preconditions.checkNotNull((configuration.syncReadTimeout != null) ? configuration.syncReadTimeout.longValue() : SyncableDatastoreBackgroundWorkerConfiguration.defaultSyncReadTimeout);
  Preconditions.checkArgument((this.syncReadTimeout == -1) || (this.syncReadTimeout > 0));
  this.syncWriteTimeout=Preconditions.checkNotNull((configuration.syncWriteTimeout != null) ? configuration.syncWriteTimeout.longValue() : SyncableDatastoreBackgroundWorkerConfiguration.defaultSyncWriteTimeout);
  Preconditions.checkArgument((this.syncWriteTimeout == -1) || (this.syncWriteTimeout > 0));
  if (this.syncReadTimeout != -1)   this.syncReadDatastore=SyncableImmutableDatastore.class.cast(this.datastore);
 else   this.syncReadDatastore=null;
  if (this.syncWriteTimeout != -1)   this.syncWriteDatastore=SyncableMutableDatastore.class.cast(this.datastore);
 else   this.syncWriteDatastore=null;
  this.cancel=false;
}
Program: 5912
Project: 5912
Buggy source:
public final boolean cancel(){
  this.gracefull=true;
  if (this.isCurrentThread()) {
    this.cancel=true;
    return (true);
  }
 else {
    this.requestStop();
    return (this.awaitStop());
  }
}

Fixed version (ground truth):
public final boolean cancel(){
  this.cancel=true;
  if (this.isCurrentThread())   return (true);
 else {
    this.requestStop();
    return (this.awaitStop());
  }
}
Program: 5914
Project: 5914
Buggy source:
@Override protected final void finalizeLoop(){
synchronized (this.monitor) {
    this.callbacks.handleLogEvent(Level.DEBUG,null,"String_Node_Str");
    if (!this.cancel) {
      this.cancel=true;
      this.callbacks.handleLogEvent(Level.WARN,null,"String_Node_Str");
      if (!this.datastore.close())       this.callbacks.handleLogEvent(Level.ERROR,null,"String_Node_Str");
    }
    this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected final void finalizeLoop(){
synchronized (this.monitor) {
    this.callbacks.handleLogEvent(Level.DEBUG,null,"String_Node_Str");
    if (!this.cancel) {
      this.callbacks.handleLogEvent(Level.WARN,null,"String_Node_Str");
      if (!this.datastore.close())       this.callbacks.handleLogEvent(Level.ERROR,null,"String_Node_Str");
    }
    this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
  }
}
Program: 5915
Project: 5915
Buggy source:
protected final void disconnect(){
  if (this.connection == null)   throw (new IllegalStateException("String_Node_Str"));
  this.shouldReconnect=true;
  try {
    try {
      if (this.channel != null)       this.channel.close();
    }
  finally {
      this.connection.close();
    }
  }
 catch (  final Throwable exception) {
    this.exceptionHandler.handleException("String_Node_Str",exception);
  }
 finally {
    this.connection=null;
    this.channel=null;
  }
}

Fixed version (ground truth):
protected final void disconnect(){
  if (this.connection == null)   throw (new IllegalStateException("String_Node_Str"));
  this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
  this.shouldReconnect=true;
  try {
    try {
      if (this.channel != null)       this.channel.close();
    }
  finally {
      this.connection.close();
    }
  }
 catch (  final Throwable exception) {
    this.callbacks.handleException(exception,"String_Node_Str");
  }
 finally {
    this.connection=null;
    this.channel=null;
  }
}
Program: 5916
Project: 5916
Buggy source:
public final void start(){
synchronized (this) {
    if (this.thread != null)     throw (new IllegalStateException("String_Node_Str"));
    this.thread=new Thread(new Runnable(){
      public final void run(){
        AmqpAccessor.this.loop();
        if (AmqpAccessor.this.shutdownHook != null)         Runtime.getRuntime().removeShutdownHook(AmqpAccessor.this.shutdownHook);
      }
    }
);
    this.thread.setName(String.format("String_Node_Str",this.getClass().getName(),System.identityHashCode(this)));
    this.thread.setDaemon(true);
    this.shutdownHook=new Thread(new Runnable(){
      public final void run(){
        AmqpAccessor.this.shutdownHook=null;
        if (AmqpAccessor.this.isStarted()) {
          AmqpAccessor.this.stop();
          while (AmqpAccessor.this.isStarted())           try {
            Thread.sleep(AmqpAccessor.waitTimeout);
          }
 catch (          final InterruptedException exception) {
            break;
          }
        }
      }
    }
);
    Runtime.getRuntime().addShutdownHook(this.shutdownHook);
    this.shouldStopLoop=false;
    this.thread.start();
  }
}

Fixed version (ground truth):
public final void start(){
synchronized (this) {
    if (this.thread != null)     throw (new IllegalStateException("String_Node_Str"));
    this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
    this.thread=new Thread(new Runnable(){
      public final void run(){
        AmqpAccessor.this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
        AmqpAccessor.this.loop();
        if (AmqpAccessor.this.shutdownHook != null)         Runtime.getRuntime().removeShutdownHook(AmqpAccessor.this.shutdownHook);
        AmqpAccessor.this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
      }
    }
);
    this.thread.setName(String.format("String_Node_Str",this.getClass().getName(),System.identityHashCode(this)));
    this.thread.setDaemon(true);
    this.shutdownHook=new Thread(new Runnable(){
      public final void run(){
        AmqpAccessor.this.shutdownHook=null;
        if (AmqpAccessor.this.isRunning()) {
          if (!AmqpAccessor.this.shouldStopLoop)           AmqpAccessor.this.stop();
          while (AmqpAccessor.this.isRunning())           try {
            Thread.sleep(AmqpAccessor.waitTimeout);
          }
 catch (          final InterruptedException exception) {
            break;
          }
        }
      }
    }
);
    Runtime.getRuntime().addShutdownHook(this.shutdownHook);
    this.shouldStopLoop=false;
    this.thread.start();
  }
}
Program: 5917
Project: 5917
Buggy source:
public void shutdownCompleted(final ShutdownSignalException exception){
  AmqpAccessor.this.shouldReconnect=true;
  if (!exception.isInitiatedByApplication())   AmqpAccessor.this.exceptionHandler.handleException("String_Node_Str",exception);
}

Fixed version (ground truth):
public void shutdownCompleted(final ShutdownSignalException exception){
  AmqpAccessor.this.shouldReconnect=true;
  if (!exception.isInitiatedByApplication()) {
    AmqpAccessor.this.callbacks.handleException(exception,"String_Node_Str");
    AmqpAccessor.this.disconnect();
  }
}
Program: 5918
Project: 5918
Buggy source:
public final void run(){
  AmqpAccessor.this.shutdownHook=null;
  if (AmqpAccessor.this.isStarted()) {
    AmqpAccessor.this.stop();
    while (AmqpAccessor.this.isStarted())     try {
      Thread.sleep(AmqpAccessor.waitTimeout);
    }
 catch (    final InterruptedException exception) {
      break;
    }
  }
}

Fixed version (ground truth):
public final void run(){
  AmqpAccessor.this.shutdownHook=null;
  if (AmqpAccessor.this.isRunning()) {
    if (!AmqpAccessor.this.shouldStopLoop)     AmqpAccessor.this.stop();
    while (AmqpAccessor.this.isRunning())     try {
      Thread.sleep(AmqpAccessor.waitTimeout);
    }
 catch (    final InterruptedException exception) {
      break;
    }
  }
}
Program: 5919
Project: 5919
Buggy source:
protected AmqpAccessor(final String host,final Integer port,final String virtualHost,final String username,final String password,final ExceptionHandler exceptionHandler){
  super();
  this.host=((host != null) && !host.isEmpty()) ? host : "String_Node_Str";
  this.port=((port != null) && (port != 0)) ? port : 5672;
  this.virtualHost=((virtualHost != null) && !virtualHost.isEmpty()) ? virtualHost : "String_Node_Str";
  this.username=((username != null) && !username.isEmpty()) ? username : "String_Node_Str";
  this.password=((password != null) && !password.isEmpty()) ? password : "String_Node_Str";
  this.exceptionHandler=exceptionHandler;
  this.thread=null;
  this.shutdownHook=null;
  this.shouldStopLoop=true;
  this.connection=null;
  this.channel=null;
  this.shouldReconnect=true;
}

Fixed version (ground truth):
protected AmqpAccessor(final String host,final Integer port,final String virtualHost,final String username,final String password,final Callbacks callbacks){
  super();
  this.host=((host != null) && !host.isEmpty()) ? host : "String_Node_Str";
  this.port=((port != null) && (port != 0)) ? port : 5672;
  this.virtualHost=((virtualHost != null) && !virtualHost.isEmpty()) ? virtualHost : "String_Node_Str";
  this.username=((username != null) && !username.isEmpty()) ? username : "String_Node_Str";
  this.password=((password != null) && !password.isEmpty()) ? password : "String_Node_Str";
  this.callbacks=callbacks;
  this.thread=null;
  this.shutdownHook=null;
  this.shouldStopLoop=true;
  this.connection=null;
  this.channel=null;
  this.shouldReconnect=true;
}
Program: 5920
Project: 5920
Buggy source:
public final void stop(){
synchronized (this) {
    if (this.thread == null)     throw (new IllegalStateException("String_Node_Str"));
    this.shouldStopLoop=true;
  }
}

Fixed version (ground truth):
public final void stop(){
synchronized (this) {
    if (this.thread == null)     throw (new IllegalStateException("String_Node_Str"));
    this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
    this.shouldStopLoop=true;
  }
}
Program: 5922
Project: 5922
Buggy source:
public final void start(){
  if (this.isStarted())   throw (new IllegalStateException("String_Node_Str"));
  if (this.publisher != null)   throw (new IllegalStateException("String_Node_Str"));
  this.exchangeLayout.start();
  this.routingKeyLayout.start();
  this.publisher=new AmqpPublisher(this.host,this.port,this.virtualHost,this.username,this.password,this,this.buffer);
  this.publisher.start();
  super.start();
}

Fixed version (ground truth):
public final void start(){
  if (this.isStarted())   throw (new IllegalStateException("String_Node_Str"));
  if (this.publisher != null)   throw (new IllegalStateException("String_Node_Str"));
  this.exchangeLayout.start();
  this.routingKeyLayout.start();
  this.publisher=new AmqpPublisher(this.host,this.port,this.virtualHost,this.username,this.password,new DefaultContextAwareCallbacks(this),this.buffer);
  this.publisher.start();
  super.start();
}
Program: 5923
Project: 5923
Buggy source:
public final boolean isRunning(){
  final AmqpPublisher publisher=this.publisher;
  return (((publisher != null) && publisher.isStarted()) || super.isStarted());
}

Fixed version (ground truth):
public final boolean isRunning(){
  final AmqpPublisher publisher=this.publisher;
  return (((publisher != null) && publisher.isRunning()) || super.isStarted());
}
Program: 5924
Project: 5924
Buggy source:
public AmqpPublisher(final String host,final Integer port,final String virtualHost,final String username,final String password,final ExceptionHandler exceptionHandler,final LinkedBlockingDeque<AmqpMessage> source){
  super(host,port,virtualHost,username,password,exceptionHandler);
  this.source=source;
}

Fixed version (ground truth):
public AmqpPublisher(final String host,final Integer port,final String virtualHost,final String username,final String password,final Callbacks callbacks,final LinkedBlockingDeque<AmqpMessage> source){
  super(host,port,virtualHost,username,password,callbacks);
  this.source=source;
}
Program: 5925
Project: 5925
Buggy source:
protected final void loop(){
  loop:   while (true) {
    while (true) {
synchronized (this) {
        if (this.shouldStopLoop())         break loop;
        if (!this.shouldReconnect())         break;
        if (this.reconnect())         break;
      }
      this.sleep();
    }
    while (true) {
synchronized (this) {
        if (this.shouldStopLoop())         break loop;
        if (this.shouldReconnect())         break;
      }
      final AmqpMessage message;
      try {
        message=this.source.poll(AmqpAccessor.waitTimeout,TimeUnit.MILLISECONDS);
      }
 catch (      final InterruptedException exception) {
        continue;
      }
      if (message == null)       continue;
synchronized (this) {
        if (!this.publish(message))         this.source.addFirst(message);
      }
    }
  }
  if (this.isConnected())   this.disconnect();
}

Fixed version (ground truth):
protected final void loop(){
  loop:   while (true) {
    while (true) {
synchronized (this) {
        if (this.shouldStopLoop())         break loop;
        if (!this.shouldReconnect())         break;
        if (this.reconnect())         break;
      }
      this.sleep();
    }
    this.callbacks.handleLogEvent(Level.INFO,null,"String_Node_Str");
    while (true) {
synchronized (this) {
        if (this.shouldStopLoop())         break loop;
        if (this.shouldReconnect())         break;
      }
      final AmqpMessage message;
      try {
        message=this.source.poll(AmqpAccessor.waitTimeout,TimeUnit.MILLISECONDS);
      }
 catch (      final InterruptedException exception) {
        continue;
      }
      if (message == null)       continue;
synchronized (this) {
        if (!this.publish(message))         this.source.addFirst(message);
      }
    }
  }
  if (this.isConnected())   this.disconnect();
}
Program: 5926
Project: 5926
Buggy source:
private final boolean publish(final AmqpMessage message){
  final Channel channel=this.getChannel();
  final AMQP.BasicProperties properties=new AMQP.BasicProperties();
  properties.setContentType(message.contentType);
  properties.setContentEncoding(message.contentEncoding);
  properties.setDeliveryMode(2);
  try {
    channel.basicPublish(message.exchange,message.routingKey,false,false,properties,message.content);
    return (true);
  }
 catch (  final Throwable exception) {
    this.exceptionHandler.handleException("String_Node_Str",exception);
    return (false);
  }
}

Fixed version (ground truth):
private final boolean publish(final AmqpMessage message){
  final Channel channel=this.getChannel();
  final AMQP.BasicProperties properties=new AMQP.BasicProperties();
  properties.setContentType(message.contentType);
  properties.setContentEncoding(message.contentEncoding);
  properties.setDeliveryMode(2);
  try {
    channel.basicPublish(message.exchange,message.routingKey,false,false,properties,message.content);
    return (true);
  }
 catch (  final Throwable exception) {
    this.callbacks.handleException(exception,"String_Node_Str");
    return (false);
  }
}
Program: 5927
Project: 5927
Buggy source:
public void addProfessor(){
  DialogAddProf dialog=new DialogAddProf(adminMain,true);
  DefaultComboBoxModel model=new DefaultComboBoxModel();
  for (  Specialty s : adminMain.getSelectedFaculty().getSpecialties()) {
    for (    Course c : s.getCourses()) {
      model.addElement(c);
    }
  }
  dialog.setInputCurs(model);
  dialog.pack();
  dialog.setVisible(true);
  Professor prof=new Professor();
  prof.setTitle(dialog.getTitlu());
  prof.setFirstName(dialog.getPrenume());
  prof.setLastName(dialog.getNume());
  prof.setUserName(dialog.getUser());
  prof.setPassword(dialog.getParola());
  prof.addCourse(dialog.getCurs());
  administratorService.addProfesor(prof);
  administratorService.manageProfessors();
  loadProgesoriByFaculta_list(adminMain.getSelectedFaculty());
}

Fixed version (ground truth):
public void addProfessor(){
  DialogAddProf dialog=new DialogAddProf(adminMain,true);
  DefaultComboBoxModel model=new DefaultComboBoxModel();
  for (  Specialty s : adminMain.getSelectedFaculty().getSpecialties()) {
    for (    Course c : s.getCourses()) {
      model.addElement(c);
    }
  }
  dialog.setInputCurs(model);
  dialog.pack();
  dialog.setVisible(true);
  Professor prof=new Professor();
  prof.setTitle(dialog.getTitlu());
  prof.setFirstName(dialog.getPrenume());
  prof.setLastName(dialog.getNume());
  prof.setUserName(dialog.getUser());
  prof.setPassword(dialog.getParola());
  prof.addCourse(dialog.getCurs());
  dialog.getCurs().addProfessor(prof);
  administratorService.addProfesor(prof);
  adminMain.setListProfesori(loadProgesoriByFaculta_list(adminMain.getSelectedFaculty()));
}
Program: 5928
Project: 5928
Buggy source:
public List<DbObject> toDbObjectListContract(){
  return null;
}

Fixed version (ground truth):
public List<DbObject> toDbObjectListContract() throws SQLException {
  return null;
}
Program: 5929
Project: 5929
Buggy source:
public List<DbObject> toDbObjectListSS(){
  return null;
}

Fixed version (ground truth):
public List<DbObject> toDbObjectListSS() throws SQLException {
  return null;
}
Program: 5930
Project: 5930
Buggy source:
public void openAdminFrame(){
  adminMain=new FrameAdminMain(this);
  adminMain.setVisible(true);
  loadFaculties();
  loadAdministrators();
  adminMain.setLabelNumeAdmin(administrator);
  adminMain.setLabelUserAdmin(administrator);
}

Fixed version (ground truth):
public void openAdminFrame(){
  adminMain=new FrameAdminMain(this);
  loadFaculties();
  loadAdministrators();
  adminMain.setLabelNumeAdmin(administrator);
  adminMain.setLabelUserAdmin(administrator);
  adminMain.setVisible(true);
}
Program: 5931
Project: 5931
Buggy source:
/** 
 * constuctor privat pentru singleton
 */
private AppService(){
  adminRepo=AdministratorRepository.getInstance();
  profRepo=ProfessorRepository.getInstance();
  studRepo=StudentRepository.getInstance();
  facultyReposiitory=FacultyRepository.getInstance();
}

Fixed version (ground truth):
/** 
 * constuctor privat pentru singleton
 */
private AppService(){
  adminRepo=AdministratorRepository.getInstance();
  profRepo=ProfessorRepository.getInstance();
  studRepo=StudentRepository.getInstance();
  facultyReposiitory=FacultyRepository.getInstance();
  groupRepo=GroupRepository.getInstance();
}
Program: 5932
Project: 5932
Buggy source:
private GroupRepository(){
  for (  Specialty s : specRepo.getAll()) {
    l.addAll(s.getGroups());
    for (    Professor p : pr.getAll())     for (    Group grp : p.getGroups())     for (    Group grr : s.getGroups())     if (grp.getGroupName().equals(grr.getGroupName())) {
      grp.setSpecialty(grr.getSpecialty());
    }
  }
}

Fixed version (ground truth):
private GroupRepository(){
  for (  Specialty s : specRepo.getAll()) {
    l.addAll(s.getGroups());
    for (    Professor p : pr.getAll())     for (    Group grp : p.getGroups()) {
      for (      Group grr : s.getGroups())       if (grp.getGroupName().equals(grr.getGroupName())) {
        grp.setSpecialty(grr.getSpecialty());
      }
      System.out.println(p);
    }
  }
}