auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , setupNetworksParams ) ; }

Target:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , setupNetworksParams ) ; }
Source:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.compat.RpmVersion vdsOsVersion = null ; try { vdsOsVersion = new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return vdsOsVersion ; }

Target:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return null ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > getClustersToAttach ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > clusterToAttach = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > ( ) ; for ( java.lang.Object item : getNetworkClusterList ( ) . getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( item ) ) ; if ( networkClusterModel.isAttached ( ) ) { clusterToAttach.add ( networkClusterModel ) ; } } return clusterToAttach ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > getClustersToAttach ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > clusterToAttach = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel : getNetworkClusterList ( ) . getItems ( ) ) { if ( networkClusterModel.isAttached ( ) ) { clusterToAttach.add ( networkClusterModel ) ; } } return clusterToAttach ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshotsList = org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getDbFacade ( ) . getSnapshotDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( snapshotsList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshotsList = org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getDbFacade ( ) . getSnapshotDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.GetAllVmSnapshotsByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( snapshotsList ) ; }
Source:
public static org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( ( context != null ) && ( context.isTasksMonitored ( ) ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( parentTaskStep , stepName , description ) ; } } return step ; }

Target:
public static org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( context.isTasksMonitored ( ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( parentTaskStep , stepName , description ) ; } } return step ; }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }
Source:
public void getHugePagesNoHugePagesDefined ( ) { org.ovirt.engine.core.common.utils.HugePageUtils utils = new org.ovirt.engine.core.common.utils.HugePageUtils ( ) ; org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setMemSizeMb ( 1025 ) ; org.hamcrest.MatcherAssert.assertThat ( utils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 0 ) ) ; }

Target:
public void getHugePagesNoHugePagesDefined ( ) { org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setMemSizeMb ( 1 ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 0 ) ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getQuotaDao ( ) ) . thenReturn ( quotaDAO ) ; returnedQuotas = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getAdElementId ( ) ) . thenReturn ( adElementId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; org.mockito.Mockito.when ( quotaDAO.getQuotaByAdElementId ( adElementId , storagePoolId ) ) . thenReturn ( returnedQuotas ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getQuotaDao ( ) ) . thenReturn ( quotaDAO ) ; returnedQuotas = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getAdElementId ( ) ) . thenReturn ( adElementId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; org.mockito.Mockito.when ( quotaDAO.getQuotaByAdElementId ( adElementId , storagePoolId , false ) ) . thenReturn ( returnedQuotas ) ; }
Source:
protected void executeVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.LockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }

Target:
protected void executeVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.LockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }
Source:
public void testGetCurrent ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Cdrom cdrom = resource.get ( ) ; verifyModelWithCurrentCd ( cdrom ) ; }

Target:
public void testGetCurrent ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = resource.get ( ) ; verifyModelWithCurrentCd ( cdrom ) ; }