auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "RepoImageId" } , new java.lang.Object [ ] { GUIDS [ 1 ] . toString ( ) } , ( notFound ? null : getEntity ( 1 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpGetEntityExpectations ( QueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "RepoImageId" } , new java.lang.Object [ ] { GUIDS [ 1 ] . toString ( ) } , ( notFound ? null : getEntity ( 1 ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { ( sucessCount ) ++ ; if ( ( ( toAddList.size ( ) ) > 0 ) && ( ( sucessCount ) == ( toRemoveList.size ( ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.AddEventSubscription , toAddList ) ; } } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { ( sucessCount ) ++ ; if ( ( ( toAddList.size ( ) ) > 0 ) && ( ( sucessCount ) == ( toRemoveList.size ( ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.AddEventSubscription , toAddList ) ; } } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.StopVmCommand.getSuspendedVm ( ) ) { return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM : org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM_FAILED ; } else { switch ( org.ovirt.engine.core.bll.StopVmCommand.getParameters ( ) . getStopVmType ( ) ) { case NORMAL : return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_STOP_VM ; case CANNOT_SHUTDOWN : return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOPPED_VM_INSTEAD_OF_SHUTDOWN : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_STOPPING_VM_INSTEAD_OF_SHUTDOWN ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.StopVmCommand.shouldSkipCommandExecutionCached ( ) ) { return org.ovirt.engine.core.bll.StopVmCommand.logCommandExecutionSkipped ( "Stop VM" ) ; } if ( org.ovirt.engine.core.bll.StopVmCommand.getSuspendedVm ( ) ) { return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM : org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM_FAILED ; } else { switch ( org.ovirt.engine.core.bll.StopVmCommand.getParameters ( ) . getStopVmType ( ) ) { case NORMAL : return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_STOP_VM ; case CANNOT_SHUTDOWN : return org.ovirt.engine.core.bll.StopVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOPPED_VM_INSTEAD_OF_SHUTDOWN : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_STOPPING_VM_INSTEAD_OF_SHUTDOWN ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } } }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private void generateWriterSource ( org.ovirt.api.metamodel.concepts.StructType type ) { org.ovirt.api.metamodel.tool.JavaClassName writerName = javaTypes.getJsonWriterName ( type ) ; javaBuffer.addLine ( "public class %1$s {" , writerName.getSimpleName ( ) ) ; javaBuffer.addLine ( ) ; generateWriteOne ( type ) ; generateWriteMany ( type ) ; javaBuffer.addLine ( "}" ) ; javaBuffer.addLine ( ) ; }

Target:
private void generateStructWriteMany ( org.ovirt.api.metamodel.concepts.StructType type ) { generateWriteMany ( type ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult existsAndUp ( ) { if ( ( ( storagePool ) == null ) || ( ( storagePool.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult existsAndUp ( ) { org.ovirt.engine.core.bll.ValidationResult existsResult = exists ( ) ; if ( ! ( existsResult.isValid ( ) ) ) { return existsResult ; } if ( ( storagePool.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void validateAndAssertQosOverridden ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertInterfaceModified ( helper , iface ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( nic ) ; return nic ; }
Source:
public void networkInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.networkInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }

Target:
public void networkInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.networkInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testIsInvalidHostname ( ) { java.lang.String [ ] straValidHosts = new java.lang.String [ ] { "www.redhat.com" , "127.0.0.1" , "www.rhn.redhat.com" } ; java.lang.String [ ] straInvalidHosts = new java.lang.String [ ] { "www.redhat#com" , "123/456" , "www@redhat.com" , "www.řhň.řěďháť.čőm" , "你好世界" , "שלוםעולם" } ; for ( java.lang.String s : straValidHosts ) { org.junit.Assert.assertTrue ( ( "Valid host name: " + s ) , org.ovirt.engine.core.common.utils.ValidationUtils.validHostname ( s ) ) ; } for ( java.lang.String s : straInvalidHosts ) { org.junit.Assert.assertTrue ( ( "Invalid host name: " + s ) , ( ! ( org.ovirt.engine.core.common.utils.ValidationUtils.validHostname ( s ) ) ) ) ; } }

Target:
public void testIsInvalidHostname ( ) { java.lang.String [ ] straValidHosts = new java.lang.String [ ] { "blahblah" , "www.redhat.com" , "www.rhn.redhat.com" , "127.0.0.1" , "1::2" , "1:0002:34:4:5:6:7:8" } ; java.lang.String [ ] straInvalidHosts = new java.lang.String [ ] { "www.redhat#com" , "123/456" , "www@redhat.com" , "www.řhň.řěďháť.čőm" , "你好世界" , "שלוםעולם" } ; for ( java.lang.String s : straValidHosts ) { org.junit.Assert.assertTrue ( ( "Valid host name: " + s ) , org.ovirt.engine.core.common.utils.ValidationUtils.validHostname ( s ) ) ; } for ( java.lang.String s : straInvalidHosts ) { org.junit.Assert.assertTrue ( ( "Invalid host name: " + s ) , ( ! ( org.ovirt.engine.core.common.utils.ValidationUtils.validHostname ( s ) ) ) ) ; } }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = getVdsGroup ( ) ; if ( vdsGroup.supportsVirtService ( ) ) { setSucceeded ( initVirtResources ( ) ) ; } if ( vdsGroup.supportsGlusterService ( ) ) { setSucceeded ( initGlusterPeerProcess ( ) ) ; } }

Target:
private boolean initGlusterHost ( ) { glusterHostUuidFound = true ; if ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterHostUuidSupported ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) { if ( ! ( saveGlusterHostUuid ( ) ) ) { glusterHostUuidFound = false ; setNonOperational ( NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND , null ) ; } } return ( glusterHostUuidFound ) && ( initGlusterPeerProcess ( ) ) ; }
Source:
private boolean isCurrentTaskLookedFor ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.bll.SPMAsyncTask task ) { return ( ( ( task instanceof org.ovirt.engine.core.bll.EntityAsyncTask ) && ( id.equals ( task.getParameters ( ) . getEntityInfo ( ) . getId ( ) ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.Cleared ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.ClearFailed ) ) ; }

Target:
private boolean isCurrentTaskLookedFor ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.bll.SPMAsyncTask task ) { return ( ( ( task instanceof org.ovirt.engine.core.bll.CommandAsyncTask ) && ( id.equals ( task.getParameters ( ) . getEntityInfo ( ) . getId ( ) ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.Cleared ) ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.ClearFailed ) ) ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
public void customPropertiesNetworkRemoved ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createManagementNetworkNic ( "eth0" ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; mockExistingIfaces ( iface ) ; iface.setNetworkName ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNetworkRemoved ( helper , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void customPropertiesNetworkRemoved ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createManagementNetworkNic ( "eth0" ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; mockExistingIfaces ( iface ) ; iface.setNetworkName ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNetworkRemoved ( helper , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus pollEntityIfSupported ( org.ovirt.engine.core.bll.CommandBase < ? > cmd ) { if ( ! ( cmd instanceof org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ) { log.error ( "Command id: '{}': entity polling isn't supported, will retry to poll the job soon" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; return null ; } try { return ( ( org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ( cmd ) ) . poll ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Command id: '{}': failed to poll the command entity" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus handleUndeterminedJobStatus ( org.ovirt.engine.core.bll.CommandBase < ? > cmd , boolean jobsReportedByHost ) { if ( isEntityPollingSupported ( cmd ) ) { return pollEntity ( cmd ) ; } if ( jobsReportedByHost ) { log.error ( ( "Command id: '{}': entity polling isn't supported and the job isn't reported by the host," + "assuming it failed so that the command execution will end." ) , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; return org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus.failed ; } log.error ( "Command id: '{}': entity polling isn't supported, will retry to poll the job soon" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; return null ; }
Source:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmType ( ) , _vds.getPmOptions ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue proxyNotFound ( ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; returnValue.setSucceeded ( false ) ; returnValue.setExceptionString ( ( ( "Failed to run Power Management command on Host " + ( getNameOrId ( _vds ) ) ) + " no running proxy Host was found" ) ) ; return returnValue ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdByName ( java.lang.String storageDomainName ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > storageDomains = getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; for ( org.ovirt.engine.api.model.StorageDomain storageDomain : storageDomains ) { if ( storageDomain.getStorageName ( ) . equals ( storageDomainName ) ) { return storageDomain.getId ( ) ; } } return null ; }

Target:
public org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentsResource getAttachmentsResource ( ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentsResource ( vmId ) ) ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private boolean hasSnappableDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ! ( vm.getImages ( ) . isEmpty ( ) ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
private void updateActionAvailability ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { if ( volumeEntity == null ) { return ; } getNewSessionCommand ( ) . setIsAvailable ( true ) ; getRemoveSessionCommand ( ) . setIsAvailable ( false ) ; getStartSessionCommand ( ) . setIsAvailable ( false ) ; getStopSessionCommand ( ) . setIsAvailable ( false ) ; getSessionOptionsCommand ( ) . setIsAvailable ( false ) ; getViewSessionDetailsCommand ( ) . setIsAvailable ( false ) ; }

Target:
private void updateActionAvailability ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { if ( volumeEntity == null ) { return ; } getNewSessionCommand ( ) . setIsAvailable ( true ) ; getRemoveSessionCommand ( ) . setIsAvailable ( false ) ; getStartSessionCommand ( ) . setIsAvailable ( false ) ; getStopSessionCommand ( ) . setIsAvailable ( false ) ; getSessionOptionsCommand ( ) . setIsAvailable ( false ) ; getViewSessionDetailsCommand ( ) . setIsAvailable ( false ) ; getRefreshSessionsCommand ( ) . setIsAvailable ( true ) ; }
Source:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.OK ) ; onFinish ( cmdId ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . getImageId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }
Source:
private void VolumeType_SelectedItemChanged ( ) { UpdateVolumeFormat ( ) ; }

Target:
private void VolumeType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned : ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getstorage_type ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }
Source:
public static void GetSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
Source:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable e ) { java.lang.String msg = "Failed to encrypt the current value" ; org.apache.log4j.Logger.getLogger ( org.ovirt.engine.core.config.EngineConfig.class ) . debug ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }

Target:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable e ) { java.lang.String msg = "Failed to encrypt the current value" ; org.apache.log4j.Logger.getLogger ( org.ovirt.engine.core.config.EngineConfig.class ) . debug ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }
Source:
protected void EndWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getCompensationContext ( ) ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: EndAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }

Target:
protected void endWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getCompensationContext ( ) ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: EndAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.network.NetworkView networkView ) { java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText = new java.util.LinkedHashMap < > ( ) ; if ( networkView.isVmNetwork ( ) ) { imagesToText.put ( vmImage , constants.vmItemInfo ( ) ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.NetworkRoleColumnHelper.getTooltip ( imagesToText ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.network.NetworkView networkView ) { java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText = new java.util.LinkedHashMap < > ( ) ; if ( networkView.isVmNetwork ( ) ) { imagesToText.put ( vmImage , org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabNetworkView.constants.vmItemInfo ( ) ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.NetworkRoleColumnHelper.getTooltip ( imagesToText ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { return new org.ovirt.engine.core.common.businessentities.DiskImage ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) , new java.util.Date ( ) , new java.util.Date ( ) , 1L , "1" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "2" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , 1L , diskId , org.ovirt.engine.core.common.businessentities.ImageStatus.OK , new java.util.Date ( ) , "" , org.ovirt.engine.core.common.businessentities.VmEntityType.VM , 1 , null , null , org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED , false ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.core.common.businessentities.DiskImage di = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; di.setActive ( false ) ; di.setId ( diskId ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }
Source:
void AddVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }

Target:
void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . save ( stats ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; }
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void InitOSType ( ) { getOSType ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetOSList ( ) ) ; getOSType ( ) . setSelectedItem ( VmOsType.Unassigned ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VmOsType o1 , org.ovirt.engine.core.common.businessentities.VmOsType o2 ) { if ( o1.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return - 1 ; } if ( o2.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return 1 ; } return o1.name ( ) . compareTo ( o2.name ( ) ) ; }
Source:
public void rollback ( ) { super . rollback ( ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . removePool ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; poolPerDc.createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.cachedDefaultTimeZoneKeys.put ( timeZoneType , ( ( java.lang.String ) ( returnValue ) ) ) ; postUpdateDefaultTimeZone.run ( ) ; }

Target:
public java.lang.String getDisplayValue ( ) { if ( isDefault ( ) ) { final java.lang.String defaultTimeZoneKey = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( timeZoneType.getDefaultTimeZoneConfigurationKey ( ) ) ) ) ; if ( ! ( timeZoneType.getTimeZoneList ( ) . containsKey ( defaultTimeZoneKey ) ) ) { timeZoneKey = timeZoneType.getUltimateFallback ( ) ; } return timeZoneType.getTimeZoneList ( ) . get ( defaultTimeZoneKey ) ; } else { return timeZoneType.getTimeZoneList ( ) . get ( timeZoneKey ) ; } }
Source:
public void testGetBrickByServerIdAndDirectory ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_SERVER_ID , org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_DIRECTORY ) ; org.junit.Assert.assertNotNull ( brick ) ; org.junit.Assert.assertEquals ( brick.getServerId ( ) , org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_SERVER_ID ) ; org.junit.Assert.assertEquals ( brick.getBrickDirectory ( ) , org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_DIRECTORY ) ; }

Target:
public void testGetBrickByServerIdAndDirectory ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory ( FixturesTool.GLUSTER_BRICK_SERVER1 , FixturesTool.GLUSTER_BRICK_DIR1 ) ; org.junit.Assert.assertNotNull ( brick ) ; org.junit.Assert.assertEquals ( brick.getServerId ( ) , FixturesTool.GLUSTER_BRICK_SERVER1 ) ; org.junit.Assert.assertEquals ( brick.getBrickDirectory ( ) , FixturesTool.GLUSTER_BRICK_DIR1 ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getIsInternal ( ) . setEntity ( true ) ; } revealDiskPanel ( disk ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getIsInternal ( ) . setEntity ( true ) ; } revealDiskPanel ( disk ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > getGraphicsInfos ( ) { return vmDynamic.getGraphicsInfos ( ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterStorageQosListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterHostNetworkQosListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < > ( ) ; } log.debug ( "Executing generic query: {}" , data.getQuery ( ) ) ; return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDao < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < > ( ) ; } log.debug ( "Executing generic query: {}" , data.getQuery ( ) ) ; return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }