auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue removeImage ( org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , parameters ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { if ( ( e.getErrorCode ( ) ) == ( org.ovirt.engine.core.common.errors.EngineError.ImageDoesNotExistInDomainError ) ) { return createImageDoesNotExistInDomainReturnValue ( ) ; } throw e ; } }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue removeImage ( org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.DeleteImageGroup , parameters ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { if ( ( e.getErrorCode ( ) ) == ( org.ovirt.engine.core.common.errors.EngineError.ImageDoesNotExistInDomainError ) ) { return createImageDoesNotExistInDomainReturnValue ( ) ; } throw e ; } }
Source:
public void releaseMacsInCaseOfRollback ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.context.CompensationContext compensationContext = this . commandContext.getCompensationContext ( ) ; compensationContext.addListener ( compensationListener ) ; compensationContext.snapshotObject ( new org.ovirt.engine.core.common.businessentities.ReleaseMacsTransientCompensation ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , macPoolId , macs ) ) ; }

Target:
public void releaseMacsInCaseOfRollback ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.context.CompensationContext compensationContext = this . commandContext.getCompensationContext ( ) ; compensationContext.addListener ( compensationListener ) ; compensationContext.snapshotObject ( new org.ovirt.engine.core.common.businessentities.ReleaseMacsTransientCompensation ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , macPool.getId ( ) , macs ) ) ; }
Source:
private java.lang.String getMemoryVolumeForNewActiveSnapshot ( ) { return getParameters ( ) . isImportAsNewEntity ( ) ? org.apache.commons.lang.StringUtils.EMPTY : getMemoryVolumeFromActiveSnapshotInExportDomain ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
public void dispatchEvent ( org.ovirt.engine.core.notifier.filter.AuditLogEvent event , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( address ) ) { org.ovirt.engine.core.notifier.transport.smtp.Smtp.log.error ( ( "Address is empty, cannot distribute message." + ( event.getName ( ) ) ) ) ; } else { sendQueue.add ( new org.ovirt.engine.core.notifier.transport.smtp.Smtp.DispatchAttempt ( event , address ) ) ; } }

Target:
public void dispatchEvent ( org.ovirt.engine.core.notifier.filter.AuditLogEvent event , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( address ) ) { org.ovirt.engine.core.notifier.transport.smtp.Smtp.log.error ( "Address is empty, cannot distribute message. {}" , event.getName ( ) ) ; } else { sendQueue.add ( new org.ovirt.engine.core.notifier.transport.smtp.Smtp.DispatchAttempt ( event , address ) ) ; } }
Source:
private static void assertGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : result ) { org.junit.Assert.assertEquals ( "Template generation wasn't loaded as expected" , 1 , template.getDbGeneration ( ) ) ; } }

Target:
private static void assertGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : result ) { org.junit.jupiter.api.Assertions.assertEquals ( 1 , template.getDbGeneration ( ) , "Template generation wasn't loaded as expected" ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; return performCreate ( ActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; return performCreate ( ActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( returnValue ) ) ; vmGuideModel.nics = nics ; vmGuideModel.addNetworkPostData ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { updateOptionsPostData ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.ShutdownVmCommand.getSuspendedVm ( ) ) { return org.ovirt.engine.core.bll.ShutdownVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM : org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM_FAILED ; } else { return org.ovirt.engine.core.bll.ShutdownVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_INITIATED_SHUTDOWN_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SHUTDOWN_VM ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.ShutdownVmCommand.shouldSkipCommandExecutionCached ( ) ) { return org.ovirt.engine.core.bll.ShutdownVmCommand.logCommandExecutionSkipped ( "Shutdown VM" ) ; } if ( org.ovirt.engine.core.bll.ShutdownVmCommand.getSuspendedVm ( ) ) { return org.ovirt.engine.core.bll.ShutdownVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM : org.ovirt.engine.core.common.AuditLogType.USER_STOP_SUSPENDED_VM_FAILED ; } else { return org.ovirt.engine.core.bll.ShutdownVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_INITIATED_SHUTDOWN_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SHUTDOWN_VM ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ) { return ; } org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( ( "ImportExportEntities" . equals ( changedArgs.PropertyName ) ) && ( ( model.getEntities ( ) ) != null ) ) { imageList.setRowData ( model.getEntities ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ) { return ; } org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( ( "ImportExportEntities" . equals ( changedArgs.propertyName ) ) && ( ( model.getEntities ( ) ) != null ) ) { imageList.setRowData ( model.getEntities ( ) ) ; } }
Source:
public void Execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . ConnectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getvds_name ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . ConnectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getvds_name ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }
Source:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertThat ( "One domain should not be active" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; }

Target:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; domain3.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertThat ( "One domain should not be active" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , remoteUserName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForStorageAllocations ( ) ; return disksList ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
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:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase params ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( commandType , params ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage getDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setReadRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_RATE ) ; disk.setWriteRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_RATE ) ; disk.setReadLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_LATENCY ) ; disk.setWriteLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_LATENCY ) ; disk.setFlushLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.FLUSH_LATENCY ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setReadRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_RATE ) ; disk.setWriteRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_RATE ) ; disk.setReadLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_LATENCY ) ; disk.setWriteLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_LATENCY ) ; disk.setFlushLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.FLUSH_LATENCY ) ; return disk ; }
Source:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { boolean prestartVmSucceeded = false ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.CanAttachNonPrestartedVmToUser ( vmGuid ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmGuid ) ; if ( runVmAsStateless ( vmToPrestart ) ) { prestartVmSucceeded = true ; } } return prestartVmSucceeded ; }

Target:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { boolean prestartVmSucceeded = false ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; if ( runVmAsStateless ( vmToPrestart ) ) { prestartVmSucceeded = true ; } } return prestartVmSucceeded ; }
Source:
public static < T > org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < T > makeSortable ( org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < T > column , java.lang.String sortBy ) { if ( sortBy == null ) { column.makeSortable ( ) ; } else if ( ! ( sortBy.equals ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.empty ( ) ) ) ) { column.makeSortable ( sortBy ) ; } return column ; }

Target:
public static < C extends org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < T > , T > C makeSortable ( C column , java.lang.String sortBy ) { if ( sortBy == null ) { column.makeSortable ( ) ; } else if ( ! ( sortBy.equals ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.empty ( ) ) ) ) { column.makeSortable ( sortBy ) ; } return column ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }
Source:
private java.util.List < java.lang.String > readPubKey ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue readPubKeyReturnvalue = runInternalQuery ( VdcQueryType.GetGlusterHostPublicKeys , new org.ovirt.engine.core.common.queries.IdQueryParameters ( upServer.getId ( ) ) ) ; if ( readPubKeyReturnvalue.getSucceeded ( ) ) { return ( ( java.util.List < java.lang.String > ) ( readPubKeyReturnvalue.getReturnValue ( ) ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_GEO_REP_PUB_KEY_FETCH_FAILED , readPubKeyReturnvalue.getExceptionString ( ) ) ; return null ; } }

Target:
protected boolean setUpPasswordlessSSH ( org.ovirt.engine.core.compat.Guid masterUpServerId , java.util.Set < org.ovirt.engine.core.compat.Guid > remoteServerSet , java.lang.String userName ) { java.util.List < java.lang.String > pubKeys = readPubKey ( masterUpServerId ) ; boolean canProceed = ( pubKeys != null ) && ( ( pubKeys.size ( ) ) > 0 ) ; if ( canProceed ) { canProceed = updatePubKeysToRemoteHosts ( pubKeys , remoteServerSet , userName ) ; } return canProceed ; }
Source:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getNetworkProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }
Source:
public void saveGlusterServerHook ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid hostId , java.lang.String checksum , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus status ) { getCallsHandler ( ) . executeModification ( "InsertGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "host_id" , hostId ) . addValue ( "checksum" , checksum ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }

Target:
public void saveGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook ) { getCallsHandler ( ) . executeModification ( "InsertGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , serverHook.getHookId ( ) ) . addValue ( "server_id" , serverHook.getServerId ( ) ) . addValue ( "hook_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getStatus ( ) ) ) . addValue ( "content_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( serverHook.getContentType ( ) ) ) . addValue ( "checksum" , serverHook.getChecksum ( ) ) ) ; }
Source:
public void setValueA ( java.lang.Integer value ) { this . valueA = value ; java.lang.String percentage = value + "%" ; percentageLabelA.setText ( ( value < 10 ? "" : percentage ) ) ; percentageLabelA.setStyleName ( style.percentageLabel ( ) ) ; percentageBarA.setWidth ( percentage ) ; percentageBarA.setVisible ( ( value != 0 ) ) ; percentageBarA.setTitle ( percentage ) ; }

Target:
public void setZeroValue ( ) { percentageBarA.setVisible ( true ) ; percentageBarA.setTitle ( title ) ; percentageBarA.setStyleName ( style.empty ( ) ) ; percentageBarA.setWidth ( ( ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.FULL_WIDTH ) + "%" ) ) ; percentageLabelA.setText ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.ZERO ) ; percentageLabelA.setStyleName ( style.percentageLabelBlack ( ) ) ; }
Source:
public void storageAndPoolExists ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; sd.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStorageDomain ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sd ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void storageAndPoolExists ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; sd.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStorageDomain ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sd ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( volumeName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( "" ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionDelete ( volumeName , remoteHost , remoteVolumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.dao.DbGroupDao dao = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getAdGroupDao ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupToAdd = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getParameters ( ) . getGroupToAdd ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup dbGroup = dao.getByExternalId ( groupToAdd.getDomain ( ) , groupToAdd.getExternalId ( ) ) ; if ( dbGroup == null ) { dao.save ( groupToAdd ) ; } else { dao.update ( dbGroup ) ; groupToAdd = dbGroup ; } setActionReturnValue ( groupToAdd.getId ( ) ) ; org.ovirt.engine.core.bll.aaa.AddGroupCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup groupToAdd = org.ovirt.engine.core.bll.aaa.AddGroupCommand.getParameters ( ) . getGroupToAdd ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup dbGroup = dbGroupDao.getByExternalId ( groupToAdd.getDomain ( ) , groupToAdd.getExternalId ( ) ) ; if ( dbGroup == null ) { dbGroupDao.save ( groupToAdd ) ; } else { dbGroupDao.update ( dbGroup ) ; groupToAdd = dbGroup ; } setActionReturnValue ( groupToAdd.getId ( ) ) ; org.ovirt.engine.core.bll.aaa.AddGroupCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VMHostDevice getById ( java.lang.String id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + id ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.HostDevice.class , org.ovirt.engine.sdk.decorators.VMHostDevice.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostStorageConnectionExtension getById ( java.lang.String id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + id ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.StorageConnectionExtension.class , org.ovirt.engine.sdk.decorators.HostStorageConnectionExtension.class ) ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void GetRedirectServletReportsPage ( 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.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { }

Target:
private void Spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; UpdateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }
Source:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) { return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTab ( ( ( org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) { return new org.ovirt.engine.ui.common.widget.tab.DynamicTab ( ( ( org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }

Target:
public static org.ovirt.engine.ui.common.widget.tab.TabDefinition createTab ( com.gwtplatform.mvp.client.TabData tabData , org.ovirt.engine.ui.common.widget.tab.AbstractTabPanel tabPanel , com.google.gwt.event.shared.EventBus eventBus ) { if ( tabData instanceof org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) { return new org.ovirt.engine.ui.common.widget.tab.GroupedTab ( ( ( org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ) ( tabData ) ) , tabPanel ) ; } else if ( tabData instanceof org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) { return new org.ovirt.engine.ui.common.widget.tab.DynamicTab ( ( ( org.ovirt.engine.ui.common.widget.tab.DynamicTabData ) ( tabData ) ) , tabPanel , eventBus ) ; } else { return new org.ovirt.engine.ui.common.widget.tab.SimpleTab ( tabData , tabPanel ) ; } }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( templateDiskImage.getId ( ) , templateId ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskVmElementDao ( ) . save ( dve ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }
Source:
private boolean validateCanUpdateReadOnly ( ) { if ( ( ( shouldUpdateReadOnly ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }

Target:
private boolean validateCanUpdateReadOnly ( ) { if ( ( ( updateReadOnlyRequested ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }
Source:
private static int GetNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }
Source:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; } catch ( java.lang.Exception e ) { } }

Target:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; } catch ( java.lang.Exception e ) { logger.log ( java.util.logging.Level.WARNING , ( "Failed loading VNC data. Exception message: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }
Source:
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 ; }

Target:
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.VDSGroup > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }
Source:
public void setItems ( java.util.Collection < org.ovirt.engine.core.common.businessentities.AuditLog > value ) { java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > list = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > ) ( value ) ) ; if ( list != null ) { java.util.Collections.sort ( list , java.util.Collections.reverseOrder ( new org.ovirt.engine.ui.uicommonweb.Linq.AuditLogComparer ( ) ) ) ; } super . setItems ( list ) ; }

Target:
public void setItems ( java.util.Collection < org.ovirt.engine.core.common.businessentities.AuditLog > value ) { java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > list = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > ) ( value ) ) ; if ( list != null ) { java.util.Collections.sort ( list , java.util.Collections.reverseOrder ( Linq.AuditLogComparer ) ) ; } super . setItems ( list ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.GLUSTER_NOT_SUPPORTED ) ; }

Target:
public void clusterWithNoCpu ( ) { createCommandWithNoCpuName ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; allQueriesForVms ( ) ; initAndAssertValidation ( true ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.Disk disk = getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; } } return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }
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 ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }

Target:
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 ( ) ) ; } } } ) ; } }
Source:
private static void assertValidGetByAdElement ( java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getad_element_id ( ) ) ; } }

Target:
private static void assertValidGetByAdElement ( java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }
Source:
private static org.ovirt.engine.api.model.QosType mapModelQosType ( java.lang.String type ) { switch ( type ) { case "storage" : return org.ovirt.engine.api.model.QosType.STORAGE ; case "cpu" : return org.ovirt.engine.api.model.QosType.CPU ; case "network" : return org.ovirt.engine.api.model.QosType.NETWORK ; case "hostnetwork" : return org.ovirt.engine.api.model.QosType.HOSTNETWORK ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "QosType %s cannot be mapped to %s: " , type , org.ovirt.engine.api.model.QosType.class ) ) ; } }

Target:
private static org.ovirt.engine.api.model.QosType mapModelQosType ( java.lang.String type ) { switch ( type.toLowerCase ( ) ) { case "storage" : return org.ovirt.engine.api.model.QosType.STORAGE ; case "cpu" : return org.ovirt.engine.api.model.QosType.CPU ; case "network" : return org.ovirt.engine.api.model.QosType.NETWORK ; case "hostnetwork" : return org.ovirt.engine.api.model.QosType.HOSTNETWORK ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "QosType %s cannot be mapped to %s: " , type , org.ovirt.engine.api.model.QosType.class ) ) ; } }
Source:
private boolean hasRunningChildCommands ( ) { org.ovirt.engine.core.compat.Guid rootCmdId = getParameters ( ) . getDbAsyncTask ( ) . getRootCommandId ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity entity : coco.getChildCmdsByParentCmdId ( rootCmdId ) ) { if ( ( ! ( hasCompleted ( entity ) ) ) && ( ! ( coco.doesCommandContainAsyncTask ( entity.getId ( ) ) ) ) ) { return true ; } } return false ; }

Target:
private boolean hasRunningChildCommands ( ) { org.ovirt.engine.core.compat.Guid rootCmdId = getParameters ( ) . getDbAsyncTask ( ) . getRootCommandId ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity entity : coco.getChildCmdsByRootCmdId ( rootCmdId ) ) { if ( ( ! ( hasCompleted ( entity ) ) ) && ( ! ( coco.doesCommandContainAsyncTask ( entity.getId ( ) ) ) ) ) { return true ; } } return false ; }