auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( resource.getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
private void removeNetwork ( ) { networkMap.remove ( getNetworkList ( ) . getSelectedItem ( ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( networkMap.keySet ( ) ) ) ; getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( networkMap.keySet ( ) ) ) ; }

Target:
private void removeNetwork ( ) { networkMap.remove ( ( ( java.lang.String ) ( getNetworkList ( ) . getSelectedItem ( ) ) ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( networkMap.keySet ( ) ) ) ; getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( networkMap.keySet ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult dataCenterVersionMismatch ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.CLUSTER_CANNOT_ADD_COMPATIBILITY_VERSION_WITH_LOWER_STORAGE_POOL ) . when ( ( ( dataCenter != null ) && ( cluster.supportsVirtService ( ) ? ( dataCenter.getCompatibilityVersion ( ) . compareTo ( cluster.getCompatibilityVersion ( ) ) ) > 0 : false ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult dataCenterVersionMismatch ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.CLUSTER_CANNOT_ADD_COMPATIBILITY_VERSION_WITH_LOWER_STORAGE_POOL ) . when ( ( ( ( dataCenter != null ) && ( cluster.supportsVirtService ( ) ) ) && ( ( dataCenter.getCompatibilityVersion ( ) . compareTo ( cluster.getCompatibilityVersion ( ) ) ) > 0 ) ) ) ; }
Source:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList < > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , disks , null ) , true , null ) ; }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList < > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , disks ) , true , null ) ; }
Source:
public boolean invokeAsBoolean ( com.google.gwt.core.client.JsArray < ? > args , org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunction.ErrorHandler errorHandler ) { clearResultInformation ( ) ; return function.invoke ( args , JsFunction.RESULT_TYPE_BOOLEAN , new org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunction.ResultHandler < java.lang.Boolean > ( ) { @ java.lang.Override public void onResult ( java.lang.Boolean result ) { org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.this . resultValue = result ; org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.this . resultType = JsFunction.RESULT_TYPE_BOOLEAN ; } } , errorHandler ) ; }

Target:
public boolean invokeAsBoolean ( com.google.gwt.core.client.JsArray < ? > args , org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunction.ErrorHandler errorHandler ) { clearResultInformation ( ) ; return function.invoke ( args , JsFunction.RESULT_TYPE_BOOLEAN , ( java.lang.Boolean result ) -> { this . resultValue = result ; this . resultType = JsFunction.RESULT_TYPE_BOOLEAN ; } , errorHandler ) ; }
Source:
private boolean removeMemoryFromSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean clearFromDB ) { final java.lang.String memoryVolume = snapshot.getMemoryVolume ( ) ; if ( memoryVolume.isEmpty ( ) ) { return true ; } if ( clearFromDB ) { getSnapshotDao ( ) . removeMemoryFromSnapshot ( snapshot.getId ( ) ) ; } return removeMemoryVolumes ( memoryVolume , getActionType ( ) , false ) ; }

Target:
private boolean removeMemoryFromSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean clearFromDB ) { final java.lang.String memoryVolume = snapshot.getMemoryVolume ( ) ; if ( memoryVolume.isEmpty ( ) ) { return true ; } if ( clearFromDB ) { getSnapshotDao ( ) . removeMemoryFromSnapshot ( snapshot.getId ( ) ) ; } return removeMemoryVolumes ( memoryVolume ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangeable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangeable ( true ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterNetworkProviders ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ) ) ; providers.add ( 0 , null ) ; getExternalProviders ( ) . setItems ( providers ) ; getExternalProviders ( ) . setSelectedItem ( null ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; providers.add ( 0 , null ) ; getExternalProviders ( ) . setItems ( providers ) ; getExternalProviders ( ) . setSelectedItem ( null ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initCreateVmParams ( ) { org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initCreateVmParams ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setCloudInitParameters ( runOnceParams.getCloudInitParameters ( ) ) ; return createVmParams ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initCreateVmParams ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initCreateVmParams ( ) ; createVmParams.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setCloudInitParameters ( runOnceParams.getCloudInitParameters ( ) ) ; return createVmParams ; }
Source:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.AddVmCommand.getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster net_cluster ) { setEnumTitle ( net_cluster.getstatus ( ) ) ; switch ( net_cluster.getstatus ( ) ) { case OPERATIONAL : return getApplicationResources ( ) . upImage ( ) ; case NON_OPERATIONAL : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster net_cluster ) { setEnumTitle ( net_cluster.getStatus ( ) ) ; switch ( net_cluster.getStatus ( ) ) { case OPERATIONAL : return getApplicationResources ( ) . upImage ( ) ; case NON_OPERATIONAL : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.trim ( ) . length ( ) ) == 0 ) ) { return "" ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } }

Target:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.trim ( ) . length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStepsByJobId , org.ovirt.engine.core.common.queries.GetStepsByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStepsByJobId , org.ovirt.engine.core.common.queries.GetStepsByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
public void testGetWithInvalidNetworkId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondWithNoMatchingNetworks ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetWithInvalidNetworkId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondWithNoMatchingNetworks ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( vm.getRunOnVds ( ) . toString ( ) ) ) ; if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( vm.getRunOnVds ( ) . toString ( ) ) ) ; if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void mockDaos ( boolean pluggedInterface ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.createVM ( org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.VM_NAME , org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.NETWORK_NAME , pluggedInterface ) ; org.mockito.Mockito.when ( vmDao.getAllRunningForVds ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vm.getId ( ) ) ) . thenReturn ( vm.getInterfaces ( ) ) ; }

Target:
private void mockDaos ( boolean pluggedInterface ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.createVM ( org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.VM_NAME , org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetworkTest.NETWORK_NAME , pluggedInterface ) ; org.mockito.Mockito.when ( vmDao.getAllRunningForVds ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vm.getId ( ) ) ) . thenReturn ( vm.getInterfaces ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > vdsList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; if ( ( vdsList.size ( ) ) > 0 ) { clusterModel.getClusterPolicyModel ( ) . getEnableTrustedService ( ) . setIsChangable ( false ) ; clusterModel.getClusterPolicyModel ( ) . getEnableTrustedService ( ) . setInfo ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . trustedServiceDisabled ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > vdsList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; if ( ( vdsList.size ( ) ) > 0 ) { clusterModel.getEnableTrustedService ( ) . setIsChangable ( false ) ; clusterModel.getEnableTrustedService ( ) . setInfo ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . trustedServiceDisabled ( ) ) ; } }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( permissions.size ( ) , 1 ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( permissions.size ( ) , 2 ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }
Source:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( vdsDaoMock ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDaoMock ) . when ( command ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( asyncTaskDaoMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }

Target:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( vdsDaoMock ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( asyncTaskDaoMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }
Source:
public static void Init ( ) { for ( org.ovirt.engine.core.common.businessentities.storage_pool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } }

Target:
public static void Init ( ) { for ( org.ovirt.engine.core.common.businessentities.StoragePool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } }
Source:
void initialize ( ) { org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Start initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.AutoRecoverySchedule ) ) ; org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Finished initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; }

Target:
void initialize ( ) { org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Start initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleACronJob ( this , "onTimer" , new java.lang.Class < ? > [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AutoRecoverySchedule ) ) ; org.ovirt.engine.core.bll.AutoRecoveryManager.log.info ( ( "Finished initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.mockito.Mockito.when ( qosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createQos ( ) ) ; qos ( network , iface , null , false ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.mockito.Mockito.when ( qosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createQos ( ) ) ; qos ( network , iface , null ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getSortedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( vm.getDiskMap ( ) . values ( ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; java.util.Collections.sort ( diskImages , java.util.Collections.reverseOrder ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.DiskImageByBootAndSnapshotComparator ( ) ) ) ; return diskImages ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getSortedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = new java.util.ArrayList ( vm.getDiskMap ( ) . values ( ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; java.util.Collections.sort ( diskImages , java.util.Collections.reverseOrder ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase.DiskImageByBootAndSnapshotComparator ( ) ) ) ; return diskImages ; }
Source:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.RunQuery ( queryType , queryParams ) ; return result.getSucceeded ( ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runQuery ( queryType , queryParams ) ; return result.getSucceeded ( ) ? result.getReturnValue ( ) : null ; }
Source:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean availableCpuShares = ( cluster.getCompatibilityVersion ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }

Target:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { boolean availableCpuShares = ( getModel ( ) . getCompatibilityVersion ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }
Source:
protected void runCanDoActionOnly ( final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues , final int currentCanDoActionId , final int totalSize , final java.util.concurrent.CountDownLatch latch ) { try { super . runCanDoActionOnly ( returnValues , currentCanDoActionId , totalSize , latch ) ; } finally { getCommands ( ) . get ( currentCanDoActionId ) . freeLock ( ) ; } }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runCanDoActionOnly ( final int currentCanDoActionId , final int totalSize ) { try { return super . runCanDoActionOnly ( currentCanDoActionId , totalSize ) ; } finally { getCommands ( ) . get ( currentCanDoActionId ) . freeLock ( ) ; } }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitVmModel ) { super . edit ( unitVmModel ) ; if ( unitVmModel.isVmAttachedToPool ( ) ) { specificHost.setEnabled ( false ) ; specificHostLabel.setStyleName ( style.labelDisabled ( ) , true ) ; customPropertiesSheetEditor.setEnabled ( false ) ; } }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitVmModel ) { super . edit ( unitVmModel ) ; if ( unitVmModel.isVmAttachedToPool ( ) ) { specificHost.setEnabled ( false ) ; specificHostLabel.setStyleName ( style.labelDisabled ( ) , true ) ; } }
Source:
private void updateTabsData ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel ) { generalForm.update ( snapshotModel.getVm ( ) ) ; disksTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getDisks ( ) ) ) ) ; nicsTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getNics ( ) ) ) ) ; appsTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getApps ( ) ) ) ) ; }

Target:
public void updateTabsData ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel ) { generalForm.update ( snapshotModel.getVm ( ) ) ; disksTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getDisks ( ) ) ) ) ; nicsTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getNics ( ) ) ) ) ; appsTable.setRowData ( ( ( java.util.List ) ( snapshotModel.getApps ( ) ) ) ) ; }
Source:
private void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > callbacks , boolean waitForResult ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setValid ( ( waitForResult ? true : success ) ) ; result.setSucceeded ( ( waitForResult ? success : false ) ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( ACTION_TYPE , null , java.util.Collections.singletonList ( result ) ) ) ; } }

Target:
private void executeCallbacks ( boolean success , org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState , java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > callbacks , boolean waitForResult ) { java.util.Collections.shuffle ( callbacks ) ; for ( org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback : callbacks ) { assertNotAllDone ( flowState ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; result.setValid ( ( waitForResult || success ) ) ; result.setSucceeded ( ( waitForResult && success ) ) ; callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( ACTION_TYPE , null , java.util.Collections.singletonList ( result ) ) ) ; } }
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.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { org.ovirt.engine.core.common.AuditLogType startMessage = ( org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START ; return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : startMessage : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }
Source:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.network net = new org.ovirt.engine.core.common.businessentities.network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setname ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setdescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setstorage_pool_id ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; getNetworkDAO ( ) . save ( net ) ; }

Target:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.Network net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setname ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setdescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setstorage_pool_id ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; getNetworkDAO ( ) . save ( net ) ; }
Source:
protected void expectGetLunsMap ( java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( storageServerConnectionLunMapDao.getAll ( lunId ) ) . thenReturn ( ret ) ; }

Target:
private void expectGetLunsMap ( java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( storageServerConnectionLunMapDao.getAll ( lunId ) ) . thenReturn ( ret ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.executed ( f ) ; org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { try { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; } }
Source:
private void removeEntry ( org.ovirt.engine.core.common.utils.Pair < T , V > item ) { items.remove ( item ) ; contentPanel.remove ( item.getSecond ( ) . getParent ( ) ) ; onRemove ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
private void removeEntry ( org.ovirt.engine.core.common.utils.Pair < T , V > item ) { items.remove ( item ) ; contentPanel.remove ( item.getSecond ( ) . getParent ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getMacPoolListModel ( ) . setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; initSelectedMacPool ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getMacPoolListModel ( ) . setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; stopProgress ( ) ; }
Source:
protected int calcHostScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds ) { int score = java.lang.Math.round ( ( ( ( ( vds.getMaxSchedulingMemory ( ) ) - 1 ) * ( ( MaxSchedulerWeight ) - 1 ) ) / ( maxMemoryOfVdsInCluster - 1 ) ) ) ; return ( MaxSchedulerWeight ) - score ; }

Target:
private int calcHostScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds ) { int score = java.lang.Math.round ( ( ( ( ( vds.getMaxSchedulingMemory ( ) ) - 1 ) * ( ( MaxSchedulerWeight ) - 1 ) ) / ( maxMemoryOfVdsInCluster - 1 ) ) ) ; return ( MaxSchedulerWeight ) - score ; }
Source:
private void expectGetDeviceList ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.setUpLunsFromDeviceList ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontendMock.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetDeviceList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void expectGetDeviceList ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.setUpLunsFromDeviceList ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontendMock.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetDeviceList ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( returnValue ) ; }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getRemovedVolume ( ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.log.error ( "Could not volume id from Cinder which is related to disk {}" , cinderVolume.getDiskAlias ( ) , cinderVolume.getImageId ( ) ) ; if ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . isFaultTolerant ( ) ) { endRemoveCinderDisk ( cinderVolume ) ; } else { auditLogFailureWithImageDeletion ( cinderVolume.getImageId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDisk ( ) . getId ( ) , ImageStatus.ILLEGAL ) ; } }

Target:
public java.lang.String getDiskAlias ( ) { return org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getRemovedVolume ( ) . getDiskAlias ( ) ; }
Source:
private java.lang.String getStrippedVdsUniqueId ( ) { if ( ( _strippedVdsUniqueId ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( char ch : org.ovirt.engine.core.bll.RegisterVdsQuery.getParameters ( ) . getVdsUniqueId ( ) . toCharArray ( ) ) { if ( ( org.ovirt.engine.core.bll.RegisterVdsQuery.validChars.indexOf ( ch ) ) != ( - 1 ) ) { builder.append ( ch ) ; } } _strippedVdsUniqueId = builder.toString ( ) ; } return _strippedVdsUniqueId ; }

Target:
protected java.lang.String getStrippedVdsUniqueId ( ) { if ( ( _strippedVdsUniqueId ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( char ch : org.ovirt.engine.core.bll.RegisterVdsQuery.getParameters ( ) . getVdsUniqueId ( ) . toCharArray ( ) ) { if ( org.ovirt.engine.core.bll.RegisterVdsQuery.validChars.get ( ch ) ) { builder.append ( ch ) ; } } _strippedVdsUniqueId = builder.toString ( ) ; } return _strippedVdsUniqueId ; }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { javax.sql.DataSource ds = new org.ovirt.engine.extension.aaa.jdbc.core.datasource.DataSourceProvider ( configuration ) . provide ( ) ; this . authorization = new org.ovirt.engine.extension.aaa.jdbc.core.Authorization ( ds ) ; this . tasks = new org.ovirt.engine.extension.aaa.jdbc.core.Tasks ( ds , this . authorization ) ; output.put ( Base.InvokeKeys.RESULT , Base.InvokeResult.SUCCESS ) ; }

Target:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { this . ds = new org.ovirt.engine.extension.aaa.jdbc.core.datasource.DataSourceProvider ( configuration ) . provide ( ) ; this . authorization = new org.ovirt.engine.extension.aaa.jdbc.core.Authorization ( ds ) ; this . tasks = new org.ovirt.engine.extension.aaa.jdbc.core.Tasks ( ds , this . authorization ) ; output.put ( Base.InvokeKeys.RESULT , Base.InvokeResult.SUCCESS ) ; }