auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public void testIsNotHeHostWithVmCountOfZeroAndHeVmAssigned ( ) { final int vmCount = 0 ; final boolean isHostedEngine = true ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.Assert.assertFalse ( isHostedEngineHost ) ; }

Target:
public void testIsNotHeHostWithVmCountOfZeroAndHeVmAssigned ( ) { final int vmCount = 0 ; final boolean isHostedEngine = true ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( isHostedEngineHost ) ; }
Source:
private void extractTokenFromRequest ( javax.servlet.http.HttpServletRequest req ) { java.util.List < java.lang.String > header = java.util.Collections.list ( req.getHeaders ( XsrfRpcRequestBuilder.XSRF_TOKEN_HEADER ) ) ; if ( ( header != null ) && ( ( header.size ( ) ) == 1 ) ) { this . token = new com.google.gwt.user.client.rpc.XsrfToken ( header.get ( 0 ) ) ; } }

Target:
private com.google.gwt.user.client.rpc.XsrfToken extractTokenFromRequest ( ) { java.util.List < java.lang.String > header = java.util.Collections.list ( getThreadLocalRequest ( ) . getHeaders ( XsrfRpcRequestBuilder.XSRF_TOKEN_HEADER ) ) ; com.google.gwt.user.client.rpc.XsrfToken result = null ; if ( ( header != null ) && ( ( header.size ( ) ) == 1 ) ) { result = new com.google.gwt.user.client.rpc.XsrfToken ( header.get ( 0 ) ) ; } return result ; }
Source:
public void testInterfaceExistsWhenInterfaceIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testInterfaceExistsWhenInterfaceIsNull ( ) throws java.lang.Exception { java.lang.String failingSlaveName = "slaveName" ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_HAVING_NAME_DOES_NOT_EXIST ; java.lang.String nicNameReplacement = org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , failingSlaveName ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceExists ( failingSlaveName ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , nicNameReplacement ) ) ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = getBackend ( ) . runInternalAction ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; getReturnValue ( ) . getTaskIdList ( ) . addAll ( vdcRetValue.getInternalTaskIdList ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = getBackend ( ) . runInternalAction ( getImagesActionType ( ) , buildModeOrCopyImageGroupParameters ( containerID , disk ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }
Source:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( Guid.Empty , org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) , true ) ; } }

Target:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( Guid.Empty , runVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) , true ) ; } }
Source:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }

Target:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( "network" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "network" ) ; mockExistingIfaces ( nic ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.ApplyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.applyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( "status" , status.toString ( ) ) ; values.put ( "info" , " " ) ; return values ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( GlusterConstants.JOB_STATUS , status.toString ( ) ) ; values.put ( GlusterConstants.JOB_INFO , " " ) ; return values ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveVmCommand.getActionState ( ) ) { case EXECUTE : if ( hasImages ) { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } else { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } case END_FAILURE : case END_SUCCESS : default : return org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveVmCommand.getActionState ( ) ) { case EXECUTE : if ( hasImages ) { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } else { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } case END_FAILURE : case END_SUCCESS : default : return disksLeftInVm.isEmpty ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }

Target:
public static java.util.List < java.lang.Integer > getOsIds ( ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . unless ( ( ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) || ( ( ( ipConfiguration.getAddress ( ) ) != null ) && ( ( ipConfiguration.getNetmask ( ) ) != null ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }
Source:
public void canDoActionVmShareableDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = initDiskImage ( diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void canDoActionVmShareableDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = initDiskImage ( diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ( isShareableDiskEnabled && ( ( getVm ( ) ) != null ) ) && ( getVm ( ) . isDown ( ) ) ) ) ; }

Target:
protected boolean isEditEnabled ( ) { return ( ( ( getIsFloating ( ) ) || ( getIsNew ( ) ) ) || ( getVm ( ) . isDown ( ) ) ) || ( ! ( getDisk ( ) . getPlugged ( ) ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.setUpStorageServerConnection ( ) ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainsResourceTest.verifyStorageDomain ( resource.get ( ) , 0 ) ; }

Target:
public void testRemoveCantDo ( ) throws java.lang.Exception { doTestBadRemove ( false , true , org.ovirt.engine.api.restapi.resource.CANT_DO ) ; }
Source:
private org.ovirt.engine.core.common.interfaces.IVdcUser getCurrentUser ( ) { java.lang.String sessionId = org.ovirt.engine.core.bll.GetRolesForDelegationByUserQuery.getParameters ( ) . getSessionId ( ) ; org.ovirt.engine.core.common.interfaces.IVdcUser user = null ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( sessionId ) ) ) { user = org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . getUser ( sessionId , false ) ; } return user ; }

Target:
private org.ovirt.engine.core.common.interfaces.IVdcUser getCurrentUser ( ) { java.lang.String sessionId = org.ovirt.engine.core.bll.GetRolesForDelegationByUserQuery.getParameters ( ) . getSessionId ( ) ; org.ovirt.engine.core.common.interfaces.IVdcUser user = null ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( sessionId ) ) { user = org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . getUser ( sessionId , false ) ; } return user ; }
Source:
public void canRemoveIncreaseReplica ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedReplicatedVolume ( volumeId1 , 12 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 5 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT ) == ( validationResult.getMessage ( ) ) ) ) ; }

Target:
public void canRemoveIncreaseReplica ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedReplicatedVolume ( volumeId1 , 12 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 5 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT ) == ( validationResult.getMessage ( ) ) ) ) ; }
Source:
public void testRemoveStorageDomainNull ( ) { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveStorageDomainNull ( ) { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyBadRequest ( wae ) ; } }
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = ( progress < 70 ) ? "#669966" : progress < 95 ? "#FF9900" : "#FF0000" ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }

Target:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = getColorByProgress ( progress ) ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_SAVE ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_SAVE ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }
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 testRemove ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; dao.removeBrick ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNull ( dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ) ; }
Source:
public static void GetVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static 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.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.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private void cancelTasks ( ) { if ( hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status ) { setCommandStatus ( status , true ) ; }
Source:
private void addManagementNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.ManagementNetwork ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private void addNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) + "2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }
Source:
protected void revertTask ( ) { if ( getEnclosingCommand ( ) . getReturnValue ( ) . getSucceeded ( ) ) { getEnclosingCommand ( ) . getParameters ( ) . setExecutionIndex ( 0 ) ; } }

Target:
protected void revertTask ( ) { org.ovirt.engine.core.compat.Guid targetStorageDomainId = getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) ; org.ovirt.engine.core.compat.Guid destinationImageId = getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . get ( destinationImageId ) ; if ( ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ) { getEnclosingCommand ( ) . getParameters ( ) . setExecutionIndex ( 0 ) ; } }
Source:
public static 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 ) ; }

Target:
public static void getTemplateNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosList = ( returnValue == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; qosList.add ( 0 , NetworkQoSModel.EMPTY_QOS ) ; return qosList ; }
Source:
public void updateGeneralTabValidity ( boolean isValid ) { if ( isValid ) { generalTab.markAsValid ( ) ; } else { generalTab.markAsInvalid ( null ) ; } }

Target:
protected void populateTabMap ( ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.CLUSTERS_TAB , this . clusterTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.PROFILES_TAB , this . profilesTab ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.AbstractNetworkPopupView.getTabNameMapping ( ) . put ( TabName.SUBNET_TAB , this . subnetTab ) ; }
Source:
protected void addDiskPermissions ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > newDiskImageIds = new java.util.ArrayList ( srcDiskIdToTargetDiskIdMapping.values ( ) ) ; org.ovirt.engine.core.common.businessentities.Permissions [ ] permsArray = new org.ovirt.engine.core.common.businessentities.Permissions [ newDiskImageIds.size ( ) ] ; for ( int i = 0 ; i < ( newDiskImageIds.size ( ) ) ; i ++ ) { permsArray [ i ] = new org.ovirt.engine.core.common.businessentities.Permissions ( getUserIdOfDiskOperator ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , newDiskImageIds.get ( i ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; } org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( permsArray ) ; }

Target:
protected void addDiskPermissions ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > newDiskImageIds = new java.util.ArrayList ( srcDiskIdToTargetDiskIdMapping.values ( ) ) ; org.ovirt.engine.core.common.businessentities.Permission [ ] permsArray = new org.ovirt.engine.core.common.businessentities.Permission [ newDiskImageIds.size ( ) ] ; for ( int i = 0 ; i < ( newDiskImageIds.size ( ) ) ; i ++ ) { permsArray [ i ] = new org.ovirt.engine.core.common.businessentities.Permission ( getUserIdOfDiskOperator ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , newDiskImageIds.get ( i ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; } org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( permsArray ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry : storageDomains ) { org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; } }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.OpenStackImageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry : storageDomains ) { org.ovirt.engine.core.bll.provider.OpenStackImageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.OpenStackImageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo host = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ( obj ) ) ; return ( ( java.util.Objects.equals ( getUuid ( ) , host.getUuid ( ) ) ) && ( java.util.Objects.equals ( getHostnameOrIp ( ) , host.getHostnameOrIp ( ) ) ) ) && ( java.util.Objects.equals ( getStatus ( ) , host.getStatus ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo host = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ( obj ) ) ; return ( ( java.util.Objects.equals ( uuid , host.uuid ) ) && ( java.util.Objects.equals ( hostnameOrIp , host.hostnameOrIp ) ) ) && ( java.util.Objects.equals ( status , host.status ) ) ; }
Source:
public boolean isDomainExistAndActive ( java.util.List < java.lang.String > messages ) { if ( ( storageDomain ) == null ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.toString ( ) ) ; return false ; } if ( ( ( storageDomain.getstatus ( ) ) == null ) || ( ( storageDomain.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL.toString ( ) ) ; return false ; } return true ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { if ( ( storageDomain ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( ( storageDomain.getstatus ( ) ) == null ) || ( ( storageDomain.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( null ) ; } }

Target:
private void updateTotalDiskSize ( ) { java.lang.Integer available = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( null ) ; } }
Source:
org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( java.util.List < java.util.Map < java.lang.String , java.lang.String > > migrationIds ) { org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( sourceSolution , migrationIds , customDrlFiles ) ; }

Target:
org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( java.util.List < java.util.Map < java.lang.String , java.lang.String > > migrationIds ) { org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( sourceSolution , migrationIds , java.util.Collections.< java.lang.String > emptySet ( ) , customDrlFiles ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.logNullParameters ( task ) ; org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; parameterSource.addValue ( "storage_pool_id" , task.getStoragePoolId ( ) ) ; getCallsHandler ( ) . executeModification ( "Updateasync_tasks" , parameterSource ) ; }

Target:
public void saveOrUpdate ( org.ovirt.engine.core.common.businessentities.AsyncTask task ) { org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.AsyncTaskParameterSource parameterSource = getTaskParameterSource ( task ) ; parameterSource.addValue ( "started_at" , task.getStartTime ( ) ) ; parameterSource.addValue ( "storage_pool_id" , task.getStoragePoolId ( ) ) ; parameterSource.addValue ( "async_task_type" , task.getTaskType ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertOrUpdateAsyncTasks" , parameterSource ) ; }
Source:
protected void ExecuteVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - entered , starting logic to add VDS {0}" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - VDS {0} was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . AddVds ( vds , false ) ; }

Target:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - entered , starting logic to add VDS {0}" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.infoFormat ( "AddVds - VDS {0} was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . AddVds ( vds , false ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.UICommand getOkCommand ( ) { return okCommand ; }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSetupNetworks" ) ) { onSetupNetworks ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
public void isUSBEnabledByDefault ( 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 ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { runQueryByIdParameter ( VdcQueryType.IsClusterEmpty , aQuery , clusterId ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
protected void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status ) { this . commandStatus = status ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ) ; } return null ; }

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