auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient getJsonClient ( org.ovirt.vdsm.jsonrpc.client.reactors.Reactor reactor , java.lang.String hostName , int port , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy , int parallelism ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactor.createClient ( hostName , port ) ; client.setClientPolicy ( connectionPolicy ) ; org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker worker = org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory.getWorker ( parallelism ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonClient = worker.register ( client ) ; jsonClient.setRetryPolicy ( clientPolicy ) ; return jsonClient ; }

Target:
private static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient getJsonClient ( org.ovirt.vdsm.jsonrpc.client.reactors.Reactor reactor , java.lang.String hostName , int port , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy , int parallelism , java.util.concurrent.ScheduledExecutorService executorService ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactor.createClient ( hostName , port ) ; client.setClientPolicy ( connectionPolicy ) ; org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker worker = org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory.getWorker ( parallelism ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonClient = worker.register ( client ) ; jsonClient.setRetryPolicy ( clientPolicy ) ; jsonClient.setExecutorService ( executorService ) ; return jsonClient ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( final org.ovirt.engine.api.model.HostNIC nic ) { validateParameters ( nic , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; return performCreation ( VdcActionType.AddBond , new org.ovirt.engine.core.common.action.AddBondParameters ( asGuid ( hostId ) , nic.getName ( ) , lookupNetwork ( nic.getNetwork ( ) ) , lookupSlaves ( nic ) ) { { setBondingOptions ( map ( nic , null ) . getBondOptions ( ) ) ; } } , new org.ovirt.engine.api.restapi.resource.BackendHostNicsResource.HostNicResolver ( nic.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( final org.ovirt.engine.api.model.HostNIC nic ) { validateParameters ( nic , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; validateEnums ( org.ovirt.engine.api.model.HostNIC.class , nic ) ; return performCreation ( VdcActionType.AddBond , new org.ovirt.engine.core.common.action.AddBondParameters ( asGuid ( hostId ) , nic.getName ( ) , lookupNetwork ( nic.getNetwork ( ) ) , lookupSlaves ( nic ) ) { { setBondingOptions ( map ( nic , null ) . getBondOptions ( ) ) ; } } , new org.ovirt.engine.api.restapi.resource.BackendHostNicsResource.HostNicResolver ( nic.getName ( ) ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; setTitle ( ( disk.isShareable ( ) ? constants.shareable ( ) : null ) ) ; return disk.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }
Source:
public java.util.List < java.lang.String > convert ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > source ) { if ( source != null ) { java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : source ) { if ( desiredImage ( repoImage ) ) { fileNameList.add ( transform ( repoImage ) ) ; } } java.util.Collections.sort ( fileNameList , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; return fileNameList ; } return new java.util.ArrayList < > ( ) ; }

Target:
public java.util.List < java.lang.String > convert ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > source ) { if ( source != null ) { java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : source ) { if ( imagePredicate.test ( repoImage ) ) { fileNameList.add ( transform.apply ( repoImage ) ) ; } } java.util.Collections.sort ( fileNameList , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; return fileNameList ; } return new java.util.ArrayList < > ( ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.api.model.Storage transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getType ( ) , transform.getType ( ) ) ; assertNotNull ( model.getVolumeGroup ( ) ) ; assertEquals ( model.getVolumeGroup ( ) . getId ( ) , model.getVolumeGroup ( ) . getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.model.HostStorage transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getType ( ) , transform.getType ( ) ) ; assertNotNull ( model.getVolumeGroup ( ) ) ; assertEquals ( model.getVolumeGroup ( ) . getId ( ) , model.getVolumeGroup ( ) . getId ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( VdcActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( ActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
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.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }

Target:
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.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { initImportClonedTemplateDisks ( ) ; AddVmTemplateToDb ( ) ; AddVmInterfaces ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; MoveOrCopyAllImageGroups ( getVmTemplateId ( ) , getParameters ( ) . getImages ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { boolean success = true ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { initImportClonedTemplateDisks ( ) ; AddVmTemplateToDb ( ) ; AddVmInterfaces ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; MoveOrCopyAllImageGroups ( getVmTemplateId ( ) , getParameters ( ) . getImages ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVmTemplate ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; setSucceeded ( success ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachNonPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getValidationMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolId ( ) , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachNonPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getValidationMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
private void addAuthzColumn ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > authzColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return object.getAuthz ( ) ; } } ; authzColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( authzColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.authz ( ) , "150px" ) ; }
Source:
public synchronized void _timer_Elapsed ( ) { if ( ThereAreTasksToPoll ( ) ) { PollAndUpdateAsyncTasks ( ) ; if ( ( ThereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "AsyncTaskManager::_timer_Elapsed: Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { CleanZombieTasks ( ) ; } } }

Target:
public synchronized void _timer_Elapsed ( ) { if ( ThereAreTasksToPoll ( ) ) { PollAndUpdateAsyncTasks ( ) ; if ( ( ThereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Finished polling Tasks, will poll again in {0} seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { CleanZombieTasks ( ) ; } } }
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.ImageType.ISO ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.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.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } 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.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.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.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoImageId ( ) ) ; } return fileNames ; }
Source:
private void setUpStorageHelper ( ) { org.ovirt.engine.core.bll.storage.IStorageHelper helper = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.storage.IStorageHelper.class ) ; org.mockito.Mockito.when ( helper.connectStorageToDomainByVdsId ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( helper.disconnectStorageFromDomainByVdsId ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( helper ) . when ( command ) . getStorageHelper ( storageDomain ) ; }

Target:
private void setUpStorageHelper ( ) { org.ovirt.engine.core.bll.storage.IStorageHelper helper = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.storage.IStorageHelper.class ) ; org.mockito.Mockito.when ( helper.connectStorageToDomainByVdsIdDetails ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.errors.VdcFault > ( true , null ) ) ; org.mockito.Mockito.when ( helper.disconnectStorageFromDomainByVdsId ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( helper ) . when ( command ) . getStorageHelper ( storageDomain ) ; }
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.HOT_PLUG_IDE_DISK_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_PLUG_IDE_DISK_IS_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForDisksWithSnapshots ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > disksMap = getDomainsDisksMap ( disksList ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( disksList ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForDisksWithSnapshots ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( diskImages ) ; } } ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangable ( ( ! entity ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }
Source:
protected boolean isPostZero ( ) { if ( ( cachedPostZero ) == null ) { cachedPostZero = vm.getDiskMap ( ) . values ( ) . contains ( new java.lang.Object ( ) { @ java.lang.Override public boolean equals ( java.lang.Object obj ) { return ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( obj ) ) . isWipeAfterDelete ( ) ; } } ) ; } return cachedPostZero ; }

Target:
private boolean isVmContainsWipeAfterDeleteDisk ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( disk.isWipeAfterDelete ( ) ) { return true ; } } return false ; }
Source:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForCluster ( existingEntity.getClusterId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.Assert.assertEquals ( existingEntity.getClusterId ( ) , vds.getClusterId ( ) ) ; } }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForCluster ( existingEntity.getClusterId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.jupiter.api.Assertions.assertEquals ( existingEntity.getClusterId ( ) , vds.getClusterId ( ) ) ; } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getPluginType ( ) ) == null ? 0 : getPluginType ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getAgentConfiguration ( ) ) == null ? 0 : getAgentConfiguration ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ) { return false ; } org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties other = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ( obj ) ) ; return ( ( super . equals ( obj ) ) && ( java.util.Objects.equals ( pluginType , other.pluginType ) ) ) && ( java.util.Objects.equals ( agentConfiguration , other.agentConfiguration ) ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
private static void GetVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParanet , new org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void GetVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.core.common.businessentities.network entity ) { org.ovirt.engine.core.common.businessentities.network updated = getMapper ( modelType , org.ovirt.engine.core.common.businessentities.network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getstorage_pool_id ( ) . getValue ( ) , updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getstorage_pool_id ( ) . getValue ( ) , updated ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void propagateFailure ( org.ovirt.engine.core.common.action.VdcReturnValueBase internalReturnValue ) { getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( internalReturnValue.getExecuteFailedMessages ( ) ) ; getReturnValue ( ) . setFault ( internalReturnValue.getFault ( ) ) ; getReturnValue ( ) . getCanDoActionMessages ( ) . addAll ( internalReturnValue.getCanDoActionMessages ( ) ) ; getReturnValue ( ) . setCanDoAction ( internalReturnValue.getCanDoAction ( ) ) ; }

Target:
protected void propagateFailure ( org.ovirt.engine.core.common.action.VdcReturnValueBase internalReturnValue ) { getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( internalReturnValue.getExecuteFailedMessages ( ) ) ; getReturnValue ( ) . setFault ( internalReturnValue.getFault ( ) ) ; getReturnValue ( ) . getValidationMessages ( ) . addAll ( internalReturnValue.getValidationMessages ( ) ) ; getReturnValue ( ) . setValid ( internalReturnValue.isValid ( ) ) ; }
Source:
public static boolean isCpusToBeHotplugged ( org.ovirt.engine.core.common.businessentities.VM source , org.ovirt.engine.core.common.businessentities.VM destination ) { return ( ( ( source.getCpuPerSocket ( ) ) == ( destination.getCpuPerSocket ( ) ) ) && ( ( source.getNumOfSockets ( ) ) != ( destination.getNumOfSockets ( ) ) ) ) && ( ( source.getThreadsPerCpu ( ) ) == ( destination.getThreadsPerCpu ( ) ) ) ; }

Target:
public static boolean isCpusToBeHotpluggedOrUnplugged ( org.ovirt.engine.core.common.businessentities.VM source , org.ovirt.engine.core.common.businessentities.VM destination ) { return ( ( ( source.getCpuPerSocket ( ) ) == ( destination.getCpuPerSocket ( ) ) ) && ( ( source.getNumOfSockets ( ) ) != ( destination.getNumOfSockets ( ) ) ) ) && ( ( source.getThreadsPerCpu ( ) ) == ( destination.getThreadsPerCpu ( ) ) ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void addStyles ( ) { overrideIpTablesEditor.addContentWidgetContainerStyleName ( style.overrideIpStyle ( ) ) ; activateHostAfterInstallEditor.addContentWidgetContainerStyleName ( style.activateHostAfterInstallStyle ( ) ) ; publicKeyEditor.setCustomStyle ( style.pkStyle ( ) ) ; }

Target:
void initEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.compat.RpmVersion > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.compat.RpmVersion version ) { return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor ( ) ; activateHostAfterInstallEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; overrideIpTablesEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; junit.framework.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { mockOsRepository ( ) ; initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public void canDoActionFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( "create" , model.getGlusterCommand ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( "create" , model.getGlusterCommand ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getHostId ( java.lang.String host ) { try { return org.ovirt.engine.core.compat.Guid.createGuidFromString ( host ) ; } catch ( java.lang.IllegalArgumentException exception ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host ) , host ) ; if ( entity != null ) { return entity.getId ( ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; } }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( java.lang.String host ) { try { return org.ovirt.engine.core.compat.Guid.createGuidFromString ( host ) ; } catch ( java.lang.IllegalArgumentException exception ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , QueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host ) , host ) ; if ( entity != null ) { return entity.getId ( ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; } }
Source:
protected void executeVdsBrokerCommand ( ) { infoReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getBroker ( ) . getCapabilities ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVDSDynamicData ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) , vdsmNameMapper.createVdsmNameMapping ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) . getClusterId ( ) ) , infoReturn.info ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { infoReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getBroker ( ) . getCapabilities ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.proceedProxyReturnValue ( ) ; vdsBrokerObjectsBuilder.updateVDSDynamicData ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) , vdsmNameMapper.createVdsmNameMapping ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) . getClusterId ( ) ) , infoReturn.info ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetCapabilitiesVDSCommand.getVds ( ) ) ; }
Source:
protected void executeCommand ( ) { try { if ( isAsync ( ) ) { executeCommandAsynchronously ( ) ; return ; } _returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; getVDSReturnValue ( ) . setSucceeded ( true ) ; executeVDSCommand ( ) ; } catch ( java.lang.RuntimeException ex ) { setVdsRuntimeError ( ex ) ; } }

Target:
protected void setVdsRuntimeErrorAndReport ( java.lang.RuntimeException ex ) { setVdsRuntimeError ( ex ) ; logException ( ex ) ; }
Source:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setVolumeType ( cinderDisk.getCinderVolumeType ( ) ) ; return proxy.createVolume ( cinderVolume ) ; }

Target:
public java.lang.String createDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setVolumeType ( cinderDisk.getCinderVolumeType ( ) ) ; return proxy.createVolume ( cinderVolume ) ; } ) ; }
Source:
public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vdsId : getRunVdssList ( ) ) { if ( ! ( vdsId.equals ( getCurrentVdsId ( ) ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FailedToRunVm , new org.ovirt.engine.core.common.vdscommands.FailedToRunVmVDSCommandParameters ( vdsId ) ) ; } } }

Target:
public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vdsId : getRunVdssList ( ) ) { if ( ! ( vdsId.equals ( getCurrentVdsId ( ) ) ) ) { runVdsCommand ( VDSCommandType.FailedToRunVm , new org.ovirt.engine.core.common.vdscommands.FailedToRunVmVDSCommandParameters ( vdsId ) ) ; } } }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }