nus-yam/ex-repair huggingface dataset:
Program: 160416
Project: 160416
Buggy source:
@Override public void updateModelMerger(SModelMergerPluginConfiguration modelMerger) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    ModelMergerPluginConfiguration convert=getBimServer().getSConverter().convertFromSObject(modelMerger,session);
    session.executeAndCommitAction(new UpdateModelMergerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateModelMerger(SModelMergerPluginConfiguration modelMerger) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    ModelMergerPluginConfiguration convert=session.get(modelMerger.getOid(),OldQuery.getDefault());
    getBimServer().getSConverter().convertFromSObject(modelMerger,convert,session);
    session.executeAndCommitAction(new UpdateModelMergerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160417
Project: 160417
Buggy source:
@Override public void updateInternalService(SInternalServicePluginConfiguration internalService) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    InternalServicePluginConfiguration convertFromSObject=getBimServer().getSConverter().convertFromSObject(internalService,session);
    session.executeAndCommitAction(new UpdateDatabaseAction<InternalServicePluginConfiguration>(session,getInternalAccessMethod(),convertFromSObject));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateInternalService(SInternalServicePluginConfiguration internalService) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    InternalServicePluginConfiguration convertFromSObject=session.get(internalService.getOid(),OldQuery.getDefault());
    getBimServer().getSConverter().convertFromSObject(internalService,convertFromSObject,session);
    session.executeAndCommitAction(new UpdateDatabaseAction<InternalServicePluginConfiguration>(session,getInternalAccessMethod(),convertFromSObject));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160418
Project: 160418
Buggy source:
@Override public void updateDeserializer(SDeserializerPluginConfiguration deserializer) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    DeserializerPluginConfiguration convert=getBimServer().getSConverter().convertFromSObject(deserializer,session);
    session.executeAndCommitAction(new UpdateDeserializerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateDeserializer(SDeserializerPluginConfiguration deserializer) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    DeserializerPluginConfiguration convert=session.get(deserializer.getOid(),OldQuery.getDefault());
    getBimServer().getSConverter().convertFromSObject(deserializer,convert,session);
    session.executeAndCommitAction(new UpdateDeserializerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160419
Project: 160419
Buggy source:
@Override public void updateObjectIDM(SObjectIDMPluginConfiguration objectIDM) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    session.executeAndCommitAction(new UpdateObjectIDMDatabaseAction(session,getInternalAccessMethod(),getBimServer().getSConverter().convertFromSObject(objectIDM,session)));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateObjectIDM(SObjectIDMPluginConfiguration objectIDM) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    session.executeAndCommitAction(new UpdateObjectIDMDatabaseAction(session,getInternalAccessMethod(),getBimServer().getSConverter().convertFromSObject(objectIDM,session.get(objectIDM.getOid(),OldQuery.getDefault()),session)));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160420
Project: 160420
Buggy source:
@Override public void updateSerializer(SSerializerPluginConfiguration serializer) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    SerializerPluginConfiguration convert=getBimServer().getSConverter().convertFromSObject(serializer,session);
    session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateSerializer(SSerializerPluginConfiguration serializer) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    SerializerPluginConfiguration convert=session.get(serializer.getOid(),OldQuery.getDefault());
    getBimServer().getSConverter().convertFromSObject(serializer,convert,session);
    session.executeAndCommitAction(new UpdateSerializerDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160421
Project: 160421
Buggy source:
@Override public void updateRenderEngine(SRenderEnginePluginConfiguration renderEngine) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    RenderEnginePluginConfiguration convert=getBimServer().getSConverter().convertFromSObject(renderEngine,session);
    session.executeAndCommitAction(new UpdateRenderEngineDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
@Override public void updateRenderEngine(SRenderEnginePluginConfiguration renderEngine) throws ServerException, UserException {
  requireRealUserAuthentication();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    RenderEnginePluginConfiguration convert=session.get(renderEngine.getOid(),OldQuery.getDefault());
    getBimServer().getSConverter().convertFromSObject(renderEngine,convert,session);
    session.executeAndCommitAction(new UpdateRenderEngineDatabaseAction(session,getInternalAccessMethod(),convert));
  }
 catch (  Exception e) {
    handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160422
Project: 160422
Buggy source:
/** 
 * @param address
 * @return
 */
public static final BimServerClientInterface setupJson(String address){
  try {
    Path home=Paths.get("String_Node_Str");
    if (!Files.isDirectory(home)) {
      Files.createDirectory(home);
    }
    Path tmp=home.resolve("String_Node_Str");
    MavenPluginRepository mavenPluginRepository=new MavenPluginRepository(home.resolve("String_Node_Str"));
    PluginManager pluginManager=new PluginManager(tmp,home.resolve("String_Node_Str"),mavenPluginRepository,System.getProperty("String_Node_Str"),null,null,null);
    pluginManager.loadAllPluginsFromEclipseWorkspace(Paths.get("String_Node_Str"),true);
    MetaDataManager metaDataManager=new MetaDataManager(tmp);
    pluginManager.setMetaDataManager(metaDataManager);
    metaDataManager.init();
    pluginManager.initAllLoadedPlugins();
    BimServerClientFactory factory=new JsonBimServerClientFactory(metaDataManager,address);
    return factory.create(new UsernamePasswordAuthenticationInfo("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 (  ChannelConnectionException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param address
 * @return
 */
public static final BimServerClientInterface setupJson(String address){
  try {
    Path home=Paths.get("String_Node_Str");
    if (!Files.isDirectory(home)) {
      Files.createDirectory(home);
    }
    Path tmp=home.resolve("String_Node_Str");
    if (!Files.isDirectory(tmp)) {
      Files.createDirectory(tmp);
    }
    MavenPluginRepository mavenPluginRepository=new MavenPluginRepository(home.resolve("String_Node_Str"));
    PluginManager pluginManager=new PluginManager(tmp,home.resolve("String_Node_Str"),mavenPluginRepository,System.getProperty("String_Node_Str"),null,null,null);
    pluginManager.loadAllPluginsFromEclipseWorkspace(Paths.get("String_Node_Str"),true);
    MetaDataManager metaDataManager=new MetaDataManager(tmp);
    pluginManager.setMetaDataManager(metaDataManager);
    metaDataManager.init();
    pluginManager.initAllLoadedPlugins();
    BimServerClientFactory factory=new JsonBimServerClientFactory(metaDataManager,address);
    return factory.create(new UsernamePasswordAuthenticationInfo("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 (  ChannelConnectionException e) {
    LOGGER.error("String_Node_Str",e);
  }
catch (  IOException e) {
    LOGGER.error("String_Node_Str",e);
  }
  return null;
}
Program: 160425
Project: 160425
Buggy source:
private void setTransformationMatrix(VirtualObject geometryInfo,double[] transformationMatrix) throws BimserverDatabaseException {
  ByteBuffer byteBuffer=ByteBuffer.allocate(16 * 4);
  byteBuffer.order(ByteOrder.nativeOrder());
  DoubleBuffer asDoubleBuffer=byteBuffer.asDoubleBuffer();
  for (  double f : transformationMatrix) {
    asDoubleBuffer.put(f);
  }
  geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_Transformation(),byteBuffer.array());
}

Fixed version (ground truth):
private void setTransformationMatrix(VirtualObject geometryInfo,double[] transformationMatrix) throws BimserverDatabaseException {
  ByteBuffer byteBuffer=ByteBuffer.allocate(16 * 8);
  byteBuffer.order(ByteOrder.nativeOrder());
  DoubleBuffer asDoubleBuffer=byteBuffer.asDoubleBuffer();
  for (  double d : transformationMatrix) {
    asDoubleBuffer.put(d);
  }
  geometryInfo.setAttribute(GeometryPackage.eINSTANCE.getGeometryInfo_Transformation(),byteBuffer.array());
}
Program: 160426
Project: 160426
Buggy source:
public Short getCidOfEClass(EClass eClass){
  return classifiers.getA(eClass);
}

Fixed version (ground truth):
public Short getCidOfEClass(EClass eClass){
  return eClassToCid.get(eClass);
}
Program: 160427
Project: 160427
Buggy source:
public void initCounters(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
  for (  EClass eClass : classifiers.keyBSet()) {
    RecordIterator iterator=keyValueStore.getRecordIterator(eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName(),databaseSession);
    try {
      Record record=iterator.last();
      initCounter(eClass);
      if (record != null) {
        ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
        int pid=buffer.getInt();
        long oid=buffer.getLong();
        if (oid > oidCounters.get(eClass).get()) {
          oidCounters.put(eClass,new AtomicLong(oid));
        }
        if (pid > pidCounter.get()) {
          pidCounter.set(pid);
        }
      }
    }
  finally {
      iterator.close();
    }
  }
}

Fixed version (ground truth):
public void initCounters(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
  for (  EClass eClass : eClassToCid.keySet()) {
    RecordIterator iterator=keyValueStore.getRecordIterator(eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName(),databaseSession);
    try {
      Record record=iterator.last();
      initCounter(eClass);
      if (record != null) {
        ByteBuffer buffer=ByteBuffer.wrap(record.getKey());
        int pid=buffer.getInt();
        long oid=buffer.getLong();
        if (oid > oidCounters.get(eClass).get()) {
          oidCounters.put(eClass,new AtomicLong(oid));
        }
        if (pid > pidCounter.get()) {
          pidCounter.set(pid);
        }
      }
    }
  finally {
      iterator.close();
    }
  }
}
Program: 160428
Project: 160428
Buggy source:
public Database(BimServer bimServer,Set<? extends EPackage> emfPackages,KeyValueStore keyValueStore,MetaDataManager metaDataManager) throws DatabaseInitException {
  this.bimServer=bimServer;
  this.keyValueStore=keyValueStore;
  this.metaDataManager=metaDataManager;
  this.emfPackages.put(StorePackage.eINSTANCE.getName(),StorePackage.eINSTANCE);
  this.emfPackages.put(LogPackage.eINSTANCE.getName(),LogPackage.eINSTANCE);
  this.emfPackages.put(GeometryPackage.eINSTANCE.getName(),GeometryPackage.eINSTANCE);
  for (  EPackage ePackage : emfPackages) {
    this.emfPackages.put(ePackage.getName(),ePackage);
  }
  this.registry=new Registry(keyValueStore);
}

Fixed version (ground truth):
public Database(BimServer bimServer,Set<? extends EPackage> emfPackages,KeyValueStore keyValueStore,MetaDataManager metaDataManager) throws DatabaseInitException {
  this.cidToEclass=new EClass[10000];
  this.bimServer=bimServer;
  this.keyValueStore=keyValueStore;
  this.metaDataManager=metaDataManager;
  this.emfPackages.put(StorePackage.eINSTANCE.getName(),StorePackage.eINSTANCE);
  this.emfPackages.put(LogPackage.eINSTANCE.getName(),LogPackage.eINSTANCE);
  this.emfPackages.put(GeometryPackage.eINSTANCE.getName(),GeometryPackage.eINSTANCE);
  for (  EPackage ePackage : emfPackages) {
    this.emfPackages.put(ePackage.getName(),ePackage);
  }
  this.registry=new Registry(keyValueStore);
}
Program: 160429
Project: 160429
Buggy source:
public Set<EClass> getClasses(){
  return classifiers.keyBSet();
}

Fixed version (ground truth):
public Set<EClass> getClasses(){
  return eClassToCid.keySet();
}
Program: 160432
Project: 160432
Buggy source:
public EClass getEClassForCid(short cid){
  return classifiers.getB(cid);
}

Fixed version (ground truth):
public EClass getEClassForCid(short cid){
  return cidToEclass[cid];
}
Program: 160435
Project: 160435
Buggy source:
public Runner(EClass eClass,RenderEnginePlugin renderEnginePlugin,DatabaseSession databaseSession,RenderEngineSettings renderEngineSettings,ObjectProvider objectProvider,StreamingSerializerPlugin ifcSerializerPlugin,Map<IdEObject,IdEObject> bigMap,RenderEngineFilter renderEngineFilter,GenerateGeometryResult generateGeometryResult,QueryContext queryContext){
  this.eClass=eClass;
  this.renderEnginePlugin=renderEnginePlugin;
  this.renderEngineSettings=renderEngineSettings;
  this.objectProvider=objectProvider;
  this.ifcSerializerPlugin=ifcSerializerPlugin;
  this.bigMap=bigMap;
  this.renderEngineFilter=renderEngineFilter;
  this.generateGeometryResult=generateGeometryResult;
  this.queryContext=queryContext;
}

Fixed version (ground truth):
public Runner(EClass eClass,RenderEnginePlugin renderEnginePlugin,DatabaseSession databaseSession,RenderEngineSettings renderEngineSettings,ObjectProvider objectProvider,StreamingSerializerPlugin ifcSerializerPlugin,RenderEngineFilter renderEngineFilter,GenerateGeometryResult generateGeometryResult,QueryContext queryContext){
  this.eClass=eClass;
  this.renderEnginePlugin=renderEnginePlugin;
  this.renderEngineSettings=renderEngineSettings;
  this.objectProvider=objectProvider;
  this.ifcSerializerPlugin=ifcSerializerPlugin;
  this.renderEngineFilter=renderEngineFilter;
  this.generateGeometryResult=generateGeometryResult;
  this.queryContext=queryContext;
}
Program: 160438
Project: 160438
Buggy source:
@Override public void error(Exception error){
  LOGGER.error("String_Node_Str",error);
  errors.add(error.getMessage());
  stop=new GregorianCalendar();
  changeActionState(ActionState.AS_ERROR,error == null ? "String_Node_Str" : error.getMessage(),0);
}

Fixed version (ground truth):
@Override public void error(Exception error){
  if (error == null) {
    LOGGER.error("String_Node_Str");
    changeActionState(ActionState.AS_ERROR,"String_Node_Str",0);
  }
 else {
    LOGGER.error("String_Node_Str",error);
    errors.add(error.getMessage());
    stop=new GregorianCalendar();
    changeActionState(ActionState.AS_ERROR,error == null ? "String_Node_Str" : error.getMessage(),0);
  }
}
Program: 160440
Project: 160440
Buggy source:
@Override public void unregisterInternalNewRevisionHandler(ServiceDescriptor serviceDescriptor){
  internalServices.remove(serviceDescriptor.getIdentifier());
  internalRemoteServiceInterfaces.remove(serviceDescriptor.getIdentifier());
}

Fixed version (ground truth):
@Override public void unregisterInternalNewRevisionHandler(long uoid,ServiceDescriptor serviceDescriptor){
  Map<String,ServiceDescriptor> map=uoidToInternalServices.get(uoid);
  if (map != null) {
    map.remove(serviceDescriptor.getIdentifier());
  }
  internalRemoteServiceInterfaces.remove(serviceDescriptor.getIdentifier());
}
Program: 160441
Project: 160441
Buggy source:
public ServiceDescriptor getInternalService(Long uoid,String serviceIdentifier){
  for (  Entry<Long,Map<String,ServiceDescriptor>> entry : internalServices.entrySet()) {
    if (entry.getValue().containsKey(serviceIdentifier)) {
      return entry.getValue().get(serviceIdentifier);
    }
  }
  return null;
}

Fixed version (ground truth):
public ServiceDescriptor getInternalService(Long uoid,String serviceIdentifier){
  for (  Entry<Long,Map<String,ServiceDescriptor>> entry : uoidToInternalServices.entrySet()) {
    if (entry.getValue().containsKey(serviceIdentifier)) {
      return entry.getValue().get(serviceIdentifier);
    }
  }
  return null;
}
Program: 160442
Project: 160442
Buggy source:
public Map<String,ServiceDescriptor> getInternalServices(long uoid){
  return internalServices.get(uoid);
}

Fixed version (ground truth):
public Map<String,ServiceDescriptor> getInternalServices(long uoid){
  return uoidToInternalServices.get(uoid);
}
Program: 160443
Project: 160443
Buggy source:
@Override public void register(long uoid,ServiceDescriptor serviceDescriptor,Bimsie1RemoteServiceInterface remoteServiceInterface){
  serviceDescriptor.setUrl(url);
  Map<String,ServiceDescriptor> map=internalServices.get(uoid);
  if (map == null) {
    map=new HashMap<String,ServiceDescriptor>();
    internalServices.put(uoid,map);
  }
  map.put(serviceDescriptor.getIdentifier(),serviceDescriptor);
  internalRemoteServiceInterfaces.put(serviceDescriptor.getIdentifier(),remoteServiceInterface);
}

Fixed version (ground truth):
@Override public void register(long uoid,ServiceDescriptor serviceDescriptor,Bimsie1RemoteServiceInterface remoteServiceInterface){
  serviceDescriptor.setUrl(url);
  Map<String,ServiceDescriptor> map=uoidToInternalServices.get(uoid);
  if (map == null) {
    map=new HashMap<String,ServiceDescriptor>();
    uoidToInternalServices.put(uoid,map);
  }
  map.put(serviceDescriptor.getIdentifier(),serviceDescriptor);
  internalRemoteServiceInterfaces.put(serviceDescriptor.getIdentifier(),remoteServiceInterface);
}
Program: 160444
Project: 160444
Buggy source:
protected synchronized void updateProgress(final LongActionState state){
  try {
    boolean sendMessage=lastSent == -1 || (System.nanoTime() - lastSent > RATE_LIMIT_NANO_SECONDS && state.getProgress() != lastProgress.getProgress());
    sendMessage|=state.getProgress() == 100;
    sendMessage|=state.getState() == ActionState.FINISHED;
    sendMessage|=state.getState() == ActionState.AS_ERROR;
    sendMessage|=lastProgress != null && lastProgress.getStage() != state.getStage();
    sendMessage|=lastProgress != null && !lastProgress.getTitle().equals(state.getTitle());
    if (sendMessage) {
      try {
        map(new Mapper(){
          @Override public void map(          EndPoint endPoint) throws UserException, ServerException, BimserverDatabaseException {
            try {
              endPoint.getNotificationInterface().progress(key.getId(),new SConverter().convertToSObject(state));
            }
 catch (            Exception e) {
              LOGGER.error("String_Node_Str",e);
            }
          }
        }
);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
      lastProgress=state;
      lastSent=System.nanoTime();
    }
 else {
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected synchronized void updateProgress(final LongActionState state){
  try {
    boolean sendMessage=lastSent == -1L || (System.nanoTime() - lastSent > RATE_LIMIT_NANO_SECONDS && state.getProgress().intValue() != lastProgress.getProgress().intValue());
    sendMessage|=state.getProgress() == 100;
    sendMessage|=state.getState() == ActionState.FINISHED;
    sendMessage|=state.getState() == ActionState.AS_ERROR;
    sendMessage|=lastProgress != null && lastProgress.getStage() != state.getStage();
    sendMessage|=lastProgress != null && !lastProgress.getTitle().equals(state.getTitle());
    if (sendMessage) {
      try {
        map(new Mapper(){
          @Override public void map(          EndPoint endPoint) throws UserException, ServerException, BimserverDatabaseException {
            try {
              endPoint.getNotificationInterface().progress(key.getId(),new SConverter().convertToSObject(state));
            }
 catch (            Exception e) {
              LOGGER.error("String_Node_Str",e);
            }
          }
        }
);
      }
 catch (      Exception e) {
        LOGGER.error("String_Node_Str",e);
      }
      lastProgress=state;
      lastSent=System.nanoTime();
    }
 else {
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 160446
Project: 160446
Buggy source:
public VersionChecker(ResourceFetcher resourceFetcher){
  try {
    Path pom=resourceFetcher.getFile("String_Node_Str");
    MavenXpp3Reader mavenreader=new MavenXpp3Reader();
    if (Files.exists(pom)) {
      String version=null;
      if (pom != null) {
        Model model=mavenreader.read(new FileReader(pom.toFile()));
        version=model.getVersion();
      }
      if (version == null) {
        Path parentPom=resourceFetcher.getFile("String_Node_Str");
        if (parentPom != null) {
          Model parentModel=mavenreader.read(new FileReader(parentPom.toFile()));
          version=parentModel.getVersion();
        }
 else {
          LOGGER.error("String_Node_Str");
        }
      }
      DefaultArtifactVersion defaultArtifactVersion=new DefaultArtifactVersion(version);
      localVersion=new SVersion();
      localVersion.setMajor(defaultArtifactVersion.getMajorVersion());
      localVersion.setMinor(defaultArtifactVersion.getMinorVersion());
      localVersion.setRevision(defaultArtifactVersion.getIncrementalVersion());
      localVersion.setFullString(defaultArtifactVersion.toString());
    }
 else {
      LOGGER.warn("String_Node_Str");
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  XmlPullParserException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public VersionChecker(ResourceFetcher resourceFetcher) throws VersionCheckException {
  try {
    Path pom=resourceFetcher.getFile("String_Node_Str");
    if (pom == null) {
      throw new VersionCheckException("String_Node_Str");
    }
    MavenXpp3Reader mavenreader=new MavenXpp3Reader();
    if (Files.exists(pom)) {
      String version=null;
      if (pom != null) {
        Model model=mavenreader.read(new FileReader(pom.toFile()));
        version=model.getVersion();
      }
      if (version == null) {
        Path parentPom=resourceFetcher.getFile("String_Node_Str");
        if (parentPom != null) {
          Model parentModel=mavenreader.read(new FileReader(parentPom.toFile()));
          version=parentModel.getVersion();
        }
 else {
          LOGGER.error("String_Node_Str");
        }
      }
      DefaultArtifactVersion defaultArtifactVersion=new DefaultArtifactVersion(version);
      localVersion=new SVersion();
      localVersion.setMajor(defaultArtifactVersion.getMajorVersion());
      localVersion.setMinor(defaultArtifactVersion.getMinorVersion());
      localVersion.setRevision(defaultArtifactVersion.getIncrementalVersion());
      localVersion.setFullString(defaultArtifactVersion.toString());
    }
 else {
      LOGGER.warn("String_Node_Str");
    }
  }
 catch (  Exception e) {
    throw new VersionCheckException(e);
  }
}
Program: 160449
Project: 160449
Buggy source:
void unregisterNewRevisionHandler(ServiceDescriptor serviceDescriptor);

Fixed version (ground truth):
void unregisterNewRevisionHandler(long uoid,ServiceDescriptor serviceDescriptor);
Program: 160450
Project: 160450
Buggy source:
protected void unregisterNewRevisionHandler(ServiceDescriptor serviceDescriptor){
  pluginManager.unregisterNewRevisionHandler(serviceDescriptor);
}

Fixed version (ground truth):
protected void unregisterNewRevisionHandler(long uoid,ServiceDescriptor serviceDescriptor){
  pluginManager.unregisterNewRevisionHandler(uoid,serviceDescriptor);
}
Program: 160451
Project: 160451
Buggy source:
void unregisterInternalNewRevisionHandler(ServiceDescriptor serviceDescriptor);

Fixed version (ground truth):
void unregisterInternalNewRevisionHandler(long uoid,ServiceDescriptor serviceDescriptor);
Program: 160452
Project: 160452
Buggy source:
protected void processPossibleIncludes(EClass previousType,CanInclude canInclude) throws QueryException, BimserverDatabaseException {
  if (currentObject != null) {
    if (currentObject.eClass().getName().equals("String_Node_Str"))     if (canInclude.hasIncludes()) {
      for (      Include include : canInclude.getIncludes()) {
        processPossibleInclude(canInclude,include);
      }
    }
 else     if (canInclude.isIncludeAllFields()) {
      for (      EReference eReference : currentObject.eClass().getEAllReferences()) {
        Include include=new Include(reusable.getPackageMetaData());
        include.addType(currentObject.eClass(),false);
        include.addField(eReference.getName());
        processPossibleInclude(canInclude,include);
      }
    }
    if (canInclude instanceof Include) {
      processPossibleInclude(null,(Include)canInclude);
    }
  }
}

Fixed version (ground truth):
protected void processPossibleIncludes(EClass previousType,CanInclude canInclude) throws QueryException, BimserverDatabaseException {
  if (currentObject != null) {
    if (canInclude.hasIncludes()) {
      for (      Include include : canInclude.getIncludes()) {
        processPossibleInclude(canInclude,include);
      }
    }
 else     if (canInclude.isIncludeAllFields()) {
      for (      EReference eReference : currentObject.eClass().getEAllReferences()) {
        Include include=new Include(reusable.getPackageMetaData());
        include.addType(currentObject.eClass(),false);
        include.addField(eReference.getName());
        processPossibleInclude(canInclude,include);
      }
    }
    if (canInclude instanceof Include) {
      processPossibleInclude(null,(Include)canInclude);
    }
  }
}
Program: 160453
Project: 160453
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Reference reAttach(IdEObject mainObject){
  AbstractEList list=(AbstractEList)getIdEObject().eGet(geteReference());
  int index=list.indexOf(getReferredObject());
  list.set(index,mainObject);
  while (list.contains(getReferredObject())) {
    list.remove(getReferredObject());
  }
  return new MultiReference(getIdEObject(),mainObject,geteReference());
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public Reference reAttach(IdEObject mainObject){
  AbstractEList list=(AbstractEList)getIdEObject().eGet(geteReference());
  int index=list.indexOf(getReferredObject());
  if (index != -1) {
    if (!list.contains(mainObject)) {
      list.set(index,mainObject);
    }
  }
  while (list.contains(getReferredObject())) {
    list.remove(getReferredObject());
  }
  return new MultiReference(getIdEObject(),mainObject,geteReference());
}
Program: 160454
Project: 160454
Buggy source:
private void removeReplaceLinks(IdEObject mainObject,IdEObject objectToRemove){
  if (mainObject.eClass() != objectToRemove.eClass()) {
    throw new RuntimeException("String_Node_Str");
  }
  Set<Reference> referencesTo=referenceCounter.getReferencesTo(objectToRemove);
  if (referencesTo != null) {
    Iterator<Reference> referenceIterator=referencesTo.iterator();
    Set<Reference> newReferences=new HashSet<Reference>();
    while (referenceIterator.hasNext()) {
      Reference reference=referenceIterator.next();
      newReferences.add(reference.reAttach(mainObject));
      referenceIterator.remove();
    }
    for (    Reference reference : newReferences) {
      referenceCounter.addReference(reference);
    }
  }
  referenceCounter.remove(objectToRemove);
  model.remove(objectToRemove);
}

Fixed version (ground truth):
private void removeReplaceLinks(IdEObject mainObject,IdEObject objectToRemove){
  LOGGER.info("String_Node_Str" + mainObject.eClass().getName());
  if (mainObject.eClass() != objectToRemove.eClass()) {
    throw new RuntimeException("String_Node_Str");
  }
  Set<Reference> referencesTo=referenceCounter.getReferencesTo(objectToRemove);
  if (referencesTo != null) {
    Iterator<Reference> referenceIterator=referencesTo.iterator();
    Set<Reference> newReferences=new HashSet<Reference>();
    while (referenceIterator.hasNext()) {
      Reference reference=referenceIterator.next();
      newReferences.add(reference.reAttach(mainObject));
      referenceIterator.remove();
    }
    for (    Reference reference : newReferences) {
      referenceCounter.addReference(reference);
    }
  }
  referenceCounter.remove(objectToRemove);
  model.remove(objectToRemove);
}
Program: 160455
Project: 160455
Buggy source:
public LongCheckinAction(BimServer bimServer,String username,String userUsername,Authorization authorization,CheckinDatabaseAction checkinDatabaseAction){
  super(bimServer,username,userUsername,authorization);
  this.checkinDatabaseAction=checkinDatabaseAction;
  this.fileName=checkinDatabaseAction.getFileName();
  setProgressTopic(bimServer.getNotificationsManager().createProgressOnProjectTopic(authorization.getUoid(),checkinDatabaseAction.getPoid(),SProgressTopicType.UPLOAD,"String_Node_Str"));
  checkinDatabaseAction.addProgressListener(this);
}

Fixed version (ground truth):
public LongCheckinAction(Long topicId,BimServer bimServer,String username,String userUsername,Authorization authorization,CheckinDatabaseAction checkinDatabaseAction){
  super(bimServer,username,userUsername,authorization);
  this.checkinDatabaseAction=checkinDatabaseAction;
  this.fileName=checkinDatabaseAction.getFileName();
  if (topicId == -1) {
    setProgressTopic(bimServer.getNotificationsManager().createProgressOnProjectTopic(authorization.getUoid(),checkinDatabaseAction.getPoid(),SProgressTopicType.UPLOAD,"String_Node_Str"));
  }
 else {
    setProgressTopic(bimServer.getNotificationsManager().getProgressTopic(topicId));
  }
  checkinDatabaseAction.addProgressListener(this);
}
Program: 160456
Project: 160456
Buggy source:
public void onClose(){
  bimServer.getEndPointManager().unregister(this);
}

Fixed version (ground truth):
public void onClose(){
  LOGGER.info("String_Node_Str" + this.getEndPointId());
  bimServer.getEndPointManager().unregister(this);
}
Program: 160461
Project: 160461
Buggy source:
public FollowReferenceStackFrame(QueryObjectProvider queryObjectProvider,Long oid,PackageMetaData packageMetaData,Reusable reusable,QueryInterface query,EClass previousType,QueryPart queryPart,Include include){
  super(packageMetaData,reusable,queryObjectProvider,query,queryPart);
  this.oid=oid;
  this.query=query;
  this.previousType=previousType;
  this.queryPart=queryPart;
  this.include=include;
}

Fixed version (ground truth):
public FollowReferenceStackFrame(QueryObjectProvider queryObjectProvider,Long oid,PackageMetaData packageMetaData,Reusable reusable,QueryInterface query,EClass previousType,QueryPart queryPart,Include include){
  super(packageMetaData,reusable,queryObjectProvider,query,queryPart);
  this.oid=oid;
  this.query=query;
  this.previousType=previousType;
  this.include=include;
}
Program: 160462
Project: 160462
Buggy source:
public QueryException(String message){
  super(message);
}

Fixed version (ground truth):
public QueryException(Exception e){
  super(e);
}
Program: 160463
Project: 160463
Buggy source:
private void processReference(long refOid){
  if (outputFilterCids == null || outputFilterCids.contains((short)refOid)) {
    if (!getQueryObjectProvider().hasRead(refOid)) {
      getQueryObjectProvider().push(new FollowReferenceStackFrame(getQueryObjectProvider(),refOid,getPackageMetaData(),getReusable(),getQuery(),currentObject.eClass(),getQueryPart(),include));
    }
  }
}

Fixed version (ground truth):
private void processReference(long refOid){
  if (outputFilterCids == null || outputFilterCids.contains((short)refOid)) {
    getQueryObjectProvider().push(new FollowReferenceStackFrame(getQueryObjectProvider(),refOid,getPackageMetaData(),getReusable(),getQuery(),currentObject.eClass(),getQueryPart(),include));
  }
}
Program: 160464
Project: 160464
Buggy source:
private void initHomeDir() throws IOException {
  String[] filesToCheck=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  if (!Files.exists(config.getHomeDir())) {
    Files.createDirectories(config.getHomeDir());
  }
  if (Files.exists(config.getHomeDir()) && Files.isDirectory(config.getHomeDir())) {
    for (    String fileToCheck : filesToCheck) {
      Path sourceFile=config.getResourceFetcher().getFile(fileToCheck);
      if (sourceFile != null && Files.exists(sourceFile)) {
        Path destFile=config.getHomeDir().resolve(fileToCheck);
        if (!Files.exists(destFile)) {
          if (Files.isDirectory(sourceFile)) {
            Files.createDirectories(destFile);
            for (            Path f : PathUtils.list(sourceFile)) {
              if (Files.isDirectory(f)) {
                Path destDir2=destFile.resolve(f.getFileName().toString());
                for (                Path x : PathUtils.list(f)) {
                  FileUtils.copyFile(x.toFile(),destDir2.resolve(x.getFileName().toString()).toFile());
                }
              }
 else               if (Files.isDirectory(f)) {
                FileUtils.copyFile(f.toFile(),destFile.resolve(f.getFileName().toString()).toFile());
              }
            }
          }
 else {
            FileUtils.copyFile(sourceFile.toFile(),destFile.toFile());
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void initHomeDir() throws IOException {
  String[] filesToCheck=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  if (!Files.exists(config.getHomeDir())) {
    Files.createDirectories(config.getHomeDir());
  }
  if (Files.exists(config.getHomeDir()) && Files.isDirectory(config.getHomeDir())) {
    for (    String fileToCheck : filesToCheck) {
      Path sourceFile=config.getResourceFetcher().getFile(fileToCheck);
      if (sourceFile != null && Files.exists(sourceFile)) {
        Path destFile=config.getHomeDir().resolve(fileToCheck);
        if (!Files.exists(destFile)) {
          if (Files.isDirectory(sourceFile)) {
            Files.createDirectories(destFile);
            for (            Path f : PathUtils.list(sourceFile)) {
              if (Files.isDirectory(f)) {
                Path destDir2=destFile.resolve(f.getFileName().toString());
                for (                Path x : PathUtils.list(f)) {
                  FileUtils.copyFile(x.toFile(),destDir2.resolve(x.getFileName().toString()).toFile());
                }
              }
 else {
                FileUtils.copyFile(f.toFile(),destFile.resolve(f.getFileName().toString()).toFile());
              }
            }
          }
 else {
            FileUtils.copyFile(sourceFile.toFile(),destFile.toFile());
          }
        }
      }
    }
  }
}
Program: 160466
Project: 160466
Buggy source:
public DiskCacheOutputStream(DiskCacheManager diskCacheManager,Path file,DownloadParameters downloadParameters) throws FileNotFoundException {
  super(file.resolve("String_Node_Str"));
  this.tempFile=file.resolve("String_Node_Str");
  this.diskCacheManager=diskCacheManager;
  this.file=file;
  this.downloadParameters=downloadParameters;
}

Fixed version (ground truth):
public DiskCacheOutputStream(DiskCacheManager diskCacheManager,Path file,DownloadParameters downloadParameters) throws FileNotFoundException {
  super(file.getParent().resolve(file.getFileName().toString() + "String_Node_Str"));
  this.tempFile=file.getParent().resolve(file.getFileName().toString() + "String_Node_Str");
  this.diskCacheManager=diskCacheManager;
  this.file=file;
  this.downloadParameters=downloadParameters;
}
Program: 160468
Project: 160468
Buggy source:
@Override public Revision execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  Revision revision=getRevisionByRoid(roid);
  if (revision == null) {
    throw new UserException("String_Node_Str");
  }
  Project project=revision.getProject();
  User user=getUserByUoid(authorization.getUoid());
  if (authorization.hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
    return revision;
  }
  throw new UserException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Revision execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
  Revision revision=getRevisionByRoid(roid);
  if (revision == null) {
    throw new UserException("String_Node_Str");
  }
  Project project=revision.getProject();
  User user=getUserByUoid(authorization.getUoid());
  if (authorization.hasRightsOnProjectOrSuperProjectsOrSubProjects(user,project)) {
    return revision;
  }
  throw new UserException("String_Node_Str" + project.getName() + "String_Node_Str");
}
Program: 160470
Project: 160470
Buggy source:
@Override public void registerProgressHandler(Long topicId,Long endPointId) throws UserException {
  EndPoint endPoint=getEndPoint(endPointId);
  if (endPoint == null) {
    throw new UserException("String_Node_Str" + endPointId + "String_Node_Str");
  }
  ProgressTopic progressTopic=getBimServer().getNotificationsManager().getProgressTopic(topicId);
  if (progressTopic == null) {
    throw new UserException("String_Node_Str" + topicId + "String_Node_Str");
  }
  try {
    progressTopic.register(endPoint);
    LongActionState lastProgress=progressTopic.getLastProgress();
    if (lastProgress != null && lastProgress.getState() == ActionState.FINISHED) {
      LoggerFactory.getLogger(Bimsie1NotificationRegistryInterface.class).debug("String_Node_Str" + progressTopic.getKey().getId());
    }
 else {
      LoggerFactory.getLogger(Bimsie1NotificationRegistryInterface.class).debug("String_Node_Str" + progressTopic.getKey().getId());
    }
  }
 catch (  TopicRegisterException e) {
    throw new UserException(e);
  }
}

Fixed version (ground truth):
@Override public void registerProgressHandler(Long topicId,Long endPointId) throws UserException {
  if (endPointId == null) {
    throw new UserException("String_Node_Str");
  }
  EndPoint endPoint=getEndPoint(endPointId);
  if (endPoint == null) {
    throw new UserException("String_Node_Str" + endPointId + "String_Node_Str");
  }
  ProgressTopic progressTopic=getBimServer().getNotificationsManager().getProgressTopic(topicId);
  if (progressTopic == null) {
    throw new UserException("String_Node_Str" + topicId + "String_Node_Str");
  }
  try {
    progressTopic.register(endPoint);
    LongActionState lastProgress=progressTopic.getLastProgress();
    if (lastProgress != null && lastProgress.getState() == ActionState.FINISHED) {
      LoggerFactory.getLogger(Bimsie1NotificationRegistryInterface.class).debug("String_Node_Str" + progressTopic.getKey().getId());
    }
 else {
      LoggerFactory.getLogger(Bimsie1NotificationRegistryInterface.class).debug("String_Node_Str" + progressTopic.getKey().getId());
    }
  }
 catch (  TopicRegisterException e) {
    throw new UserException(e);
  }
}
Program: 160471
Project: 160471
Buggy source:
@Override public void registerChangeProgressOnProject(Long endPointId,Long poid) throws ServerException, UserException {
  ChangeProgressTopicOnProjectTopic changeProgressOnProjectTopic=getBimServer().getNotificationsManager().getChangeProgressOnProjectTopic(poid);
  EndPoint endPoint=getEndPoint(endPointId);
  try {
    changeProgressOnProjectTopic.register(endPoint);
  }
 catch (  TopicRegisterException e) {
    handleException(e);
  }
}

Fixed version (ground truth):
@Override public void registerChangeProgressOnProject(Long endPointId,Long poid) throws ServerException, UserException {
  if (endPointId == null) {
    throw new UserException("String_Node_Str");
  }
  ChangeProgressTopicOnProjectTopic changeProgressOnProjectTopic=getBimServer().getNotificationsManager().getChangeProgressOnProjectTopic(poid);
  EndPoint endPoint=getEndPoint(endPointId);
  try {
    changeProgressOnProjectTopic.register(endPoint);
  }
 catch (  TopicRegisterException e) {
    handleException(e);
  }
}
Program: 160472
Project: 160472
Buggy source:
public SExtendedDataSchema getExtendedDataSchemaByNamespace(String nameSpace) throws UserException, ServerException {
  requireAuthenticationAndRunningServer();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(new GetExtendedDataSchemaByNamespaceDatabaseAction(session,getInternalAccessMethod(),nameSpace)));
  }
 catch (  Exception e) {
    return handleException(e);
  }
 finally {
    session.close();
  }
}

Fixed version (ground truth):
public SExtendedDataSchema getExtendedDataSchemaByNamespace(String nameSpace) throws UserException, ServerException {
  if (nameSpace == null) {
    throw new UserException("String_Node_Str");
  }
  requireAuthenticationAndRunningServer();
  DatabaseSession session=getBimServer().getDatabase().createSession();
  try {
    return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(new GetExtendedDataSchemaByNamespaceDatabaseAction(session,getInternalAccessMethod(),nameSpace)));
  }
 catch (  Exception e) {
    return handleException(e);
  }
 finally {
    session.close();
  }
}
Program: 160474
Project: 160474
Buggy source:
public DatabaseSession(Database database,BimTransaction bimTransaction){
  this.database=database;
  this.bimTransaction=bimTransaction;
  this.stackTrace=Thread.currentThread().getStackTrace();
  if (DEVELOPER_DEBUG) {
    LOGGER.info("String_Node_Str");
    LOGGER.info("String_Node_Str");
  }
}

Fixed version (ground truth):
public DatabaseSession(Database database,BimTransaction bimTransaction){
  this.database=database;
  this.bimTransaction=bimTransaction;
  if (DEVELOPER_DEBUG) {
    this.stackTrace=Thread.currentThread().getStackTrace();
    LOGGER.info("String_Node_Str");
    LOGGER.info("String_Node_Str");
  }
  for (  EClass eClass : database.getClasses()) {
    startOids.put(eClass,getCounter(eClass));
  }
}
Program: 160476
Project: 160476
Buggy source:
public Long newOid(EClass eClass){
  return database.newOid(eClass);
}

Fixed version (ground truth):
public Long newOid(EClass eClass){
  long newOid=database.newOid(eClass);
  return newOid;
}
Program: 160477
Project: 160477
Buggy source:
public void send() throws MessagingException {
  Properties props=new Properties();
  ServerSettings serverSettings=bimServer.getServerSettingsCache().getServerSettings();
  props.put("String_Node_Str","String_Node_Str");
  String smtpProps=serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS ? "String_Node_Str" : "String_Node_Str";
  props.put(smtpProps,serverSettings.getSmtpPort());
  Session mailSession=Session.getDefaultInstance(props);
  Transport transport=null;
  if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTP) {
    transport=new SMTPTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    transport.connect(serverSettings.getSmtpServer(),null,null);
  }
 else   if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS) {
    transport=new SMTPSSLTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
    String username=serverSettings.getSmtpUsername();
    String password=serverSettings.getSmtpPassword();
    try {
      transport.connect(serverSettings.getSmtpServer(),username,password);
    }
 catch (    MessagingException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
  Message message=new MimeMessage(mailSession);
  message.setSubject(subject);
  message.setRecipients(to,addressTo);
  message.setContent(body,contentType);
  message.setFrom(from);
  transport.sendMessage(message,addressTo);
}

Fixed version (ground truth):
public void send() throws MessagingException {
  Properties props=new Properties();
  ServerSettings serverSettings=bimServer.getServerSettingsCache().getServerSettings();
  props.put("String_Node_Str","String_Node_Str");
  String smtpProps=serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS ? "String_Node_Str" : "String_Node_Str";
  props.put(smtpProps,serverSettings.getSmtpPort());
  Session mailSession=Session.getDefaultInstance(props);
  Transport transport=null;
  try {
    if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTP) {
      transport=new SMTPTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
      transport.connect(serverSettings.getSmtpServer(),null,null);
    }
 else     if (serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS) {
      transport=new SMTPSSLTransport(mailSession,new URLName(serverSettings.getSmtpServer()));
      String username=serverSettings.getSmtpUsername();
      String password=serverSettings.getSmtpPassword();
      try {
        transport.connect(serverSettings.getSmtpServer(),username,password);
      }
 catch (      MessagingException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
    Message message=new MimeMessage(mailSession);
    message.setSubject(subject);
    message.setRecipients(to,addressTo);
    message.setContent(body,contentType);
    message.setFrom(from);
    transport.sendMessage(message,addressTo);
  }
 catch (  MessagingException e) {
    LOGGER.error("String_Node_Str");
  }
}