auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( violatingEntityId , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
public java.lang.Object call ( ) { getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; return null ; }

Target:
public java.lang.Object call ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ; map.setStatus ( storageDomainStatus ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; return null ; }
Source:
private void cleanup ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Start deleteAgedOutCommandEntities" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; commandCoordinatorUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Finished deleteAgedOutCommandEntities" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "deleteAgedOutCommandEntities failed with exception" , e ) ; } }

Target:
private void cleanup ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Start cleanup" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; commandCoordinatorUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Finished cleanup" ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "Exception in performing command entity cleanup: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Exception" , t ) ; } }
Source:
private void setUpGetTagExpectations ( boolean succeed ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetTagsByUserId , org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters.class , new java.lang.String [ ] { "UserId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID.toString ( ) } , ( succeed ? setUpTagsExpectations ( ) : java.util.Collections.emptyList ( ) ) ) ; }

Target:
private void setUpGetTagExpectations ( boolean succeed ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetTagsByUserId , org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters.class , new java.lang.String [ ] { "UserId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID.toString ( ) } , ( succeed ? setUpTagsExpectations ( ) : java.util.Collections.emptyList ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol map ( org.ovirt.engine.api.model.BootProtocol bootProtocol , org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol template ) { if ( bootProtocol != null ) { switch ( bootProtocol ) { case DHCP : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.Dhcp ; case STATIC : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.StaticIp ; case NONE : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.None ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol map ( org.ovirt.engine.api.model.BootProtocol bootProtocol , org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol template ) { if ( bootProtocol != null ) { switch ( bootProtocol ) { case DHCP : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.DHCP ; case STATIC : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ; case NONE : return org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ; default : return null ; } } return null ; }
Source:
private void addSharedLockEntry ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( sharedLockMap ) == null ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; } sharedLockMap.put ( vds.getStoragePoolId ( ) . toString ( ) , LockingGroup.POOL.name ( ) ) ; }

Target:
private void addSharedLockEntry ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( sharedLockMap ) == null ) { sharedLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; } sharedLockMap.put ( vds.getStoragePoolId ( ) . toString ( ) , LockMessagesMatchUtil.POOL ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , getMemoryVolumeForNewActiveSnapshot ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAttachedClustersByClusterPolicyId , params , new org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.SetItemsAsyncQuery ( ) ) ; setIsQueryFirstTime ( false ) ; }
Source:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( VdcActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; return params ; }

Target:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MAX_MEMORY_SIZE ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( VdcActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; return params ; }
Source:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( domainsInPool , vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeFileComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }

Target:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( domainsInPool , vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeSharedComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeFileComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }
Source:
public void refuseBalloonOnPPC ( ) { setupCanImportPpcTest ( ) ; addBalloonToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString ( ) ) ) ; }

Target:
public void refuseBalloonOnPPC ( ) { setupCanImportPpcTest ( ) ; addBalloonToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString ( ) ) ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
protected void endSuccessfully ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; if ( ! ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { unlockSnapshot ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getSnapshot ( ) . getId ( ) ) ; super . endSuccessfully ( ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }
Source:
private static org.ovirt.engine.api.model.DataCenterStatus map ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { switch ( storagePoolStatus ) { case Contend : return org.ovirt.engine.api.model.DataCenterStatus.CONTEND ; case Maintanance : return org.ovirt.engine.api.model.DataCenterStatus.MAINTENANCE ; case NotOperational : return org.ovirt.engine.api.model.DataCenterStatus.NOT_OPERATIONAL ; case Problematic : return org.ovirt.engine.api.model.DataCenterStatus.PROBLEMATIC ; case Uninitialized : return org.ovirt.engine.api.model.DataCenterStatus.UNINITIALIZED ; case Up : return org.ovirt.engine.api.model.DataCenterStatus.UP ; default : throw new java.lang.IllegalStateException ( "Enum mapping failed" ) ; } }

Target:
private static org.ovirt.engine.api.model.DataCenterStatus map ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { switch ( storagePoolStatus ) { case Contend : return org.ovirt.engine.api.model.DataCenterStatus.CONTEND ; case Maintenance : return org.ovirt.engine.api.model.DataCenterStatus.MAINTENANCE ; case NotOperational : return org.ovirt.engine.api.model.DataCenterStatus.NOT_OPERATIONAL ; case Problematic : return org.ovirt.engine.api.model.DataCenterStatus.PROBLEMATIC ; case Uninitialized : return org.ovirt.engine.api.model.DataCenterStatus.UNINITIALIZED ; case Up : return org.ovirt.engine.api.model.DataCenterStatus.UP ; default : throw new java.lang.IllegalStateException ( "Enum mapping failed" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vm.setVmName ( vmName ) ; org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vm.setVmName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getAAANamespaces ( 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 ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void GetLowUtilizationForPowerSave ( 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 ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LowUtilizationForPowerSave , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetMaxSpmPriority ( 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 ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }

Target:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( ( task.getActionParameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s%n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; existingVds = staticDao.get ( org.ovirt.engine.core.dao.VdsStatisticsDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > upHosts = filterUpHosts ( hosts ) ; proxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; xenProxyHosts.setItems ( addAnyHostInCluster ( upHosts ) ) ; this . hosts.setItems ( upHosts ) ; stopProgress ( ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getUndoCommand ( ) ; }

Target:
public java.lang.String getButtonToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }
Source:
private void mockVds ( ) { mockGetStorageDomainList ( 100 , 100 ) ; mockGetImagesList ( ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
public void testUpdateWhenAbortedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.ABORTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void testGetFileFromString_Happy ( ) throws java.net.URISyntaxException { java.lang.String path = this . getClass ( ) . getResource ( "." ) . toURI ( ) . toASCIIString ( ) . replaceAll ( "file:" , "" ) ; java.io.File file = new java.io.File ( path ) ; java.io.File testFile = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( "small_file.txt" , file ) ; org.junit.Assert.assertEquals ( "new file should be same as old file" , new java.io.File ( canReadFileName ) , testFile ) ; }

Target:
public void testGetFileFromString_Happy ( ) throws java.net.URISyntaxException { java.lang.String path = this . getClass ( ) . getResource ( "." ) . toURI ( ) . toASCIIString ( ) . replaceAll ( "file:" , "" ) ; java.io.File file = new java.io.File ( path ) ; java.io.File testFile = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( "small_file.txt" , file ) ; org.junit.jupiter.api.Assertions.assertEquals ( new java.io.File ( canReadFileName ) , testFile , "new file should be same as old file" ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Disks" . equals ( changedArgs.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( changedArgs.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } }

Target:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "Disks" . equals ( args.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( args.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } } ) ; }
Source:
private static boolean isVlanOverBondNetwork ( java.lang.String bondName , java.lang.String networkName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : interfaces ) { if ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( iface , bondName ) ) ) && ( networkName.equals ( iface.getNetworkName ( ) ) ) ) { return true ; } } return false ; }

Target:
private static boolean isBaseInterfaceDown ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { if ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } java.lang.String baseIfaceName = iface.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface tmpIface : interfaces ) { if ( tmpIface.getName ( ) . equals ( baseIfaceName ) ) { return ( tmpIface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } return false ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Inventory populateInventoryCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory = lookupInventory ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard inventoy cache updated in {}ms" , ( endTime - startTime ) ) ; return inventory ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getDashboardFromCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory ; synchronized ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_LOCK ) { dashboard = dashboardCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY ) ; if ( dashboard == null ) { dashboard = populateUtilizationCache ( ) ; } inventory = inventoryCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY ) ; if ( inventory == null ) { inventory = populateInventoryCache ( ) ; } } dashboard.setInventory ( inventory ) ; return dashboard ; }
Source:
public void externalNetworkNameChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = mockExternalNetwork ( ) ; org.mockito.Mockito.when ( externalNetwork.getName ( ) ) . thenReturn ( "aaa" ) ; org.mockito.Mockito.when ( network.getName ( ) ) . thenReturn ( "bbb" ) ; org.junit.Assert.assertThat ( validator.externalNetworkDetailsUnchanged ( externalNetwork ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void externalNetworkDescriptionChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = createExternalNetwork ( ) ; externalNetwork.setDescription ( "aaa" ) ; network.setDescription ( "bbb" ) ; org.junit.Assert.assertThat ( validator.externalNetworkDetailsUnchanged ( externalNetwork ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( interfacePopupModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; if ( ! isBondSalve ) { computeAndCommitLabelChanges ( entity , interfacePopupModel.getLabelsModel ( ) ) ; } commitVfsConfigChanges ( hostNicVfsConfig , interfacePopupModel.getVfsConfigModel ( ) ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( vfsConfigPopupModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; commitVfsConfigChanges ( hostNicVfsConfig , vfsConfigPopupModel ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel clusterNetworkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > dcNetworks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel networkToManage = createNetworkList ( dcNetworks ) ; clusterNetworkListModel.setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHashName ( "assign_networks" ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel clusterNetworkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > dcNetworks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel networkToManage = createNetworkList ( dcNetworks ) ; clusterNetworkListModel.setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHashName ( "assign_networks" ) ; }
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 ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkMasterDomainIsUp ( ) ) ) ; return returnValue ; }
Source:
protected void EndWithFailure ( ) { SetIsVmRunningStateless ( ) ; rollbackQuota ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . EndWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; rollbackQuota ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; setItems ( templates ) ; }

Target:
protected void syncSearch ( ) { syncSearch ( VdcQueryType.GetUnregisteredVmTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; }
Source:
protected void resetPeriodicPauseLogTime ( long ts ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getLastPauseLogTime ( ) ) != ts ) { org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . setLastPauseLogTime ( ts ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } }

Target:
protected void resetPeriodicPauseLogTime ( long ts ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getLastPauseLogTime ( ) ) != ts ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . setLastPauseLogTime ( ts ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.getRootTag ( ) . gettag_id ( ) ) ; return tag ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setDescription ( description ) ; tag.setTagId ( tagId ) ; tag.setTagName ( name ) ; tag.setType ( TagsType.GeneralTag ) ; tag.setParentId ( tagsDirector.getRootTag ( ) . getTagId ( ) ) ; return tag ; }
Source:
private void importHostedEngineVM ( java.util.Map vmStruct ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( vmStruct ) ; vm.setImages ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.BuildDiskImagesFromDevices ( vmStruct ) ) ; vm.setInterfaces ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.BuildVmNetworkInterfacesFromDevices ( vmStruct ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : vm.getImages ( ) ) { vm.getDiskMap ( ) . put ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImage ) ; } vm.setVdsGroupId ( getVdsManager ( ) . getVdsGroupId ( ) ) ; getVdsEventListener ( ) . importHostedEngineVm ( vm ) ; }

Target:
private void importHostedEngineVM ( java.util.Map vmStruct ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( vmStruct ) ; vm.setImages ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildDiskImagesFromDevices ( vmStruct ) ) ; vm.setInterfaces ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmNetworkInterfacesFromDevices ( vmStruct ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : vm.getImages ( ) ) { vm.getDiskMap ( ) . put ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImage ) ; } vm.setVdsGroupId ( getVdsManager ( ) . getVdsGroupId ( ) ) ; getVdsEventListener ( ) . importHostedEngineVm ( vm ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getAllAsyncTasksFromDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask : asyncTasks ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTasks ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { return coCoAsyncTaskHelper.getAsyncTaskFromDb ( asyncTaskId ) ; }
Source:
public void canDoActionFailedGuestOsIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( VmOsType.RHEL3x64 ) ; cretaeVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void canDoActionFailedGuestOsIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; cretaeVirtIODisk ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VDS provider = control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.easymock.EasyMock.expect ( provider.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( provider.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return provider ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VDS provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( provider.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( provider.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; return provider ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.equals ( getSyncStorageDevicesCommand ( ) ) ) { syncStorageDevices ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.equals ( getCreateBrickCommand ( ) ) ) { createBrick ( ) ; } else if ( command.getName ( ) . equals ( "onCreateBrick" ) ) { onCreateBrick ( ) ; } else if ( command.getName ( ) . equals ( "closeWindow" ) ) { setWindow ( null ) ; } else if ( command.equals ( getSyncStorageDevicesCommand ( ) ) ) { syncStorageDevices ( ) ; } }