auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.METADATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.METADATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return img ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return img ; }
Source:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds , final org.ovirt.engine.core.compat.Guid hostId ) { if ( vmIds.isEmpty ( ) ) { return ; } org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( vmId , true ) ) ; } org.ovirt.engine.core.bll.hostdev.HostDeviceManager hostDeviceManager = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.hostdev.HostDeviceManager.class ) ; hostDeviceManager.refreshHostIfAnyVmHasHostDevices ( vmIds , hostId ) ; } } ) ; }

Target:
public void run ( ) { processOnVmStopInternal ( vmIds , hostId ) ; }
Source:
private void validateGateway ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( iface.getGateway ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( iface.getNetworkName ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY , iface.getNetworkName ( ) ) ; } }

Target:
private void validateGateway ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( iface.getGateway ( ) ) ) && ( ! ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , vds.getVdsGroupId ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY , iface.getNetworkName ( ) ) ; } }
Source:
private void setCommandExecutionAllowedForProvider ( org.ovirt.engine.core.common.businessentities.Provider provider ) { if ( ( provider.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.ProviderType.EXTERNAL_NETWORK ) ) { org.ovirt.engine.core.common.businessentities.ExternalNetworkProviderProperties properties = ( ( org.ovirt.engine.core.common.businessentities.ExternalNetworkProviderProperties ) ( provider.getAdditionalProperties ( ) ) ) ; if ( ( properties != null ) && ( properties.getReadOnly ( ) ) ) { setCommandExecutionAllowed ( false ) ; return ; } } setCommandExecutionAllowed ( true ) ; }

Target:
private void setCommandExecutionAllowedForProvider ( org.ovirt.engine.core.common.businessentities.Provider provider ) { if ( ( provider.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.ProviderType.EXTERNAL_NETWORK ) ) { org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ( provider.getAdditionalProperties ( ) ) ) ; if ( ( properties != null ) && ( properties.getReadOnly ( ) ) ) { setCommandExecutionAllowed ( false ) ; return ; } } setCommandExecutionAllowed ( true ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , false , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( nic ) ; return nic ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }

Target:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 1 ) ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( domainsInPool , vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }

Target:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( domainsInPool , vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeFileComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) != null ) { applicationsTable.setRowData ( org.ovirt.engine.ui.uicommonweb.Linq.ToList ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) ) ; } else { applicationsTable.setRowData ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) != null ) { applicationsTable.setRowData ( org.ovirt.engine.ui.uicommonweb.Linq.toList ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) ) ; } else { applicationsTable.setRowData ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , params , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc fenceSpmStorage ( java.lang.String spUUID , int prevID , java.lang.String prevLVER ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.fence" ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Gluster.writeGeoRepPubKeys" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , remoteUserName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS uniteAgentsSingleVds ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > agents = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { agents.addAll ( vds.getFenceAgents ( ) ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = vdsList.get ( 0 ) ; vds.setFenceAgents ( agents ) ; return vds ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePoolAndStatuses ( org.ovirt.engine.core.compat.Guid storagePool , java.util.Set < org.ovirt.engine.core.common.businessentities.VDSStatus > statuses ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getCallsHandler ( ) . executeReadList ( "getVdsByStoragePoolIdWithStatuses" , org.ovirt.engine.core.dao.VdsDaoImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "statuses" , ( statuses != null ? org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.utils.IdentifiableUtils.getValues ( statuses ) , "," ) : null ) ) ) ; return uniteAgents ( vdsList ) ; }
Source:
private void initEditors ( ) { pinnedHostEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; pinnedHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.pinnedHost ( ) ) ; availableHostDevices = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( true , false , true ) ; selectedHostDevices = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( true , false , true ) ; splitTable = new org.ovirt.engine.ui.common.widget.HorizontalSplitTable ( availableHostDevices , selectedHostDevices , org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.availableHostDevices ( ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.selectedHostDevices ( ) ) ; initHostDeviceCellTable ( availableHostDevices ) ; initHostDeviceCellTable ( selectedHostDevices ) ; }

Target:
private void initEditors ( ) { pinnedHostEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; pinnedHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.pinnedHost ( ) ) ; availableHostDevices = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( true , false , true ) ; selectedHostDevices = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( true , false , true ) ; splitTable = new org.ovirt.engine.ui.common.widget.HorizontalSplitTable ( availableHostDevices , selectedHostDevices , org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.availableHostDevices ( ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.AddVmHostDevicePopupView.constants.selectedHostDevices ( ) ) ; initHostDeviceCellTable ( availableHostDevices ) ; initHostDeviceCellTable ( selectedHostDevices ) ; splitTable.enableDoubleClickItemMoving ( ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > getBricks ( org.ovirt.engine.core.compat.Guid volumeId , int n ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ; for ( java.lang.Integer i = 0 ; i < n ; i ++ ) { brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( volumeId , new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) , ( "/tmp/test-vol" + ( i.toString ( ) ) ) , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; bricks.add ( brick ) ; } return bricks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > getBricks ( org.ovirt.engine.core.compat.Guid volumeId , int n ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ; for ( java.lang.Integer i = 0 ; i < n ; i ++ ) { brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setBrickDirectory ( ( "/tmp/test-vol" + ( i.toString ( ) ) ) ) ; brick.setStatus ( GlusterStatus.UP ) ; bricks.add ( brick ) ; } return bricks ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public org.ovirt.optimizer.solver.test.TestOptimizer addMigration ( org.ovirt.engine.sdk.entities.VM vm , org.ovirt.engine.sdk.entities.Host destination ) { if ( destination != null ) { bestSolution.getHosts ( ) . add ( destination ) ; } if ( vm != null ) { bestSolution.getVms ( ) . add ( vm ) ; } bestSolution.getSteps ( ) . add ( new org.ovirt.optimizer.solver.problemspace.Migration ( vm , destination ) ) ; return this ; }

Target:
public org.ovirt.optimizer.solver.test.TestOptimizer addMigration ( org.ovirt.optimizer.solver.facts.Instance vm , org.ovirt.engine.sdk.entities.Host destination ) { if ( destination != null ) { bestSolution.getHosts ( ) . add ( destination ) ; } if ( vm != null ) { bestSolution.getInstances ( ) . add ( vm ) ; } bestSolution.getSteps ( ) . add ( new org.ovirt.optimizer.solver.problemspace.Migration ( vm , destination ) ) ; return this ; }
Source:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }

Target:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao ) ; return validator.validate ( ) ; }
Source:
private static java.security.KeyStore _getKeyStore ( java.lang.String type , java.io.File file , char [ ] password ) { try ( final java.io.InputStream in = new java.io.FileInputStream ( file ) ) { java.security.KeyStore ks = java.security.KeyStore.getInstance ( type ) ; ks.load ( in , password ) ; return ks ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Failed to local keystore '%1$s'" , file ) , e ) ; } }

Target:
private static java.security.KeyStore getKeyStore ( java.lang.String type , java.io.File file , char [ ] password ) { try ( final java.io.InputStream in = new java.io.FileInputStream ( file ) ) { java.security.KeyStore ks = java.security.KeyStore.getInstance ( type ) ; ks.load ( in , password ) ; return ks ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Failed to local keystore '%1$s'" , file ) , e ) ; } }
Source:
protected R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; entity = doUpdate ( incoming , entity , entityResolver , update , updateProvider ) ; R model = org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.deprecatedPopulate ( model , entity ) ; return addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.doPopulate ( model , entity ) ) ; }

Target:
protected < T > R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; entity = doUpdate ( incoming , entity , entityResolver , update , updateProvider ) ; R model = org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.deprecatedPopulate ( model , entity ) ; return addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.doPopulate ( model , entity ) ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { if ( node.InnerText.equals ( java.lang.String.valueOf ( OsRepository.OLD_OTHER_ID ) ) ) { node.InnerText = java.lang.String.valueOf ( OsRepository.DEFAULT_OS ) ; } _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.innerText ) ) ; } _vmTemplate.setClusterArch ( ArchitectureType.x86_64 ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getUserId ( ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmBase getVmBase ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDao ( ) . get ( vmId ) ; org.ovirt.engine.core.common.businessentities.VmBase vmBase = ( vm != null ) ? vm.getStaticData ( ) : null ; if ( vmBase == null ) { vmBase = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmTemplateDao ( ) . get ( vmId ) ; } return vmBase ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmBase getVmBase ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = vmDao.get ( vmId ) ; org.ovirt.engine.core.common.businessentities.VmBase vmBase = ( vm != null ) ? vm.getStaticData ( ) : null ; if ( vmBase == null ) { vmBase = vmTemplateDao.get ( vmId ) ; } return vmBase ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageType storageType , java.lang.String template ) { switch ( storageType ) { case ISCSI : return StorageType.ISCSI.value ( ) ; case FCP : return StorageType.FCP.value ( ) ; case NFS : return StorageType.NFS.value ( ) ; case LOCALFS : return StorageType.LOCALFS.value ( ) ; case POSIXFS : return StorageType.POSIXFS.value ( ) ; case GLUSTERFS : return StorageType.GLUSTERFS.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageType storageType , java.lang.String template ) { switch ( storageType ) { case ISCSI : return StorageType.ISCSI.value ( ) ; case FCP : return StorageType.FCP.value ( ) ; case NFS : return StorageType.NFS.value ( ) ; case LOCALFS : return StorageType.LOCALFS.value ( ) ; case POSIXFS : return StorageType.POSIXFS.value ( ) ; case GLUSTERFS : return StorageType.GLUSTERFS.value ( ) ; case GLANCE : return StorageType.GLANCE.value ( ) ; default : return null ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkClusterDAO ( ) . getAllForNetwork ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . getId ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } if ( networkChangedToNonVmNetwork ( ) ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.removeVnicProfiles ( ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }

Target:
public java.lang.Void runInTransaction ( ) { getNetworkDAO ( ) . update ( getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getNetworkClusterDAO ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , getNetwork ( ) ) ; } if ( networkChangedToNonVmNetwork ( ) ) { removeVnicProfiles ( ) ; } return null ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getImages ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( disk.getQuotaId ( ) , imageToDestinationDomainMap.get ( disk.getId ( ) ) , disk.getSizeInGigabytes ( ) ) ) ; } return list ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getParameters ( ) . getVmTemplate ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( disk.getQuotaId ( ) , imageToDestinationDomainMap.get ( disk.getId ( ) ) , disk.getSizeInGigabytes ( ) ) ) ; } return list ; }
Source:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } if ( saveStatistics ) { vmsMonitoring.addVmStatisticsToList ( dbVm.getStatisticsData ( ) ) ; } if ( saveVmInterfaces ) { vmsMonitoring.addVmInterfaceStatisticsToList ( dbVm.getInterfaces ( ) ) ; } }

Target:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } if ( saveStatistics ) { vmsMonitoring.addVmStatisticsToList ( dbVm.getStatisticsData ( ) ) ; } if ( saveVmInterfaces ) { vmsMonitoring.addVmInterfaceStatisticsToList ( dbVm.getInterfaces ( ) ) ; } }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getId ( ) . toString ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.network.host.RemoveFenceAgentsByVdsIdCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.network.host.RemoveFenceAgentsByVdsIdCommand.getParameters ( ) . getVdsId ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.VDS_REMOVE_FENCE_AGENTS_VDS_ID_REQUIRED ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.network.host.RemoveFenceAgentsByVdsIdCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.network.host.RemoveFenceAgentsByVdsIdCommand.getParameters ( ) . getVdsId ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.VDS_REMOVE_FENCE_AGENTS_VDS_ID_REQUIRED ) ; } return super . canDoAction ( ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( type ) == null ? 0 : type.hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.asynctasks.EntityInfo ) ) { return false ; } org.ovirt.engine.core.common.asynctasks.EntityInfo other = ( ( org.ovirt.engine.core.common.asynctasks.EntityInfo ) ( obj ) ) ; return ( java.util.Objects.equals ( id , other.id ) ) && ( java.util.Objects.equals ( type , other.type ) ) ; }
Source:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }
Source:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; }

Target:
private void saveGlusterStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveGluster" } ) ) ) . Run ( ) ; }
Source:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.network.Network findManagementNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { if ( network.getCluster ( ) . isManagement ( ) ) { return network ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Network findManagementNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( networks , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.Network > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return network.getCluster ( ) . isManagement ( ) ; } } ) ; }