auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void SleepOnReboot ( ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ServerRebootTimeout ) ; org.ovirt.engine.core.bll.VdsCommand.log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }

Target:
private void SleepOnReboot ( ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( T value ) { if ( ( value == null ) || ( ( value.getComment ( ) ) == null ) ) { return null ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value.getComment ( ) ) ; }

Target:
public java.lang.String getValue ( T value ) { if ( ( ( value != null ) && ( ( value.getComment ( ) ) != null ) ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return value.getComment ( ) ; } return null ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = setNetwork ( nic , entity ) ; return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , iface , ( nic.isSetNetwork ( ) ? iface.getNetworkName ( ) : null ) , ( nic.isSetPortMirroring ( ) ? iface.isPortMirroring ( ) : false ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , entity ) ; }
Source:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getname ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }

Target:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getname ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) ; params.setLastUpdate ( lastUpdate ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public static org.ovirt.engine.api.model.HostProtocol map ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol , org.ovirt.engine.api.model.HostProtocol template ) { org.ovirt.engine.api.model.HostProtocol result = null ; if ( protocol != null ) { switch ( protocol ) { case STOMP : result = org.ovirt.engine.api.model.HostProtocol.STOMP ; break ; case AMQP : result = org.ovirt.engine.api.model.HostProtocol.AMQP ; break ; case XML : default : result = org.ovirt.engine.api.model.HostProtocol.XML ; break ; } } return result ; }

Target:
public static org.ovirt.engine.api.model.HostProtocol map ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol , org.ovirt.engine.api.model.HostProtocol template ) { org.ovirt.engine.api.model.HostProtocol result = null ; if ( protocol != null ) { switch ( protocol ) { case STOMP : result = org.ovirt.engine.api.model.HostProtocol.STOMP ; break ; case XML : default : result = org.ovirt.engine.api.model.HostProtocol.XML ; break ; } } return result ; }
Source:
private void setupVmNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > expectedVmNetworkInterface = java.util.Collections.singletonList ( vmNetworkInterface ) ; org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao vmNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForTemplatesByNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDaoMock ) ; }

Target:
private void setupVmNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > expectedVmNetworkInterface = java.util.Collections.singletonList ( vmNetworkInterface ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForTemplatesByNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterface ) ; }
Source:
public void run ( ) { try { org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Start event notification service iteration" ) ; startup ( ) ; processEvents ( ) ; if ( shouldDeleteHistory ) { deleteObseleteHistoryData ( ) ; } org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Finish event notification service iteration" ) ; } catch ( java.lang.Throwable e ) { if ( ! ( java.lang.Thread.interrupted ( ) ) ) { org.ovirt.engine.core.notifier.NotificationService.log.error ( java.lang.String.format ( "Failed to run the service: [%s]" , e.getMessage ( ) ) , e ) ; } shutdown ( ) ; } }

Target:
public void run ( ) { try { org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Start event notification service iteration" ) ; startup ( ) ; processEvents ( ) ; if ( shouldDeleteHistory ) { deleteObseleteHistoryData ( ) ; } org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Finish event notification service iteration" ) ; } catch ( java.lang.Throwable e ) { if ( ! ( java.lang.Thread.interrupted ( ) ) ) { org.ovirt.engine.core.notifier.NotificationService.log.error ( java.lang.String.format ( "Failed to run the service: [%s]" , e.getMessage ( ) ) , e ) ; } } }
Source:
private java.lang.Object addPrefixToLogMessage ( java.lang.Object logMessage ) { java.lang.String correlationId = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getCorrelationId ( ) ; if ( correlationId == null ) { return logMessage ; } return java.lang.String.format ( org.ovirt.engine.core.utils.log.Log.CORRELATION_ID_MESSAGE_FORMAT , correlationId , logMessage ) ; }

Target:
private java.lang.String addPrefixToLogMessage ( java.lang.Object logMessage ) { java.lang.String correlationId = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getCorrelationId ( ) ; if ( correlationId == null ) { if ( logMessage == null ) { return null ; } else { return logMessage.toString ( ) ; } } return java.lang.String.format ( org.ovirt.engine.core.utils.log.Log.CORRELATION_ID_MESSAGE_FORMAT , correlationId , logMessage ) ; }
Source:
public void onSuccess ( java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangeable ( true ) ; setEnableSearchHost ( true ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) , true , false ) ; } else { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( diskImageList , true , false ) ; } }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > diskImageList ) { if ( diskImageList == null ) { return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) , true , false ) ; } return org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( diskImageList , true , false ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_domains setupForSpaceTest ( final org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; dynamic.setavailable_disk_size ( settings.diskSpaceFree ) ; dynamic.setused_disk_size ( settings.diskSpaceUsed ) ; org.ovirt.engine.core.common.businessentities.storage_domains domain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; domain.setStorageDynamicData ( dynamic ) ; org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.mockConfig ( settings.spaceThresholdGB , settings.spaceThresholdPct ) ; return domain ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage_domains setupForSpaceTest ( final org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; dynamic.setavailable_disk_size ( settings.diskSpaceFree ) ; dynamic.setused_disk_size ( settings.diskSpaceUsed ) ; org.ovirt.engine.core.common.businessentities.storage_domains domain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; domain.setStorageDynamicData ( dynamic ) ; org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.mockConfig ( settings.spaceThresholdGB ) ; return domain ; }
Source:
public void allow36HostWithoutDeployingHostedEngine ( ) { mockCluster ( Version.v3_6 ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration heConfig = new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.NONE ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( heConfig ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void allow36HostWithoutDeployingHostedEngine ( ) { org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration heConfig = new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.NONE ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( heConfig ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SsoSession ssoSession ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SsoConstants.JSON_ACCESS_TOKEN , ssoSession.getAccessToken ( ) ) ; payload.put ( SsoConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SsoConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) ) ; payload.put ( SsoConstants.JSON_TOKEN_TYPE , "bearer" ) ; return payload ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SsoSession ssoSession ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SsoConstants.JSON_ACCESS_TOKEN , ssoSession.getAccessToken ( ) ) ; payload.put ( SsoConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SsoConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) . toString ( ) ) ; payload.put ( SsoConstants.JSON_TOKEN_TYPE , "bearer" ) ; return payload ; }
Source:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void endSuccessfully ( ) { endCreateAllSnapshots ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { updateDestinationImageId ( parameters ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( enclosingCommand.getExecutionContext ( ) , true ) ; enclosingCommand.setExecutionContext ( null ) ; }

Target:
public void endSuccessfully ( ) { endCreateAllSnapshots ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { updateDestinationImageId ( parameters ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( enclosingCommand.getExecutionContext ( ) , true ) ; }
Source:
private static org.ovirt.engine.api.model.TagParent parent ( org.ovirt.engine.core.common.businessentities.Tags entity ) { if ( ( entity.getparent_id ( ) ) != null ) { org.ovirt.engine.api.model.TagParent parent = new org.ovirt.engine.api.model.TagParent ( ) ; parent.setTag ( new org.ovirt.engine.api.model.Tag ( ) ) ; parent.getTag ( ) . setId ( entity.getparent_id ( ) . toString ( ) ) ; return parent ; } else { return null ; } }

Target:
private static org.ovirt.engine.api.model.Tag parent ( org.ovirt.engine.core.common.businessentities.Tags entity ) { if ( ( entity.getparent_id ( ) ) != null ) { org.ovirt.engine.api.model.Tag parent = new org.ovirt.engine.api.model.Tag ( ) ; parent.setId ( entity.getparent_id ( ) . toString ( ) ) ; return parent ; } else { return null ; } }
Source:
public void testCreateTasksStartedFromCLIWithErrors ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocksForTasksFromCLI ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testCreateTasksStartedFromCLIWithErrors ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
Source:
void initEditors ( ) { selectHostAutomaticallyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; selectDestinationHostEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; hostsListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getName ( ) ; } } ) ; }

Target:
protected java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return cluster.getName ( ) ; }
Source:
public void testConvertPiBToZiB ( ) { double pib = 15 * ( java.lang.Math.pow ( 1024 , 2 ) ) ; int zib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( pib ) ) , SizeUnit.PiB , SizeUnit.ZiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( zib , 15 ) ; }

Target:
public void testConvertPiBToZiB ( ) { double pib = 15 * ( java.lang.Math.pow ( 1024 , 2 ) ) ; int zib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( pib ) ) , SizeUnit.PiB , SizeUnit.ZiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( 15 , zib ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ipValidation = org.ovirt.engine.ui.uicommonweb.validation.SubnetMaskValidation.IP_VALIDATOR.validate ( value ) ; if ( ! ( ipValidation.getSuccess ( ) ) ) { return ipValidation ; } org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( value instanceof java.lang.String ) { result.setSuccess ( validateNetMask ( ( ( java.lang.String ) ( value ) ) ) ) ; result.setReasons ( org.ovirt.engine.ui.uicommonweb.validation.SubnetMaskValidation.reasons ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ipValidation = super . validate ( value ) ; if ( ! ( ipValidation.getSuccess ( ) ) ) { return ipValidation ; } org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( value instanceof java.lang.String ) { result.setSuccess ( validateNetMask ( ( ( java.lang.String ) ( value ) ) ) ) ; result.setReasons ( org.ovirt.engine.ui.uicommonweb.validation.SubnetMaskValidation.reasons ) ; } return result ; }
Source:
private java.lang.Integer parseInt ( java.lang.Object entity ) { if ( entity instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( entity ) ) ; } if ( ! ( entity instanceof java.lang.String ) ) { return null ; } java.lang.String text = ( ( java.lang.String ) ( entity ) ) ; try { return new java.lang.Integer ( text ) ; } catch ( java.lang.Exception e ) { return null ; } }

Target:
private java.lang.Integer parseInt ( java.lang.Object entity ) { if ( entity instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( entity ) ) ; } if ( ! ( entity instanceof java.lang.String ) ) { return null ; } java.lang.String text = ( ( java.lang.String ) ( entity ) ) ; try { return java.lang.Integer.valueOf ( text ) ; } catch ( java.lang.Exception e ) { return null ; } }
Source:
public void testCompleteWhenUnsetIdAndName ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors withoutNameOrIdSet = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors.class ) ; completer.complete ( withoutNameOrIdSet ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setName ( org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setId ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void testCompleteWhenUnsetIdAndName ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors withoutNameOrIdSet = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter.NicNameAndNicIdAccessors.class ) ; completer.complete ( withoutNameOrIdSet ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setName ( org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.verify ( withoutNameOrIdSet , org.mockito.Mockito.never ( ) ) . setId ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters createLiveMigrateVmDisksParameters ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveDiskParamsList , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > liveMigrateDiskParametersList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : moveDiskParamsList ) { liveMigrateDiskParametersList.add ( createLiveMigrateDiskParameters ( moveDiskParameters , vmId ) ) ; } org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters liveMigrateDisksParameters = new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( liveMigrateDiskParametersList , vmId ) ; liveMigrateDisksParameters.setParentCommand ( VdcActionType.MoveDisks ) ; return liveMigrateDisksParameters ; }

Target:
private org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters createLiveMigrateVmDisksParameters ( java.util.List < org.ovirt.engine.core.common.action.MoveDiskParameters > moveDiskParamsList , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > liveMigrateDiskParametersList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters : moveDiskParamsList ) { liveMigrateDiskParametersList.add ( createLiveMigrateDiskParameters ( moveDiskParameters , vmId ) ) ; } org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters liveMigrateDisksParameters = new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( liveMigrateDiskParametersList , vmId ) ; return liveMigrateDisksParameters ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport , false ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateFromImportExport , org.ovirt.engine.core.common.action.VmTemplateImportExportParameters.class , new java.lang.String [ ] { "VmTemplateId" , "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] , GUIDS [ 3 ] , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateFromImportExport , org.ovirt.engine.core.common.action.VmTemplateImportExportParameters.class , new java.lang.String [ ] { "VmTemplateId" , "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] , GUIDS [ 3 ] , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void initStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setCompatibilityVersion ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setCompatibilityVersion ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , nic ) ; validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmTemplateInterface , new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( instanceTypeId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmTemplateInterface , new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( instanceTypeId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void testVMIsNotValid ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.FALSE ) . when ( cmd ) . validateVM ( vmValidator ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void testVMIsNotValid ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.FALSE ) . when ( cmd ) . validateVM ( vmValidator ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public static void isSoundcardEnabled ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void mockVmDevice ( boolean plugged ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }

Target:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
private void buidSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( listVms != null ) && ( ! ( listVms.isEmpty ( ) ) ) ) { sharedLockMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { sharedLockMap.put ( vm.getId ( ) , LockingGroup.VM.name ( ) ) ; } } }

Target:
private void buidSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( listVms != null ) && ( ! ( listVms.isEmpty ( ) ) ) ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; } } }
Source:
private boolean stopVms ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ! ( vm.isDown ( ) ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.StopVm , withRootCommandInfo ( new org.ovirt.engine.core.common.action.StopVmParameters ( vm.getId ( ) , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.getActionType ( ) ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { return false ; } } } return true ; }

Target:
private boolean stopVms ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ! ( vm.isDown ( ) ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.StopVm , org.ovirt.engine.core.bll.RemoveVmPoolCommand.withRootCommandInfo ( new org.ovirt.engine.core.common.action.StopVmParameters ( vm.getId ( ) , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL ) ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { return false ; } } } return true ; }
Source:
public void validateFailsWithForceNotSupported ( ) { org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters parameters = new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( getVolume ( 2 , true ) , true ) ; org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand command = new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand ( parameters ) ; cmd = org.mockito.Mockito.spy ( command ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }

Target:
public void validateFailsWithForceNotSupported ( ) { org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters parameters = new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( getVolume ( 2 , true ) , true ) ; org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand command = new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand ( parameters , null ) ; cmd = org.mockito.Mockito.spy ( command ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source == null ) { return new java.util.ArrayList < > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }
Source:
public void testAddIdSuppliedButNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( "11111111-1111-1111-1111-111111111111" ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetClusterExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }

Target:
public void testAddIdSuppliedButNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( "11111111-1111-1111-1111-111111111111" ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetClusterExpectations ( 1 ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.HashMap < java.lang.Integer , java.lang.String > result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.lang.String defaultValue = result.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = new org.ovirt.engine.ui.uicommonweb.MapWithDefaults < java.lang.Integer , java.lang.String > ( result , defaultValue ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; }