auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void updateButton ( ) { getButtonWidget ( ) . setVisible ( ( ( command.getIsAvailable ( ) ) && ( command.getIsVisible ( ) ) ) ) ; getButtonWidget ( ) . setEnabled ( command.getIsExecutionAllowed ( ) ) ; getButtonWidget ( ) . setText ( command.getTitle ( ) ) ; getButtonWidget ( ) . setTitle ( command.getTitle ( ) ) ; }

Target:
void updateButton ( ) { getButtonWidget ( ) . setVisible ( ( ( command.getIsAvailable ( ) ) && ( command.getIsVisible ( ) ) ) ) ; getButtonWidget ( ) . setEnabled ( command.getIsExecutionAllowed ( ) ) ; getButtonWidget ( ) . setTitle ( command.getTitle ( ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS ) ; addCanDoActionMessage ( java.lang.String.format ( "$VmName %1$s" , duplicateVm.getVmName ( ) ) ) ; return false ; } return true ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS ) ; addCanDoActionMessage ( java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; return false ; } return true ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getDeviceProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.deviceCustomProperties ( version ) ) ) { return new java.util.HashMap < > ( ) ; } java.util.Map < java.lang.String , java.lang.String > map = deviceProperties.get ( version ) . get ( type ) ; if ( map == null ) { map = new java.util.HashMap < > ( ) ; } else { map = new java.util.HashMap < > ( map ) ; } return map ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getDeviceProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type ) { java.util.Map < java.lang.String , java.lang.String > map = deviceProperties.get ( version ) . get ( type ) ; if ( map == null ) { map = new java.util.HashMap < > ( ) ; } else { map = new java.util.HashMap < > ( map ) ; } return map ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( request.getPathInfo ( ) , base ) ; file = checkForIndex ( request , response , file , request.getPathInfo ( ) ) ; if ( file == null ) { response.sendError ( HttpServletResponse.SC_NOT_FOUND ) ; } else { org.ovirt.engine.core.utils.servlet.ServletUtils.sendFile ( request , response , file , type ) ; } }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( request.getPathInfo ( ) , base ) ; file = checkForIndex ( request , response , file , request.getPathInfo ( ) ) ; org.ovirt.engine.core.utils.servlet.ServletUtils.sendFile ( request , response , file , type ) ; }
Source:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }

Target:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( returnValue ) ) ; filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.IsDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } getStorage ( ) . setItems ( filteredStorageDomains ) ; if ( hasQuota ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.IsDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } getStorage ( ) . setItems ( filteredStorageDomains ) ; if ( hasQuota ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }
Source:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getInstallCommand ( ) ) ) { return installPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { int count = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Integer count ) { if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } }
Source:
public void process ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { processIncoming ( ) ; if ( this . closing.get ( ) ) { return ; } processHeartbeat ( ) ; if ( this . closing.get ( ) ) { return ; } processOutgoing ( ) ; }

Target:
public void process ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( this . closing.get ( ) ) { return ; } processIncoming ( ) ; if ( this . closing.get ( ) ) { return ; } processHeartbeat ( ) ; if ( this . closing.get ( ) ) { return ; } processOutgoing ( ) ; }
Source:
public java.lang.String combine ( java.lang.String path ) { if ( path.startsWith ( this . root ) ) { return ( this . effectiveUri ) + path ; } return ( ( ( this . effectiveUri ) + ( org.ovirt.engine.sdk.utils.UrlHelper.SLASH ) ) + ( this . root ) ) + path ; }

Target:
public java.lang.String combine ( java.lang.String path ) { if ( path.startsWith ( this . root ) ) { return ( this . effectiveUri ) + path ; } if ( this . root.startsWith ( org.ovirt.engine.sdk.utils.UrlHelper.SLASH ) ) return ( ( this . effectiveUri ) + ( this . root ) ) + path ; return ( ( ( this . effectiveUri ) + ( org.ovirt.engine.sdk.utils.UrlHelper.SLASH ) ) + ( this . root ) ) + path ; }
Source:
public boolean isMonitoringNeeded ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) || ( ( vds.getVmCount ( ) ) > 0 ) ) || ( ( ( vds.getNonOperationalReason ( ) ) != null ) && ( vds.getNonOperationalReason ( ) . shouldCollectStats ( ) ) ) ; }

Target:
public boolean isMonitoringNeeded ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) || ( ( vds.getVmCount ( ) ) > 0 ) ; }
Source:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , T defaultValue ) { if ( ! ( defaultValue.getClass ( ) . isAssignableFrom ( key.getType ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } T value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return value ; }

Target:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , T defaultValue ) { if ( ! ( key.getType ( ) . isAssignableFrom ( defaultValue.getClass ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } T value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return value ; }
Source:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }

Target:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( 4 , hooks.getHooks ( ) . size ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storageDiskListModel.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( storageDiskListModel.getSelectedItem ( ) ) ) ) ; } } return importData ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storageDiskListModel.getSelectedItem ( ) ) != null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( storageDiskListModel.getSelectedItem ( ) ) ) ) ; } } return importData ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setGetGuestAgentQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }
Source:
private void updateActionAvailability ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( disks.size ( ) ) > 0 ) && ( isRemoveCommandAvailable ( disks ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( disks.size ( ) ) > 0 ) && ( isRemoveCommandAvailable ( disks ) ) ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getExportStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsExportModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixExportModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel glusterExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; models.add ( glusterExportModel ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.addTypeToStorageModels ( StorageDomainType.ImportExport , models ) ; return models ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getExportStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsExportModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixExportModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel glusterExportModel = new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; models.add ( glusterExportModel ) ; addTypeToStorageModels ( StorageDomainType.ImportExport , models ) ; return models ; }
Source:
protected void loadVmInit ( ) { if ( ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmInit ( ) ) == null ) ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStaticData ( ) , false ) ; } }

Target:
protected void loadVmInit ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmInit ( ) ) == null ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStaticData ( ) , false ) ; } }
Source:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getstorage_pool_id ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , true , null ) ; }

Target:
protected boolean validateImagesAndVMStates ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , hasImages ( ) , hasImages ( ) , hasImages ( ) , hasImages ( ) , true , true , true , true , null ) ; }
Source:
public void bufferEmpty ( ) { org.junit.Assert.assertArrayEquals ( testedListToArray ( ) , new java.lang.String [ 0 ] ) ; org.junit.Assert.assertEquals ( tested.head ( ) , 0 ) ; org.junit.Assert.assertEquals ( tested.size ( ) , 0 ) ; org.junit.Assert.assertTrue ( tested.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( tested.isFull ( ) ) ; }

Target:
public void bufferEmpty ( ) { org.junit.Assert.assertArrayEquals ( testedListToArray ( ) , new java.lang.String [ 0 ] ) ; org.junit.Assert.assertEquals ( 0 , tested.head ( ) ) ; org.junit.Assert.assertEquals ( 0 , tested.size ( ) ) ; org.junit.Assert.assertTrue ( tested.isEmpty ( ) ) ; org.junit.Assert.assertFalse ( tested.isFull ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; }
Source:
protected void init ( ) { getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { setStoragePoolId ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; } }

Target:
protected void init ( ) { org.ovirt.engine.core.bll.RemoveVmCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { setStoragePoolId ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetTagsExpectations ( false ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( wae.getResponse ( ) . getStatus ( ) , 404 ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetTagsExpectations ( false ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void setUpUdpateVm ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setUpGetPayloadExpectations ( 0 , 2 ) ; setUpGetBallooningExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( new int [ ] { 0 } ) ; setUpGetVmOvfExpectations ( new int [ ] { 0 } ) ; setUpGetVirtioScsiExpectations ( new int [ ] { 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 } ) ; setUpGetRngDeviceExpectations ( new int [ ] { 0 } ) ; setUpGetGraphicsExpectations ( 1 ) ; }

Target:
private void setUpUdpateVm ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setUpGetPayloadExpectations ( 0 , 2 ) ; setUpGetBallooningExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( 0 ) ; setUpGetVmOvfExpectations ( 0 ) ; setUpGetVirtioScsiExpectations ( 0 ) ; setUpGetSoundcardExpectations ( 0 ) ; setUpGetRngDeviceExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; }
Source:
public java.lang.Void runInTransaction ( ) { copyVmDevices ( ) ; addDiskPermissions ( ) ; if ( ( getInstanceType ( ) ) == null ) { addVmPayload ( ) ; updateSmartCardDevices ( ) ; addVmWatchdog ( ) ; } setActionReturnValue ( getVm ( ) . getId ( ) ) ; setSucceeded ( true ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { copyVmDevices ( ) ; addDiskPermissions ( ) ; addVmPayload ( ) ; updateSmartCardDevices ( ) ; addVmWatchdog ( ) ; setActionReturnValue ( getVm ( ) . getId ( ) ) ; setSucceeded ( true ) ; return null ; }
Source:
private void updateActionAvailability ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomainDR > domainDRs = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomainDR > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomainDR > ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( domainDRs.size ( ) ) == 1 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainDR > domainDRs = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomainDR > ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( domainDRs.size ( ) ) == 1 ) ) ; }
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 ( ) . toString ( ) ) ; payload.put ( SsoConstants.JSON_TOKEN_TYPE , "bearer" ) ; return payload ; }

Target:
protected 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:
protected org.ovirt.engine.core.compat.Guid getImageGroupId ( ) { if ( _imageGroupId.equals ( Guid.Empty ) ) { _imageGroupId = ( ( getDiskImage ( ) . getId ( ) ) != null ) ? getDiskImage ( ) . getId ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; } return _imageGroupId ; }

Target:
protected org.ovirt.engine.core.compat.Guid getImageGroupId ( ) { if ( _imageGroupId.equals ( Guid.Empty ) ) { _imageGroupId = ( ( getDiskImage ( ) . getId ( ) ) != null ) ? getDiskImage ( ) . getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ; } return _imageGroupId ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { this . stopProgress ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > clusterFeatures = ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( returnValue ) ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > featuresEnabled = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature : clusterFeatures ) { if ( feature.isEnabled ( ) ) { featuresEnabled.add ( feature.getFeature ( ) ) ; } } updateAddtionClusterFeatureList ( features , featuresEnabled ) ; }

Target:
public void onSuccess ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > clusterFeatures ) { stopProgress ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > featuresEnabled = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature : clusterFeatures ) { if ( feature.isEnabled ( ) ) { featuresEnabled.add ( feature.getFeature ( ) ) ; } } updateAddtionClusterFeatureList ( features , featuresEnabled ) ; }
Source:
protected void executeQuery ( org.ovirt.engine.core.bll.adbroker.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( org.ovirt.engine.core.bll.adbroker.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , false ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }
Source:
public static void GetClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void validateSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; param.setVolumeId ( startedVolumeId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param ) ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; param.setVolumeId ( startedVolumeId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel copyDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; copyDiskModel.onInitAllDisks ( disks ) ; copyDiskModel.onInitDisks ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel copyDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; copyDiskModel.onInitAllDisks ( disks ) ; copyDiskModel.onInitDisks ( ) ; }
Source:
private org.ovirt.engine.api.model.Watchdog getUpdate ( ) { org.ovirt.engine.api.model.Watchdog watchdog = new org.ovirt.engine.api.model.Watchdog ( ) ; watchdog.setId ( org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.WATCHDOG_ID.toString ( ) ) ; watchdog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchdog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; return watchdog ; }

Target:
private org.ovirt.engine.api.model.Watchdog getUpdate ( ) { org.ovirt.engine.api.model.Watchdog watchdog = new org.ovirt.engine.api.model.Watchdog ( ) ; watchdog.setId ( org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.WATCHDOG_ID.toString ( ) ) ; watchdog.setAction ( WatchdogAction.RESET ) ; watchdog.setModel ( WatchdogModel.I6300ESB ) ; return watchdog ; }
Source:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( newStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newStoragePoolIsoMap , result ) ; }

Target:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getstorage_id ( ) , newStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newStoragePoolIsoMap , result ) ; }
Source:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( data ) ) ; return profile == VnicProfileView.EMPTY ? org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.emptyProfile ( ) . asString ( ) : org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.profileAndNetworkSelected ( profile.getName ( ) , profile.getNetworkName ( ) ) . asString ( ) ; }

Target:
public java.lang.String getReplacementStringNullSafe ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile ) { return profile == VnicProfileView.EMPTY ? org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.emptyProfile ( ) . asString ( ) : org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.profileAndNetworkSelected ( profile.getName ( ) , profile.getNetworkName ( ) ) . asString ( ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
protected java.util.List < java.lang.String > getEntityNames ( org.ovirt.engine.core.common.scheduling.AffinityGroup object ) { java.util.List < java.lang.String > entityNames = super . getEntityNames ( object ) ; java.lang.String vmName = getDetailModel ( ) . getParentEntity ( ) . getName ( ) ; for ( int i = 0 ; i < ( entityNames.size ( ) ) ; i ++ ) { if ( entityNames.get ( i ) . equals ( vmName ) ) { entityNames.remove ( i ) ; break ; } } return entityNames ; }

Target:
protected java.util.List < java.lang.String > getEntityNames ( org.ovirt.engine.core.common.scheduling.AffinityGroup object ) { java.util.List < java.lang.String > entityNames = super . getEntityNames ( object ) ; java.lang.String vmName = getDetailModel ( ) . getEntity ( ) . getName ( ) ; for ( int i = 0 ; i < ( entityNames.size ( ) ) ; i ++ ) { if ( entityNames.get ( i ) . equals ( vmName ) ) { entityNames.remove ( i ) ; break ; } } return entityNames ; }
Source:
private void audit ( org.ovirt.engine.core.common.AuditLogType auditMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Action" , getAction ( ) . name ( ) . toLowerCase ( ) ) ; logable.addCustomValue ( "VdsName" , org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) ) ; logable.setVdsId ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVdsId ( ) ) ; auditLogDirector.log ( logable , auditMessage ) ; }

Target:
private void audit ( org.ovirt.engine.core.common.AuditLogType auditMessage ) { addCustomValue ( "Action" , getAction ( ) . name ( ) . toLowerCase ( ) ) ; addCustomValue ( "VdsName" , org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) ) ; auditLogDirector.log ( this , auditMessage ) ; }