auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full endAction" ) ; } }
Source:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.Matchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.< org.ovirt.engine.core.compat.Guid > asList ( jobId ) ) ; }

Target:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.Matchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( jobId ) ) ; }
Source:
protected java.lang.String buildTooltipText ( ) { java.lang.StringBuilder tooltipText = new java.lang.StringBuilder ( ) ; if ( ! ( getCommand ( ) . getExecuteProhibitionReasons ( ) . isEmpty ( ) ) ) { for ( java.lang.String reason : getCommand ( ) . getExecuteProhibitionReasons ( ) ) { if ( ( tooltipText.length ( ) ) == 0 ) { tooltipText.append ( ", " ) ; } tooltipText.append ( reason ) ; } } return tooltipText.toString ( ) ; }

Target:
protected com.google.gwt.safehtml.shared.SafeHtml buildTooltipHtml ( ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder tooltipText = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; if ( ! ( getCommand ( ) . getExecuteProhibitionReasons ( ) . isEmpty ( ) ) ) { for ( java.lang.String reason : getCommand ( ) . getExecuteProhibitionReasons ( ) ) { if ( ( tooltipText.toSafeHtml ( ) . asString ( ) . length ( ) ) != 0 ) { tooltipText.appendHtmlConstant ( "<br/><br/>" ) ; } tooltipText.appendEscaped ( reason ) ; } } return tooltipText.toSafeHtml ( ) ; }
Source:
private void setupListExpectations ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultClusterName ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; parentMock = control.createMock ( org.ovirt.engine.api.resource.ClusterResource.class ) ; org.easymock.EasyMock.expect ( parentMock.get ( ) ) . andReturn ( cluster ) . anyTimes ( ) ; }

Target:
private void setupListExpectations ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultClusterName ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock = control.createMock ( org.ovirt.engine.api.resource.ClusterResource.class ) ; org.easymock.EasyMock.expect ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock.get ( ) ) . andReturn ( cluster ) . anyTimes ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > GetNonOperationalVdssInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allVds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . getAll ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > nonOperationalvdsInPool = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : allVds ) { if ( ( ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) == ( vds.getstatus ( ) ) ) && ( _storagePoolId.equals ( vds.getstorage_pool_id ( ) ) ) ) { nonOperationalvdsInPool.add ( vds ) ; } } return nonOperationalvdsInPool ; }

Target:
private void runStoragePoolUpEvent ( final org.ovirt.engine.core.common.businessentities.storage_pool storagePool ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . isStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } } } ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) ) == null ) ? null : org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) . getNetworkId ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.common.businessentities.ActionGroup.ASSIGN_CLUSTER_NETWORK ) ) ; return permissions ; }

Target:
protected boolean checkPermissions ( final java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permSubjects ) { return permissionsChecker.checkPermissions ( this , permSubjects ) ; }
Source:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } fireAsyncOperationCompleteEvent ( state ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { mVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > returnVMs = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ( ) ; for ( int idx = 0 ; idx < ( mVmListReturn.mInfoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vmInternalData = createVmInternalData ( mVmListReturn.mInfoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > returnVMs = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ( ) ; for ( int idx = 0 ; idx < ( vmListReturn.infoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vmInternalData = createVmInternalData ( vmListReturn.infoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void 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 ) ; }
Source:
public void testListFailure ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.Assert.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return safeIntersection ( searchList , filteredList ) ; } else { return filteredList ; } }

Target:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return safeIntersection ( searchList , filteredList ) ; } else { return filteredList ; } }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void Spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; UpdateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }

Target:
private void spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; updateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }
Source:
public static void registerRollbackHandler ( final org.ovirt.engine.core.utils.transaction.RollbackHandler rollbackHandler ) { try { org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) . registerSynchronization ( new javax.transaction.Synchronization ( ) { @ java.lang.Override public void beforeCompletion ( ) { } @ java.lang.Override public void afterCompletion ( int status ) { if ( ! ( org.ovirt.engine.core.utils.transaction.TransactionSupport.needToRollback ( status ) ) ) return ; rollbackHandler.rollback ( ) ; } } ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Unable to register synchronization to current transaction" , e ) ; } }

Target:
public static void registerRollbackHandler ( final org.ovirt.engine.core.utils.transaction.TransactionCompletionListener transactionCompletionListener ) { try { org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) . registerSynchronization ( new org.ovirt.engine.core.utils.transaction.TransactionSupport.RollbackHandlerSynchronization ( transactionCompletionListener ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Unable to register synchronization to current transaction" , e ) ; } }
Source:
public void restoreFixtures ( ) { java.util.Iterator < org.ovirt.engine.core.common.businessentities.VmStatic > vmStaticIterator = vmStatics.iterator ( ) ; while ( vmStaticIterator.hasNext ( ) ) { dbFacade.getVmStaticDAO ( ) . update ( ( ( org.ovirt.engine.core.common.businessentities.VmStatic ) ( vmStaticIterator.next ( ) ) ) ) ; } }

Target:
public void restoreFixtures ( ) { java.util.Iterator < org.ovirt.engine.core.common.businessentities.VmStatic > vmStaticIterator = vmStatics.iterator ( ) ; while ( vmStaticIterator.hasNext ( ) ) { dbFacade.getVmStaticDao ( ) . update ( ( ( org.ovirt.engine.core.common.businessentities.VmStatic ) ( vmStaticIterator.next ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Arrays.asList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }
Source:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UriHostAddressValidation ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }

Target:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UriHostAddressValidation ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }
Source:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { java.lang.String capsParam = filterConfig.getInitParameter ( org.ovirt.engine.core.aaa.filters.NegotiationFilter.CAPABILITIES_PARAMETER ) ; if ( capsParam != null ) { for ( java.lang.String nego : capsParam.trim ( ) . split ( " *\\| *" ) ) { try { caps |= Authn.Capabilities.class . getField ( nego ) . getLong ( null ) ; } catch ( java.lang.IllegalArgumentException | java.lang.IllegalAccessException | java.lang.NoSuchFieldException ex ) { org.ovirt.engine.core.aaa.filters.NegotiationFilter.log.error ( "Error calculating authn capabilities while accessing constant {}" , nego ) ; } } } }

Target:
public void update ( java.util.Observable o , java.lang.Object arg ) { cacheNegotiatingProfiles ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel exportVmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( array [ 1 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; vmListModel.PostShowWarningOnExistingVms ( exportVmModel , storagePools , getVmOrTemplateQuery ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel exportVmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( array [ 1 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; vmListModel.postShowWarningOnExistingVms ( exportVmModel , storagePools , getVmOrTemplateQuery ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.vds_spm_id_map vds_spm_id_map ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , vds_spm_id_map.getstorage_pool_id ( ) ) . addValue ( "vds_id" , vds_spm_id_map.getId ( ) ) . addValue ( "vds_spm_id" , vds_spm_id_map.getvds_spm_id ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertvds_spm_id_map" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VdsSpmIdMap vdsSpmIdMap ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , vdsSpmIdMap.getStoragePoolId ( ) ) . addValue ( "vds_id" , vdsSpmIdMap.getId ( ) ) . addValue ( "vds_spm_id" , vdsSpmIdMap.getVdsSpmId ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertvds_spm_id_map" , parameterSource ) ; }
Source:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair ( false , "abc" ) ; org.junit.Assert.assertEquals ( p1 , p2 ) ; org.junit.Assert.assertNotEquals ( p1 , p3 ) ; }

Target:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair ( false , "abc" ) ; org.junit.jupiter.api.Assertions.assertEquals ( p1 , p2 ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( p1 , p3 ) ; }
Source:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }

Target:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk , vmDeviceUtils ) . validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }
Source:
private boolean labelRemoved ( ) { return ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( getOldNetwork ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ) ) ; }

Target:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelChanged ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelAdded ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ) ; }
Source:
public void testGlobalSpiceProxy ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; mcr.mockConfigValue ( ConfigValues.SpiceProxyDefault , org.ovirt.engine.api.restapi.types.VmMapperTest.GLOBAL_SPICE_PROXY ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.GLOBAL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void testGlobalSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; mcr.mockConfigValue ( ConfigValues.SpiceProxyDefault , org.ovirt.engine.api.restapi.types.VmMapperTest.GLOBAL_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.GLOBAL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }
Source:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "hello" , "Hello" , comp.changeCaseDisplay ( "hello" ) ) ; org.junit.Assert.assertEquals ( "Hello" , "Hello" , comp.changeCaseDisplay ( "Hello" ) ) ; org.junit.Assert.assertEquals ( "HELLO" , "Hello" , comp.changeCaseDisplay ( "HELLO" ) ) ; org.junit.Assert.assertEquals ( "helLO" , "Hello" , comp.changeCaseDisplay ( "helLO" ) ) ; }

Target:
public void testChangeCaseDisplay ( ) { org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectsBaseAutoCompleter ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Hello" , comp.changeCaseDisplay ( "hello" ) , "hello" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Hello" , comp.changeCaseDisplay ( "Hello" ) , "Hello" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Hello" , comp.changeCaseDisplay ( "HELLO" ) , "HELLO" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "Hello" , comp.changeCaseDisplay ( "helLO" ) , "helLO" ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( ( ( java.lang.String ) ( result ) ) ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }

Target:
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 ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }
Source:
public java.util.Set < java.lang.String > removeSnapshots ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.Set < java.lang.String > memoryVolumes = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getSnapshotDao ( ) . getAll ( vmId ) ) { memoryVolumes.add ( snapshot.getMemoryVolume ( ) ) ; getSnapshotDao ( ) . remove ( snapshot.getId ( ) ) ; } return memoryVolumes ; }

Target:
public java.util.Set < java.lang.String > removeSnapshots ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.Set < java.lang.String > memoryVolumes = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getSnapshotDao ( ) . getAll ( vmId ) ) { memoryVolumes.add ( snapshot.getMemoryVolume ( ) ) ; getSnapshotDao ( ) . remove ( snapshot.getId ( ) ) ; } memoryVolumes.remove ( StringUtils.EMPTY ) ; return memoryVolumes ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initCreateVmParams ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initCreateVmParams ( ) ; createVmParams.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setCloudInitParameters ( runOnceParams.getCloudInitParameters ( ) ) ; return createVmParams ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . buildCreateVmParameters ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setVmInit ( runOnceParams.getVmInit ( ) ) ; return createVmParams ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__HOT_SET_CPUS ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__VM ) ; }

Target:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__HOT_SET_CPUS ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__VM ) ; addCanDoActionMessage ( java.lang.String.format ( "$clusterVersion %1$s" , org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; addCanDoActionMessage ( java.lang.String.format ( "$architecture %1$s" , org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getVm ( ) . getClusterArch ( ) ) ) ; }
Source:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmDao ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }

Target:
protected boolean isDiskExist ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( disk ) ; return ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToVm ( org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmId ( ) ) ) ) ; }
Source:
static void verify ( org.ovirt.engine.api.model.Statistic statistic , java.lang.String name ) { assertEquals ( java.util.UUID.nameUUIDFromBytes ( name.getBytes ( ) ) . toString ( ) , statistic.getId ( ) ) ; assertEquals ( name , statistic.getName ( ) ) ; assertEquals ( StatisticUnit.BYTES , statistic.getUnit ( ) ) ; assertEquals ( StatisticType.GAUGE , statistic.getType ( ) ) ; assertTrue ( statistic.isSetValues ( ) ) ; assertEquals ( ValueType.INTEGER , statistic.getValues ( ) . getType ( ) ) ; }

Target:
static void verify ( org.ovirt.engine.api.model.Statistic statistic , java.lang.String name ) { assertEquals ( java.util.UUID.nameUUIDFromBytes ( name.getBytes ( ) ) . toString ( ) , statistic.getId ( ) ) ; assertEquals ( name , statistic.getName ( ) ) ; assertEquals ( StatisticUnit.BYTES , statistic.getUnit ( ) ) ; assertEquals ( StatisticKind.GAUGE , statistic.getKind ( ) ) ; assertTrue ( statistic.isSetValues ( ) ) ; assertEquals ( ValueType.INTEGER , statistic.getType ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void execute ( ) { int minWidth = calculateWidgetMinWidthNeeded ( ) ; contentPanel.getElement ( ) . getStyle ( ) . setProperty ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.MIN_WIDTH , minWidth , Unit.PX ) ; if ( ( widgetMinWidth ) > 0 ) { siblingWidth = calculateSiblingWidth ( ) ; } initializeCascadeMenuPanel ( ) ; }

Target:
public void execute ( ) { int minWidth = calculateWidgetMinWidthNeeded ( ) ; contentPanel.getElement ( ) . getStyle ( ) . setProperty ( org.ovirt.engine.ui.common.widget.action.AbstractActionPanel.MIN_WIDTH , minWidth , Unit.PX ) ; if ( ( widgetMinWidth ) > 0 ) { siblingWidth = calculateSiblingWidth ( ) ; } for ( int i = 0 ; i < ( ( contentPanel.getWidgetCount ( ) ) - 1 ) ; i ++ ) { originallyVisible.add ( contentPanel.getWidget ( i ) . isVisible ( ) ) ; } initializeCascadeMenuPanel ( ) ; }
Source:
public java.lang.String render ( java.lang.Object [ ] arg ) { java.lang.Object entity = arg [ 0 ] ; org.ovirt.engine.core.compat.Guid objectGuid = ( ( org.ovirt.engine.core.compat.Guid ) ( arg [ 1 ] ) ) ; if ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetEntityGuid ( entity ) . equals ( objectGuid ) ) { return "" ; } java.lang.String ownerName = ( ( java.lang.String ) ( arg [ 2 ] ) ) ; return ownerName ; }

Target:
public java.lang.String render ( java.lang.Object [ ] arg ) { java.lang.Object entity = arg [ 0 ] ; org.ovirt.engine.core.compat.Guid objectGuid = ( ( org.ovirt.engine.core.compat.Guid ) ( arg [ 1 ] ) ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetEntityGuid ( entity ) . equals ( objectGuid ) ) { return "" ; } java.lang.String ownerName = ( ( java.lang.String ) ( arg [ 2 ] ) ) ; return ownerName ; }
Source:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map image_storage_domain_map = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , image_storage_domain_map.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DISK_PROFILE_2 ) ; image_storage_domain_map = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , image_storage_domain_map.getDiskProfileId ( ) , FixturesTool.DISK_PROFILE_2 ) ; }

Target:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , imageStorageDomainMap.getDiskProfileId ( ) , FixturesTool.DISK_PROFILE_2 ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.StorageDomain selectedItem ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageGeneralView.Driver.driver.edit ( getDetailModel ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain entity = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getDetailModel ( ) . getEntity ( ) ) ) ; if ( entity == null ) return ; totalSize.setValue ( entity.getTotalDiskSize ( ) ) ; availableSize.setValue ( entity.getAvailableDiskSize ( ) ) ; usedSize.setValue ( entity.getUsedDiskSize ( ) ) ; overAllocationRatio.setValue ( entity.getStorageDomainOverCommitPercent ( ) ) ; formBuilder.showForm ( getDetailModel ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.StorageDomain selectedItem ) { driver.edit ( getDetailModel ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain entity = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getDetailModel ( ) . getEntity ( ) ) ) ; if ( entity == null ) return ; totalSize.setValue ( entity.getTotalDiskSize ( ) ) ; availableSize.setValue ( entity.getAvailableDiskSize ( ) ) ; usedSize.setValue ( entity.getUsedDiskSize ( ) ) ; overAllocationRatio.setValue ( entity.getStorageDomainOverCommitPercent ( ) ) ; formBuilder.showForm ( getDetailModel ( ) ) ; }
Source:
private void initEditors ( ) { pmTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < java.lang.String > ( ) ) ; }

Target:
private void initEditors ( ) { pmTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StringRenderer < java.lang.String > ( ) ) ; pmEncryptOptionsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; pmEncryptOptionsEditor.setUsePatternFly ( true ) ; pmSecureEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; pmSecureEditor.setUsePatternFly ( true ) ; }