auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
public void remove ( final org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveExternalPolicyUnit , new org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters ( policyUnit.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getRefreshPolicyUnitsEvent ( ) . raise ( this , null ) ; } } ) ; }

Target:
public void remove ( final org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( ActionType.RemoveExternalPolicyUnit , new org.ovirt.engine.core.common.scheduling.parameters.RemoveExternalPolicyUnitParameters ( policyUnit.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getRefreshPolicyUnitsEvent ( ) . raise ( this , null ) ; } } ) ; }
Source:
public void setUp ( ) { storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.createStoragePool ( ) ; initCommand ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( cmd ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( cmd ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }
Source:
public void customPropertiesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , network ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoInterfacesModified ( helper ) ; }

Target:
public void customPropertiesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v4_0 ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , network ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoInterfacesModified ( helper ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.WatchDog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ; } return isVnc ; }

Target:
private void onNumaSupport ( ) { if ( ( getWindow ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel ) ( getWindow ( ) ) ) ; setVmNumaNodes ( model.getVm ( ) . getvNumaNodeList ( ) ) ; }
Source:
public int hashCode ( ) { if ( this . hashCodeDirty ) { final int prime = ovirt_engine_dwh.configurationsync_3_5.ConfigurationSync.delete_usersStruct.PRIME ; int result = ovirt_engine_dwh.configurationsync_3_5.ConfigurationSync.delete_usersStruct.DEFAULT_HASHCODE ; result = ( prime * result ) + ( ( this . user_join_id ) == null ? 0 : this . user_join_id.hashCode ( ) ) ; this . hashCode = result ; this . hashCodeDirty = false ; } return this . hashCode ; }

Target:
public int hashCode ( ) { if ( this . hashCodeDirty ) { final int prime = ovirt_engine_dwh.configurationsync_3_5.ConfigurationSync.delete_usersStruct.PRIME ; int result = ovirt_engine_dwh.configurationsync_3_5.ConfigurationSync.delete_usersStruct.DEFAULT_HASHCODE ; result = ( prime * result ) + ( ( this . user_id ) == null ? 0 : this . user_id.hashCode ( ) ) ; this . hashCode = result ; this . hashCodeDirty = false ; } return this . hashCode ; }
Source:
org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) ;

Target:
public static java.lang.Integer getEffectiveCpuCores ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( vds.getVdsGroupId ( ) ) ; if ( ( ( ( vds.getCpuThreads ( ) ) != null ) && ( vdsGroup != null ) ) && ( java.lang.Boolean.TRUE.equals ( vdsGroup.getCountThreadsAsCores ( ) ) ) ) { return vds.getCpuThreads ( ) ; } else { return vds.getCpuCores ( ) ; } }
Source:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.utils.BlockStorageDiscardFunctionalityHelper.class , discardFunctionalityHelper ) ; org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.ArgumentMatchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.Assert.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }

Target:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.utils.BlockStorageDiscardFunctionalityHelper.class , discardFunctionalityHelper ) ; org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.Assert.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.users.VdcUser loggedUser = loginModel.getLoggedUser ( ) ; org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( loggedUser ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = ( ( java.lang.String ) ( loginModel.getPassword ( ) . getEntity ( ) ) ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }
Source:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MAX_MEMORY_SIZE ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( VdcActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; return params ; }

Target:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MAX_MEMORY_SIZE ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( ActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; return params ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; modelProvider.onSubTabSelected ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; modelProvider.onSubTabSelected ( ) ; if ( ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) ) != null ) { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } }
Source:
public void engineIsRunningNotification ( ) { try { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - Start" ) ; heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; dwhHistoryTimekeepingDao.save ( heartBeatVar ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - End" ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "Exception" , ex ) ; } }

Target:
public void engineIsRunningNotification ( ) { try { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - Start" ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.RequiresNew , ( ) -> { heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; dwhHistoryTimekeepingDao.save ( heartBeatVar ) ; return null ; } ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - End" ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "Exception" , ex ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.WatchDog watchDog = resource.get ( ) ; verifyModel ( watchDog , 1 ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validateVmProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; return populateVMProperties ( version , properties , map ) ; }

Target:
public java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validateVmProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; return populateVMProperties ( version , properties , map ) ; }
Source:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.isPmEnabled ( ) ) && ( isPowerManagementLegal ( getDbFacade ( ) . getFenceAgentDao ( ) . getFenceAgentsForHost ( vds.getId ( ) ) , cluster , messages ) ) ) ) { messages.add ( EngineMessage.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.isPmEnabled ( ) ) && ( isPowerManagementLegal ( fenceAgentDao.getFenceAgentsForHost ( vds.getId ( ) ) , cluster , messages ) ) ) ) { messages.add ( EngineMessage.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( ( ( rs.getString ( "config_possible_values" ) ) != null ? java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) : null ) ) ; return entity ; }
Source:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN , VDSCommandType.GetIsoList ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , fileListRefreshed , ImageFileType.ISO , fileStatsFromVDSReturnValue ( fileStats ) ) ; }

Target:
private boolean updateAllFileListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStatsVDSReturnValue = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ALL_FILES_PATTERN , null ) ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStats = fileStatsFromVDSReturnValue ( fileStatsVDSReturnValue ) ; updateIsoListFromVDSM ( repoStoragePoolId , repoStorageDomainId , removeFileStatsForComplyingFileNames ( fileStats , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN_REGEX ) ) ; updateFloppyListFromVDSM ( repoStoragePoolId , repoStorageDomainId , removeFileStatsForComplyingFileNames ( fileStats , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FLOPPY_FILE_PATTERN_REGEX ) ) ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , ImageFileType.Unknown , fileStats , null ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.AbstractBackendResource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( entityType , guid , query ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain sp ) { setEnumTitle ( sp.getstorage_domain_shared_status ( ) ) ; switch ( sp.getstorage_domain_shared_status ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Mixed : return getApplicationResources ( ) . upalertImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain sp ) { setEnumTitle ( sp.getStorageDomainSharedStatus ( ) ) ; switch ( sp.getStorageDomainSharedStatus ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Mixed : return getApplicationResources ( ) . upalertImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; aQuery.asyncCallback.onSuccess ( 5 ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosBondSpeedSetup ( java.lang.Integer slaveSpeed , java.lang.Integer bondSpeed ) { return setupCompositeQosConfiguration ( true , createQos ( ) , slaveSpeed , bondSpeed , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_4 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private void removeDomainFromDb ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getstorage_type ( ) ) . StorageDomainRemoved ( domain.getStorageStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . remove ( domain.getId ( ) ) ; return null ; } } ) ; }

Target:
private void removeDomainFromDb ( final org.ovirt.engine.core.common.businessentities.storage_domains domain ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getstorage_type ( ) ) . storageDomainRemoved ( domain.getStorageStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . remove ( domain.getId ( ) ) ; return null ; } } ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters tempVar = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionByRoleId , tempVar , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.SetItemsAsyncQuery ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage_domain_static > fillInDetails ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domain_static > list ) { for ( org.ovirt.engine.core.common.businessentities.storage_domain_static sds : list ) { org.hibernate.Query query = getSession ( ) . createQuery ( ( "select pool.name from storage_pool pool, storage_pool_iso_map map " + ( "where pool.id = map.id.storagePoolId " + "and map.id.storageId = :storage_id" ) ) ) ; query.setParameter ( "storage_id" , sds.getId ( ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < java.lang.String > names = query.list ( ) ; sds.setstorage_pool_name ( ( ( names.isEmpty ( ) ) != true ? names.get ( 0 ) : "" ) ) ; } return list ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > fillInDetails ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > list ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic sds : list ) { org.hibernate.Query query = getSession ( ) . createQuery ( ( "select pool.name from storage_pool pool, storage_pool_iso_map map " + ( "where pool.id = map.id.storagePoolId " + "and map.id.storageId = :storage_id" ) ) ) ; query.setParameter ( "storage_id" , sds.getId ( ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < java.lang.String > names = query.list ( ) ; sds.setstorage_pool_name ( ( ( names.isEmpty ( ) ) != true ? names.get ( 0 ) : "" ) ) ; } return list ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameter = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getParameters ( ) ; result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionStatus ( parameter.getVolumeName ( ) , parameter.getSlaveHost ( ) , parameter.getSlaveVolume ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getGeoRepDetails ( ) ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameter = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getParameters ( ) ; result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionStatus ( parameter.getVolumeName ( ) , parameter.getSlaveHost ( ) , parameter.getSlaveVolume ( ) , parameter.getUserName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeGeoRepSessionStatusVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( result.getGeoRepDetails ( ) ) ; } }
Source:
public void networksUsedByAVm ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( net , false , true , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.junit.matchers.JUnitMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }

Target:
public void networksUsedByAVm ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_ONCE ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeResetBrickCommitForce ( java.lang.String volumeName , java.lang.String existingBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.resetBrickCommitForce" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public void getCapabilities ( org.ovirt.vdsm.jsonrpc.client.BrokerCommandCallback callback ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; try { client.call ( request , callback ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException e ) { throw new org.ovirt.engine.core.vdsbroker.TransportRunTimeException ( "Connection issues during send request" , e ) ; } }
Source:
protected void Perform ( ) { if ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . isRunningOrPaused ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }

Target:
protected void perform ( ) { if ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . isRunningOrPaused ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }
Source:
public void testCompleteWhenNicNameAndNicIdAreIncoherent ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors accessors = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors ( ) ; org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.lang.String name = nic.getName ( ) ; accessors.setId ( id ) ; accessors.setName ( name ) ; completer.complete ( accessors ) ; org.junit.Assert.assertThat ( accessors.getId ( ) , org.hamcrest.CoreMatchers.is ( id ) ) ; org.junit.Assert.assertThat ( accessors.getName ( ) , org.hamcrest.CoreMatchers.is ( name ) ) ; }

Target:
public void testCompleteWhenNicNameAndNicIdAreIncoherent ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors accessors = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleterTest.TestAccessors ( ) ; org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.lang.String name = nic.getName ( ) ; accessors.setId ( id ) ; accessors.setName ( name ) ; completer.complete ( accessors ) ; org.hamcrest.MatcherAssert.assertThat ( accessors.getId ( ) , org.hamcrest.CoreMatchers.is ( id ) ) ; org.hamcrest.MatcherAssert.assertThat ( accessors.getName ( ) , org.hamcrest.CoreMatchers.is ( name ) ) ; }
Source:
private void addNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) + "2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private void addNonManagementNetworksToPool ( int numberOfNetwworks ) { for ( int i = 0 ; i < numberOfNetwworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( false ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.io.FileOutputStream os = null ; try { os = new java.io.FileOutputStream ( args [ 0 ] ) ; org.ovirt.engine.core.utils.archivers.tar.Tar.doTar ( os , new java.io.File ( args [ 1 ] ) ) ; } finally { try { if ( os != null ) { os.close ( ) ; } } finally { } } }

Target:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.io.FileOutputStream os = null ; try { os = new java.io.FileOutputStream ( args [ 0 ] ) ; org.ovirt.engine.core.utils.archivers.tar.Tar.doTar ( os , new java.io.File ( args [ 1 ] ) ) ; } finally { if ( os != null ) { try { os.close ( ) ; } catch ( java.io.IOException e ) { } } } }
Source:
public void testMissingListSubFields ( ) throws java.lang.Exception { org.ovirt.engine.api.model.HostNic bond = new org.ovirt.engine.api.model.HostNic ( ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( bond , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostNic" , "name, network.id|name, bonding.slaves.id|name" ) ; } }

Target:
public void testMissingListSubFields ( ) throws java.lang.Exception { org.ovirt.engine.api.model.HostNic bond = new org.ovirt.engine.api.model.HostNic ( ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( bond , "name" , "network.id|name" , "bonding.slaves.id|name" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostNic" , "name, network.id|name, bonding.slaves.id|name" ) ; } }
Source:
private static boolean GetSANWipeAfterDelete ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Boolean ) ( returnValue.getReturnValue ( ) ) ) ; } return false ; }

Target:
private static boolean GetSANWipeAfterDelete ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.Boolean ) ( returnValue.getReturnValue ( ) ) ) ; } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLogin ( java.lang.String vmId , java.lang.String domain , java.lang.String user , java.lang.String password ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.desktopLogin" ) . withParameter ( "vmID" , vmId ) . withParameter ( "domain" , domain ) . withParameter ( "username" , user ) . withParameter ( "password" , password ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn desktopLogin ( java.lang.String vmId , java.lang.String domain , java.lang.String user , java.lang.String password ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.desktopLogin" ) . withParameter ( "vmID" , vmId ) . withParameter ( "domain" , domain ) . withParameter ( "username" , user ) . withParameter ( "password" , password ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private void initExternalProvidersList ( ) { org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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 ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllNetworkProviders ( getProvidersQuery ) ; }

Target:
private void initNetworkProvidersList ( ) { org.ovirt.engine.ui.frontend.AsyncQuery getProvidersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getProvidersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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 ) ; getNetworkProviders ( ) . setItems ( providers ) ; getNetworkProviders ( ) . setSelectedItem ( null ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllNetworkProviders ( getProvidersQuery ) ; }
Source:
private org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > createCommand ( org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters params ) { org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; return command ; }

Target:
public void mockVdsDao ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsType ( VDSType.oVirtVintageNode ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; }