auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ; dbFacade.getVmNetworkInterfaceDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; dbFacade.getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }

Target:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.bll.AddVmInterfaceCommand.getVmNetworkInterfaceDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getDbFacade ( ) . getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelper.getInstance ( ) . createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null , org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }
Source:
private void mtuValidTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , int mtu , boolean featureSupported ) { mockConfigRule.mockConfigValue ( ConfigValues.MTUOverrideSupported , dataCenter.getcompatibility_version ( ) , featureSupported ) ; org.mockito.Mockito.when ( network.getMtu ( ) ) . thenReturn ( mtu ) ; org.junit.Assert.assertThat ( validator.mtuValid ( ) , matcher ) ; }

Target:
private void mtuValidTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , int mtu , boolean featureSupported ) { mockConfigRule.mockConfigValue ( ConfigValues.MTUOverrideSupported , dataCenter.getCompatibilityVersion ( ) , featureSupported ) ; org.mockito.Mockito.when ( network.getMtu ( ) ) . thenReturn ( mtu ) ; org.junit.Assert.assertThat ( validator.mtuValid ( ) , matcher ) ; }
Source:
public void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandExecuted ( getCommandId ( ) ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.TaskManagerUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallBackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public static 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 static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void CreateUISyntaxChecker ( ) { org.ovirt.engine.core.searchbackend.ISyntaxChecker checker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createUISyntaxChecker ( "foo" ) ; junit.framework.Assert.assertNotNull ( checker ) ; junit.framework.Assert.assertEquals ( checker , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createUISyntaxChecker ( "foo" ) ) ; junit.framework.Assert.assertEquals ( "foo" , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.getConfigAuthenticationMethod ( ) ) ; }

Target:
public void CreateUISyntaxChecker ( ) { org.ovirt.engine.core.searchbackend.ISyntaxChecker checker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createUISyntaxChecker ( "foo" ) ; org.junit.Assert.assertNotNull ( checker ) ; org.junit.Assert.assertEquals ( checker , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createUISyntaxChecker ( "foo" ) ) ; org.junit.Assert.assertEquals ( "foo" , org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.getConfigAuthenticationMethod ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID ) ; return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolume ( ) ; if ( ! ( volume.isOnline ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_INVALID ) ; return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolume ( ) ; if ( ! ( volume.isOnline ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN ) ; addValidationMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }
Source:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }

Target:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDao ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }
Source:
private void onPreview ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; if ( snapshot == null ) { cancel ( ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; boolean memory = ( ( java.lang.Boolean ) ( snapshotModel.getMemory ( ) . getEntity ( ) ) ) ; runTryBackToAllSnapshotsOfVm ( snapshotModel , vm , snapshot , memory , null ) ; }

Target:
private void updatePreviewedDiskSnapshots ( final java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getVmDisks ( ) ) { if ( ( diskImage.getSnapshots ( ) . size ( ) ) <= 1 ) { continue ; } org.ovirt.engine.core.compat.Guid snapshotId = diskImage.getSnapshots ( ) . get ( 1 ) . getVmSnapshotId ( ) ; getSnapshotsMap ( ) . get ( snapshotId ) . getEntity ( ) . getDiskImages ( ) . add ( diskImage ) ; } updateItems ( snapshots ) ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public java.lang.Object map ( java.lang.Object from , java.lang.Object template ) { java.lang.Object ret = null ; try { ret = method.invoke ( null , from , template ) ; } catch ( java.lang.reflect.InvocationTargetException ite ) { if ( ( ite.getTargetException ( ) ) instanceof org.ovirt.engine.api.restapi.utils.MalformedIdException ) { throw ( ( org.ovirt.engine.api.restapi.utils.MalformedIdException ) ( ite.getTargetException ( ) ) ) ; } } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } return to.cast ( ret ) ; }

Target:
public java.lang.Object map ( java.lang.Object from , java.lang.Object template ) { try { return to.cast ( method.invoke ( null , from , template ) ) ; } catch ( java.lang.reflect.InvocationTargetException ite ) { if ( ( ite.getTargetException ( ) ) instanceof org.ovirt.engine.api.restapi.utils.MalformedIdException ) { throw ( ( org.ovirt.engine.api.restapi.utils.MalformedIdException ) ( ite.getTargetException ( ) ) ) ; } else { throw new org.ovirt.engine.api.restapi.utils.MappingException ( ite ) ; } } catch ( java.lang.IllegalAccessException e ) { throw new org.ovirt.engine.api.restapi.utils.MappingException ( e ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.Host add ( org.ovirt.engine.sdk.decorators.Host host ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , host , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Host add ( org.ovirt.engine.sdk.decorators.Host host ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , host , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class , headers ) ; }
Source:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
public void testPersistNetworkAttachmentsWhenCustomPropertiesChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( new java.util.HashMap < > ( ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }

Target:
public void testPersistNetworkAttachmentsWhenCustomPropertiesChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.common.utils.NetworkCommonUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( new java.util.HashMap < > ( ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }
Source:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . 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 ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
public void execute ( ) { frontend.runQuery ( VdcQueryType.GetEngineSessionIdToken , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String engineAuthToken = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; restApiSessionManager.acquireSession ( engineAuthToken ) ; } } ) ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > createStorageDomainsMap ( org.ovirt.engine.core.common.businessentities.DiskImage ... diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > toReturn = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { org.ovirt.engine.core.compat.Guid id = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setId ( id ) ; domain.setStatus ( StorageDomainStatus.Active ) ; toReturn.put ( id , domain ) ; } return toReturn ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > createStorageDomainsMap ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ... diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > toReturn = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { org.ovirt.engine.core.compat.Guid id = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setId ( id ) ; domain.setStatus ( StorageDomainStatus.Active ) ; toReturn.put ( id , domain ) ; } return toReturn ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc fenceSpmStorage ( java.lang.String spUUID , int prevID , java.lang.String prevLVER ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.fence" ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getExternalVMs" ) . withParameter ( "uri" , uri ) . withParameter ( "username" , username ) . withParameter ( "password" , password ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }
Source:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDao ( ) . remove ( iface.getId ( ) ) ; } } }

Target:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNicDao ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDao ( ) . remove ( iface.getId ( ) ) ; } } }
Source:
public static void Init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : allPools ) { if ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }

Target:
public static void Init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > allPools = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : allPools ) { if ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.poolStatusChanged ( pool.getId ( ) , StoragePoolStatus.NotOperational ) ; } } }
Source:
protected boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return getVmRunHandler ( ) . canRunVm ( vm , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) , getVmPropertiesUtils ( ) ) ; }

Target:
private void removeMemoryFromSnapshot ( ) { if ( memoryVolumeFromSnapshot.isEmpty ( ) ) { return ; } if ( ( getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( memoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } getSnapshotDao ( ) . removeMemoryFromSnapshot ( getBaselineSnapshot ( ) . getId ( ) ) ; }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }

Target:
public void AttachTask ( org.ovirt.engine.core.bll.CommandAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "CommandMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }
Source:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPost3_0Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPost3_0Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networks , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct bonds , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options ) { return vdsServer.futureSetupNetworks ( networks.getInnerMap ( ) , bonds.getInnerMap ( ) , options.getInnerMap ( ) ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookDisable ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookDisable ( glusterCommand , stage , hookName ) ; 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 testGetGlusterVolumeSnapshotConfigByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( configs ) ; org.junit.Assert.assertEquals ( 3 , configs.size ( ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }

Target:
public void testGetGlusterVolumeSnapshotConfigByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( configs ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , configs.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( configs.contains ( existingConfig1 ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.class ) ; } else if ( "LOCAL" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.SPMTask concreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.concreteCreateTask ( this , asyncTaskCreationInfo , parentCommand ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { pathLabel.setText ( constants.storagePopupNfsPathLabel ( ) ) ; pathHintLabel.setText ( constants.storagePopupNfsPathHintLabel ( ) ) ; warningLabel.setText ( constants.advancedOptionsLabel ( ) ) ; versionLabel.setText ( constants.storagePopupNfsVersionLabel ( ) ) ; retransmissionsLabel.setText ( constants.storagePopupNfsRetransmissionsLabel ( ) ) ; timeoutLabel.setText ( constants.storagePopupNfsTimeoutLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { pathLabel.setText ( constants.storagePopupNfsPathLabel ( ) ) ; pathHintLabel.setText ( constants.storagePopupNfsPathHintLabel ( ) ) ; warningLabel.setText ( constants.advancedOptionsLabel ( ) ) ; overrideEditor.setLabel ( constants.storagePopupNfsOverrideLabel ( ) ) ; versionLabel.setText ( constants.storagePopupNfsVersionLabel ( ) ) ; retransmissionsLabel.setText ( constants.storagePopupNfsRetransmissionsLabel ( ) ) ; timeoutLabel.setText ( constants.storagePopupNfsTimeoutLabel ( ) ) ; }
Source:
private java.lang.String clustersListIntoTokenizedString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > attachedClustersList = getClusterDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) ; java.util.List < java.lang.String > clusterNamesList = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : attachedClustersList ) { clusterNamesList.add ( cluster.getName ( ) ) ; } return org.apache.commons.lang.StringUtils.join ( clusterNamesList , ',' ) ; }

Target:
private java.lang.String clustersListIntoTokenizedString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > attachedClustersList = clusterDao.getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) ; java.util.List < java.lang.String > clusterNamesList = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : attachedClustersList ) { clusterNamesList.add ( cluster.getName ( ) ) ; } return org.apache.commons.lang.StringUtils.join ( clusterNamesList , ',' ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToHost ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_HOST ) . when ( networkAttachedToHost ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToHost ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "networkName" , getNetwork ( ) . getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "hostName" , host.getName ( ) ) ) . when ( networkAttachedToHost ( ) ) ; }
Source:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void ResetData ( ) { storageDomain = null ; storageModel = null ; storageId = null ; nfsConnection = null ; connection = null ; removeConnection = false ; path = null ; hostId = new org.ovirt.engine.core.compat.Guid ( ) ; domainType = org.ovirt.engine.core.common.businessentities.StorageDomainType.values ( ) [ 0 ] ; clusters = null ; allStorageDomains = null ; attachedStorageDomains = null ; isoStorageDomains = null ; allHosts = null ; localStorageHost = null ; }

Target:
private void ResetData ( ) { storageDomain = null ; storageModel = null ; storageId = null ; nfsConnection = null ; connection = null ; removeConnection = false ; path = null ; hostId = new org.ovirt.engine.core.compat.Guid ( ) ; domainType = org.ovirt.engine.core.common.businessentities.StorageDomainType.values ( ) [ 0 ] ; clusters = null ; allStorageDomains = null ; attachedStorageDomains = null ; isoStorageDomains = null ; allHosts = null ; localStorageHost = null ; noLocalStorageHost = false ; }
Source:
public void failOnStoppedVm ( ) { org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams params = new org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams ( getValidOptions ( GraphicsType.SPICE ) , false ) ; org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery ( params ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.SPICE ) ; mockVm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( query ) . getCachedVm ( ) ; query.validateInputs ( ) ; org.junit.Assert.assertFalse ( query.getQueryReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void failOnStoppedVm ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.SPICE ) ; mockVm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( getQuery ( ) ) . getCachedVm ( ) ; getQuery ( ) . validateInputs ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity , uriInfo ) ; } parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . setAllowsViewingChildren ( false ) ; org.ovirt.engine.core.bll.AddRoleCommand.getRoleDao ( ) . save ( org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . setAllowsViewingChildren ( false ) ; org.ovirt.engine.core.bll.AddRoleCommand.getRoleDao ( ) . save ( org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.AddRoleCommand.getRole ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.AddRoleCommand.setSucceeded ( true ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }