auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean vmDeviceChanged ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = ( device != null ) ? org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , deviceType , device ) : org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdAndType ( vmId , deviceType ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
public static boolean vmDeviceChanged ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceGeneralType , java.lang.String deviceTypeName , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = ( deviceTypeName != null ) ? org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , deviceGeneralType , deviceTypeName ) : org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdAndType ( vmId , deviceGeneralType ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }
Source:
public void rollbackQuota ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }

Target:
public void rollbackQuota ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; mockUniqueOsNames ( ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , 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:
private void doTestGetNotFound ( java.lang.String id ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
private void doTestGetNotFound ( java.lang.String id ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep getInitialMergeStepForImage ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.Image image = org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getImageDao ( ) . get ( imageId ) ; if ( ( ( image.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) && ( image.getParentId ( ) . equals ( Guid.Empty ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > children = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForParent ( imageId ) ; if ( children.isEmpty ( ) ) { org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Image has been previously merged, proceeding with deletion" ) ; return org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep.DESTROY_IMAGE ; } } return org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep.MERGE ; }

Target:
private org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep getInitialMergeStepForImage ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.storage.Image image = org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getImageDao ( ) . get ( imageId ) ; if ( ( ( image.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL ) ) && ( image.getParentId ( ) . equals ( Guid.Empty ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > children = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForParent ( imageId ) ; if ( children.isEmpty ( ) ) { org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Image has been previously merged, proceeding with deletion" ) ; return org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep.DESTROY_IMAGE ; } } return org.ovirt.engine.core.common.action.RemoveSnapshotSingleDiskLiveStep.MERGE ; }
Source:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommandBase.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getCurrentVdsId ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.RunVmCommandBase.getVds ( ) ; return vds != null ? vds.getId ( ) : null ; }
Source:
private void InternalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; EndWithFailure ( ) ; }

Target:
private void internalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public static void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , params , aQuery ) ; }
Source:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.asynctasks.AsyncTaskType getTaskType ( ) { return org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception { mockEngineSSHDialog = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.utils.EngineSSHDialog.class ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHDialog ) . connect ( ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHDialog ) . authenticate ( ) ; org.mockito.Mockito.doReturn ( mockEngineSSHDialog ) . when ( getQuery ( ) ) . getEngineSSHDialog ( ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { mockEngineSSHDialog = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.ssh.EngineSSHDialog.class ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHDialog ) . connect ( ) ; org.mockito.Mockito.doNothing ( ) . when ( mockEngineSSHDialog ) . authenticate ( ) ; org.mockito.Mockito.doReturn ( mockEngineSSHDialog ) . when ( getQuery ( ) ) . getEngineSSHDialog ( ) ; }
Source:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( java.lang.Boolean.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDSGroup > singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsGroupDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }

Target:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( java.lang.Boolean.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDSGroup > singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsGroupDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }
Source:
private void updateOptionsPostData ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.ovirt.engine.ui.uicommonweb.UICommand addDiskAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( "AddDisk" , this ) ; if ( disks.isEmpty ( ) ) { addDiskAction.setTitle ( VmConfigureVirtualDisksAction ) ; getCompulsoryActions ( ) . add ( addDiskAction ) ; } else { addDiskAction.setTitle ( VmAddAnotherVirtualDiskAction ) ; getOptionalActions ( ) . add ( addDiskAction ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; updateOptions ( ( ! ( disks.isEmpty ( ) ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getVGList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( 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.vdsbroker.StatusOnlyReturnForXmlRpc snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks , java.lang.String memory , boolean frozen ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , disks , memory , frozen ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( clientAgentType.isIE8OrBelow ( ) ) { Window.Location.reload ( ) ; } org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; getLoginModel ( ) . resetAfterLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.clearCache ( ) ; connectAutomaticallyManager.resetAlreadyOpened ( ) ; org.ovirt.engine.ui.userportal.system.ApplicationInit.super . onLogout ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( clientAgentType.isIE8OrBelow ( ) ) { Window.Location.reload ( ) ; } frontend.clearLoggedInUser ( ) ; getLoginModel ( ) . resetAfterLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.clearCache ( ) ; connectAutomaticallyManager.resetAlreadyOpened ( ) ; org.ovirt.engine.ui.userportal.system.ApplicationInit.super . onLogout ( ) ; }
Source:
public void poll ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } updateIteration ( ) ; }

Target:
public void poll ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetcher , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , manager.getVdsName ( ) ) ; } } updateIteration ( ) ; }
Source:
public void testMapOriginTypeRhev ( ) { java.lang.String s = org.ovirt.engine.api.restapi.types.VmMapper.map ( OriginType.RHEV , null ) ; assertEquals ( s , "rhev" ) ; org.ovirt.engine.core.common.businessentities.OriginType s2 = org.ovirt.engine.api.restapi.types.VmMapper.map ( s , OriginType.RHEV ) ; assertEquals ( s2 , OriginType.RHEV ) ; }

Target:
public void testClusterSpiceProxy ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setVdsGroupSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public static 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 ) ; }

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 org.ovirt.engine.core.compat.Guid findChildCommandByActionType ( org.ovirt.engine.core.common.action.VdcActionType commandType , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { for ( org.ovirt.engine.core.compat.Guid cmdId : childCmdIds ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( cmdId ) ; if ( ( commandEntity.getCommandType ( ) ) == commandType ) { return cmdId ; } } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid findChildCommandByActionType ( org.ovirt.engine.core.common.action.ActionType commandType , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { for ( org.ovirt.engine.core.compat.Guid cmdId : childCmdIds ) { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = commandCoordinatorUtil.getCommandEntity ( cmdId ) ; if ( ( commandEntity.getCommandType ( ) ) == commandType ) { return cmdId ; } } return null ; }
Source:
public void testHasPeersTrue ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }

Target:
public void testHasPeersTrue ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.storagePopupNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.storagePopupDescriptionLabel ( ) ) ; datacenterListEditor.setLabel ( constants.storagePopupDataCenterLabel ( ) ) ; storageTypeListEditor.setLabel ( constants.storagePopupStorageTypeLabel ( ) ) ; formatListEditor.setLabel ( constants.storagePopupFormatTypeLabel ( ) ) ; hostListEditor.setLabel ( constants.storagePopupHostLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.storagePopupNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.storagePopupDescriptionLabel ( ) ) ; commentEditor.setLabel ( constants.commentLabel ( ) ) ; datacenterListEditor.setLabel ( constants.storagePopupDataCenterLabel ( ) ) ; storageTypeListEditor.setLabel ( constants.storagePopupStorageTypeLabel ( ) ) ; formatListEditor.setLabel ( constants.storagePopupFormatTypeLabel ( ) ) ; hostListEditor.setLabel ( constants.storagePopupHostLabel ( ) ) ; }
Source:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.AddTag ( tag1 ) ; tagsDirector.AddTag ( tag2 ) ; tagsDirector.MoveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.IsTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }

Target:
public void testDirectDescetor ( ) { org.ovirt.engine.core.common.businessentities.Tags tag1 = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "tag2" , "desc2" ) ; tagsDirector.AddTag ( tag1 ) ; tagsDirector.AddTag ( tag2 ) ; tagsDirector.MoveTag ( tag2.gettag_id ( ) , tag1.gettag_id ( ) ) ; org.junit.Assert.assertTrue ( tagsDirector.IsTagDescestorOfTag ( tag1.gettag_id ( ) , tag2.gettag_id ( ) ) ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public void setGuestOsKernelVersion ( java.lang.String guestOsKernelVersion ) { vmDynamic.setGuestOsKernelVersion ( guestOsKernelVersion ) ; }
Source:
public void removeNetworkFromParameters ( org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network net ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( net ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = getVlanDevice ( params.getInterfaces ( ) , nic , net ) ; if ( vlan == null ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.NETWORK_LABEL_CONFLICT ) ; } else { params.getInterfaces ( ) . remove ( vlan ) ; } } else if ( org.apache.commons.lang.StringUtils.equals ( net.getName ( ) , nic.getNetworkName ( ) ) ) { nic.setNetworkName ( null ) ; } }

Target:
private boolean isNetworkAssignedToNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.lang.String networkName , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByNetwork ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicToWhichNetworkIsAssigned = nicsByNetwork.get ( networkName ) ; java.lang.String baseNicNameToWhichNetworkIsAssigned = ( nicToWhichNetworkIsAssigned == null ) ? null : org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( nicToWhichNetworkIsAssigned ) ; return nic.getName ( ) . equals ( baseNicNameToWhichNetworkIsAssigned ) ; }
Source:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.bll.ImagesHandler.cdPathWindowsToLinux ( windowsPath , ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters ( storagePoolId ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vdsId ) { return org.ovirt.engine.core.bll.ImagesHandler.cdPathWindowsToLinux ( windowsPath , ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.VdsAndPoolIDVDSParametersBase ( vdsId , storagePoolId ) ) . getReturnValue ( ) ) ) ) ; }
Source:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDAO vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setSupportedClusterLevels ( getVds ( ) . getDynamicData ( ) . getSupportedClusterLevels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }

Target:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDao vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setSupportedClusterLevels ( getVds ( ) . getDynamicData ( ) . getSupportedClusterLevels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }
Source:
private void assertDiskDescriptionMap ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , java.lang.String ... jsonEntries ) throws java.io.IOException { org.junit.Assert.assertEquals ( java.lang.String.format ( "{%s}" , org.apache.commons.lang.StringUtils.join ( jsonEntries , "," , 0 , jsonEntries.length ) ) , metadataDiskDescriptionHandler.generateJsonDiskDescription ( disk ) ) ; }

Target:
private void assertDiskDescriptionMap ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , java.lang.String ... jsonEntries ) throws java.io.IOException { org.junit.jupiter.api.Assertions.assertEquals ( java.lang.String.format ( "{%s}" , org.apache.commons.lang.StringUtils.join ( jsonEntries , "," , 0 , jsonEntries.length ) ) , metadataDiskDescriptionHandler.generateJsonDiskDescription ( disk ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { long sizeNeeded = ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) ) / ( BYTES_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , sizeNeeded ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
protected boolean isOsSupportingHotPlug ( ) { java.lang.String vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) . name ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }

Target:
protected boolean isOsSupportingHotPlug ( ) { int vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( osRepository.getOsName ( vmOs ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }
Source:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }

Target:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }
Source:
private boolean handleLibvirtSecrets ( org.ovirt.engine.core.bll.context.CommandContext cmdContext , org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLibvirtSecretDao ( ) . getAllByStoragePoolIdFilteredByActiveStorageDomains ( poolId ) ; if ( ( ! ( libvirtSecrets.isEmpty ( ) ) ) && ( ! ( registerLibvirtSecretsImpl ( vds , libvirtSecrets , false ) ) ) ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.log.error ( "Failed to register libvirt secret on vds {}." , vds.getName ( ) ) ; setNonOperational ( cmdContext , vds.getId ( ) , NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE ) ; return false ; } return true ; }

Target:
private boolean handleLibvirtSecrets ( org.ovirt.engine.core.bll.context.CommandContext cmdContext , org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( poolId ) ; if ( ( ! ( libvirtSecrets.isEmpty ( ) ) ) && ( ! ( registerLibvirtSecretsImpl ( vds , libvirtSecrets , false ) ) ) ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.log.error ( "Failed to register libvirt secret on vds {}." , vds.getName ( ) ) ; setNonOperational ( cmdContext , vds.getId ( ) , NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE ) ; return false ; } return true ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isInVm = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; topPanel.setVisible ( isInVm ) ; aliasEditor.setFocus ( ( ! isInVm ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isInVm = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; topPanel.setVisible ( ( isInVm && ( disk.getAttachDisk ( ) . getIsAvailable ( ) ) ) ) ; aliasEditor.setFocus ( ( ! isInVm ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = getVMs ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQueryBase.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = getVMs ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { vmHandler.updateVmGuestAgentVersion ( vm ) ; vmHandler.updateVmStatistics ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQueryBase.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }
Source:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
private void setUpGetVirtioScsiExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVirtioScsiControllers , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }
Source:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( changedArgs.PropertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } else if ( changedArgs.PropertyName.contains ( "consoleAddressPartiallyOverridden" ) ) { updateAlerts ( getView ( ) , model ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( changedArgs.propertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } else if ( changedArgs.propertyName.contains ( "consoleAddressPartiallyOverridden" ) ) { updateAlerts ( getView ( ) , model ) ; } } }
Source:
protected void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.uicommonweb.UICommand newCommand = ( command != null ) ? command : org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ; if ( ( this . command ) != newCommand ) { this . command = newCommand ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( this ) ; if ( newCommand != ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ) ) { newCommand.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.this ) ; } } ) ; } } }

Target:
protected void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.uicommonweb.UICommand newCommand = ( command != null ) ? command : org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ; if ( ( this . command ) != newCommand ) { this . command = newCommand ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( this ) ; if ( newCommand != ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ) ) { newCommand.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.this ) ; } } ) ; } } }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }