auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }

Target:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }
Source:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }

Target:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }
Source:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertSame ( GlusterVolumeType.DISTRIBUTE , volume.getVolumeType ( ) ) ; } }

Target:
public void testGetVolumesByStatusAndTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusAndTypes ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTE ) ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertEquals ( GlusterVolumeType.DISTRIBUTE , volume.getVolumeType ( ) ) ; } }
Source:
private boolean isIpv4GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv4PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv4Gateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }

Target:
private boolean isIpv4GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv4PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv4Gateway ( ) ; return java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ; }
Source:
private boolean hasImages ( ) { int allowedDisksNum = getOvfInfo ( ) . size ( ) ; return ( ( getDiskImageDao ( ) . getAllSnapshotsForStorageDomain ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) || ( ( getImageStorageDomainMapDao ( ) . getAllByStorageDomainId ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) ; }

Target:
private boolean hasImages ( ) { int allowedDisksNum = getOvfInfo ( ) . size ( ) ; return ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getDiskImageDao ( ) . getAllSnapshotsForStorageDomain ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) || ( ( getImageStorageDomainMapDao ( ) . getAllByStorageDomainId ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) ; }
Source:
private boolean validateNames ( ) { boolean valid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( getItems ( ) ) ) ) { if ( ! ( validateName ( importVmData ) ) ) { valid = false ; } else { importVmData.setError ( null ) ; } } if ( ! valid ) { onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "InvalidVm" ) ) ; } return valid ; }

Target:
protected boolean validateNames ( ) { boolean valid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( getItems ( ) ) ) ) { if ( ! ( validateName ( importVmData ) ) ) { valid = false ; } } if ( ! valid ) { onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "InvalidVm" ) ) ; } return valid ; }
Source:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters ( org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NIC_ID , org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NUM_OF_VFS , false ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommand ( param ) ) ; org.mockito.Mockito.doReturn ( validator ) . when ( command ) . getVfsConfigValidator ( ) ; org.mockito.Mockito.doReturn ( vfsConfigDao ) . when ( command ) . getVfsConfigDao ( ) ; org.mockito.Mockito.doReturn ( interfaceDao ) . when ( command ) . getInterfaceDao ( ) ; }

Target:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters ( org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NIC_ID , org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NUM_OF_VFS , false ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( validator ) . when ( command ) . getVfsConfigValidator ( ) ; org.mockito.Mockito.doReturn ( vfsConfigDao ) . when ( command ) . getVfsConfigDao ( ) ; org.mockito.Mockito.doReturn ( interfaceDao ) . when ( command ) . getInterfaceDao ( ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter getFieldAutoCompleter ( java.lang.String obj ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter retval = null ; if ( obj == null ) { return null ; } if ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) ) != null ) { return org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . conditionFieldAutoCompleter ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter getFieldAutoCompleter ( java.lang.String obj ) { if ( obj == null ) { return null ; } if ( ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) ) != null ) { return org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter.getEntitySearchInfo ( obj ) . conditionFieldAutoCompleter ; } return null ; }
Source:
public void compare ( ) { org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v4_0 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v4_0.compareTo ( Version.v3_6 ) ) > 0 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) == 0 ) ) ; }

Target:
public void compare ( ) { org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v4_0 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v4_0.compareTo ( Version.v3_6 ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( 0 , Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s.setstatus ( StorageDomainStatus.InActive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s2 = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s2.setstatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setstatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setstatus ( StorageDomainStatus.InActive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s2.setstatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setstatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }
Source:
private java.util.concurrent.Future < java.lang.Void > scheduleClose ( final java.lang.String message ) { this . closing.set ( true ) ; final java.util.concurrent.Callable < java.lang.Void > disconnectCallable = new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { disconnect ( message ) ; return null ; } } ; return scheduleTask ( disconnectCallable ) ; }

Target:
private java.util.concurrent.Future < java.lang.Void > scheduleClose ( final java.lang.String message ) { this . closing.set ( true ) ; return scheduleTask ( ( ) -> { disconnect ( message ) ; return null ; } ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } return getCachedIsoListByDomainId ( storageDomainId , imageType ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void mapModel ( ) { for ( org.ovirt.engine.api.model.WatchdogModel model : org.ovirt.engine.api.model.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( backendModel ) ; org.junit.Assert.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapModel ( ) { for ( org.ovirt.engine.api.model.WatchdogModel model : org.ovirt.engine.api.model.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model ) ; org.junit.Assert.assertNotNull ( backendModel ) ; org.junit.Assert.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }
Source:
private static void addBondDeviceToHost ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.Object [ ] interfaces ) { vds.getInterfaces ( ) . add ( iface ) ; if ( interfaces != null ) { for ( java.lang.Object name : interfaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface tempInterface : vds.getInterfaces ( ) ) { if ( tempInterface.getName ( ) . equals ( name.toString ( ) ) ) { tempInterface.setBondName ( iface.getName ( ) ) ; } } } } }

Target:
private static void addBondDeviceToHost ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.Object [ ] interfaces ) { vds.getInterfaces ( ) . add ( iface ) ; if ( interfaces != null ) { for ( java.lang.Object name : interfaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface tempInterface : vds.getInterfaces ( ) ) { if ( tempInterface.getName ( ) . equals ( name.toString ( ) ) ) { tempInterface.setBondName ( iface.getName ( ) ) ; break ; } } } } }
Source:
private void createParameters ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.createCpuProfile ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.PROFILE_NAME ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters = new org.ovirt.engine.core.common.action.CpuProfileParameters ( cpuProfile , cpuProfile.getId ( ) ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setCorrelationId ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CORRELATION_ID ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setAddPermissions ( true ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setSessionId ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.SESSION_ID ) ; }

Target:
private void createParameters ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.createCpuProfile ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.PROFILE_NAME ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters = new org.ovirt.engine.core.common.action.CpuProfileParameters ( cpuProfile ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setCorrelationId ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CORRELATION_ID ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setAddPermissions ( true ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.parameters.setSessionId ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.SESSION_ID ) ; }
Source:
public void testRemoveAllByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( volume.getSnapshotsCount ( ) . intValue ( ) , 2 ) ; dao.removeAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertTrue ( snapshots.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume1 = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( volume1.getSnapshotsCount ( ) . intValue ( ) , 0 ) ; }

Target:
public void testRemoveAllByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( 2 , volume.getSnapshotsCount ( ) . intValue ( ) ) ; dao.removeAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertTrue ( snapshots.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume1 = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( 0 , volume1.getSnapshotsCount ( ) . intValue ( ) ) ; }
Source:
public void mapGuestAgentSsoFromRestToBackend ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Sso restSso = new org.ovirt.engine.api.model.Sso ( ) ; restSso.setMethods ( new org.ovirt.engine.api.model.Methods ( ) ) ; org.ovirt.engine.api.model.Method guestAgent = new org.ovirt.engine.api.model.Method ( ) ; guestAgent.setId ( org.ovirt.engine.api.model.SsoMethod.GUEST_AGENT.toString ( ) ) ; restSso.getMethods ( ) . getMethods ( ) . add ( guestAgent ) ; org.ovirt.engine.core.common.businessentities.SsoMethod expectedBackendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.GUEST_AGENT ; org.junit.Assert.assertEquals ( expectedBackendSsoMethod , org.ovirt.engine.api.restapi.types.SsoMapper.map ( restSso , null ) ) ; }

Target:
public void mapGuestAgentSsoFromRestToBackend ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Sso restSso = new org.ovirt.engine.api.model.Sso ( ) ; restSso.setMethods ( new org.ovirt.engine.api.model.Methods ( ) ) ; org.ovirt.engine.api.model.Method guestAgent = new org.ovirt.engine.api.model.Method ( ) ; guestAgent.setId ( org.ovirt.engine.api.model.SsoMethod.GUEST_AGENT ) ; restSso.getMethods ( ) . getMethods ( ) . add ( guestAgent ) ; org.ovirt.engine.core.common.businessentities.SsoMethod expectedBackendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.GUEST_AGENT ; org.junit.Assert.assertEquals ( expectedBackendSsoMethod , org.ovirt.engine.api.restapi.types.SsoMapper.map ( restSso , null ) ) ; }
Source:
public void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( stepDaoMock ) . when ( command ) . getStepDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) ; }

Target:
public void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > convertToStatusList ( ) { java.util.HashMap < java.lang.String , java.lang.String > result = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct st : this . mStatusList ) { java.lang.String status = st.getItem ( "status" ) . toString ( ) ; java.lang.String id = st.getItem ( "id" ) . toString ( ) ; result.put ( id , status ) ; } return result ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > convertToStatusList ( ) { java.util.HashMap < java.lang.String , java.lang.String > result = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( java.util.Map < java.lang.String , java.lang.Object > st : this . mStatusList ) { java.lang.String status = st.get ( "status" ) . toString ( ) ; java.lang.String id = st.get ( "id" ) . toString ( ) ; result.put ( id , status ) ; } return result ; }
Source:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( activeSnapshot ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk1.getImageId ( ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( diskImageDao.get ( disk2.getImageId ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( activeSnapshot ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void executeNotRespondingTreatment ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { final org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( host.getId ( ) , org.ovirt.engine.core.common.businessentities.pm.FenceActionType.RESTART ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } } ) ; } }

Target:
private void executeNotRespondingTreatment ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { final org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( host.getId ( ) ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } } ) ; } }
Source:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedAppendedNameValidators ( java.lang.Object object ) { final int maxClonedNameLength = getMaxClonedNameLength ( object ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) { @ java.lang.Override protected java.lang.String composeMessage ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . newNameWithSuffixCannotContainBlankOrSpecialChars ( maxClonedNameLength ) ; } } , new org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel.UniqueClonedAppendedNameValidator ( assignedVmNames ) } ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedAppendedNameValidators ( ) { final int maxClonedNameLength = getMaxClonedNameLength ( ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) { @ java.lang.Override protected java.lang.String composeMessage ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . newNameWithSuffixCannotContainBlankOrSpecialChars ( maxClonedNameLength ) ; } } , new org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel.UniqueClonedAppendedNameValidator ( assignedVmNames ) } ; }
Source:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vmDevice ) ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void addISCSIEmptyConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; }

Target:
public void addISCSIEmptyConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getImportBlockDataStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportIscsiStorageModel iscsiDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.ImportIscsiStorageModel ( ) ; models.add ( iscsiDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel fcpDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel ( ) ; models.add ( fcpDataModel ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.addTypeToStorageModels ( StorageDomainType.Data , models ) ; return models ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getImportBlockDataStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportIscsiStorageModel iscsiDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.ImportIscsiStorageModel ( ) ; models.add ( iscsiDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel fcpDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel ( ) ; models.add ( fcpDataModel ) ; addTypeToStorageModels ( StorageDomainType.Data , models ) ; return models ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { detach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnDetach" ) ) { onDetach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { detach ( ) ; } if ( "OnDetach" . equals ( command.getName ( ) ) ) { onDetach ( ) ; } if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
public static boolean isFencingPolicySupported ( java.util.Set < org.ovirt.engine.core.compat.Version > clusterLevels ) { boolean supported = false ; for ( org.ovirt.engine.core.compat.Version v : clusterLevels ) { if ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) { supported = true ; break ; } } return supported ; }

Target:
public static boolean isFencingPolicySupported ( java.util.Set < org.ovirt.engine.core.compat.Version > clusterLevels ) { return ! ( clusterLevels.isEmpty ( ) ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.Network net ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.getItem ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.getItem ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModel.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModel.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue response ) { if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModel.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModel.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains stDomain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; stDomain.setstatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( stDomain ) ; }

Target:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain stDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; stDomain.setstatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( stDomain ) ; }
Source:
public void run ( ) { org.ovirt.engine.core.notifier.Notifier.log.info ( "Preparing for shutdown after receiving signal " ) ; if ( ( serviceHandler.size ( ) ) > 0 ) { for ( java.util.concurrent.ScheduledFuture < ? > scheduled : serviceHandler ) { scheduled.cancel ( true ) ; } } if ( ( scheduler.size ( ) ) > 0 ) { for ( java.util.concurrent.ScheduledExecutorService executer : scheduler ) { executer.shutdown ( ) ; } } org.ovirt.engine.core.notifier.Notifier.log.info ( "Event Notification service was shutdown" ) ; java.lang.System.exit ( 0 ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.notifier.Notifier.log.info ( "Preparing for shutdown after receiving signal " ) ; if ( ( serviceHandler.size ( ) ) > 0 ) { for ( java.util.concurrent.ScheduledFuture < ? > scheduled : serviceHandler ) { scheduled.cancel ( true ) ; } } if ( ( scheduler.size ( ) ) > 0 ) { for ( java.util.concurrent.ScheduledExecutorService executer : scheduler ) { executer.shutdown ( ) ; } } org.ovirt.engine.core.notifier.Notifier.log.info ( "Event Notification service was shutdown" ) ; }
Source:
private void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; final char NAME_VALUE_SEPARATOR = '=' ; if ( ( builder.length ( ) ) > 0 ) { builder.append ( DELIMITER ) ; } builder.append ( key ) . append ( NAME_VALUE_SEPARATOR ) . append ( value ) ; }

Target:
private static void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; final char NAME_VALUE_SEPARATOR = '=' ; if ( ( builder.length ( ) ) > 0 ) { builder.append ( DELIMITER ) ; } builder.append ( key ) . append ( NAME_VALUE_SEPARATOR ) . append ( value ) ; }
Source:
protected java.lang.String getClientTitle ( ) { java.lang.String releaseCursorKeys = getReleaseCursorKeys ( ) ; java.lang.String releaseCursorKeysTranslated = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getComplexValueFromSpiceRedKeysResource ( ( releaseCursorKeys != null ? releaseCursorKeys : "shift+f12" ) ) ; java.lang.String releaseCursorMsg = "" ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( releaseCursorKeysTranslated ) ) ) { releaseCursorMsg = " - " + ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . pressKeyToReleaseCursor ( releaseCursorKeysTranslated ) ) ; } return ( ( getEntity ( ) . getName ( ) ) + ":%d" ) + releaseCursorMsg ; }

Target:
protected java.lang.String getClientTitle ( ) { java.lang.String releaseCursorKeys = getReleaseCursorKeys ( ) ; java.lang.String releaseCursorKeysTranslated = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getComplexValueFromSpiceRedKeysResource ( ( releaseCursorKeys != null ? releaseCursorKeys : "shift+f12" ) ) ; java.lang.String releaseCursorMsg = "" ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( releaseCursorKeysTranslated ) ) ) { releaseCursorMsg = " - " + ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . pressKeyToReleaseCursor ( releaseCursorKeysTranslated ) ) ; } return ( ( getEntity ( ) . getName ( ) ) + ":%d" ) + releaseCursorMsg ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryUser fetchPrincipalRecord ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtMap authRecord ) { return org.ovirt.engine.core.aaa.AuthzUtils.mapPrincipalRecord ( extension , extension.invoke ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Base.InvokeKeys.COMMAND , Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ) . mput ( Authn.InvokeKeys.AUTH_RECORD , authRecord ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , ( ( Authz.QueryFlags.RESOLVE_GROUPS ) | ( Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE ) ) ) ) . < org.ovirt.engine.api.extensions.ExtMap > get ( Authz.InvokeKeys.PRINCIPAL_RECORD ) ) ; }

Target:
public static org.ovirt.engine.api.extensions.ExtMap fetchPrincipalRecord ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtMap authRecord ) { return extension.invoke ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Base.InvokeKeys.COMMAND , Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ) . mput ( Authn.InvokeKeys.AUTH_RECORD , authRecord ) ) . < org.ovirt.engine.api.extensions.ExtMap > get ( Authz.InvokeKeys.PRINCIPAL_RECORD ) ; }
Source:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } return null ; }

Target:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return null ; }