nus-yam/ex-repair huggingface dataset:
Program: 160611
Project: 160611
Buggy source:
public void start(String address,int port){
  BimServerConfig config=new BimServerConfig();
  config.setHomeDir(new File("String_Node_Str"));
  config.setResourceFetcher(new LocalDevelopmentResourceFetcher());
  config.setStartEmbeddedWebServer(true);
  config.setClassPath(System.getProperty("String_Node_Str"));
  config.setPort(port);
  config.setStartCommandLine(true);
  bimServer=new BimServer(config);
  LocalVersionConstructor.augmentWithSvn(bimServer.getVersionChecker().getLocalVersion());
  try {
    LocalDevPluginLoader.loadPlugins(bimServer.getPluginManager());
    bimServer.start();
  }
 catch (  PluginException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseInitException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  BimserverDatabaseException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseRestartRequiredException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void start(String address,int port){
  BimServerConfig config=new BimServerConfig();
  config.setHomeDir(new File("String_Node_Str"));
  config.setResourceFetcher(new LocalDevelopmentResourceFetcher());
  config.setStartEmbeddedWebServer(true);
  config.setClassPath(System.getProperty("String_Node_Str"));
  config.setPort(port);
  config.setStartCommandLine(true);
  bimServer=new BimServer(config);
  LocalVersionConstructor.augmentWithSvn(bimServer.getVersionChecker().getLocalVersion());
  try {
    LocalDevPluginLoader.loadPlugins(bimServer.getPluginManager());
    bimServer.start();
    if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) {
      bimServer.getServiceFactory().getService(ServiceInterface.class,new SystemAuthorization(1,TimeUnit.HOURS)).setup("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    }
  }
 catch (  PluginException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseInitException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  BimserverDatabaseException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseRestartRequiredException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160613
Project: 160613
Buggy source:
public SGeometry convertToSObject(Geometry input){
  if (input == null) {
    return null;
  }
  SGeometry result=new SGeometry();
  result.setOid(input.getOid());
  result.setRid(input.getRid());
  result.getIndices().addAll(input.getIndices());
  result.getVertices().addAll(input.getVertices());
  result.getNormals().addAll(input.getNormals());
  return result;
}

Fixed version (ground truth):
public SExternalServiceCalled convertToSObject(ExternalServiceCalled input){
  if (input == null) {
    return null;
  }
  SExternalServiceCalled result=new SExternalServiceCalled();
  result.setOid(input.getOid());
  result.setRid(input.getRid());
  result.setDate(input.getDate());
  result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(SNotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  User executorVal=input.getExecutor();
  result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
  Service serviceVal=input.getService();
  result.setServiceId(serviceVal == null ? -1 : serviceVal.getOid());
  return result;
}
Program: 160614
Project: 160614
Buggy source:
public Geometry convertFromSObject(SGeometry input,Geometry result,DatabaseSession session) throws BimserverDatabaseException {
  if (input == null) {
    return null;
  }
  result.getIndices().addAll(input.getIndices());
  result.getVertices().addAll(input.getVertices());
  result.getNormals().addAll(input.getNormals());
  return result;
}

Fixed version (ground truth):
public ExternalServiceCalled convertFromSObject(SExternalServiceCalled input,ExternalServiceCalled result,DatabaseSession session) throws BimserverDatabaseException {
  if (input == null) {
    return null;
  }
  result.setDate(input.getDate());
  result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setState(NotifictionResultEnum.values()[input.getState().ordinal()]);
  result.setPercentage(input.getPercentage());
  result.getInfos().addAll(input.getInfos());
  result.getWarnings().addAll(input.getWarnings());
  result.getErrors().addAll(input.getErrors());
  result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(),input.getExecutorId(),false,null));
  result.setService((Service)session.get(StorePackage.eINSTANCE.getService(),input.getServiceId(),false,null));
  return result;
}
Program: 160616
Project: 160616
Buggy source:
public String generate(Object argument){
  final StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(TEXT_1);
  stringBuffer.append(TEXT_2);
  stringBuffer.append(TEXT_3);
  stringBuffer.append(Licenser.getCommentedLicenseText(new File("String_Node_Str")));
  stringBuffer.append(TEXT_4);
  Object[] args=(Object[])argument;
  Class<?> cl=(Class<?>)args[0];
  EPackage ePackage=(EPackage)args[1];
  stringBuffer.append(TEXT_5);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_6);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_7);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_8);
  for (  EClassifier eClassifier : ePackage.getEClassifiers()) {
    if (eClassifier instanceof EClass || eClassifier instanceof EEnum) {
      stringBuffer.append(TEXT_9);
      stringBuffer.append(eClassifier.getName());
      stringBuffer.append(TEXT_10);
    }
  }
  stringBuffer.append(TEXT_11);
  return stringBuffer.toString();
}

Fixed version (ground truth):
public String generate(Object argument){
  final StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(TEXT_1);
  stringBuffer.append(TEXT_2);
  stringBuffer.append(TEXT_3);
  stringBuffer.append(Licenser.getCommentedLicenseText(new File("String_Node_Str")));
  stringBuffer.append(TEXT_4);
  Object[] args=(Object[])argument;
  Class<?> cl=(Class<?>)args[0];
  EPackage ePackage=(EPackage)args[1];
  stringBuffer.append(TEXT_5);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_6);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_7);
  stringBuffer.append(cl.getSimpleName());
  stringBuffer.append(TEXT_8);
  for (  EClassifier eClassifier : ePackage.getEClassifiers()) {
    if (eClassifier instanceof EClass) {
      stringBuffer.append(TEXT_9);
      stringBuffer.append(eClassifier.getName());
      stringBuffer.append(TEXT_10);
      stringBuffer.append(eClassifier.getName());
      stringBuffer.append(TEXT_11);
    }
 else     if (eClassifier instanceof EEnum) {
      stringBuffer.append(TEXT_12);
      stringBuffer.append(eClassifier.getName());
      stringBuffer.append(TEXT_13);
    }
  }
  stringBuffer.append(TEXT_14);
  return stringBuffer.toString();
}
Program: 160618
Project: 160618
Buggy source:
public CheckinStatus convertFromSObject(SCheckinStatus input){
  return CheckinStatus.values()[input.ordinal()];
}

Fixed version (ground truth):
public UserChanged convertFromSObject(SUserChanged input,BimDatabaseSession session){
  if (input == null) {
    return null;
  }
  UserChanged result=LogFactory.eINSTANCE.createUserChanged();
  result.setOid(input.getOid());
  result.setDate(input.getDate());
  result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(),input.getExecutorId(),false,null));
  result.setUser((User)session.get(StorePackage.eINSTANCE.getUser(),input.getUserId(),false,null));
  return result;
}
Program: 160619
Project: 160619
Buggy source:
public SCheckinStatus convertToSObject(CheckinStatus input){
  return SCheckinStatus.values()[input.ordinal()];
}

Fixed version (ground truth):
public SUserChanged convertToSObject(UserChanged input){
  if (input == null) {
    return null;
  }
  SUserChanged result=new SUserChanged();
  result.setOid(input.getOid());
  result.setDate(input.getDate());
  result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
  User executorVal=input.getExecutor();
  result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
  User userVal=input.getUser();
  result.setUserId(userVal == null ? -1 : userVal.getOid());
  return result;
}
Program: 160620
Project: 160620
Buggy source:
public AddDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,IdEObject idEObject){
  super(bimDatabaseSession,accessMethod);
  this.idEObject=idEObject;
}

Fixed version (ground truth):
public AddDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,T idEObject){
  super(bimDatabaseSession,accessMethod);
  this.idEObject=idEObject;
}
Program: 160621
Project: 160621
Buggy source:
@Override public void updateSerializer(SSerializer serializer) throws ServerException, UserException {
  requireAdminAuthenticationAndRunningServer();
  BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    Serializer convert=converter.convertFromSObject(serializer,session);
    if (convert.getObjectIDM() != null) {
      session.store(convert.getObjectIDM());
    }
    session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session,accessMethod,convert),DEADLOCK_RETRIES);
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateSerializer(SSerializer serializer) throws ServerException, UserException {
  requireAdminAuthenticationAndRunningServer();
  BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    Serializer convert=converter.convertFromSObject(serializer,session);
    session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session,accessMethod,convert),DEADLOCK_RETRIES);
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160622
Project: 160622
Buggy source:
public void start(String address,int port,String homedir,String resourceBase){
  if (homedir.startsWith("String_Node_Str") && homedir.endsWith("String_Node_Str")) {
    homedir=homedir.substring(1,homedir.length() - 2);
  }
  System.setProperty("String_Node_Str","String_Node_Str");
  BimServerConfig bimServerConfig=new BimServerConfig();
  bimServerConfig.setHomeDir(new File(homedir));
  bimServerConfig.setResourceFetcher(new JarResourceFetcher());
  bimServerConfig.setStartEmbeddedWebServer(true);
  bimServerConfig.setPort(port);
  bimServerConfig.setClassPath(System.getProperty("String_Node_Str"));
  bimServer=new BimServer(bimServerConfig);
  try {
    bimServer.getEmbeddedWebServer().getContext().setResourceBase("String_Node_Str");
    bimServer.getPluginManager().loadAllPluginsFromDirectoryOfJars(new File("String_Node_Str"));
    bimServer.start();
  }
 catch (  PluginException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  ServerException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseInitException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  BimDatabaseException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseRestartRequiredException e) {
    LOGGER.error("String_Node_Str",e);
  }
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
public void start(String address,int port,String homedir,String resourceBase){
  if (homedir.startsWith("String_Node_Str") && homedir.endsWith("String_Node_Str")) {
    homedir=homedir.substring(1,homedir.length() - 2);
  }
  System.setProperty("String_Node_Str","String_Node_Str");
  BimServerConfig bimServerConfig=new BimServerConfig();
  bimServerConfig.setHomeDir(new File(homedir));
  bimServerConfig.setResourceFetcher(new JarResourceFetcher());
  bimServerConfig.setStartEmbeddedWebServer(true);
  bimServerConfig.setPort(port);
  bimServerConfig.setClassPath(System.getProperty("String_Node_Str"));
  bimServer=new BimServer(bimServerConfig);
  try {
    bimServer.getEmbeddedWebServer().getContext().setResourceBase("String_Node_Str");
    bimServer.getPluginManager().loadAllPluginsFromDirectoryOfJars(new File("String_Node_Str"));
    bimServer.start();
    LOGGER.info("String_Node_Str");
  }
 catch (  PluginException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  ServerException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseInitException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  BimDatabaseException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  DatabaseRestartRequiredException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160623
Project: 160623
Buggy source:
@Override public Boolean execute() throws UserException, BimDatabaseException, BimDeadlockException {
  User actingUser=getUserByUoid(actingUoid);
  final Project project=getProjectByPoid(poid);
  if (actingUser.getUserType() == UserType.ADMIN || actingUser.getHasRightsOn().contains(project)) {
    delete(project);
    ProjectDeleted projectDeleted=LogFactory.eINSTANCE.createProjectDeleted();
    projectDeleted.setAccessMethod(getAccessMethod());
    projectDeleted.setDate(new Date());
    projectDeleted.setExecutor(actingUser);
    projectDeleted.setProject(project);
    getDatabaseSession().store(project);
    return true;
  }
 else {
    throw new UserException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public Boolean execute() throws UserException, BimDatabaseException, BimDeadlockException {
  User actingUser=getUserByUoid(actingUoid);
  final Project project=getProjectByPoid(poid);
  if (actingUser.getUserType() == UserType.ADMIN || (actingUser.getHasRightsOn().contains(project) && bimServer.getSettingsManager().getSettings().isAllowUsersToCreateTopLevelProjects())) {
    delete(project);
    ProjectDeleted projectDeleted=LogFactory.eINSTANCE.createProjectDeleted();
    projectDeleted.setAccessMethod(getAccessMethod());
    projectDeleted.setDate(new Date());
    projectDeleted.setExecutor(actingUser);
    projectDeleted.setProject(project);
    getDatabaseSession().store(project);
    return true;
  }
 else {
    throw new UserException("String_Node_Str");
  }
}
Program: 160624
Project: 160624
Buggy source:
public DeleteProjectDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,long poid,long actingUoid){
  super(bimDatabaseSession,accessMethod);
  this.poid=poid;
  this.actingUoid=actingUoid;
}

Fixed version (ground truth):
public DeleteProjectDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,BimServer bimServer,long poid,long actingUoid){
  super(bimDatabaseSession,accessMethod);
  this.bimServer=bimServer;
  this.poid=poid;
  this.actingUoid=actingUoid;
}
Program: 160625
Project: 160625
Buggy source:
@Override public List<Deserializer> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getDeserializer());
  Map<Long,Deserializer> result=getDatabaseSession().query(condition,Deserializer.class,false,null);
  List<Deserializer> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<Deserializer> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      Deserializer deserializer=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(deserializer.getClassName())) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}

Fixed version (ground truth):
@Override public List<Deserializer> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getDeserializer());
  Map<Long,Deserializer> result=getDatabaseSession().query(condition,Deserializer.class,false,null);
  List<Deserializer> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<Deserializer> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      Deserializer deserializer=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(deserializer.getClassName()) || !deserializer.getEnabled()) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}
Program: 160626
Project: 160626
Buggy source:
@Override public List<IfcEngine> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getIfcEngine());
  Map<Long,IfcEngine> result=getDatabaseSession().query(condition,IfcEngine.class,false,null);
  List<IfcEngine> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<IfcEngine> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      IfcEngine ifcEngine=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(ifcEngine.getClassName())) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}

Fixed version (ground truth):
@Override public List<IfcEngine> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getIfcEngine());
  Map<Long,IfcEngine> result=getDatabaseSession().query(condition,IfcEngine.class,false,null);
  List<IfcEngine> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<IfcEngine> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      IfcEngine ifcEngine=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(ifcEngine.getClassName()) || !ifcEngine.getEnabled()) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}
Program: 160627
Project: 160627
Buggy source:
public List<ObjectIDM> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getObjectIDM());
  Map<Long,ObjectIDM> result=getDatabaseSession().query(condition,ObjectIDM.class,false,null);
  List<ObjectIDM> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<ObjectIDM> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      ObjectIDM objectIdm=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(objectIdm.getClassName())) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}

Fixed version (ground truth):
public List<ObjectIDM> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getObjectIDM());
  Map<Long,ObjectIDM> result=getDatabaseSession().query(condition,ObjectIDM.class,false,null);
  List<ObjectIDM> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<ObjectIDM> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      ObjectIDM objectIdm=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(objectIdm.getClassName()) || !objectIdm.getEnabled()) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}
Program: 160628
Project: 160628
Buggy source:
@Override public List<Serializer> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getSerializer());
  Map<Long,Serializer> result=getDatabaseSession().query(condition,Serializer.class,false,null);
  List<Serializer> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<Serializer> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      Serializer serializer=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(serializer.getClassName())) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}

Fixed version (ground truth):
@Override public List<Serializer> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Condition condition=new IsOfTypeCondition(StorePackage.eINSTANCE.getSerializer());
  Map<Long,Serializer> result=getDatabaseSession().query(condition,Serializer.class,false,null);
  List<Serializer> mapToList=CollectionUtils.mapToList(result);
  if (onlyEnabled) {
    Iterator<Serializer> iterator=mapToList.iterator();
    while (iterator.hasNext()) {
      Serializer serializer=iterator.next();
      if (!bimServer.getPluginManager().isEnabled(serializer.getClassName()) || !serializer.getEnabled()) {
        iterator.remove();
      }
    }
  }
  return mapToList;
}
Program: 160629
Project: 160629
Buggy source:
private void checkOtherUsersCheckouts(Project project,User user,Set<String> warnings){
  int activeCheckouts=0;
  for (  Project p : getAllRelatedProjects(project)) {
    for (    Checkout checkout : p.getCheckouts()) {
      if (checkout.getActive() && checkout.getUser() != user) {
        activeCheckouts++;
      }
    }
  }
  if (activeCheckouts == 1) {
    warnings.add("String_Node_Str");
  }
 else   if (activeCheckouts > 1) {
    warnings.add("String_Node_Str" + activeCheckouts + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void checkOtherUsersCheckouts(Project project,User user,Set<String> warnings){
  int activeCheckouts=0;
  for (  Project p : getAllRelatedProjects(project)) {
    for (    Checkout checkout : p.getCheckouts()) {
      if (checkout.getActive() && checkout.getUser() != user) {
        activeCheckouts++;
      }
    }
  }
  if (activeCheckouts == 1) {
    warnings.add("String_Node_Str");
  }
 else   if (activeCheckouts > 1) {
    warnings.add("String_Node_Str" + activeCheckouts + "String_Node_Str");
  }
}
Program: 160630
Project: 160630
Buggy source:
@Override public Set<String> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Project project=getProjectByPoid(poid);
  User user=getUserByUoid(uoid);
  Set<String> warnings=new HashSet<String>();
  checkInterleavingCommits(project,user,warnings);
  checkOtherUsersCheckouts(project,user,warnings);
  return warnings;
}

Fixed version (ground truth):
@Override public Set<String> execute() throws UserException, BimDeadlockException, BimDatabaseException {
  Project project=getProjectByPoid(poid);
  User user=getUserByUoid(uoid);
  Set<String> warnings=new HashSet<String>();
  checkOtherUsersCheckouts(project,user,warnings);
  return warnings;
}
Program: 160631
Project: 160631
Buggy source:
public UpdateDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,IdEObject idEObject){
  super(bimDatabaseSession,accessMethod);
  this.idEObject=idEObject;
}

Fixed version (ground truth):
public UpdateDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,T idEObject){
  super(bimDatabaseSession,accessMethod);
  this.idEObject=idEObject;
}
Program: 160632
Project: 160632
Buggy source:
public UpdateIfcEngineDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,IfcEngine ifcEngine){
  super(bimDatabaseSession,accessMethod,ifcEngine);
}

Fixed version (ground truth):
public UpdateIfcEngineDatabaseAction(BimDatabaseSession bimDatabaseSession,AccessMethod accessMethod,IfcEngine ifcEngine){
  super(bimDatabaseSession,accessMethod,ifcEngine);
  this.ifcEngine=ifcEngine;
}
Program: 160634
Project: 160634
Buggy source:
@Override public Boolean deleteProject(Long poid) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    BimDatabaseAction<Boolean> action=new DeleteProjectDatabaseAction(session,accessMethod,poid,currentUoid);
    return session.executeAndCommitAction(action,DEADLOCK_RETRIES);
  }
 catch (  Exception e) {
    handleException(e);
    return false;
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public Boolean deleteProject(Long poid) throws ServerException, UserException {
  requireAuthenticationAndRunningServer();
  BimDatabaseSession session=bimServer.getDatabase().createSession();
  try {
    BimDatabaseAction<Boolean> action=new DeleteProjectDatabaseAction(session,accessMethod,bimServer,poid,currentUoid);
    return session.executeAndCommitAction(action,DEADLOCK_RETRIES);
  }
 catch (  Exception e) {
    handleException(e);
    return false;
  }
 finally {
    session.close();
  }
}
Program: 160635
Project: 160635
Buggy source:
@Override public SDownloadResult getDownloadData(final Integer actionId) throws ServerException, UserException {
  LongDownloadOrCheckoutAction longAction=(LongDownloadOrCheckoutAction)bimServer.getLongActionManager().getLongAction(actionId);
  if (longAction != null) {
    longAction.waitForCompletion();
    SCheckoutResult result=longAction.getCheckoutResult();
    bimServer.getLongActionManager().remove(actionId);
    return result;
  }
 else {
    throw new UserException("String_Node_Str" + actionId);
  }
}

Fixed version (ground truth):
@Override public SDownloadResult getDownloadData(final Integer actionId) throws ServerException, UserException {
  LongDownloadOrCheckoutAction longAction=(LongDownloadOrCheckoutAction)bimServer.getLongActionManager().getLongAction(actionId);
  if (longAction != null) {
    longAction.waitForCompletion();
    SCheckoutResult result=longAction.getCheckoutResult();
    return result;
  }
 else {
    throw new UserException("String_Node_Str" + actionId);
  }
}
Program: 160636
Project: 160636
Buggy source:
public static void main(String[] args){
  String address="String_Node_Str";
  String port="String_Node_Str";
  String homedir="String_Node_Str";
  for (  String arg : args) {
    if (arg.startsWith("String_Node_Str")) {
      address=arg.substring(8);
    }
 else     if (arg.startsWith("String_Node_Str")) {
      port=arg.substring(5);
    }
 else     if (arg.startsWith("String_Node_Str")) {
      homedir=arg.substring(8);
    }
  }
  final JarBimWebServer server=new JarBimWebServer();
  server.start(address,Integer.parseInt(port),homedir,"String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  String address="String_Node_Str";
  String port="String_Node_Str";
  String homedir="String_Node_Str";
  for (  String arg : args) {
    if (arg.startsWith("String_Node_Str")) {
      address=arg.substring(8);
      if (address.startsWith("String_Node_Str") && address.endsWith("String_Node_Str")) {
        address=address.substring(1,address.length() - 2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      port=arg.substring(5);
      if (port.startsWith("String_Node_Str") && port.endsWith("String_Node_Str")) {
        port=port.substring(1,port.length() - 2);
      }
    }
 else     if (arg.startsWith("String_Node_Str")) {
      homedir=arg.substring(8);
      if (homedir.startsWith("String_Node_Str") && homedir.endsWith("String_Node_Str")) {
        homedir=homedir.substring(1,homedir.length() - 2);
      }
    }
  }
  final JarBimWebServer server=new JarBimWebServer();
  server.start(address,Integer.parseInt(port),homedir,"String_Node_Str");
}
Program: 160637
Project: 160637
Buggy source:
public DatabaseSession(Database database,BimTransaction bimTransaction,boolean readOnly){
  this.database=database;
  this.bimTransaction=bimTransaction;
  this.readOnly=readOnly;
}

Fixed version (ground truth):
public DatabaseSession(Database database,BimTransaction bimTransaction,boolean readOnly){
  this.database=database;
  this.bimTransaction=bimTransaction;
  this.readOnly=readOnly;
  stackTrace=Thread.currentThread().getStackTrace();
}
Program: 160638
Project: 160638
Buggy source:
@Override public ObjectIdentifier getOidOfGuid(String guid,int pid,int rid) throws BimDeadlockException, BimDatabaseException {
  RecordIterator recordIterator=database.getColumnDatabase().getRecordIterator("String_Node_Str",BinUtils.intToByteArray(pid),BinUtils.intToByteArray(pid),this);
  try {
    Record record=recordIterator.next();
    while (record != null) {
      ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
      int pidOfRecord=buffer.getInt();
      buffer.getLong();
      int ridOfRecord=-buffer.getInt();
      if (ridOfRecord == rid && pid == pidOfRecord) {
        ByteBuffer value=ByteBuffer.wrap(record.getValue());
        byte unsettablesSize=value.get();
        value.position(value.position() + unsettablesSize);
        if (value.capacity() > 1) {
          int stringLength=value.getInt();
          if (stringLength == -1) {
            return null;
          }
 else {
            LOGGER.info("String_Node_Str" + stringLength);
            String s=BinUtils.readString(value,stringLength);
            if (s.equals(guid)) {
              short referenceCid=value.getShort();
              long referencedOid=value.getLong();
              return new ObjectIdentifier(referencedOid,referenceCid);
            }
          }
        }
      }
      record=recordIterator.next();
    }
  }
  finally {
    recordIterator.close();
  }
  return null;
}

Fixed version (ground truth):
@Override public ObjectIdentifier getOidOfGuid(String guid,int pid,int rid) throws BimDeadlockException, BimDatabaseException {
  RecordIterator recordIterator=database.getColumnDatabase().getRecordIterator("String_Node_Str",BinUtils.intToByteArray(pid),BinUtils.intToByteArray(pid),this);
  try {
    Record record=recordIterator.next();
    while (record != null) {
      ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
      int pidOfRecord=buffer.getInt();
      buffer.getLong();
      int ridOfRecord=-buffer.getInt();
      if (ridOfRecord == rid && pid == pidOfRecord) {
        ByteBuffer value=ByteBuffer.wrap(record.getValue());
        byte unsettablesSize=value.get();
        value.position(value.position() + unsettablesSize);
        if (value.capacity() > 1) {
          int stringLength=value.getInt();
          if (stringLength == -1) {
            return null;
          }
 else {
            String s=BinUtils.readString(value,stringLength);
            if (s.equals(guid)) {
              short referenceCid=value.getShort();
              long referencedOid=value.getLong();
              return new ObjectIdentifier(referencedOid,referenceCid);
            }
          }
        }
      }
      record=recordIterator.next();
    }
  }
  finally {
    recordIterator.close();
  }
  return null;
}
Program: 160639
Project: 160639
Buggy source:
@Override public <T>T executeAndCommitAction(BimDatabaseAction<T> action,int retries,ProgressHandler progressHandler) throws BimDatabaseException, UserException {
  for (int i=0; i < retries; i++) {
    try {
      T result=action.execute();
      commit(progressHandler);
      return result;
    }
 catch (    BimDeadlockException e) {
      bimTransaction.rollback();
      clearCache();
      objectsToCommit.clear();
      bimTransaction=database.getColumnDatabase().startTransaction();
      LOGGER.info("String_Node_Str" + action.getClass().getSimpleName() + "String_Node_Str"+ i+ "String_Node_Str");
    }
catch (    BimDatabaseException e) {
      LOGGER.error("String_Node_Str",e);
      throw e;
    }
    if (i < retries - 1) {
      try {
        Thread.sleep(new Random().nextInt((i + 1) * 1000));
      }
 catch (      InterruptedException e1) {
        LOGGER.error("String_Node_Str",e1);
      }
    }
  }
  throw new BimDatabaseException("String_Node_Str" + retries + "String_Node_Str");
}

Fixed version (ground truth):
@Override public <T>T executeAndCommitAction(BimDatabaseAction<T> action,int retries,ProgressHandler progressHandler) throws BimDatabaseException, UserException {
  for (int i=0; i < retries; i++) {
    try {
      T result=action.execute();
      commit(progressHandler);
      return result;
    }
 catch (    BimDeadlockException e) {
      bimTransaction.rollback();
      clearCache();
      objectsToCommit.clear();
      bimTransaction=database.getColumnDatabase().startTransaction();
      LOGGER.info("String_Node_Str" + action.getClass().getSimpleName() + "String_Node_Str"+ i+ "String_Node_Str");
      LOGGER.info("String_Node_Str",e);
      long[] ownerTxnIds=e.getLockException().getOwnerTxnIds();
      for (      long txnid : ownerTxnIds) {
        BimDatabaseSession databaseSession=database.getDatabaseSession(txnid);
        LOGGER.info("String_Node_Str" + databaseSession);
        StackTraceElement[] stackTraceElements=databaseSession.getStackTrace();
        for (        StackTraceElement stackTraceElement : stackTraceElements) {
          LOGGER.info("String_Node_Str" + stackTraceElement);
        }
      }
    }
catch (    BimDatabaseException e) {
      LOGGER.error("String_Node_Str",e);
      throw e;
    }
    if (i < retries - 1) {
      try {
        Thread.sleep(new Random().nextInt((i + 1) * 1000));
      }
 catch (      InterruptedException e1) {
        LOGGER.error("String_Node_Str",e1);
      }
    }
  }
  throw new BimDatabaseException("String_Node_Str" + retries + "String_Node_Str");
}
Program: 160645
Project: 160645
Buggy source:
public UserChanged convertFromSObject(SUserChanged input,BimDatabaseSession session){
  if (input == null) {
    return null;
  }
  UserChanged result=LogFactory.eINSTANCE.createUserChanged();
  result.setOid(input.getOid());
  result.setDate(input.getDate());
  result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
  result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(),input.getExecutorId(),false,null));
  result.setUser((User)session.get(StorePackage.eINSTANCE.getUser(),input.getUserId(),false,null));
  return result;
}

Fixed version (ground truth):
public Version convertFromSObject(SVersion input,BimDatabaseSession session){
  if (input == null) {
    return null;
  }
  Version result=StoreFactory.eINSTANCE.createVersion();
  result.setOid(input.getOid());
  result.setMajor(input.getMajor());
  result.setMinor(input.getMinor());
  result.setRevision(input.getRevision());
  result.setDate(input.getDate());
  result.setDownloadUrl(input.getDownloadUrl());
  result.setSupportUrl(input.getSupportUrl());
  result.setSupportEmail(input.getSupportEmail());
  return result;
}
Program: 160646
Project: 160646
Buggy source:
public SUserChanged convertToSObject(UserChanged input){
  if (input == null) {
    return null;
  }
  SUserChanged result=new SUserChanged();
  result.setOid(input.getOid());
  result.setDate(input.getDate());
  result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
  User executorVal=input.getExecutor();
  result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
  User userVal=input.getUser();
  result.setUserId(userVal == null ? -1 : userVal.getOid());
  return result;
}

Fixed version (ground truth):
public SVersion convertToSObject(Version input){
  if (input == null) {
    return null;
  }
  SVersion result=new SVersion();
  result.setOid(input.getOid());
  result.setMajor(input.getMajor());
  result.setMinor(input.getMinor());
  result.setRevision(input.getRevision());
  result.setDate(input.getDate());
  result.setDownloadUrl(input.getDownloadUrl());
  result.setSupportUrl(input.getSupportUrl());
  result.setSupportEmail(input.getSupportEmail());
  return result;
}
Program: 160650
Project: 160650
Buggy source:
private void setLengthUnitMeasure(IfcModelInterface model,SIPrefix prefix){
  Map<Long,IdEObject> objects=model.getObjects();
  boolean prefixFound=false;
  for (  IdEObject object : objects.values()) {
    if (object instanceof IfcProject) {
      IfcUnitAssignment unitsInContext=((IfcProject)object).getUnitsInContext();
      EList<IfcUnit> units=unitsInContext.getUnits();
      for (      IfcUnit unit : units) {
        if (unit instanceof IfcSIUnit) {
          IfcSIUnit ifcSIUnit=(IfcSIUnit)unit;
          IfcUnitEnum unitType=ifcSIUnit.getUnitType();
          if (unitType == IfcUnitEnum.LENGTHUNIT) {
            prefixFound=true;
            if (prefix == SIPrefix.METER) {
              ifcSIUnit.setPrefix(null);
            }
 else {
              ifcSIUnit.setPrefix(IfcSIPrefix.valueOf(prefix.getLiteral()));
            }
            break;
          }
        }
      }
    }
    if (prefixFound)     break;
  }
}

Fixed version (ground truth):
private void setLengthUnitMeasure(IfcModelInterface model,SIPrefix prefix){
  Map<Long,IdEObject> objects=model.getObjects();
  boolean prefixFound=false;
  for (  IdEObject object : objects.values()) {
    if (object instanceof IfcProject) {
      IfcUnitAssignment unitsInContext=((IfcProject)object).getUnitsInContext();
      EList<IfcUnit> units=unitsInContext.getUnits();
      for (      IfcUnit unit : units) {
        if (unit instanceof IfcSIUnit) {
          IfcSIUnit ifcSIUnit=(IfcSIUnit)unit;
          IfcUnitEnum unitType=ifcSIUnit.getUnitType();
          if (unitType == IfcUnitEnum.LENGTHUNIT) {
            prefixFound=true;
            if (prefix == SIPrefix.METER) {
              ifcSIUnit.setPrefix(null);
            }
 else {
              String siPrefix=prefix.getLiteral().substring(0,prefix.getLiteral().length() - 5).toUpperCase();
              ifcSIUnit.setPrefix(IfcSIPrefix.valueOf(siPrefix));
            }
            break;
          }
        }
      }
    }
    if (prefixFound) {
      break;
    }
  }
}
Program: 160651
Project: 160651
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void updateReferences(){
  for (  IdEObject idEObject : newModel.getValues()) {
    if (idEObject instanceof IfcRoot) {
      String guid=((IfcRoot)idEObject).getGlobalId().getWrappedValue();
      IfcRoot oldObject=resultModel.get(guid);
      for (      EReference eReference : idEObject.eClass().getEAllReferences()) {
        Object referencedObject=idEObject.eGet(eReference);
        if (referencedObject instanceof IfcRoot) {
          String referencedGuid=((IfcRoot)referencedObject).getGlobalId().getWrappedValue();
          IfcRoot newObject=resultModel.get(referencedGuid);
          oldObject.eSet(eReference,newObject);
          LOGGER.info("String_Node_Str" + guid + "String_Node_Str"+ referencedGuid);
        }
 else         if (referencedObject instanceof List) {
          List referencedList=(List)referencedObject;
          List oldReferencedList=(List)oldObject.eGet(eReference);
          for (          Object object : referencedList) {
            if (object instanceof IfcRoot) {
              IfcRoot referencedItem=(IfcRoot)object;
              String itemGuid=referencedItem.getGlobalId().getWrappedValue();
              oldReferencedList.add(resultModel.get(itemGuid));
              LOGGER.info("String_Node_Str" + guid + "String_Node_Str"+ itemGuid);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void updateReferences(){
  for (  IdEObject idEObject : newModel.getValues()) {
    if (idEObject instanceof IfcRoot) {
      String guid=((IfcRoot)idEObject).getGlobalId().getWrappedValue();
      IfcRoot oldObject=resultModel.get(guid);
      for (      EReference eReference : idEObject.eClass().getEAllReferences()) {
        Object referencedObject=idEObject.eGet(eReference);
        if (referencedObject instanceof IfcRoot) {
          String referencedGuid=((IfcRoot)referencedObject).getGlobalId().getWrappedValue();
          IfcRoot newObject=resultModel.get(referencedGuid);
          oldObject.eSet(eReference,newObject);
        }
 else         if (referencedObject instanceof List) {
          List referencedList=(List)referencedObject;
          List oldReferencedList=(List)oldObject.eGet(eReference);
          for (          Object object : referencedList) {
            if (object instanceof IfcRoot) {
              IfcRoot referencedItem=(IfcRoot)object;
              String itemGuid=referencedItem.getGlobalId().getWrappedValue();
              oldReferencedList.add(resultModel.get(itemGuid));
            }
          }
        }
      }
    }
  }
}
Program: 160652
Project: 160652
Buggy source:
private void copyAttributesGuidObjectsAndAddNewObjects(){
  for (  IdEObject idEObject : newModel.getValues()) {
    if (idEObject instanceof IfcRoot) {
      IfcRoot ifcRoot=(IfcRoot)idEObject;
      String guid=ifcRoot.getGlobalId().getWrappedValue();
      if (resultModel.contains(guid)) {
        LOGGER.info("String_Node_Str" + idEObject.eClass().getName() + "String_Node_Str"+ guid);
        IfcRoot oldObject=resultModel.get(guid);
        for (        EAttribute eAttribute : idEObject.eClass().getEAllAttributes()) {
          Object newValue=idEObject.eGet(eAttribute);
          oldObject.eSet(eAttribute,newValue);
        }
      }
 else {
        LOGGER.info("String_Node_Str" + idEObject.eClass().getName() + "String_Node_Str"+ guid);
        IdEObject newObject=(IdEObject)idEObject.eClass().getEPackage().getEFactoryInstance().create(idEObject.eClass());
        newObject.setOid(idEObject.getOid());
        ((IfcRoot)newObject).setGlobalId(newGuid(guid));
        for (        EAttribute eAttribute : newObject.eClass().getEAllAttributes()) {
          newObject.eSet(eAttribute,idEObject.eGet(eAttribute));
        }
        resultModel.add(newObject.getOid(),newObject);
      }
    }
  }
}

Fixed version (ground truth):
private void copyAttributesGuidObjectsAndAddNewObjects(){
  for (  IdEObject idEObject : newModel.getValues()) {
    if (idEObject instanceof IfcRoot) {
      IfcRoot ifcRoot=(IfcRoot)idEObject;
      String guid=ifcRoot.getGlobalId().getWrappedValue();
      if (resultModel.contains(guid)) {
        IfcRoot oldObject=resultModel.get(guid);
        for (        EAttribute eAttribute : idEObject.eClass().getEAllAttributes()) {
          Object newValue=idEObject.eGet(eAttribute);
          oldObject.eSet(eAttribute,newValue);
        }
      }
 else {
        IdEObject newObject=(IdEObject)idEObject.eClass().getEPackage().getEFactoryInstance().create(idEObject.eClass());
        newObject.setOid(idEObject.getOid());
        ((IfcRoot)newObject).setGlobalId(newGuid(guid));
        for (        EAttribute eAttribute : newObject.eClass().getEAllAttributes()) {
          newObject.eSet(eAttribute,idEObject.eGet(eAttribute));
        }
        resultModel.add(newObject.getOid(),newObject);
      }
    }
  }
}
Program: 160654
Project: 160654
Buggy source:
public ProtocolBuffersConnectionHandler(Socket socket,ProtocolBuffersServer protocolBuffersServer){
  this.socket=socket;
  this.protocolBuffersServer=protocolBuffersServer;
  setName("String_Node_Str");
  try {
    dataInputStream=new DataInputStream(socket.getInputStream());
    outputStream=socket.getOutputStream();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public ProtocolBuffersConnectionHandler(Socket socket,ProtocolBuffersServer protocolBuffersServer){
  this.socket=socket;
  this.protocolBuffersServer=protocolBuffersServer;
  setName("String_Node_Str");
  try {
    dataInputStream=new DataInputStream(socket.getInputStream());
    outputStream=socket.getOutputStream();
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160655
Project: 160655
Buggy source:
@Override public void run(){
  try {
    while (true) {
      String serviceName=dataInputStream.readUTF();
      String methodName=dataInputStream.readUTF();
      ProtocolBuffersMetaData protocolBuffersMetaData=protocolBuffersServer.getProtocolBuffersMetaData();
      if (!services.containsKey(serviceName)) {
        services.put(serviceName,protocolBuffersServer.getServiceFactoryRegistry().createServiceFactory(serviceName).newService(AccessMethod.PROTOCOL_BUFFERS,socket.getRemoteSocketAddress().toString()));
      }
      ReflectiveRpcChannel reflectiveRpcChannel=new ReflectiveRpcChannel(services.get(serviceName),protocolBuffersMetaData,new SService(ServiceInterface.class));
      MethodDescriptorContainer method=protocolBuffersMetaData.getMethod(serviceName,methodName);
      Builder requestBuilder=DynamicMessage.getDefaultInstance(method.getInputDescriptor()).newBuilderForType();
      requestBuilder.mergeDelimitedFrom(dataInputStream);
      Message response=reflectiveRpcChannel.callBlockingMethod(method,requestBuilder.build());
      response.writeDelimitedTo(outputStream);
      outputStream.flush();
    }
  }
 catch (  SocketException e) {
  }
catch (  EOFException e) {
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ServiceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (true) {
      String serviceName=dataInputStream.readUTF();
      String methodName=dataInputStream.readUTF();
      ProtocolBuffersMetaData protocolBuffersMetaData=protocolBuffersServer.getProtocolBuffersMetaData();
      if (!services.containsKey(serviceName)) {
        services.put(serviceName,protocolBuffersServer.getServiceFactoryRegistry().createServiceFactory(serviceName).newService(AccessMethod.PROTOCOL_BUFFERS,socket.getRemoteSocketAddress().toString()));
      }
      ReflectiveRpcChannel reflectiveRpcChannel=new ReflectiveRpcChannel(services.get(serviceName),protocolBuffersMetaData,new SService(ServiceInterface.class));
      MethodDescriptorContainer method=protocolBuffersMetaData.getMethod(serviceName,methodName);
      Builder requestBuilder=DynamicMessage.getDefaultInstance(method.getInputDescriptor()).newBuilderForType();
      requestBuilder.mergeDelimitedFrom(dataInputStream);
      Message response=reflectiveRpcChannel.callBlockingMethod(method,requestBuilder.build());
      response.writeDelimitedTo(outputStream);
      outputStream.flush();
    }
  }
 catch (  SocketException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  EOFException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160657
Project: 160657
Buggy source:
@Override public Long addUser(String username,String name,SUserType type,Boolean selfRegistration) throws ServerException, UserException {
  if (!selfRegistration) {
    requireAuthenticationAndRunningServer();
  }
 else   if (!bimServer.getSettingsManager().getSettings().isAllowSelfRegistration()) {
    requireSelfregistrationAllowed();
  }
  BimDatabaseSession session=bimServer.getDatabase().createSession(true);
  try {
    BimDatabaseAction<Long> action=new AddUserDatabaseAction(bimServer,session,accessMethod,username,name,converter.convertFromSObject(type),currentUoid,selfRegistration);
    return session.executeAndCommitAction(action,DEADLOCK_RETRIES);
  }
 catch (  Exception e) {
    handleException(e);
    return -1L;
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public SUser addUser(String username,String name,SUserType type,Boolean selfRegistration) throws ServerException, UserException {
  if (!selfRegistration) {
    requireAuthenticationAndRunningServer();
  }
 else   if (!bimServer.getSettingsManager().getSettings().isAllowSelfRegistration()) {
    requireSelfregistrationAllowed();
  }
  BimDatabaseSession session=bimServer.getDatabase().createSession(true);
  try {
    BimDatabaseAction<User> action=new AddUserDatabaseAction(bimServer,session,accessMethod,username,name,converter.convertFromSObject(type),currentUoid,selfRegistration);
    return converter.convertToSObject(session.executeAndCommitAction(action,DEADLOCK_RETRIES));
  }
 catch (  Exception e) {
    handleException(e);
    return null;
  }
 finally {
    session.close();
  }
}
Program: 160658
Project: 160658
Buggy source:
public java.lang.Long addUser(java.lang.String arg0,java.lang.String arg1,org.bimserver.interfaces.objects.SUserType arg2,java.lang.Boolean arg3) throws org.bimserver.shared.exceptions.UserException, org.bimserver.shared.exceptions.ServerException {
  return (java.lang.Long)reflector.callMethod("String_Node_Str","String_Node_Str",java.lang.Long.class,arg0,arg1,arg2,arg3);
}

Fixed version (ground truth):
public org.bimserver.interfaces.objects.SUser addUser(java.lang.String arg0,java.lang.String arg1,org.bimserver.interfaces.objects.SUserType arg2,java.lang.Boolean arg3) throws org.bimserver.shared.exceptions.UserException, org.bimserver.shared.exceptions.ServerException {
  return (org.bimserver.interfaces.objects.SUser)reflector.callMethod("String_Node_Str","String_Node_Str",org.bimserver.interfaces.objects.SUser.class,arg0,arg1,arg2,arg3);
}