auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.VmPoolUserParameters params = new org.ovirt.engine.core.common.action.VmPoolUserParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }

Target:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.VmPoolUserParameters params = new org.ovirt.engine.core.common.action.VmPoolUserParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . getId ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS host1 , org.ovirt.engine.core.common.businessentities.VDS host2 ) { if ( ( host1.getVdsSpmPriority ( ) ) > ( host2.getVdsSpmPriority ( ) ) ) { return - 1 ; } else if ( ( host1.getVdsSpmPriority ( ) ) < ( host2.getVdsSpmPriority ( ) ) ) { return 1 ; } return 0 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS host1 , org.ovirt.engine.core.common.businessentities.VDS host2 ) { return java.lang.Integer.compare ( host2.getVdsSpmPriority ( ) , host1.getVdsSpmPriority ( ) ) ; }
Source:
public void failWhenHostDoesNotExist ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isHostExists ( null , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , "ACTION_TYPE_FAILED_HOST_NOT_EXIST" ) ; }

Target:
public void failWhenHostDoesNotExist ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isHostExists ( null , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "ACTION_TYPE_FAILED_HOST_NOT_EXIST" , messages.get ( 0 ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final org.ovirt.engine.api.extensions.ExtMap filter , boolean recursiveGroupsResolving ) { return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , Authz.InvokeCommands.QUERY_OPEN , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.RESOLVE_GROUPS_RECURSIVE , recursiveGroupsResolving ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final org.ovirt.engine.api.extensions.ExtMap filter , boolean recursiveGroupsResolving ) { return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.RESOLVE_GROUPS_RECURSIVE , recursiveGroupsResolving ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) ) ; }
Source:
public void nonLocalStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nonLocalStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; org.junit.Assert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected java.lang.Object resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { return entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
protected java.lang.Object resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { return entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { return null ; } }
Source:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getVdsName ( ) , target_vds.getHostName ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( java.util.Arrays.asList ( target_vds ) ) ) ; } return returnValue ; }

Target:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getName ( ) , target_vds.getHostName ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( java.util.Arrays.asList ( target_vds ) ) ) ; } return returnValue ; }
Source:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; }

Target:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; }
Source:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }

Target:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( false ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( canDoActionMessages , domainsMap ) ) ) { return failCanDoActionWithType ( ) ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } if ( ! ( canDoActionAfterCloneVm ( canDoActionMessages , domainsMap ) ) ) { return failCanDoActionWithType ( ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( domainsMap ) ) ) { return false ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } return canDoActionAfterCloneVm ( domainsMap ) ; }
Source:
public boolean validate ( ) { getSlaveVolumes ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 128 ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; getSlaveHosts ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 128 ) } ) ; return ( getSlaveVolumes ( ) . getIsValid ( ) ) && ( getSlaveHosts ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { getSlaveVolumes ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 128 ) } ) ; getSlaveHosts ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( 128 ) } ) ; return ( getSlaveVolumes ( ) . getIsValid ( ) ) && ( getSlaveHosts ( ) . getIsValid ( ) ) ; }
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 , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , baseUri , replay ) ; }

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 , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , null , null , baseUri , replay ) ; }
Source:
public final java.lang.Object getData ( java.lang.String sessionId , java.lang.String key , boolean refresh ) { if ( sessionId == null ) { return null ; } org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; java.lang.Object value = null ; if ( sessionInfo != null ) { if ( refresh ) { refresh ( sessionInfo ) ; } value = sessionInfo.contentOfSession.get ( key ) ; } return value ; }

Target:
protected final java.lang.Object getData ( java.lang.String sessionId , java.lang.String key , boolean refresh ) { if ( sessionId == null ) { return null ; } org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; java.lang.Object value = null ; if ( sessionInfo != null ) { if ( refresh ) { refresh ( sessionInfo ) ; } value = sessionInfo.contentOfSession.get ( key ) ; } return value ; }
Source:
public org.ovirt.engine.core.common.job.Job getJobWithSteps ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; loadJobSteps ( job ) ; } return job ; }

Target:
public org.ovirt.engine.core.common.job.Job getJobWithSteps ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; } return job ; }
Source:
public void equalSpaceThreshold ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 5 ; settings.diskSpaceUsed = 5 ; settings.spaceThresholdGB = 5 ; settings.spaceThresholdPct = 10 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }

Target:
public void equalSpaceThreshold ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 5 ; settings.diskSpaceUsed = 5 ; settings.spaceThresholdGB = 5 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( volumeId , new org.ovirt.engine.core.common.businessentities.VdsStatic ( serverName , "127.0.0.1" , "0934390834" , 20 , 22 , "root" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , serverId , serverName , true , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode ) , org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; return brick ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( volumeId , new org.ovirt.engine.core.common.businessentities.VdsStatic ( serverName , "127.0.0.1" , "0934390834" , 20 , org.ovirt.engine.core.compat.Guid.newGuid ( ) , serverId , serverName , true , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode ) , org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; return brick ; }
Source:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = 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 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getVdsGroupCompatibilityVersion ( ) , dataCenterVersion ) ; }

Target:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = 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 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getVdsGroupCompatibilityVersion ( ) , dataCenterVersion ) ; }
Source:
public void externalVmAreNotSavedAsLastVm ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { stubCalls ( data ) ; org.junit.Assert.assertTrue ( vmsListFetcher.fetch ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.mockito.Mockito.verify ( vdsManager ) . setLastVmsList ( vdsManagerArgumentCaptor.capture ( ) ) ; org.junit.Assert.assertTrue ( ( ( vdsManagerArgumentCaptor.getValue ( ) . size ( ) ) == 0 ) ) ; }

Target:
public void externalVmAreNotSavedAsLastVm ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { stubCalls ( data ) ; org.junit.Assert.assertTrue ( vmsListFetcher.fetch ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.mockito.Mockito.verify ( vdsManager ) . setLastVmsList ( vdsManagerArgumentCaptor.capture ( ) ) ; org.junit.Assert.assertEquals ( 0 , vdsManagerArgumentCaptor.getValue ( ) . size ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StatsInfo > getStatsInfo ( ) { org.ovirt.engine.core.common.businessentities.gluster.StatsInfo statInfo = new org.ovirt.engine.core.common.businessentities.gluster.StatsInfo ( ) ; statInfo.setDuration ( 2 ) ; statInfo.setDurationFormatted ( new org.ovirt.engine.core.common.utils.Pair ( new java.lang.Integer ( 2 ) , java.util.concurrent.TimeUnit.SECONDS.toString ( ) ) ) ; statInfo.setTotalRead ( 0 ) ; statInfo.setTotalWrite ( 0 ) ; statInfo.setBlockStats ( getBlockStats ( ) ) ; statInfo.setFopStats ( getFopStats ( ) ) ; return java.util.Collections.singletonList ( statInfo ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StatsInfo > getStatsInfo ( ) { org.ovirt.engine.core.common.businessentities.gluster.StatsInfo statInfo = new org.ovirt.engine.core.common.businessentities.gluster.StatsInfo ( ) ; statInfo.setDuration ( 2 ) ; statInfo.setDurationFormatted ( new org.ovirt.engine.core.common.utils.Pair ( 2 , java.util.concurrent.TimeUnit.SECONDS.toString ( ) ) ) ; statInfo.setTotalRead ( 0 ) ; statInfo.setTotalWrite ( 0 ) ; statInfo.setBlockStats ( getBlockStats ( ) ) ; statInfo.setFopStats ( getFopStats ( ) ) ; return java.util.Collections.singletonList ( statInfo ) ; }
Source:
private org.ovirt.engine.core.bll.AddQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( mockGeneralStorageQuota ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( quotaDao ) . getQuotaByQuotaName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.AddQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( mockGeneralStorageQuota ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; return command ; }
Source:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String message ; if ( loggerString.isEmpty ( ) ) { message = auditLog.toStringForLogging ( ) ; } else { message = java.text.MessageFormat.format ( loggerString , auditLog.getMessage ( ) ) ; } return java.text.MessageFormat.format ( "EVENT_ID: {0}({1}), {2}" , auditLog.getLogType ( ) , auditLog.getLogType ( ) . getValue ( ) , message ) ; }

Target:
private static java.lang.String getMessageToLog ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { return java.text.MessageFormat.format ( "EVENT_ID: {0}({1}), {2}" , auditLog.getLogType ( ) , auditLog.getLogType ( ) . getValue ( ) , auditLog.getMessage ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { java.lang.Boolean includeUserData = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.SendVmTicketUID , org.ovirt.engine.core.vdsbroker.vdsbroker.SetVmTicketVDSCommand.getVds ( ) . getClusterCompatibilityVersion ( ) . toString ( ) ) ; if ( org.ovirt.engine.core.common.FeatureSupported.graphicsDeviceEnabled ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetVmTicketVDSCommand.getVds ( ) . getClusterCompatibilityVersion ( ) ) ) { setTicketUsingUpdateDevice ( includeUserData ) ; } else { setTicketLegacy ( includeUserData ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.SetVmTicketVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.graphicsDeviceEnabled ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetVmTicketVDSCommand.getVds ( ) . getClusterCompatibilityVersion ( ) ) ) { setTicketUsingUpdateDevice ( ) ; } else { setTicketLegacy ( ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.SetVmTicketVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isReadOnly ( ) , "" , null , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . getSnapshotId ( ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , null , true , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . isReadOnly ( ) , "" , null , org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getParameters ( ) . getSnapshotId ( ) , null ) ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData lookupClusterUtilization ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData utilization = new org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData ( ) ; try { org.ovirt.engine.ui.frontend.server.dashboard.HeatMapHelper.getCpuAndMemory ( utilization , dwhDataSource ) ; utilization.setStorage ( org.ovirt.engine.ui.frontend.server.dashboard.HeatMapHelper.getStorage ( dwhDataSource ) ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException ( e ) ; } return utilization ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData lookupClusterUtilization ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData utilization = new org.ovirt.engine.ui.frontend.server.dashboard.HeatMapData ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.HeatMapHelper.getCpuAndMemory ( utilization , dwhDataSource ) ; utilization.setStorage ( org.ovirt.engine.ui.frontend.server.dashboard.HeatMapHelper.getStorage ( dwhDataSource ) ) ; return utilization ; }
Source:
private void setConsoleHelpers ( ) { this . consoleUtils = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) ) ) ; this . consoleManager = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) ) ) ; this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }

Target:
private void setConsoleHelpers ( ) { this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }
Source:
private void refreshHostDeviceList ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.hostDevicePassthrough ( getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { try { runInternalAction ( VdcActionType.RefreshHostDevices , new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.error ( "Could not refresh host devices for host '{}'" , getVds ( ) . getName ( ) ) ; } } }

Target:
private void refreshHostDeviceList ( ) { try { runInternalAction ( VdcActionType.RefreshHostDevices , new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.error ( "Could not refresh host devices for host '{}'" , getVds ( ) . getName ( ) ) ; } }
Source:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
private void printKey ( ) throws java.lang.Exception { java.lang.String key = parser.getKey ( ) ; java.lang.String version = parser.getVersion ( ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( version ) ) { org.ovirt.engine.core.config.entity.ConfigKey configKey = getConfigKey ( key ) ; testIfConfigKeyCanBeFetchedOrPrinted ( configKey ) ; if ( configKey == null ) { throw new java.lang.RuntimeException ( ( ( "Error fetching " + key ) + " value: no such entry. Please verify key name and property file support." ) ) ; } printAllValuesForKey ( configKey.getKey ( ) ) ; } else { printKeyWithSpecifiedVersion ( key , version ) ; } }

Target:
private void printKey ( ) throws java.lang.Exception { java.lang.String key = parser.getKey ( ) ; java.lang.String version = parser.getVersion ( ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( version ) ) { org.ovirt.engine.core.config.entity.ConfigKey configKey = getConfigKey ( key ) ; if ( configKey == null ) { throw new java.lang.RuntimeException ( ( ( "Error fetching " + key ) + " value: no such entry. Please verify key name and property file support." ) ) ; } testIfConfigKeyCanBeFetchedOrPrinted ( configKey ) ; printAllValuesForKey ( configKey.getKey ( ) ) ; } else { printKeyWithSpecifiedVersion ( key , version ) ; } }
Source:
protected boolean isLiveSnapshotApplicable ( ) { return ( ( ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.RunVm ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . isRunning ( ) ) || ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) ; }

Target:
protected boolean isLiveSnapshotApplicable ( ) { return ( ( ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.RunVm ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . isRunning ( ) ) || ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) && ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IP_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.GATEWAY ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; result.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IP_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; return result ; }
Source:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser , java.lang.String engineSessionId , java.lang.String ssoToken ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; obj.put ( "isAdmin" , loggedInUser.isAdmin ( ) ) ; obj.put ( "engineSessionId" , engineSessionId ) ; obj.put ( "ssoToken" , ssoToken ) ; return obj ; }

Target:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser , java.lang.String ssoToken ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; obj.put ( "isAdmin" , loggedInUser.isAdmin ( ) ) ; obj.put ( "ssoToken" , ssoToken ) ; return obj ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
public void validateSucceedsWithStopActionType ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionType ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void initListBoxEditors ( ) { profileSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.aaa.ProfileEntry > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.aaa.ProfileEntry > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.aaa.ProfileEntry object ) { return object.toString ( ) ; } } ) ; roleSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Role > ( ) ) ; namespaceSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.String > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.String > ( ) { @ java.lang.Override protected java.lang.String renderNullSafe ( java.lang.String object ) { return object ; } } ) ; }

Target:
private void initListBoxEditors ( ) { profileSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.aaa.ProfileEntry > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.aaa.ProfileEntry object ) { return object.toString ( ) ; } } ) ; roleSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Role > ( ) ) ; namespaceSelection = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.String > ( ) { @ java.lang.Override protected java.lang.String renderNullSafe ( java.lang.String object ) { return object ; } } ) ; }
Source:
private static int getMaxNumberOfMonitors ( ) { int max = 0 ; java.lang.String numOfMonitorsStr = org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.ValidNumOfMonitors ) . toString ( ) . replaceAll ( "[\\[\\]]" , "" ) ; java.lang.String [ ] values = numOfMonitorsStr.split ( "," ) ; for ( java.lang.String val : values ) { val = val.trim ( ) ; if ( ( java.lang.Integer.valueOf ( val ) ) > max ) { max = java.lang.Integer.valueOf ( val ) ; } } return max ; }

Target:
private static int getMaxNumberOfMonitors ( ) { int max = 0 ; java.lang.String numOfMonitorsStr = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.ValidNumOfMonitors ) . toString ( ) . replaceAll ( "[\\[\\]]" , "" ) ; java.lang.String [ ] values = numOfMonitorsStr.split ( "," ) ; for ( java.lang.String val : values ) { val = val.trim ( ) ; if ( ( java.lang.Integer.valueOf ( val ) ) > max ) { max = java.lang.Integer.valueOf ( val ) ; } } return max ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getVdcUser ( ) ) != null ) { org.ovirt.engine.core.bll.UserCommandBase.persistAuthenticatedUser ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdUser ( ) ) ; } else if ( ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdGroup ( ) ) != null ) { org.ovirt.engine.core.bll.AdGroupsHandlingCommandBase.initAdGroup ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdGroup ( ) ) ; } org.ovirt.engine.core.bll.AddUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdUser ( ) ) != null ) { org.ovirt.engine.core.bll.UserCommandBase.persistAuthenticatedUser ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdUser ( ) ) ; } else if ( ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdGroup ( ) ) != null ) { org.ovirt.engine.core.bll.AdGroupsHandlingCommandBase.initAdGroup ( org.ovirt.engine.core.bll.AddUserCommand.getParameters ( ) . getAdGroup ( ) ) ; } org.ovirt.engine.core.bll.AddUserCommand.setSucceeded ( true ) ; }
Source:
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.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.HashMap ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageToRemoveByParam ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters param ) { org.ovirt.engine.core.compat.Guid imageGroupId = param.getDestImageGroupId ( ) ; org.ovirt.engine.core.compat.Guid imageId = param.getDestinationImageId ( ) ; org.ovirt.engine.core.compat.Guid vmId = param.getContainerId ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setvm_guid ( vmId ) ; diskImage.setId ( imageGroupId ) ; diskImage.setImageId ( imageId ) ; return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageToRemoveByParam ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters param ) { org.ovirt.engine.core.compat.Guid imageGroupId = param.getDestImageGroupId ( ) ; org.ovirt.engine.core.compat.Guid imageId = param.getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( imageGroupId ) ; diskImage.setImageId ( imageId ) ; return diskImage ; }
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusUp ( ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateAttachStorageDomain ( ) { org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator spValidator = new org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator ( getStoragePool ( ) ) ; org.ovirt.engine.core.bll.ValidationResult result ; result = spValidator.isAnyDomainInProcess ( ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } result = isCinderSupportedInDC ( ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } result = spValidator.checkStoragePoolNotInStatus ( StoragePoolStatus.Up ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAttachStorageDomain ( ) { org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator spValidator = new org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator ( getStoragePool ( ) ) ; org.ovirt.engine.core.bll.ValidationResult result ; result = spValidator.isAnyDomainInProcess ( ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } result = spValidator.checkStoragePoolNotInStatus ( StoragePoolStatus.Up ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( log ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( log ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) , context ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }