auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' function is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > pairs = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { pairs.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , 1 ) ) ; } return pairs ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( @ javax.validation.constraints.NotNull org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' function is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > pairs = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { pairs.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , 1 ) ) ; } return pairs ; }
Source:
private boolean isSysprepUsed ( ) { return ( ( ( vm.getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) && ( windows ) ) && ( ( ( vm.getFloppyPath ( ) ) == null ) || ( "" . equals ( vm.getFloppyPath ( ) ) ) ) ; }

Target:
private boolean isSysprepUsed ( ) { return ( ( ( org.ovirt.engine.core.vdsbroker.CreateVDSCommand.getParameters ( ) . getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) && ( windows ) ) && ( ( ( vm.getFloppyPath ( ) ) == null ) || ( "" . equals ( vm.getFloppyPath ( ) ) ) ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
private boolean templateExists ( ) { if ( ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmTemplate ( ) ) == null ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ; } return true ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void securityKeysDoesNotExist ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . haveSecurityKey ( ) ; org.junit.Assert.assertThat ( validator.securityKeysExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_TRY_CREATE_SECURE_CERTIFICATE_NOT_FOUND ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void verifyUsernamePassword ( ) { final com.woorea.openstack.keystone.model.authentication.UsernamePassword.PasswordCredentials passwordCredentials = usernamePasswordCaptor.getValue ( ) . getPasswordCredentials ( ) ; org.junit.Assert.assertThat ( passwordCredentials , org.hamcrest.Matchers.notNullValue ( ) ) ; org.junit.Assert.assertThat ( passwordCredentials.getPassword ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.PASSWORD ) ) ; org.junit.Assert.assertThat ( passwordCredentials.getUsername ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.USERNAME ) ) ; }

Target:
private void verifyUsernamePassword ( ) { final com.woorea.openstack.keystone.model.authentication.UsernamePassword.PasswordCredentials passwordCredentials = usernamePasswordCaptor.getValue ( ) . getPasswordCredentials ( ) ; org.hamcrest.MatcherAssert.assertThat ( passwordCredentials , org.hamcrest.Matchers.notNullValue ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( passwordCredentials.getPassword ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.PASSWORD ) ) ; org.hamcrest.MatcherAssert.assertThat ( passwordCredentials.getUsername ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProviderTest.USERNAME ) ) ; }
Source:
public void validateVmMemoryCantStartOnVdsVmTooBig ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , false ) ; }

Target:
public void validateVmMemoryCanStartOnVdsVmTooBigButLowOverhead ( ) { vm.setMinAllocatedMem ( 8865 ) ; vm.setVmMemSizeMb ( 8865 ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
public void testValidUpdateOfStatusRestrictedEditableFieldOnDownHost ( ) { int srcSshPort = 22 ; int destSshPort = 23 ; org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setSshPort ( srcSshPort ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setSshPort ( destSshPort ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.Assert.assertTrue ( "Update should be valid for different SSH ports in Down status" , updateIsValid ) ; }

Target:
public void testValidUpdateOfStatusRestrictedEditableFieldOnDownHost ( ) { int srcSshPort = 22 ; int destSshPort = 23 ; org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setSshPort ( srcSshPort ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setSshPort ( destSshPort ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.jupiter.api.Assertions.assertTrue ( updateIsValid , "Update should be valid for different SSH ports in Down status" ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , getEffectiveCompatibilityVersion ( ) ) ) ; }
Source:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected boolean validateSpaceRequirements ( ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > sdImageEntry : storageToDisksMap.entrySet ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain destStorageDomain = destStorages.get ( sdImageEntry.getKey ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = sdImageEntry.getValue ( ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( destStorageDomain ) ; if ( ( ! ( validateDomainsThreshold ( storageDomainValidator ) ) ) || ( ! ( validateFreeSpace ( storageDomainValidator , disksList ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSpaceRequirements ( ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > sdImageEntry : storageToDisksMap.entrySet ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain destStorageDomain = destStorages.get ( sdImageEntry.getKey ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = sdImageEntry.getValue ( ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( destStorageDomain ) ; if ( ( ! ( validateDomainsThreshold ( storageDomainValidator ) ) ) || ( ! ( validateFreeSpace ( storageDomainValidator , disksList ) ) ) ) { return false ; } } return true ; }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
private void addToReturnValueTaskPlaceHolderIdList ( org.ovirt.engine.core.compat.Guid taskId ) { if ( ! ( getReturnValue ( ) . getTaskPlaceHolderIdList ( ) . contains ( taskId ) ) ) { getReturnValue ( ) . getTaskPlaceHolderIdList ( ) . add ( taskId ) ; } }
Source:
private static void getVirtualStorageCount ( org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary storageSummary , javax.sql.DataSource dwhDataSource ) throws java.sql.SQLException , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.dao.VmDwhDAO dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.VmDwhDAO ( dwhDataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.models.VmStorage storageCount = dao.getVirtualStorageCount ( ) ; storageSummary.setVirtualUsed ( storageCount.getUsed ( ) ) ; storageSummary.setVirtualTotal ( storageCount.getTotal ( ) ) ; }

Target:
private static void getVirtualStorageCount ( org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary storageSummary , javax.sql.DataSource dwhDataSource ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.dao.VmDwhDao dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.VmDwhDao ( dwhDataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.models.VmStorage storageCount = dao.getVirtualStorageCount ( ) ; storageSummary.setVirtualUsed ( storageCount.getUsed ( ) ) ; storageSummary.setVirtualTotal ( storageCount.getTotal ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getStoragePoolIdForDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > storagePools = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage_pool.class , VdcQueryType.GetStoragePoolsByStorageDomainId , params ) ; if ( ( storagePools != null ) && ( ! ( storagePools.isEmpty ( ) ) ) ) { return storagePools.get ( 0 ) . getId ( ) ; } else { return org.ovirt.engine.core.compat.Guid.Empty ; } }

Target:
protected org.ovirt.engine.core.compat.Guid getStoragePoolIdForDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = getBackendCollection ( org.ovirt.engine.core.common.businessentities.StoragePool.class , VdcQueryType.GetStoragePoolsByStorageDomainId , params ) ; if ( ( storagePools != null ) && ( ! ( storagePools.isEmpty ( ) ) ) ) { return storagePools.get ( 0 ) . getId ( ) ; } else { return org.ovirt.engine.core.compat.Guid.Empty ; } }
Source:
protected void addPermissions ( ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters permissionsOperationsParameters = createPermissionParameters ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID , PredefinedRoles.CPU_PROFILE_OPERATOR.getId ( ) ) ; getBackend ( ) . runAction ( ActionType.AddPermission , permissionsOperationsParameters ) ; permissionsOperationsParameters = createPermissionParameters ( getUserId ( ) , PredefinedRoles.CPU_PROFILE_CREATOR.getId ( ) ) ; getBackend ( ) . runAction ( ActionType.AddPermission , permissionsOperationsParameters ) ; }

Target:
protected void addPermissions ( ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters permissionsOperationsParameters = createPermissionParameters ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID , PredefinedRoles.CPU_PROFILE_OPERATOR.getId ( ) ) ; backend.runAction ( ActionType.AddPermission , permissionsOperationsParameters ) ; permissionsOperationsParameters = createPermissionParameters ( getUserId ( ) , PredefinedRoles.CPU_PROFILE_CREATOR.getId ( ) ) ; backend.runAction ( ActionType.AddPermission , permissionsOperationsParameters ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( userProfileDao.getByUserId ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserId ( ) ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserProfile ( ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Quota quota1 , org.ovirt.engine.core.common.businessentities.Quota quota2 ) { boolean top1 = quota1.getId ( ) . equals ( topId ) ; boolean top2 = quota2.getId ( ) . equals ( topId ) ; if ( top1 && ( ! top2 ) ) { return - 1 ; } if ( top2 && ( ! top1 ) ) { return 1 ; } return defaultComparator.compare ( quota1 , quota2 ) ; }

Target:
public static java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > withTopId ( final org.ovirt.engine.core.compat.Guid topId , final java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > defaultComparator ) { return java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.Quota q ) -> ! ( q.getId ( ) . equals ( topId ) ) ) . thenComparing ( defaultComparator ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setServerId ( serverId ) ; brick.setServerName ( serverName ) ; brick.setBrickDirectory ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setServerId ( serverId ) ; brick.setServerName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.serverName ) ; brick.setBrickDirectory ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }
Source:
public static void GetWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice addManagedDeviceForDisk ( org.ovirt.engine.core.compat.Guid diskId , java.lang.Boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , org.ovirt.engine.core.bll.AddDiskCommand.getVmId ( ) ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , shouldDiskBePlugged ( ) , java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getReadOnly ( ) ) , null , java.lang.Boolean.TRUE.equals ( isUsingScsiReservation ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice addManagedDeviceForDisk ( org.ovirt.engine.core.compat.Guid diskId , java.lang.Boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( org.ovirt.engine.core.bll.AddDiskCommand.getVmId ( ) , diskId , shouldDiskBePlugged ( ) , java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getReadOnly ( ) ) , java.lang.Boolean.TRUE.equals ( isUsingScsiReservation ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool getSelectedDc ( ) { org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.uicommonweb.models.CommonModel.getInstance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; return ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool getSelectedDc ( ) { org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = commonModelProvider.get ( ) . getSystemTree ( ) . getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; return ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ; return returnValue ; }
Source:
public java.lang.Void runInTransaction ( ) { jobDao.update ( job ) ; stepDao.updateJobStepsCompleted ( job.getId ( ) , job.getStatus ( ) , job.getEndTime ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.job.Step step : job.getSteps ( ) ) { if ( ( step.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { step.setStatus ( job.getStatus ( ) ) ; step.setEndTime ( job.getEndTime ( ) ) ; } } jobDao.update ( job ) ; return null ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue value = new org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue ( securityCheckbox.getValue ( ) , bugCheckbox.getValue ( ) , enhancementCheckbox.getValue ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue > ( value ) { } ) ; }

Target:
public void execute ( ) { org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue value = new org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue ( securityCheckbox.isActive ( ) , bugCheckbox.isActive ( ) , enhancementCheckbox.isActive ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue > ( value ) { } ) ; }
Source:
public void getDiskLunMapForVmsInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskLunMap > diskLunMapsForVmsInPool = dao.getDiskLunMapsForVmsInPool ( FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( java.util.Arrays.asList ( FixturesTool.LUN_ID_FOR_DISK , FixturesTool.LUN_ID_FOR_DISK2 ) , diskLunMapsForVmsInPool.stream ( ) . map ( DiskLunMap :: getLunId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; }

Target:
public void getDiskLunMapForVmsInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskLunMap > diskLunMapsForVmsInPool = dao.getDiskLunMapsForVmsInPool ( FixturesTool.DATA_CENTER ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( java.util.Arrays.asList ( FixturesTool.LUN_ID_FOR_DISK , FixturesTool.LUN_ID_FOR_DISK2 ) , diskLunMapsForVmsInPool.stream ( ) . map ( DiskLunMap :: getLunId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VmDevice ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPayload other = ( ( org.ovirt.engine.core.common.businessentities.VmPayload ) ( obj ) ) ; return ( ( super . equals ( obj ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( volumeId , other.volumeId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( files , other.files ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VmDevice ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPayload other = ( ( org.ovirt.engine.core.common.businessentities.VmPayload ) ( obj ) ) ; return ( ( super . equals ( obj ) ) && ( java.util.Objects.equals ( volumeId , other.volumeId ) ) ) && ( java.util.Objects.equals ( files , other.files ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel poolDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ( model ) ) ; poolDiskListModel.SyncSearch ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ; } }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel poolDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ( model ) ) ; poolDiskListModel.setVM ( vm ) ; poolDiskListModel.SyncSearch ( ) ; } }
Source:
public void testNicIsCorrectlyAllocatedInScopedPool ( ) throws java.lang.Exception { mockCluster ( cluster ) ; mockGettingAllMacPools ( macPool ) ; mockUsedMacsInSystem ( macPool.getId ( ) , vmNic.getMacAddress ( ) ) ; macPoolPerCluster.initialize ( ) ; org.junit.Assert.assertThat ( "scoped pool for this nic should exist" , getMacPool ( cluster.getId ( ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.notNullValue ( ) ) ) ; org.junit.Assert.assertThat ( "provided mac should be used in returned pool" , getMacPool ( cluster.getId ( ) ) . isMacInUse ( vmNic.getMacAddress ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNicIsCorrectlyAllocatedInScopedPool ( ) throws java.lang.Exception { mockCluster ( cluster ) ; mockGettingAllMacPools ( macPool ) ; mockAllMacsForCluster ( cluster , vmNic.getMacAddress ( ) ) ; macPoolPerCluster.initialize ( ) ; org.junit.Assert.assertThat ( "scoped pool for this nic should exist" , getMacPool ( cluster.getId ( ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.notNullValue ( ) ) ) ; org.junit.Assert.assertThat ( "provided mac should be used in returned pool" , getMacPool ( cluster.getId ( ) ) . isMacInUse ( vmNic.getMacAddress ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public java.util.Set < java.lang.String > getPeers ( java.lang.String server , java.lang.String password ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , org.ovirt.engine.core.utils.gluster.GlusterUtil.USER , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return extractServers ( serversXml ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.util.Map < java.lang.String , java.lang.String > getPeers ( java.lang.String server , java.lang.String username , java.lang.String password , java.lang.String fingerprint ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.SSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , username , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return getFingerprints ( extractServers ( serversXml ) ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; poolPerDc.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = getModel ( ) . getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } } } ) ; }

Target:
protected void initializeModelHandlers ( ) { super . initializeModelHandlers ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items = getModel ( ) . getItems ( ) ; if ( ( items != null ) && ( ! ( items.isEmpty ( ) ) ) ) { selectionModel.setSelected ( items.get ( 0 ) , true ) ; } } } ) ; }
Source:
public abstract void onLogout ( ) ;

Target:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; query.setHandleFailure ( true ) ; query.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { Window.Location.reload ( ) ; } } ; frontend.logoffAsync ( frontend.getLoggedInUser ( ) , query ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( vmDao.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
private org.ovirt.engine.ui.uicommonweb.action.UiAction unlabelNics ( java.util.List < org.ovirt.engine.core.common.action.LabelNicParameters > removedLabelsParameters ) { org.ovirt.engine.ui.uicommonweb.action.UiVdcAction uiVdcAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.UnlabelNic , removedLabelsParameters.get ( 0 ) , this , true ) ; int size = removedLabelsParameters.size ( ) ; if ( size == 1 ) { return uiVdcAction ; } else { return uiVdcAction.then ( unlabelNics ( removedLabelsParameters.subList ( 1 , size ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { getConnectivityTimeout ( ) . setEntity ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; postOnSetupNetworks ( ) ; }
Source:
public void testGetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_GET ; setAction.validate ( engineConfigMap ) ; }

Target:
public void testSetValidatorWithOutValue ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getKey ( ) ) . thenReturn ( "keyToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> setAction.validate ( engineConfigMap ) ) ; }
Source:
public void compare ( ) { org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v4_0 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v4_0.compareTo ( Version.v3_6 ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( 0 , Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) ; }

Target:
public void compare ( ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v4_0 ) ) < 0 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( Version.v4_0.compareTo ( Version.v3_6 ) ) > 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) ; }
Source:
public void testReadStringList ( ) { java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "1" , "2" ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<action><value>1</value><value>2</value></action>" ) ; reader.next ( ) ; java.util.List < java.lang.String > strings = reader.readStrings ( ) ; org.junit.Assert.assertEquals ( expected , strings ) ; }

Target:
public void testReadStringList ( ) { java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "1" , "2" ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<action><values><value>1</value><value>2</value></values></action>" ) ; reader.next ( ) ; java.util.List < java.lang.String > strings = reader.readStrings ( ) ; org.junit.Assert.assertEquals ( expected , strings ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setForce ( true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , action ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setForce ( true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , action ) ) ; }