auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getStorageName ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }

Target:
private void addSourceStorageDomainName ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel disk , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceStorageDomains ) { java.lang.String sourceStorageName = ( sourceStorageDomains.isEmpty ( ) ) ? constants.notAvailableLabel ( ) : sourceStorageDomains.get ( 0 ) . getStorageName ( ) ; disk.getSourceStorageDomainName ( ) . setEntity ( sourceStorageName ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { boolean returnValue = super . equals ( obj ) ; if ( ( ( ! returnValue ) && ( obj != null ) ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ) { returnValue = ( ( ( getid ( ) ) != null ) && ( ! ( getid ( ) . isEmpty ( ) ) ) ) && ( getid ( ) . equals ( ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( obj ) ) . getid ( ) ) ) ; } return returnValue ; }

Target:
public boolean equals ( java.lang.Object obj ) { boolean returnValue = super . equals ( obj ) ; if ( ( ( ! returnValue ) && ( obj != null ) ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ) { returnValue = ( ( ( getId ( ) ) != null ) && ( ! ( getId ( ) . isEmpty ( ) ) ) ) && ( getId ( ) . equals ( ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( obj ) ) . getId ( ) ) ) ; } return returnValue ; }
Source:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmMaxPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }

Target:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmMaxPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }
Source:
private void listenToDetachableFields ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.Model > models ) { for ( org.ovirt.engine.ui.uicommonweb.models.Model model : models ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.ListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( model ) ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; } else if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.EntityModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( model ) ) . getEntityChangedEvent ( ) . addListener ( this ) ; } } }

Target:
private void listenToDetachableFields ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.Model > models ) { for ( org.ovirt.engine.ui.uicommonweb.models.Model model : models ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.ListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < ? > ) ( model ) ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; } else if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.EntityModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > ) ( model ) ) . getEntityChangedEvent ( ) . addListener ( this ) ; } } }
Source:
public void initUserAndGroupData ( ) { if ( ( _dbUser ) == null ) { _dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } if ( ( _adGroup ) == null ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; _adGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( dbGroup ) ; } }

Target:
public void initUserAndGroupData ( ) { if ( ( _dbUser ) == null ) { _dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } if ( ( _adGroup ) == null ) { org.ovirt.engine.core.common.businessentities.DbGroup dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; if ( dbGroup != null ) { _adGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( dbGroup ) ; } } }
Source:
private static java.lang.Object instantiate ( java.lang.Class < ? > clz ) { java.lang.Object model = null ; try { model = clz.newInstance ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.api.restapi.types.MappingTestHelper.logger.error ( ( "Failed to instantiate class " + ( clz.getSimpleName ( ) ) ) , e ) ; } return model ; }

Target:
private static java.lang.Object instantiate ( java.lang.Class < ? > clz ) throws java.lang.Exception { java.lang.Object model = null ; model = clz.newInstance ( ) ; return model ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Collection < org.ovirt.engine.core.common.businessentities.VmWatchdog > watchdogs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog watchdog : watchdogs ) { model.getWatchdogAction ( ) . setSelectedItem ( watchdog.getAction ( ) . name ( ) . toLowerCase ( ) ) ; model.getWatchdogModel ( ) . setSelectedItem ( watchdog.getModel ( ) . name ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Collection < org.ovirt.engine.core.common.businessentities.VmWatchdog > watchdogs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog watchdog : watchdogs ) { model.getWatchdogAction ( ) . setSelectedItem ( watchdog.getAction ( ) ) ; model.getWatchdogModel ( ) . setSelectedItem ( watchdog.getModel ( ) ) ; } }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.URL_BASE ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.URL_BASE ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( "templates/" + ( GUIDS [ 0 ] ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( "templates/" + ( GUIDS [ 0 ] ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
public void executeSave ( ) { org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > parameters = new org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) ; parameters.setQos ( networkQoS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateNetworkQoS , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( succeeded ) ; } } ) ; }

Target:
public void executeSave ( ) { org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > parameters = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; parameters.setQos ( networkQoS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateNetworkQoS , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( succeeded ) ; } } ) ; }
Source:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFence ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }

Target:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFence ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }
Source:
private java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.FileReader input = new java.io.FileReader ( passFile ) ; java.io.BufferedReader br = new java.io.BufferedReader ( input ) ; java.lang.String pass = br.readLine ( ) ; try { input.close ( ) ; br.close ( ) ; } catch ( java.lang.Exception e ) { } return pass ; }

Target:
public static java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.FileReader input = new java.io.FileReader ( passFile ) ; java.io.BufferedReader br = new java.io.BufferedReader ( input ) ; java.lang.String pass = br.readLine ( ) ; try { input.close ( ) ; br.close ( ) ; } catch ( java.lang.Exception e ) { } return pass ; }
Source:
private < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }
Source:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { initializeMock ( ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }

Target:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { initializeMock ( ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }
Source:
public void validateFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsDiffInterface ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 , getBricks ( volumeId1 , 2 ) , 0 , 4 , false ) ) ; prepareMocks ( cmd ) ; prepareInterfaceMocks ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.Empty ) ; }
Source:
private void initIntervals ( ) { java.util.List < java.lang.String > intervals = new java.util.ArrayList < > ( ) ; int mins = 0 ; for ( int nThMin = 1 ; mins < 55 ; nThMin ++ ) { mins = nThMin * 5 ; intervals.add ( java.lang.String.valueOf ( mins ) ) ; } getInterval ( ) . setItems ( intervals , java.lang.String.valueOf ( 5 ) ) ; }

Target:
private void initIntervals ( ) { java.util.List < java.lang.String > intervals = new java.util.ArrayList < > ( ) ; int mins = 0 ; for ( int nThMin = 1 ; mins < 55 ; nThMin ++ ) { mins = nThMin * 5 ; intervals.add ( java.lang.String.valueOf ( mins ) ) ; } getInterval ( ) . setItems ( intervals ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_DISABLE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } }

Target:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } }
Source:
private void mockVdsDao ( org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > listVds ) { org.ovirt.engine.core.dao.VdsDao vdsDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForStoragePoolAndStatus ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( vdsStatus ) ) ) . thenReturn ( listVds ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsDao ( ) ) . thenReturn ( vdsDaoMock ) ; }

Target:
private void mockVdsDao ( org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > listVds ) { org.mockito.Mockito.when ( vdsDaoMock.getAllForStoragePoolAndStatus ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( vdsStatus ) ) ) . thenReturn ( listVds ) ; }
Source:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getCluster ( false ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }

Target:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { org.mockito.Mockito.doReturn ( getCluster ( false ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { super . init ( model ) ; model.getDataCenterWithClustersList ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( model.getSelectedCluster ( ) ) != null ) { setSpiceProxyOverrideExplanation ( model.getSelectedCluster ( ) ) ; } } } ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { super . init ( model ) ; model.getDataCenterWithClustersList ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( model.getSelectedCluster ( ) ) != null ) { setSpiceProxyOverrideExplanation ( model.getSelectedCluster ( ) ) ; } } } ) ; }
Source:
public java.lang.Object call ( ) throws java.lang.Exception { if ( ( _managementNetwork ) != null ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , _managementNetwork ) ; } else if ( _isLegacyNode ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; } else { _parser.cliNoop ( ) ; } return null ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _managementNetwork ) != null ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , _managementNetwork ) ; } else if ( _isLegacyNode ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; } else { _parser.cliNoop ( ) ; } return true ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; return diskImage ; }
Source:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getClusterId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }

Target:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isMigration , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setMigration ( isMigration ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isMigration , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setMigration ( isMigration ) ; networkCluster.setRequired ( isRequired ) ; org.mockito.Mockito.when ( entity.getCluster ( ) ) . thenReturn ( networkCluster ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public void testHasPeersTrue ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }

Target:
public void testHasPeersTrue ( ) { org.junit.Assert.assertNotNull ( glusterUtil.getPeers ( client ) ) ; org.junit.Assert.assertEquals ( 2 , glusterUtil.getPeers ( client ) . size ( ) ) ; }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation , java.lang.Throwable throwable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; alert.updateCallStackFromThrowable ( throwable ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }

Target:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation , java.lang.Throwable throwable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; alert.updateCallStackFromThrowable ( throwable ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }
Source:
public static void getRedirectServletReportsPage ( 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.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getRedirectServletReportsPage ( 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 ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
void modelBoundWidgetChange ( ) { org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand = org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . getLastExecutedCommand ( ) ; org.ovirt.engine.ui.common.presenter.ModelBoundPresenterWidget < ? > modelBoundPresenterWidget = getModelBoundWidget ( lastExecutedCommand ) ; ( ( org.ovirt.engine.ui.common.presenter.ModelBoundPresenterWidget < org.ovirt.engine.ui.uicommonweb.models.Model > ) ( modelBoundPresenterWidget ) ) . init ( org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . getWidgetModel ( ) ) ; }

Target:
void modelBoundWidgetChange ( ) { org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand = getModel ( ) . getLastExecutedCommand ( ) ; org.ovirt.engine.ui.common.presenter.ModelBoundPresenterWidget < ? > modelBoundPresenterWidget = getModelBoundWidget ( lastExecutedCommand ) ; ( ( org.ovirt.engine.ui.common.presenter.ModelBoundPresenterWidget < org.ovirt.engine.ui.uicommonweb.models.Model > ) ( modelBoundPresenterWidget ) ) . init ( getModel ( ) . getWidgetModel ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > networkFilters = new java.util.ArrayList ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; networkFilters.add ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.EMPTY_FILTER ) ; getNetworkFilter ( ) . setItems ( networkFilters ) ; initSelectedNetworkFilter ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > networkFilters = new java.util.ArrayList ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > ) ( returnValue.getReturnValue ( ) ) ) ) ; networkFilters.add ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.EMPTY_FILTER ) ; getNetworkFilter ( ) . setItems ( networkFilters ) ; initSelectedNetworkFilter ( ) ; }
Source:
public void onAcccept ( final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { client.setRetryPolicy ( new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 180000 , 0 , 1000000 ) ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler handler = new org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler ( client , message ) ; service.submit ( handler ) ; } } ) ; }

Target:
public void onAcccept ( final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler handler = new org.ovirt.vdsmfake.rpc.json.JsonRpcServer.MessageHandler ( client , message ) ; service.submit ( handler ) ; } } ) ; }
Source:
public void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.lang.String s = java.lang.String.valueOf ( vmDevice.getBootOrder ( ) ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.put ( VdsProperties.BootOrder , s ) ; } }

Target:
void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.lang.String s = java.lang.String.valueOf ( vmDevice.getBootOrder ( ) ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.put ( VdsProperties.BootOrder , s ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg1 ) { int compareValue = arg0.getSecond ( ) . getVdsGroupName ( ) . compareTo ( arg1.getSecond ( ) . getVdsGroupName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return arg0.getSecond ( ) . getVdsName ( ) . compareTo ( arg1.getSecond ( ) . getVdsName ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg1 ) { int compareValue = arg0.getSecond ( ) . getVdsGroupName ( ) . compareTo ( arg1.getSecond ( ) . getVdsGroupName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return arg0.getSecond ( ) . getName ( ) . compareTo ( arg1.getSecond ( ) . getName ( ) ) ; }
Source:
private static void populateBigDecimal ( java.lang.reflect.Method method , java.lang.Object model ) { try { method.invoke ( model , new java.math.BigDecimal ( org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( 100 ) ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.api.restapi.types.MappingTestHelper.logger.error ( ( ( ( "Failed to populate big decimal in " + ( method.getDeclaringClass ( ) ) ) + "." ) + ( method.getName ( ) ) ) , e ) ; } }

Target:
private static void populateBigDecimal ( java.lang.reflect.Method method , java.lang.Object model ) throws java.lang.Exception { method.invoke ( model , new java.math.BigDecimal ( org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( 100 ) ) ) ; }
Source:
protected boolean validateName ( java.lang.String newVmName , org.ovirt.engine.ui.uicommonweb.models.EntityModel entity , org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] validators ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel temp = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; temp.setIsValid ( true ) ; temp.setEntity ( newVmName ) ; temp.validateEntity ( validators ) ; if ( ! ( temp.getIsValid ( ) ) ) { entity.setInvalidityReasons ( temp.getInvalidityReasons ( ) ) ; entity.setIsValid ( false ) ; } return temp.getIsValid ( ) ; }

Target:
protected boolean validateName ( java.lang.String newVmName , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > entity , org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] validators ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > temp = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; temp.setIsValid ( true ) ; temp.setEntity ( newVmName ) ; temp.validateEntity ( validators ) ; if ( ! ( temp.getIsValid ( ) ) ) { entity.setInvalidityReasons ( temp.getInvalidityReasons ( ) ) ; entity.setIsValid ( false ) ; } return temp.getIsValid ( ) ; }