auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setActionConfirmationMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { setErrorMessage ( result.getReturnValue ( ) , cModel ) ; } else { setWindow ( null ) ; } } }
Source:
private boolean propertiesRequiringVmUpdateDeviceWereUpdated ( ) { return ( ! ( org.apache.commons.lang.ObjectUtils.equals ( oldIface.getVnicProfileId ( ) , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . getVnicProfileId ( ) ) ) ) || ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) ; }

Target:
private boolean propertiesRequiringVmUpdateDeviceWereUpdated ( ) { return ( ! ( java.util.Objects.equals ( oldIface.getVnicProfileId ( ) , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . getVnicProfileId ( ) ) ) ) || ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void validateFails ( ) { cmd.getParameters ( ) . setVolumeId ( startedVolumeId ) ; cmd.setGlusterVolumeId ( startedVolumeId ) ; cmd.getParameters ( ) . setGeoRepSessionId ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFails ( ) { cmd.getParameters ( ) . setVolumeId ( startedVolumeId ) ; cmd.setGlusterVolumeId ( startedVolumeId ) ; cmd.getParameters ( ) . setGeoRepSessionId ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
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 , 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.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected java.lang.String localize ( java.util.List < java.lang.String > errors ) { java.util.Locale locale = getEffectiveLocale ( ) ; return locale != null ? backend.getErrorsTranslator ( ) . TranslateErrorText ( errors , locale ) . toString ( ) : backend.getErrorsTranslator ( ) . TranslateErrorText ( errors ) . toString ( ) ; }

Target:
protected java.lang.String localize ( java.util.List < java.lang.String > errors ) { java.util.Locale locale = getEffectiveLocale ( ) ; return locale != null ? backend.getErrorsTranslator ( ) . translateErrorText ( errors , locale ) . toString ( ) : backend.getErrorsTranslator ( ) . translateErrorText ( errors ) . toString ( ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.ExecuteAction ( ) ; } default : { return org.ovirt.engine.core.bll.Backend.NotAutorizedError ( ) ; } } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; command.insertAsyncTaskPlaceHolders ( ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
public void testGetConnectableBlockStorageConnections ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = dao.getConnectableStorageConnectionsByStorageType ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER , StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( conns ) ; org.junit.Assert.assertEquals ( 2 , conns.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : conns ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , conn.getstorage_type ( ) ) ; } }

Target:
public void testGetConnectableBlockStorageConnections ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = dao.getConnectableStorageConnectionsByStorageType ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER , StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( conns ) ; org.junit.Assert.assertEquals ( 2 , conns.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : conns ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , conn.getStorageType ( ) ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return createTask ( asyncTaskCreationInfo , parentCommand , null , entityType , entityIds ) ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > createEntitiesMapForSingleEntityType ( org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.compat.Guid entityId : entityIds ) { entitiesMap.put ( entityId , entityType ) ; } return entitiesMap ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setactive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }
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.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 isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void handleError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ) { java.lang.String msg = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) . getMessage ( ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( new org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ( "unknown" , msg ) ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.AlertPowerManagementStatusFailed ( msg ) ; }

Target:
private void handleError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ) { java.lang.String msg = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) . getMessage ( ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( new org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ( "unknown" , msg ) ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.alertPowerManagementStatusFailed ( msg ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.shutdown" ) . withParameter ( "vmID" , vmId ) . withOptionalParameter ( "delay" , timeout ) . withOptionalParameter ( "message" , message ) . 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.StatusOnlyReturn shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.shutdown" ) . withParameter ( "vmID" , vmId ) . withOptionalParameter ( "delay" , timeout ) . withOptionalParameter ( "message" , message ) . 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.StatusOnlyReturn ( response ) ; }
Source:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromString ( id ) , true ) ) ; } else { return remove ( id ) ; } }

Target:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) , true ) ) ; } else { return remove ( id ) ; } }
Source:
public void testGetTemplateVersionsForBaseTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > tVersions = dao.getTemplateVersionsForBaseTemplate ( FixturesTool.VM_TEMPLATE_RHEL5 ) ; org.junit.Assert.assertEquals ( 1 , tVersions.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_TEMPLATE_RHEL5_V2 , tVersions.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetTemplateVersionsForBaseTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > tVersions = dao.getTemplateVersionsForBaseTemplate ( FixturesTool.VM_TEMPLATE_RHEL5 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , tVersions.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_TEMPLATE_RHEL5_V2 , tVersions.get ( 0 ) . getId ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.SPMAsyncTask Construct ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams , boolean duringInit ) { try { org.ovirt.engine.core.bll.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.SPMAsyncTask ( asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.CommandAsyncTask ( asyncTaskParams , duringInit ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }

Target:
public static org.ovirt.engine.core.bll.SPMAsyncTask construct ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams , boolean duringInit ) { try { org.ovirt.engine.core.bll.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.SPMAsyncTask ( asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.CommandAsyncTask ( asyncTaskParams , duringInit ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE , model.getVolumeType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE , model.getVolumeType ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( javax.servlet.http.HttpServletRequest request , org.ovirt.engine.core.sso.utils.SsoSession ssoSession , java.lang.String clientId , java.lang.String clientSecret ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > payload = buildResponse ( ssoSession ) ; if ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( ssoSession.getScope ( ) ) . contains ( SsoConstants.OPENID_SCOPE ) ) { payload.put ( "id_token" , org.ovirt.engine.core.sso.utils.SsoUtils.createJWT ( request , ssoSession , clientId , clientSecret ) ) ; } return payload ; }

Target:
protected org.ovirt.engine.core.sso.utils.Credentials getCredentials ( javax.servlet.http.HttpServletRequest request ) throws java.lang.Exception { return org.ovirt.engine.core.sso.utils.SsoUtils.translateUser ( org.ovirt.engine.core.sso.utils.SsoUtils.getRequestParameter ( request , "username" ) , org.ovirt.engine.core.sso.utils.SsoUtils.getRequestParameter ( request , "password" ) , ssoContext ) ; }
Source:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.NetworkBootProtocol networkBootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( networkBootProtocol != null ) { switch ( networkBootProtocol ) { case Dhcp : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case StaticIp : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case None : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.BootProtocol map ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol , org.ovirt.engine.api.model.BootProtocol template ) { if ( networkBootProtocol != null ) { switch ( networkBootProtocol ) { case Dhcp : return org.ovirt.engine.api.model.BootProtocol.DHCP ; case StaticIp : return org.ovirt.engine.api.model.BootProtocol.STATIC ; case None : return org.ovirt.engine.api.model.BootProtocol.NONE ; default : return null ; } } return null ; }
Source:
protected boolean removeVmInSpm ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.compat.Guid storageDomainId ) { return runVdsCommand ( VDSCommandType.RemoveVM , new org.ovirt.engine.core.common.vdscommands.RemoveVMVDSCommandParameters ( storagePoolId , vmID , storageDomainId ) ) . getSucceeded ( ) ; }

Target:
protected void removeVmSnapshots ( ) { java.util.Collection < java.lang.String > memoriesOfRemovedSnapshots = new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . removeSnapshots ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( java.lang.String memoryVolumes : memoriesOfRemovedSnapshots ) { if ( shouldRemoveMemorySnapshotVolumes ( memoryVolumes ) ) { removeMemoryVolumes ( memoryVolumes , org.ovirt.engine.core.bll.VmCommand.getActionType ( ) , false ) ; } } }
Source:
public org.ovirt.engine.core.bll.ValidationResult isInProcess ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainIsoMap = storageDomain.getStoragePoolIsoMapData ( ) ; if ( ( ( domainIsoMap.getStatus ( ) ) != null ) && ( domainIsoMap.getStatus ( ) . isStorageDomainInProcess ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$status %1$s" , domainIsoMap.getStatus ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isInProcess ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainIsoMap = storageDomain.getStoragePoolIsoMapData ( ) ; if ( ( ( domainIsoMap.getStatus ( ) ) != null ) && ( domainIsoMap.getStatus ( ) . isStorageDomainInProcess ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , java.lang.String.format ( "$status %1$s" , domainIsoMap.getStatus ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private boolean validateAndAddViolation ( org.ovirt.engine.core.bll.ValidationResult validationResult , java.lang.String violatingEntity ) { if ( validationResult.isValid ( ) ) { return true ; } else { addViolation ( validationResult.getMessage ( ) , violatingEntity ) ; return false ; } }

Target:
private java.lang.String [ ] createIncoherentNicIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName ) { return new java.lang.String [ ] { java.lang.String.format ( "ENTITY_ID %s" , violatingEntityId ) , java.lang.String.format ( "$nicId %s" , nicId ) , java.lang.String.format ( "$nicName %s" , nicName ) } ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > createHotplugMemoryParamsMap ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , boolean copyAlias , int minAllocatedMem ) { java.util.Map < java.lang.String , java.lang.Object > data = org.ovirt.engine.core.vdsbroker.architecture.MemoryUtils.createHotplugMemoryParamsMap ( vmDevice , copyAlias ) ; data.put ( "memGuaranteedSize" , minAllocatedMem ) ; return data ; }

Target:
public static java.util.Map < java.lang.String , java.lang.Object > createHotplugMemoryParamsMap ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , boolean copyAlias , int minAllocatedMem ) { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( "vmId" , vmDevice.getVmId ( ) . toString ( ) ) ; data.put ( "memory" , org.ovirt.engine.core.vdsbroker.architecture.MemoryUtils.createVmMemoryDeviceMap ( vmDevice , copyAlias ) ) ; data.put ( "memGuaranteedSize" , minAllocatedMem ) ; return data ; }
Source:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceResult = result.getActionReturnValue ( ) ; skipped = ( fenceResult.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SKIPPED_DUE_TO_POLICY ) ; } return skipped ; }

Target:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.ActionReturnValue result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceResult = result.getActionReturnValue ( ) ; skipped = ( fenceResult.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SKIPPED_DUE_TO_POLICY ) ; } return skipped ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , vmId , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , "" , new java.util.Date ( ) , "" ) ; setUpDAOMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , vmId , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , "" , new java.util.Date ( ) , "" ) ; setUpDaoMocks ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getStoragePool ( ) . getId ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( cluster.getId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusters ( ) { if ( ( clusters ) == null ) { clusters = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getStoragePool ( ) . getId ( ) ) ; } return clusters ; }
Source:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }

Target:
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.storage_domains ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
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 ) ; }

Target:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }
Source:
public void setValueB ( java.lang.Integer value ) { this . valueB = value ; java.lang.String percentage = value + "%" ; percentageLabelB.setText ( ( value < 10 ? "" : percentage ) ) ; percentageBarB.setWidth ( percentage ) ; percentageBarB.setVisible ( ( value != 0 ) ) ; percentageBarB.setTitle ( percentage ) ; }

Target:
private void setBar ( com.google.gwt.user.client.ui.FlowPanel percentageBar , com.google.gwt.user.client.ui.Label percentageLabel , java.lang.Integer value , int fakeValue , java.lang.String style ) { if ( value != null ) { java.lang.String percentage = value + "%" ; java.lang.String fakePercentage = fakeValue + "%" ; percentageLabel.setText ( ( value < ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.MINIMUM_SIZE_TO_SHOW_TEXT ) ? "" : percentage ) ) ; percentageLabel.setStyleName ( style ) ; percentageBar.setWidth ( fakePercentage ) ; percentageBar.setVisible ( ( value != 0 ) ) ; percentageBar.setTitle ( percentage ) ; } }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected org.ovirt.engine.core.dao.ImageStorageDomainMapDao getImageStorageDomainMapDao ( ) { return org.ovirt.engine.core.bll.AbstractDiskVmCommand.getDbFacade ( ) . getImageStorageDomainMapDao ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allValuesPresent ( ) { return ( ( getQos ( ) ) != null ) && ( ( missingValue ( getQos ( ) . getInboundAverage ( ) , getQos ( ) . getInboundPeak ( ) , getQos ( ) . getInboundBurst ( ) ) ) || ( missingValue ( getQos ( ) . getOutboundAverage ( ) , getQos ( ) . getOutboundPeak ( ) , getQos ( ) . getOutboundBurst ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_MISSING_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult requiredValuesPresent ( ) { return ( ( getQos ( ) ) != null ) && ( ( missingValue ( getQos ( ) . getInboundAverage ( ) , getQos ( ) . getInboundPeak ( ) , getQos ( ) . getInboundBurst ( ) ) ) || ( missingValue ( getQos ( ) . getOutboundAverage ( ) , getQos ( ) . getOutboundPeak ( ) , getQos ( ) . getOutboundBurst ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_MISSING_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private org.ovirt.engine.core.compat.Guid mockSourceImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( imageId ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; list.add ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; image.setStorageIds ( list ) ; image.setActualSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; image.setSize ( 40 ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; return imageId ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String redirectUrl = url ; java.lang.String queryString = request.getQueryString ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( queryString ) ) { if ( ( redirectUrl.indexOf ( "?" ) ) == ( - 1 ) ) { redirectUrl += "?" ; } else { redirectUrl += "&" ; } redirectUrl += queryString ; } response.sendRedirect ( redirectUrl ) ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String redirectUrl = url ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( redirectUrl ) ) { java.lang.String queryString = request.getQueryString ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( queryString ) ) { if ( ( redirectUrl.indexOf ( "?" ) ) == ( - 1 ) ) { redirectUrl += "?" ; } else { redirectUrl += "&" ; } redirectUrl += queryString ; } } else { redirectUrl = url404 ; } response.sendRedirect ( redirectUrl ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveVmParameters params = new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( VdcActionType.ExportVm , params , action ) ; }

Target:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( VdcActionType.ExportVm , params , action ) ; }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, protocol=%s, ticket=%s, validTime=%s,m userName=%s, userId=%s" , super . toString ( ) , graphicsType , getTicket ( ) , getValidTime ( ) , getUserName ( ) , getUserId ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "protocol" , graphicsType ) . append ( "ticket" , getTicket ( ) ) . append ( "validTime" , getValidTime ( ) ) . append ( "userName" , getUserName ( ) ) . append ( "userId" , getUserId ( ) ) ; }
Source:
protected void endExecutionMonitoring ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; executionHandler.endJob ( executionContext , true ) ; } else { super . endExecutionMonitoring ( ) ; } }

Target:
public void onPowerringUp ( ) { decreasePendingVm ( vmStaticDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( ActionType.ExportVm , params , action ) ; }

Target:
public javax.ws.rs.core.Response exportToPathOnHost ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.ExportOvaParameters params = new org.ovirt.engine.core.common.action.ExportOvaParameters ( ) ; params.setEntityType ( VmEntityType.VM ) ; params.setEntityId ( guid ) ; params.setProxyHostId ( getHostId ( action ) ) ; params.setDirectory ( action.getDirectory ( ) ) ; params.setName ( action.getFilename ( ) ) ; return doAction ( ActionType.ExportOva , params , action ) ; }
Source:
public void initialize ( ) { org.mockito.Mockito.when ( mockConstantsManager.getMessages ( ) ) . thenReturn ( mockUiMessages ) ; org.mockito.Mockito.when ( mockUiMessages.keyValueFormat ( ) ) . thenReturn ( FORMAT ) ; org.mockito.Mockito.when ( mockUiMessages.customPropertiesValuesShouldBeInFormatReason ( FORMAT ) ) . thenReturn ( ERROR_MESSAGE_EMPTY_NOT_ALLOWED ) ; org.mockito.Mockito.when ( mockUiMessages.emptyOrValidKeyValueFormatMessage ( FORMAT ) ) . thenReturn ( ERROR_MESSAGE_EMPTY_ALLOWED ) ; underTest = new org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidation ( mockConstantsManager ) ; }

Target:
public void initialize ( ) { org.mockito.Mockito.when ( mockConstantsManager.getMessages ( ) ) . thenReturn ( mockUiMessages ) ; org.mockito.Mockito.when ( mockUiMessages.keyValueFormat ( ) ) . thenReturn ( org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidationTest.FORMAT ) ; org.mockito.Mockito.when ( mockUiMessages.customPropertiesValuesShouldBeInFormatReason ( org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidationTest.FORMAT ) ) . thenReturn ( org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidationTest.ERROR_MESSAGE_EMPTY_NOT_ALLOWED ) ; org.mockito.Mockito.when ( mockUiMessages.emptyOrValidKeyValueFormatMessage ( org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidationTest.FORMAT ) ) . thenReturn ( org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidationTest.ERROR_MESSAGE_EMPTY_ALLOWED ) ; underTest = new org.ovirt.engine.ui.uicommonweb.validation.KeyValueFormatValidation ( mockConstantsManager ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ; image.setStorageIds ( sdIds ) ; return image ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > sdIds = new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ; image.setStorageIds ( sdIds ) ; return image ; }
Source:
protected void executeCommand ( ) { boolean succeeded = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodes = org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getParameters ( ) . getVmNumaNodeList ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : vmNumaNodes ) { guids.add ( node.getId ( ) ) ; } org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getVmNumaNodeDao ( ) . massRemoveNumaNodeByNumaNodeId ( guids ) ; succeeded = true ; } finally { org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.setSucceeded ( succeeded ) ; } }

Target:
protected void executeCommand ( ) { boolean succeeded = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodes = org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.getParameters ( ) . getVmNumaNodeList ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmNumaNode node : vmNumaNodes ) { guids.add ( node.getId ( ) ) ; } vmNumaNodeDao.massRemoveNumaNodeByNumaNodeId ( guids ) ; succeeded = true ; } finally { org.ovirt.engine.core.bll.numa.vm.RemoveVmNumaNodesCommand.setSucceeded ( succeeded ) ; } }