auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.TransactionalStrategyState > getStrategyForMacAllocation ( ) { java.util.List < org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.TransactionalStrategyState > states = new java.util.ArrayList < > ( ) ; if ( usingCompensationState.shouldUseCompensation ( ) ) { states.add ( usingCompensationState ) ; } boolean shouldUseTxDecorator = ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ; if ( shouldUseTxDecorator ) { states.add ( usingTxDecoratorState ) ; } if ( states.isEmpty ( ) ) { states.add ( nontransactionalState ) ; } return states ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.TransactionalStrategyState > getStrategyForMacAllocation ( ) { java.util.List < org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.TransactionalStrategyState > states = new java.util.ArrayList < > ( ) ; if ( usingCompensationState.shouldUseCompensation ( ) ) { states.add ( usingCompensationState ) ; } boolean shouldUseTxDecorator = ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ; if ( shouldUseTxDecorator ) { states.add ( usingTxDecoratorState ) ; } if ( states.isEmpty ( ) ) { states.add ( nontransactionalState ) ; } org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.log.debug ( "Using as allocation strategies" , states ) ; return states ; }
Source:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { releaseLocksAtEndOfExecute = annotation.isReleaseAtEndOfExecute ( ) ; if ( ! ( annotation.isWait ( ) ) ) { returnValue = acquireLockInternal ( ) ; } else { acquireLockAndWait ( ) ; } } return returnValue ; }

Target:
public final boolean acquireLockAsyncTask ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = getLockProperties ( ) ; boolean returnValue = true ; if ( ! ( Scope.None.equals ( lockProperties.getScope ( ) ) ) ) { releaseLocksAtEndOfExecute = Scope.Execution.equals ( lockProperties.getScope ( ) ) ; if ( ! ( releaseLocksAtEndOfExecute ) ) { returnValue = acquireLockInternal ( ) ; } } return returnValue ; }
Source:
private static java.lang.String findActiveNicName ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > bridges ) { final java.lang.String hostIp = org.ovirt.engine.core.utils.NetworkUtils.getHostByIp ( vds ) ; final java.lang.String activeBridge = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.findActiveBridge ( hostIp , bridges ) ; if ( activeBridge != null ) { return activeBridge ; } final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface activeIface = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.resolveActiveNic ( vds , hostIp ) ; java.lang.String hostActiveNic = ( activeIface == null ) ? null : activeIface.getName ( ) ; return hostActiveNic ; }

Target:
private static java.lang.String findActiveNicName ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > bridges ) { final java.lang.String hostIp = org.ovirt.engine.core.utils.NetworkUtils.getHostIp ( vds ) ; final java.lang.String activeBridge = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.findActiveBridge ( hostIp , bridges ) ; if ( activeBridge != null ) { return activeBridge ; } final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface activeIface = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.resolveActiveNic ( vds , hostIp ) ; java.lang.String hostActiveNic = ( activeIface == null ) ? null : activeIface.getName ( ) ; return hostActiveNic ; }
Source:
public void updateAll ( java.lang.String procedureName , java.util.Collection < T > entities ) { if ( procedureName == null ) { procedureName = org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) ; } for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( procedureName , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }

Target:
public void updateAll ( java.lang.String procedureName , java.util.Collection < T > entities ) { for ( T entity : entities ) { update ( entity , ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterVolumeCreate ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount , int stripeCount , java.lang.String [ ] transportList ) { try { return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( vdsServer.glusterVolumeCreate ( volumeName , brickList , replicaCount , stripeCount , transportList ) ) ; } 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 thaw ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.thaw ( 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:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder < org.ovirt.engine.core.common.businessentities.VmStatic > ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder < org.ovirt.engine.core.common.businessentities.VmStatic > ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CpuSharesVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }
Source:
public void testGetAllForVnicProfile ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForVnicProfile ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( existingVm , result.get ( 0 ) ) ; }

Target:
public void testGetAllForVnicProfile ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForVnicProfile ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingVm , result.get ( 0 ) ) ; }
Source:
public void cpuTypeSupportsVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . cpuExists ( ) ; org.junit.Assert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void cpuTypeSupportsVirtServiceForVirtCluster ( ) { org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . cpuExists ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.cpuTypeSupportsVirtService ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void clearCpuPinning ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; model.getCpuPinning ( ) . setEntity ( "" ) ; preSavePhase3 ( ) ; }

Target:
private void setGlobalHaMaintenance ( boolean enabled ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( vm == null ) { return ; } if ( ! ( vm.isHostedEngine ( ) ) ) { return ; } org.ovirt.engine.core.common.action.SetHaMaintenanceParameters params = new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( vm.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , enabled ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.SetHaMaintenance , params ) ; }
Source:
public static void assertNoRedundantKeys ( java.io.File file , java.lang.Class < ? extends java.lang.Enum < ? > > ... template ) throws java.io.IOException { org.ovirt.engine.core.utils.EnumTranslationProperties props = new org.ovirt.engine.core.utils.EnumTranslationProperties ( template ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.MissingEnumTranslationException exception ) { org.junit.Assert.fail ( ( ( ( "Check for redundant keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }

Target:
public void testRedundantMessages ( ) throws java.io.IOException { org.ovirt.engine.core.utils.EnumTranslationProperties props = new org.ovirt.engine.core.utils.EnumTranslationProperties ( org.ovirt.engine.core.common.errors.EngineMessage.class , org.ovirt.engine.core.common.errors.EngineError.class ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.MissingEnumTranslationException exception ) { org.junit.Assert.fail ( ( ( ( "Check for redundant keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }
Source:
private void setUpGetCertuficateExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
protected boolean validateImages ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , true , true , true , true , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ) ; }

Target:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false ) ; return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , true , true , true , true , imagesToValidate ) ; }
Source:
protected boolean checkIsConnectionFieldEmpty ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( connection.getconnection ( ) ) ) { java.lang.String fieldName = org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.getFieldName ( connection ) ; org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.addCanDoActionMessageVariable ( "fieldName" , fieldName ) ; addCanDoActionMessage ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; return true ; } return false ; }

Target:
protected boolean checkIsConnectionFieldEmpty ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( connection.getconnection ( ) ) ) { java.lang.String fieldName = org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.getFieldName ( connection ) ; org.ovirt.engine.core.bll.storage.StorageServerConnectionCommandBase.addCanDoActionMessageVariable ( "fieldName" , fieldName ) ; addCanDoActionMessage ( EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; return true ; } return false ; }
Source:
protected java.lang.Integer extractDisplayPort ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType ) { org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo = getEntity ( ) . getGraphicsInfos ( ) . get ( graphicsType ) ; if ( ( graphicsInfo != null ) && ( ( graphicsInfo.getPort ( ) ) != null ) ) { return graphicsInfo.getPort ( ) ; } return 0 ; }

Target:
protected void setForeignMenuData ( org.ovirt.engine.ui.uicommonweb.restapi.HasForeignMenuData nativeImpl ) { nativeImpl.setEngineHost ( Window.Location.getHost ( ) ) ; nativeImpl.setVmId ( getEntity ( ) . getId ( ) ) ; nativeImpl.setAdmin ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . isAdmin ( ) ) ; }
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 getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected void executeCommand ( ) { try { if ( isAsync ( ) ) { executeCommandAsynchronously ( ) ; return ; } _returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; getVDSReturnValue ( ) . setSucceeded ( true ) ; executeVDSCommand ( ) ; } catch ( java.lang.RuntimeException ex ) { setVdsRuntimeError ( ex ) ; } }

Target:
protected void executeCommand ( ) { try { if ( isAsync ( ) ) { executeCommandAsynchronously ( ) ; return ; } _returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; getVDSReturnValue ( ) . setSucceeded ( true ) ; executeVDSCommand ( ) ; } catch ( java.lang.RuntimeException ex ) { setVdsRuntimeErrorAndReport ( ex ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getEntity ( ) ; if ( diskImage == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters getStorageDomainsByImageIdParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( diskImage.getImageId ( ) ) ; getStorageDomainsByImageIdParameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByImageId , getStorageDomainsByImageIdParameters , new org.ovirt.engine.ui.uicommonweb.models.disks.SetItemsAsyncQuery ( ) ) ; setIsQueryFirstTime ( false ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Cluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.Cluster.class , headers ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private java.lang.String getSubResourceEntityName ( java.lang.String parent , java.lang.String collectionName , java.lang.String [ ] periods , int i ) { java.lang.String publicEntityName = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) , periods , i , false ) ; if ( publicEntityName == null ) { publicEntityName = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName.replace ( parent , "" ) ) , periods , i ) ; } return publicEntityName ; }

Target:
private void generateCode ( org.ovirt.engine.sdk.codegen.utils.Tree < org.ovirt.engine.sdk.codegen.rsdl.Location > tree ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isEntity ( tree ) ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isSubEntity ( tree ) ) { addSubResource ( tree ) ; } else { addResource ( tree ) ; } } else if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isCollection ( tree ) ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isSubCollection ( tree ) ) { addSubCollection ( tree ) ; } else { addCollection ( tree ) ; } } }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( clusterId ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( clusterId ) ; vds.setStatus ( status ) ; return vds ; }
Source:
private void init ( ) { this . setIsAnimated ( TooltipConfig.IS_ANIMATED ) ; this . setPlacement ( TooltipConfig.PLACEMENT ) ; this . setIsHtml ( TooltipConfig.IS_HTML ) ; this . setTrigger ( TooltipConfig.TRIGGER ) ; this . setShowDelayMs ( TooltipConfig.SHOW_DELAY_MS ) ; this . setHideDelayMs ( TooltipConfig.HIDE_DELAY_MS ) ; this . setContainer ( TooltipConfig.CONTAINER ) ; }

Target:
public void setPlacement ( org.gwtbootstrap3.client.ui.constants.Placement placement ) { tooltipConfig.setPlacement ( placement ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/branding" ) . getFile ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.utils.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertTrue ( "The theme should load" , testTheme.load ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/utils/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.utils.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertTrue ( "The theme should load" , testTheme.load ( ) ) ; }
Source:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }

Target:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfType ( org.ovirt.engine.core.common.businessentities.VDSType type ) { return getCallsHandler ( ) . executeReadList ( "GetVdsByType" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_type" , type ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( final org.ovirt.engine.core.common.businessentities.VDSType type , final org.ovirt.engine.core.compat.Guid groupId , final org.ovirt.engine.core.common.businessentities.VDSStatus status , final int minNrOfCpus ) { return getCallsHandler ( ) . executeReadList ( "GetVdsToRun" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_type" , type ) . addValue ( "vds_groupid" , groupId ) . addValue ( "vds_status" , status ) . addValue ( "min_cpu_cores" , minNrOfCpus ) ) ; }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input ) { javax.sql.DataSource ds = new org.ovirt.engine.extension.aaa.jdbc.core.datasource.DataSourceProvider ( configuration ) . provide ( ) ; this . authentication = new org.ovirt.engine.extension.aaa.jdbc.core.Authentication ( ds ) ; this . tasks = new org.ovirt.engine.extension.aaa.jdbc.core.Tasks ( ds , this . authentication ) ; }

Target:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input ) throws java.io.IOException , java.sql.SQLException { javax.sql.DataSource ds = new org.ovirt.engine.extension.aaa.jdbc.core.datasource.DataSourceProvider ( configuration ) . provide ( ) ; this . authentication = new org.ovirt.engine.extension.aaa.jdbc.core.Authentication ( ds ) ; this . tasks = new org.ovirt.engine.extension.aaa.jdbc.core.Tasks ( ds , this . authentication ) ; org.ovirt.engine.extension.aaa.jdbc.binding.api.ExtensionUtils.checkDbVersion ( ds.getConnection ( ) , input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) . < java.lang.String > get ( Base.ContextKeys.CONFIGURATION_FILE ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( diskImageId ) ; diskImage.setstorage_pool_id ( storagePoolId ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( diskImageId ) ; diskImage.setStoragePoolId ( storagePoolId ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }
Source:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }

Target:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }
Source:
private void mockStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }

Target:
private void mockStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmQualifiedForSnapshotMerge ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( vm.isQualifiedForSnapshotMerge ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP , java.lang.String.format ( "$VmName %s" , vm.getName ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmQualifiedForSnapshotMerge ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( vm.isQualifiedForSnapshotMerge ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP , java.lang.String.format ( "$VmName %s" , vm.getName ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesFromSanpshot = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : imagesFromSanpshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesFromSnapshot = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : imagesFromSnapshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , iscsiBond ) ; } }
Source:
private org.ovirt.engine.api.model.WatchDog getUpdate ( ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; watchDog.setId ( GUIDS [ 1 ] . toString ( ) ) ; return watchDog ; }

Target:
private org.ovirt.engine.api.model.WatchDog getUpdate ( ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setId ( org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.WATCHDOG_ID.toString ( ) ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; return watchDog ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = getUpdateVmParameters ( applyCpuChangesLater ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = getUpdateVmParameters ( applyCpuChangesLater ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; } else { getWindow ( ) . stopProgress ( ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { ( ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue ) ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getReturnValue ( ) ) ) . setFailedVds ( vds ) ; throw e ; } }

Target:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) . ConnectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { final org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue result = getResult ( ) ; result.setFailedVds ( vds ) ; result.setFailedLun ( lun ) ; throw e ; } }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.atLeast ( 1 ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.atLeast ( 1 ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }
Source:
private void handleDomainAlreadyExists ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { java.lang.String storageName = storages.get ( 0 ) . getStorageName ( ) ; onFinish ( storageListModel.context , false , storageListModel.storageModel , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . createFailedDomainAlreadyExistStorageMsg ( storageName ) ) ; }

Target:
private void handleDomainAlreadyExists ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { java.lang.String storageName = storages.get ( 0 ) . getStorageName ( ) ; onFinish ( context , false , storageModel , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . createFailedDomainAlreadyExistStorageMsg ( storageName ) ) ; }
Source:
protected void executeCommand ( ) { initConnectionList ( getParameters ( ) . isConnectToInactiveDomains ( ) ) ; setSucceeded ( connectStorageServer ( getConnectionsTypeMap ( ) ) ) ; if ( ! ( getSucceeded ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.CONNECT_STORAGE_SERVERS_FAILED ) ; } }

Target:
protected void executeCommand ( ) { initConnectionList ( getParameters ( ) . isConnectToInactiveDomains ( ) ) ; setSucceeded ( connectStorageServer ( getConnectionsTypeMap ( ) ) ) ; if ( ! ( getSucceeded ( ) ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.CONNECT_STORAGE_SERVERS_FAILED ) ; } }