auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }

Target:
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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.Balances list ( ) { org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = getClusterPolicy ( ) ; org.ovirt.engine.api.model.Balances balances = new org.ovirt.engine.api.model.Balances ( ) ; if ( ( clusterPolicy.getBalance ( ) ) != null ) { org.ovirt.engine.api.model.Balance balance = new org.ovirt.engine.api.model.Balance ( ) ; balance.setId ( clusterPolicy.getBalance ( ) . toString ( ) ) ; balances.setBalances ( addLinks ( map ( clusterPolicy , balance ) ) ) ; } return balances ; }

Target:
public org.ovirt.engine.api.model.Balances list ( ) { org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = getClusterPolicy ( ) ; org.ovirt.engine.api.model.Balances balances = new org.ovirt.engine.api.model.Balances ( ) ; if ( ( clusterPolicy.getBalance ( ) ) != null ) { org.ovirt.engine.api.model.Balance balance = new org.ovirt.engine.api.model.Balance ( ) ; balance.setId ( clusterPolicy.getBalance ( ) . toString ( ) ) ; balances.getBalances ( ) . add ( addLinks ( map ( clusterPolicy , balance ) ) ) ; } return balances ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; behavior.postInitTemplate ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( isEditEnabled ( ) ) ; } }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setIsChangable ( isEditEnabled ( ) ) ; } }
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 getRoleList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
private java.util.Date convertDate ( java.util.Date inDate , java.lang.String tZone ) { if ( inDate == null ) { return null ; } java.text.DateFormat format = new java.text.SimpleDateFormat ( "MM/dd/yyyy HH:mm:ss" ) ; java.lang.String formattedStartDate = format.format ( inDate ) ; format.setTimeZone ( java.util.TimeZone.getTimeZone ( tZone ) ) ; try { return format.parse ( formattedStartDate ) ; } catch ( java.lang.Exception ex ) { log.error ( "Error while converting the date to engine time zone" ) ; return null ; } }

Target:
protected org.ovirt.engine.core.bll.utils.GlusterUtil getGlusterUtil ( ) { return org.ovirt.engine.core.bll.utils.GlusterUtil.getInstance ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateForImage ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { return null ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getImageId ( ) ) . values ( ) ; return ! ( templates.isEmpty ( ) ) ? templates.iterator ( ) . next ( ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateForImage ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { return null ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateDao ( ) . getAllForImage ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getImageId ( ) ) . values ( ) ; return ! ( templates.isEmpty ( ) ) ? templates.iterator ( ) . next ( ) : null ; }
Source:
public void testAllDomainsExistAndActive ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }

Target:
public void testAllDomainsExistAndActive ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
public void insufficientDiskSpaceWithSnapshots ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void insufficientDiskSpaceWithSnapshots ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void testVmDownAndDiskUnplugged ( ) { org.ovirt.engine.core.common.businessentities.VM vm = createMockVm ( VMStatus.Down ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement = createMockDiskVmElement ( vm.getId ( ) , false ) ; org.mockito.Mockito.doReturn ( vm ) . when ( vmDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( ActionType.MoveOrCopyDisk , command.getMoveActionType ( java.util.Collections.singletonList ( diskVmElement ) ) ) ; }

Target:
public void testVmDownAndDiskUnplugged ( ) { org.ovirt.engine.core.common.businessentities.VM vm = createMockVm ( VMStatus.Down ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement = createMockDiskVmElement ( vm.getId ( ) , false ) ; org.mockito.Mockito.doReturn ( vm ) . when ( vmDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( ActionType.MoveOrCopyDisk , command.getMoveActionType ( java.util.Collections.singletonList ( diskVmElement ) ) ) ; }
Source:
private static void toStringBuilder ( java.lang.Iterable iterable , java.lang.StringBuilder builder ) { if ( iterable == null ) { return ; } for ( java.lang.Object value : iterable ) { if ( value instanceof java.lang.Iterable ) { org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( ( ( java.lang.Iterable ) ( value ) ) , builder ) ; } else { builder.append ( value.toString ( ) ) ; builder.append ( "\n" ) ; } } }

Target:
private static void toStringBuilder ( java.lang.Iterable iterable , java.lang.StringBuilder builder ) { builder.append ( "[" ) ; java.util.Iterator < java.lang.Object > iterator = iterable.iterator ( ) ; while ( iterator.hasNext ( ) ) { org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( iterator.next ( ) , builder ) ; if ( iterator.hasNext ( ) ) { builder.append ( ", " ) ; } } builder.append ( "]" ) ; }
Source:
public static javax.naming.directory.SearchControls createSearchControls ( ) { javax.naming.directory.SearchControls searchControls = new javax.naming.directory.SearchControls ( ) ; searchControls.setSearchScope ( javax.naming.directory.SearchControls.OBJECT_SCOPE ) ; searchControls.setReturningObjFlag ( true ) ; return searchControls ; }

Target:
public static javax.naming.directory.SearchControls createSearchControls ( ) { java.lang.String [ ] returnAttributes = new java.lang.String [ ] { org.ovirt.engine.core.ldap.RootDSEQueryInfo.NAMING_CONTEXTS_RESULT_ATTRIBUTE , org.ovirt.engine.core.ldap.RootDSEQueryInfo.DEFAULT_NAMING_CONTEXT_RESULT_ATTRIBUTE } ; javax.naming.directory.SearchControls searchControls = new javax.naming.directory.SearchControls ( ) ; searchControls.setSearchScope ( javax.naming.directory.SearchControls.OBJECT_SCOPE ) ; searchControls.setReturningAttributes ( returnAttributes ) ; searchControls.setReturningObjFlag ( true ) ; return searchControls ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public void getFreeVfNoVfs ( ) { freeVfCommon ( 0 , 0 , 0 , 0 , 0 ) ; org.junit.Assert.assertNull ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ; }

Target:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }
Source:
public 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 getEngineSshPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void updateGlusterHookContent ( ) { java.lang.String updateContent = "Updated script content to test" ; java.lang.String updateChecksum = "ddffeef712fc008f857e77a2f3f179c710" ; dao.updateGlusterHookContent ( FixturesTool.HOOK_ID , updateChecksum , updateContent ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.Assert.assertNotNull ( hook ) ; org.junit.Assert.assertEquals ( updateContent , hook.getContent ( ) ) ; org.junit.Assert.assertEquals ( updateChecksum , hook.getChecksum ( ) ) ; }

Target:
public void updateGlusterHookContent ( ) { java.lang.String updateContent = "Updated script content to test" ; java.lang.String updateChecksum = "ddffeef712fc008f857e77a2f3f179c710" ; dao.updateGlusterHookContent ( FixturesTool.HOOK_ID , updateChecksum , updateContent ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( FixturesTool.HOOK_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( hook ) ; org.junit.jupiter.api.Assertions.assertEquals ( updateContent , hook.getContent ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( updateChecksum , hook.getChecksum ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.StopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { Cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.StopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { Cancel ( ) ; } }
Source:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; 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.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; 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.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
private static java.lang.String readFile ( java.lang.String path ) throws java.io.IOException { byte [ ] encoded = java.nio.file.Files.readAllBytes ( java.nio.file.Paths.get ( path ) ) ; return new java.lang.String ( encoded , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; }

Target:
private static java.lang.String readFile ( java.lang.String path ) throws java.io.IOException { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( java.lang.String line : java.nio.file.Files.readAllLines ( java.nio.file.Paths.get ( path ) , java.nio.charset.StandardCharsets.UTF_8 ) ) { sb.append ( line ) ; } return sb.toString ( ) ; }
Source:
public void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.EditDiskProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.EditDiskProfileModel ( this , ( ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile ) ( getSelectedItem ( ) ) ) , getEntity ( ) . getStoragePoolId ( ) ) ; setWindow ( model ) ; initProfileStorageDomains ( model ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile , org.ovirt.engine.core.common.businessentities.qos.StorageQos , org.ovirt.engine.core.common.businessentities.StorageDomain > getEditProfileModel ( ) { return new org.ovirt.engine.ui.uicommonweb.models.profiles.EditDiskProfileModel ( this , ( ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile ) ( getSelectedItem ( ) ) ) , getStoragePoolId ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.DiskImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = super . mapRow ( rs , rowNum ) ; mapEntity ( rs , entity ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.DiskImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = null ; org.ovirt.engine.core.common.businessentities.storage.DiskStorageType diskStorageType = org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : entity = super . mapRow ( rs , rowNum ) ; mapEntity ( rs , entity ) ; break ; case CINDER : entity = org.ovirt.engine.core.dao.DiskImageDAODbFacadeImpl.CinderDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return entity ; }
Source:
public void update ( int index , org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData object , java.lang.String value ) { object.selectClusterByName ( value ) ; refreshEntityTable ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData object ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.column.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( object.getClusterNames ( ) ) ; return ( object.getCluster ( ) . getSelectedItem ( ) ) != null ? object.getCluster ( ) . getSelectedItem ( ) . getName ( ) : constants.empty ( ) ; }
Source:
private void wipeAfterDelete_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { if ( ( ! ( getIsWipeAfterDelete ( ) . getIsChangable ( ) ) ) && ( getIsWipeAfterDelete ( ) . getEntity ( ) ) ) { getIsWipeAfterDelete ( ) . setEntity ( false ) ; } }

Target:
private void isShareable_EntityChanged ( ) { boolean isShareable = getIsShareable ( ) . getEntity ( ) ; if ( ( getIsBootable ( ) . getIsChangable ( ) ) || ( ( ! ( isVmContainBootableDisk ) ) && ( ! isShareable ) ) ) { getIsBootable ( ) . setIsChangable ( ( ! isShareable ) ) ; getIsBootable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.cannotEnableBootableForShareableDisk ( ) ) ; } }
Source:
public void testEvalDifferentAddress ( ) { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ; org.mockito.Mockito.when ( mockOtherIface.getIpv4Address ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ) ) ; org.junit.Assert.assertFalse ( underTest.test ( mockOtherIface ) ) ; }

Target:
public void testEvalDifferentAddress ( ) { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ; org.mockito.Mockito.when ( mockOtherIface.getIpv4Address ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( underTest.test ( mockOtherIface ) ) ; }
Source:
protected void initAllowConsoleReconnect ( ) { getAllowConsoleReconnect ( ) . setEntity ( true ) ; }

Target:
public void setRngDevice ( org.ovirt.engine.core.common.businessentities.VmRngDevice dev ) { rngBytes.setEntity ( ( ( dev.getBytes ( ) ) == null ? null : dev.getBytes ( ) ) ) ; rngPeriod.setEntity ( ( ( dev.getPeriod ( ) ) == null ? null : dev.getPeriod ( ) ) ) ; rngSourceRandom.setEntity ( ( ( dev.getSource ( ) ) == ( VmRngDevice.Source.RANDOM ) ) ) ; rngSourceHwrng.setEntity ( ( ( dev.getSource ( ) ) == ( VmRngDevice.Source.HWRNG ) ) ) ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc setVolumeLegality ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , java.lang.String legality ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVolumeLegality ( sdID , spID , imageID , volumeID , legality ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private java.lang.String offerHostId ( org.ovirt.engine.core.compat.Guid vdsGroupId ) { int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.VDS host : dbFacade.getVdsDao ( ) . getAllForVdsGroup ( vdsGroupId ) ) { if ( ( host.getHighlyAvailableScore ( ) ) > 0 ) { i ++ ; } } return java.lang.String.valueOf ( ( i + 1 ) ) ; }

Target:
private java.lang.String offerHostId ( org.ovirt.engine.core.compat.Guid clusterId ) { int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.VDS host : dbFacade.getVdsDao ( ) . getAllForCluster ( clusterId ) ) { if ( ( host.getHighlyAvailableScore ( ) ) > 0 ) { i ++ ; } } return java.lang.String.valueOf ( ( i + 1 ) ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ( ( ( a.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( a.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ( ! ( a.getStorageDomainType ( ) . isIsoOrImportExportDomain ( ) ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }
Source:
public void InitTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; }

Target:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }
Source:
public static void GetDocumentationBaseURL ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
public void getValueWithMultipleVersions ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumOfVmSockets" ; org.ovirt.engine.core.config.EngineConfigTest.log.info ( ( "getValue: Testing fetch multiple version of " + key ) ) ; java.util.List < org.ovirt.engine.core.config.entity.ConfigKey > keys = config.getEngineConfigLogic ( ) . getConfigDAO ( ) . getKeysForName ( key ) ; for ( org.ovirt.engine.core.config.entity.ConfigKey configKey : keys ) { org.ovirt.engine.core.config.EngineConfigTest.log.info ( ( ( ( configKey.getDisplayValue ( ) ) + " version: " ) + ( configKey.getVersion ( ) ) ) ) ; } org.junit.Assert.assertTrue ( ( ( keys.size ( ) ) > 0 ) ) ; }

Target:
public void getValueWithMultipleVersions ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumOfVmSockets" ; org.ovirt.engine.core.config.EngineConfigTest.log.info ( "getValue: Testing fetch multiple version of {}" , key ) ; java.util.List < org.ovirt.engine.core.config.entity.ConfigKey > keys = config.getEngineConfigLogic ( ) . getConfigDAO ( ) . getKeysForName ( key ) ; for ( org.ovirt.engine.core.config.entity.ConfigKey configKey : keys ) { org.ovirt.engine.core.config.EngineConfigTest.log.info ( "{} version: {}" , configKey.getDisplayValue ( ) , configKey.getVersion ( ) ) ; } org.junit.Assert.assertTrue ( ( ( keys.size ( ) ) > 0 ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionList ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( model.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( model.getMessage ( ) ) ; } else if ( "VM" . equals ( propName ) ) { updateMemoryBoxVisibility ( ) ; } }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( getConfigurator ( ) . IsDisplayTypeSupported ( DisplayType.qxl ) ) && ( ! ( getIsConnected ( ) ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ) ) && ( IsVmConnectReady ( ) ) ) ) ; }

Target:
private boolean isSpiceSupportedByClient ( ) { if ( ( consoleMode ) == ( ClientConsoleMode.Plugin ) ) { return ( getConfigurator ( ) . isClientWindownsExplorer ( ) ) || ( getConfigurator ( ) . isClientLinuxFirefox ( ) ) ; } return true ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoImage.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage file : files ) { fileNames.add ( file.getRepoImageId ( ) ) ; } return fileNames ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage file : files ) { fileNames.add ( file.getRepoImageId ( ) ) ; } return fileNames ; }
Source:
public synchronized org.ovirt.engine.sdk.Roles getRoles ( ) { if ( ( this . roles ) == null ) { this . roles = new org.ovirt.engine.sdk.Roles ( proxy ) ; } return roles ; }

Target:
public org.ovirt.engine.sdk.Roles getRoles ( ) { if ( ( this . roles ) == null ) { synchronized ( this . LOCK ) { if ( ( this . roles ) == null ) { this . roles = new org.ovirt.engine.sdk.Roles ( proxy ) ; } } } return roles ; }
Source:
public void getManagementNetworkName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ManagementNetwork , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public java.lang.String getCustomToolTip ( ) { 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 ( ) ; } }

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:
protected void build ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getSerialNumberPolicy ( ) . setSelectedSerialNumberPolicy ( vm.getSerialNumberPolicy ( ) ) ; model.getSerialNumberPolicy ( ) . getCustomSerialNumber ( ) . setEntity ( vm.getCustomSerialNumber ( ) ) ; }

Target:
protected void build ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( supported ( ConfigurationValues.SerialNumberPolicySupported , model ) ) { model.getSerialNumberPolicy ( ) . setSelectedSerialNumberPolicy ( vm.getSerialNumberPolicy ( ) ) ; model.getSerialNumberPolicy ( ) . getCustomSerialNumber ( ) . setEntity ( vm.getCustomSerialNumber ( ) ) ; } }
Source:
public void testRetryWithDifferentException ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( 5 , 3 , 10 , java.lang.IllegalArgumentException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }

Target:
public void testRetryWithDifferentException ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( 5 , 3 , 10 , java.lang.IllegalArgumentException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.when ( callable.call ( ) ) . thenThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setStatus ( GlusterServiceStatus.FAILED ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; dao.save ( service ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.FAILED ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; dao.save ( service ) ; return service ; }
Source:
public void testGetDefaultQuotaForDCWithDefaultQuota ( ) throws java.lang.Exception { org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaForDCWithDefaultQuota ( ) throws java.lang.Exception { org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
Source:
public org.ovirt.engine.api.model.Network get ( ) { return performGet ( VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; }

Target:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.api.model.Network entity = parent.lookupNetwork ( guid ) ; if ( entity == null ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network network = map ( entity ) ; network.setDisplay ( null ) ; return addLinks ( network ) ; }