auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void endWithFailure ( ) { if ( isVmRunningStateless ( ) ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createSnapshotParameters = buildCreateSnapshotParameters ( ) ; createSnapshotParameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , createSnapshotParameters , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( isVmRunningStateless ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , buildCreateSnapshotParametersForEndAction ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.ovirt.engine.core.dao.LunDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }

Target:
private void prepareMocks ( ) { vdsBrokerFrontendMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontendMock ) . when ( getQuery ( ) ) . getVdsBroker ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionLunMapDao ( ) ) . thenReturn ( storageServerConnectionLunMapDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( lunDao ) ; }
Source:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model ) { this . model = model ; setupDefaultVmStyles ( ) ; getView ( ) . updateRunButton ( getRunCommand ( ) , model.isPool ( ) ) ; getView ( ) . updateShutdownButton ( getShutdownCommand ( ) ) ; getView ( ) . updateSuspendButton ( getSuspendCommand ( ) ) ; getView ( ) . edit ( model ) ; if ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) { setSelectedItem ( ) ; } }

Target:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model ) { this . model = model ; setupDefaultVmStyles ( ) ; getView ( ) . updateRunButton ( getRunCommand ( ) , model.isPool ( ) ) ; getView ( ) . updateShutdownButton ( getShutdownCommand ( ) ) ; getView ( ) . updateSuspendButton ( getSuspendCommand ( ) ) ; getView ( ) . updateRebootButton ( getRebootCommand ( ) ) ; getView ( ) . edit ( model ) ; if ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) { setSelectedItem ( ) ; } }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( ( ( ( ( "<span id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" style=\"vertical-align: middle;\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( getTitle ( value ) ) ) ) + "\">" ) ) ; sb.append ( imageHtml ) ; sb.appendHtmlConstant ( "</span>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( ( ( ( ( "<span id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" style=\"vertical-align: middle;\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( getTitle ( value ) ) ) ) + "\">" ) ) ; sb.append ( imageHtml ) ; sb.appendHtmlConstant ( "</span>" ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public static boolean CanRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.IsVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }

Target:
public static boolean canRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.IsVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { java.lang.String rawData = ( value != null ) ? value.asString ( ) : "" ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , getRenderedValue ( rawData ) ) ) ; }

Target:
com.google.gwt.safehtml.shared.SafeHtml getRenderedValue ( com.google.gwt.safehtml.shared.SafeHtml value ) { java.lang.String result = value.asString ( ) ; if ( ( ( maxTextLength ) > 0 ) && ( ( result.length ( ) ) > ( maxTextLength ) ) ) { result = result.substring ( 0 , java.lang.Math.max ( ( ( maxTextLength ) - ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX.length ( ) ) ) , 0 ) ) ; result = result + ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( result ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
public void setPopupKeyPressHandler ( org.ovirt.engine.ui.common.widget.dialog.PopupNativeKeyPressHandler keyPressHandler ) { popup.setKeyPressHandler ( keyPressHandler ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public java.util.Date getCertificationExpirationDate ( ) { if ( ( ( this . sslSession ) == null ) || ( ! ( this . sslSession.isValid ( ) ) ) ) { throw new java.lang.IllegalStateException ( "SSL session is not available" ) ; } try { return ( ( java.security.cert.X509Certificate ) ( this . sslSession.getPeerCertificates ( ) [ 0 ] ) ) . getNotAfter ( ) ; } catch ( javax.net.ssl.SSLPeerUnverifiedException e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.logException ( org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log , "Failed to get peer certificates" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
public java.util.List < java.security.cert.Certificate > getPeerCertificates ( ) { try { javax.net.ssl.SSLSession sslSession = nioEngine.getSSLEngine ( ) . getSession ( ) ; if ( ( sslSession == null ) || ( ! ( sslSession.isValid ( ) ) ) ) { throw new java.lang.IllegalStateException ( "SSL session is invalid" ) ; } return java.util.Arrays.asList ( sslSession.getPeerCertificates ( ) ) ; } catch ( javax.net.ssl.SSLPeerUnverifiedException e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.logException ( org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log , "Failed to get peer certificates" , e ) ; } return null ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.NfsVersion version , java.lang.String outgoing ) { switch ( version ) { case V3 : return NfsVersion.V3.value ( ) ; case V4 : return NfsVersion.V4.value ( ) ; case AUTO : return NfsVersion.AUTO.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.NfsVersion version , java.lang.String outgoing ) { switch ( version ) { case V3 : return NfsVersion.V3.value ( ) ; case V4 : return NfsVersion.V4.value ( ) ; case V4_1 : return NfsVersion.V4_1.value ( ) ; case AUTO : return NfsVersion.AUTO.value ( ) ; default : return null ; } }
Source:
public void testDelay ( ) throws java.lang.Throwable { org.ovirt.engine.core.uutils.ssh.SSHDialogTest.ReaderSink sink = new org.ovirt.engine.core.uutils.ssh.SSHDialogTest.ReaderSink ( 10 ) ; sshDialog.setSoftTimeout ( ( 60 * 1000 ) ) ; sshDialog.setHardTimeout ( ( 60 * 1000 ) ) ; sshDialog.connect ( ) ; sshDialog.authenticate ( ) ; sshDialog.executeCommand ( sink , "x=0;while [ $x -lt 100 ]; do echo line$x; x=$(($x+1)); done" , null ) ; sink.exception ( ) ; org.junit.Assert.assertEquals ( "line99" , sink.getLast ( ) ) ; }

Target:
public void testDelay ( ) throws java.lang.Throwable { org.ovirt.engine.core.uutils.ssh.SSHDialogTest.ReaderSink sink = new org.ovirt.engine.core.uutils.ssh.SSHDialogTest.ReaderSink ( 10 ) ; sshDialog.setSoftTimeout ( ( 60 * 1000 ) ) ; sshDialog.setHardTimeout ( ( 60 * 1000 ) ) ; sshDialog.connect ( ) ; sshDialog.authenticate ( ) ; sshDialog.executeCommand ( sink , "x=0;while [ $x -lt 100 ]; do echo line$x; x=$(($x+1)); done" , null ) ; sink.exception ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( "line99" , sink.getLast ( ) ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue response ) { if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModel.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModel.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue response ) { if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModelBase.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModelBase.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public void testGetAllForProvider ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllForProvider ( FixturesTool.PROVIDER_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : result ) { org.junit.Assert.assertEquals ( FixturesTool.PROVIDER_ID , network.getProvidedBy ( ) . getProviderId ( ) ) ; } }

Target:
public void testGetAllForProvider ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllForProvider ( FixturesTool.PROVIDER_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.PROVIDER_ID , network.getProvidedBy ( ) . getProviderId ( ) ) ; } }
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 ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; vmGuideModel.quotaEnforcementType = ( dataCenter != null ) ? dataCenter.getQuotaEnforcementType ( ) : org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ; vmGuideModel.AddDiskPostData ( ) ; }

Target:
private void AddDiskUpdateData ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmGuideModel.disks = disks ; vmGuideModel.AddDiskPostData ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void create10GBVmWith11GbAvailableAndA5GbBuffer ( ) throws java.lang.Exception { mockStorageDomainDaoGetForStoragePool ( ) ; mockMaxPciSlots ( ) ; mockStorageDomainDaoGetAllForStoragePool ( ) ; mockUninterestingMethods ( ) ; mockGetAllSnapshots ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.Matchers.anyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void create10GBVmWith11GbAvailableAndA5GbBuffer ( ) throws java.lang.Exception { mockStorageDomainDaoGetForStoragePool ( ) ; mockMaxPciSlots ( ) ; mockStorageDomainDaoGetAllForStoragePool ( ) ; mockUninterestingMethods ( ) ; mockGetAllSnapshots ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , java.lang.String [ ] devicesList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = null ; if ( devicesList != null ) { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , devicesList ) ; } else { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( 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 freeze ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.freeze ( vmId ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; org.ovirt.engine.core.compat.Guid volumeId = ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ; if ( ( ( java.lang.Boolean ) ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) ) ) { optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volumeId ) ) ; } } }

Target:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( ( ( java.lang.Boolean ) ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) ) ) { optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volume ) ) ; } } }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DbUser user ) { if ( user.getLastAdminCheckStatus ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.isGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DbUser user ) { if ( user.isAdmin ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.isGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }
Source:
public void testStorageDomainTemplateLinks ( ) { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( template ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainTemplateLinks ( ) { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( template ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
private void disableAllTabs ( ) { generalTab.disableContent ( ) ; poolTab.disableContent ( ) ; initialRunTab.disableContent ( ) ; consoleTab.disableContent ( ) ; hostTab.disableContent ( ) ; highAvailabilityTab.disableContent ( ) ; resourceAllocationTab.disableContent ( ) ; bootOptionsTab.disableContent ( ) ; customPropertiesTab.disableContent ( ) ; }

Target:
private void disableAllTabs ( ) { generalTab.disableContent ( ) ; poolTab.disableContent ( ) ; initialRunTab.disableContent ( ) ; consoleTab.disableContent ( ) ; hostTab.disableContent ( ) ; highAvailabilityTab.disableContent ( ) ; resourceAllocationTab.disableContent ( ) ; bootOptionsTab.disableContent ( ) ; customPropertiesTab.disableContent ( ) ; systemTab.disableContent ( ) ; oSTypeEditor.setEnabled ( false ) ; }
Source:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validationErrors , java.util.ArrayList < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }

Target:
public static void handleCustomPropertiesError ( java.util.List < org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils.ValidationError > validationErrors , java.util.List < java.lang.String > message ) { java.lang.String invalidSyntaxMsg = VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CUSTOM_VM_PROPERTIES_INVALID_SYNTAX.name ( ) ; java.util.List < java.lang.String > errorMessages = org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . generateErrorMessages ( validationErrors , invalidSyntaxMsg , org.ovirt.engine.core.bll.VmHandler.failureReasonsToVdcBllMessagesMap , org.ovirt.engine.core.bll.VmHandler.failureReasonsToFormatMessages ) ; message.addAll ( errorMessages ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getParameters ( ) . getStoragePoolId ( ) ; java.lang.String connection = org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getParameters ( ) . getConnection ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList ; if ( storagePoolId != null ) { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllByStoragePoolAndConnection ( storagePoolId , connection ) ; } else { domainsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForConnection ( connection ) ; } org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getQueryReturnValue ( ) . setReturnValue ( domainsList ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getParameters ( ) . getStoragePoolId ( ) ; java.lang.String connection = org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getParameters ( ) . getConnection ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList ; if ( storagePoolId != null ) { domainsList = storageDomainDao.getAllByStoragePoolAndConnection ( storagePoolId , connection ) ; } else { domainsList = storageDomainDao.getAllForConnection ( connection ) ; } org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsByConnectionQuery.getQueryReturnValue ( ) . setReturnValue ( domainsList ) ; }
Source:
private static java.lang.String getPath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.restapi.util.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }

Target:
private static java.lang.String getRelativePath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.restapi.util.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }
Source:
public void setEmulatedMachine ( org.ovirt.engine.core.compat.Guid vdsGroupId , java.lang.String emulatedMachine , boolean detectEmulatedMachine ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_id" , vdsGroupId ) . addValue ( "emulated_machine" , emulatedMachine ) . addValue ( "detect_emulated_machine" , detectEmulatedMachine ) ; getCallsHandler ( ) . executeModification ( "UpdateVdsGroupEmulatedMachine" , parameterSource ) ; }

Target:
public void setEmulatedMachine ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String emulatedMachine , boolean detectEmulatedMachine ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "emulated_machine" , emulatedMachine ) . addValue ( "detect_emulated_machine" , detectEmulatedMachine ) ; getCallsHandler ( ) . executeModification ( "UpdateClusterEmulatedMachine" , parameterSource ) ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private boolean noChangesDetected ( ) { return ( ( ( getNetworksToConfigure ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBondNames ( ) . isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionPause" ) . withParameter ( "volumeName" , masterVolumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }

Target:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "Try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }
Source:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress" , "address" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionAddress" , "address" ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dcLabels = ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ; stopProgress ( ) ; onExportChanged ( ) ; }

Target:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( getQos ( ) . getItems ( ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel providerModel = ( ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel ) ( model ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; dataCenters.add ( noneStoragePool ) ; providerModel.getDataCenter ( ) . setItems ( dataCenters ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.CinderProviderSupported , storagePool.getCompatibilityVersion ( ) . toString ( ) ) ) ) ; }
Source:
private void executeNewAndEdit ( final org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( getItems ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel > lineModelIterator = orderedDisksIterator ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) , vm ) ; storeNextDisk ( lineModelIterator , vm ) ; } } ) , vm.getId ( ) ) ; }

Target:
private void executeNewAndEdit ( final org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( getItems ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel > lineModelIterator = orderedDisksIterator ( disks , vm ) ; storeNextDisk ( lineModelIterator , vm ) ; } } ) , vm.getId ( ) ) ; }
Source:
protected long getEngineSessionSeqId ( ) { java.lang.String sessionId = getParameters ( ) . getSessionId ( ) ; if ( ( sessionId == null ) && ( ( getContext ( ) ) != null ) ) { sessionId = getContext ( ) . getEngineContext ( ) . getSessionId ( ) ; } if ( sessionId == null ) { throw new java.lang.RuntimeException ( ( "No sessionId found for command " + ( getClass ( ) . getName ( ) ) ) ) ; } return org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . getEngineSessionSeqId ( sessionId ) ; }

Target:
protected long getEngineSessionSeqId ( ) { java.lang.String sessionId = getParameters ( ) . getSessionId ( ) ; if ( ( sessionId == null ) && ( ( getContext ( ) ) != null ) ) { sessionId = getContext ( ) . getEngineContext ( ) . getSessionId ( ) ; } if ( sessionId == null ) { throw new java.lang.RuntimeException ( ( "No sessionId found for command " + ( getClass ( ) . getName ( ) ) ) ) ; } return getSessionDataContainer ( ) . getEngineSessionSeqId ( sessionId ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedVolume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ; getBrickListModel ( ) . setVolumeEntity ( selectedVolume ) ; getGeoRepListModel ( ) . setEntity ( selectedVolume ) ; }

Target:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedVolume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ; getBrickListModel ( ) . setVolumeEntity ( selectedVolume ) ; getGeoRepListModel ( ) . setEntity ( selectedVolume ) ; getSnapshotListModel ( ) . setEntity ( selectedVolume ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryMetadataDisk ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) == ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryMetadataDisk ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) == ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }