auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void postOnAddStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { saveNfsStorage ( ) ; } else if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { saveLocalStorage ( ) ; } else { saveSanStorage ( ) ; } }

Target:
public void postOnAddStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } if ( ( model.getCurrentStorageItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { saveNfsStorage ( ) ; } else if ( ( model.getCurrentStorageItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { saveLocalStorage ( ) ; } else { saveSanStorage ( ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 , org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
public void testGetByNameReturnsItemOfThatName ( ) throws java.lang.Exception { java.lang.String itemName = "name" ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem item = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , itemName ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( item ) ) ; org.junit.Assert.assertThat ( map.get ( itemName ) , org.hamcrest.CoreMatchers.is ( item ) ) ; }

Target:
public void testGetByNameReturnsItemOfThatName ( ) throws java.lang.Exception { java.lang.String itemName = "name" ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem item = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , itemName ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( item ) ) ; org.junit.Assert.assertThat ( map.get ( itemName ) , org.hamcrest.CoreMatchers.is ( item ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( VdsProtocol.XML.equals ( host.getProtocol ( ) ) ) && ( ( Version.v3_6.compareTo ( cluster.getCompatibilityVersion ( ) ) ) <= 0 ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ) == ( host.getProtocol ( ) ) ) && ( cluster.getCompatibilityVersion ( ) . greaterOrEquals ( Version.v3_6 ) ) ) ) ; }
Source:
private void MoveVMsToUnknown ( ) { addMigratedVmsNotUpYet ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVmList ( ) ) { destroyVmOnDestination ( vm ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }

Target:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.alertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Template model = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
protected org.ovirt.engine.api.model.Template getRestModel ( int index ) { return org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( index ) ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { determineMigrationFailureForAuditLog ( ) ; setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { failedToMigrate ( ) ; _isRerun = true ; } }

Target:
public void reportCompleted ( ) { try { super . reportCompleted ( ) ; } finally { if ( ( getDestinationVdsId ( ) ) != null ) { decreasePendingVms ( getDestinationVdsId ( ) ) ; } } }
Source:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( this . client ) , callback , this ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }

Target:
public java.nio.channels.SelectionKey call ( ) throws java.nio.channels.ClosedChannelException { return channel.register ( selector , ( ( java.nio.channels.SelectionKey.OP_READ ) | ( java.nio.channels.SelectionKey.OP_WRITE ) ) , client ) ; }
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }

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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }
Source:
private void vnicProfileAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > vnicProfiles ) { this . vnicProfiles.addAll ( vnicProfiles ) ; org.mockito.Mockito.when ( vnicProfile.getName ( ) ) . thenReturn ( DEFAULT_VNIC_PROFILE_NAME ) ; org.mockito.Mockito.when ( vnicProfile.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.vnicProfileNameNotUsed ( ) , matcher ) ; }

Target:
private void vnicProfileAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > vnicProfiles ) { this . vnicProfiles.addAll ( vnicProfiles ) ; org.mockito.Mockito.when ( vnicProfile.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_VNIC_PROFILE_NAME ) ; org.mockito.Mockito.when ( vnicProfile.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.vnicProfileNameNotUsed ( ) , matcher ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . 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.PrepareImageReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "allowIllegal" , allowIllegal ) . 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.PrepareImageReturnForXmlRpc ( response ) ; }
Source:
public void removeTabWidget ( com.google.gwt.user.client.ui.Widget tabWidget ) { mainTabContainer.getElement ( ) . removeChild ( tabWidget.getElement ( ) ) ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetSearchPanel ) ) { setPanelContent ( searchPanelContainer , content ) ; } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetTabBar ) ) { setPanelContent ( mainTabContainer , content ) ; content.asWidget ( ) . addStyleName ( style.mainTabBar ( ) ) ; } else { super . setInSlot ( slot , content ) ; } }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { getCallsHandler ( ) . executeModification ( "InsertVmTemplate" , getInsertOrUpdateParameters ( template ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { return createBaseParametersMapper ( template ) . addValue ( "child_count" , template.getChildCount ( ) ) . addValue ( "name" , template.getName ( ) ) . addValue ( "status" , template.getStatus ( ) ) . addValue ( "is_disabled" , template.isDisabled ( ) ) . addValue ( "template_type" , template.getTemplateType ( ) . name ( ) ) . addValue ( "base_template_id" , template.getBaseTemplateId ( ) ) . addValue ( "template_version_name" , template.getTemplateVersionName ( ) ) ; }
Source:
public void canDoActionFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; }

Target:
public void canDoActionFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testIscsiLunCannotBeAddedIfSgioIsFilteredAndScsiReservationEnabled ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = createISCSILunDisk ( ScsiGenericIO.FILTERED , true , DiskInterface.IDE ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; mockVm ( ) ; mockInterfaceList ( ) ; org.junit.Assert.assertFalse ( "Lun disk added successfully WHILE sgio is filtered and scsi reservation is enabled" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getVmId ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) . getId ( ) ; } return super . getVmId ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; } return null ; }
Source:
protected void executeVdsBrokerCommand ( ) { vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getBroker ( ) . getExternalVmFromOva ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getParameters ( ) . getPath ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = vmReturn.vm ; map.put ( VdsProperties.vm_guid , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; map.put ( VdsProperties.vm_arch , ArchitectureType.x86_64.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( map ) ; setReturnValue ( vm ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getBroker ( ) . getExternalVmFromOva ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getParameters ( ) . getPath ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = vmReturn.vm ; map.put ( VdsProperties.vm_guid , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; map.put ( VdsProperties.vm_arch , ArchitectureType.x86_64.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = vdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( map ) ; setReturnValue ( vm ) ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.doCompressionCheck ( vds , vmDynamic ) ; if ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateToPowerClientOnConnect ) ) || ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateFromPowerClientToVdsWhenConnectingFromRegularClient ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.PowerClientMigrateOnConnectCheck , new org.ovirt.engine.core.common.action.PowerClientMigrateOnConnectCheckParameters ( false , vmDynamic.getId ( ) , vmDynamic.getclient_ip ( ) , vds.getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase eval ( org.ovirt.engine.core.common.businessentities.VmStatic vm ) { org.ovirt.engine.core.common.action.MigrateVmToServerParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmToServerParameters ( false , vm.getId ( ) , vds.getId ( ) ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
protected boolean hostToRunExist ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) != null ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }

Target:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }
Source:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setvm_snapshot_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getvm_snapshot_id ( ) ) == null ) ) ; }

Target:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpVDSGroupExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }
Source:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }

Target:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc fenceSpmStorage ( java.lang.String spUUID , int prevID , java.lang.String prevLVER ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.fenceSpmStorage ( spUUID , prevID , prevLVER ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testGetAllForVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForVdsGroup ( existingVds.getVdsGroupId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.Assert.assertEquals ( existingVds.getVdsGroupId ( ) , vds.getVdsGroupId ( ) ) ; } }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForCluster ( existingVds.getClusterId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.Assert.assertEquals ( existingVds.getClusterId ( ) , vds.getClusterId ( ) ) ; } }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthz ( ) . getContext ( ) . < java.lang.String > get ( Base.ContextKeys.INSTANCE_NAME ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthzName ( ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
public void canDoActionNoDisksSpecified ( ) { org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }

Target:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { manager = new org.ovirt.engine.core.utils.ovf.OvfManager ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { manager = new org.ovirt.engine.core.utils.ovf.OvfManager ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; java.util.HashMap < java.lang.Integer , java.lang.String > osIdsToNames = new java.util.HashMap < > ( ) ; org.mockito.Mockito.when ( osRepository.getUniqueOsNames ( ) ) . thenReturn ( osIdsToNames ) ; }
Source:
public java.util.List < java.lang.String > getThemeStylesheets ( java.lang.String applicationName ) { java.util.List < java.lang.String > ret = null ; final java.lang.String cssFiles = brandingProperties.getProperty ( ( applicationName + ( org.ovirt.engine.core.branding.BrandingTheme.CSS_POST_FIX ) ) ) ; if ( cssFiles == null ) { org.ovirt.engine.core.branding.BrandingTheme.log.warn ( "Theme '{}' has no property defined for key '{}'" , this . getPath ( ) , ( applicationName + ( org.ovirt.engine.core.branding.BrandingTheme.CSS_POST_FIX ) ) ) ; } else { ret = java.util.Arrays.asList ( cssFiles.split ( "\\s*,\\s*" ) ) ; } return ret ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "Path to theme" , getPath ( ) ) . append ( "webadmin css" , getThemeStylesheets ( "webadmin" ) ) . append ( "welcome css" , getThemeStylesheets ( "welcome" ) ) . build ( ) ; }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) ) ; }

Target:
protected void updateActionAvailability ( ) { super . updateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) ) ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void addGhostEntry ( ) { addEntry ( createGhostValue ( ) ) ; }

Target:
protected void init ( M model ) { items.clear ( ) ; contentPanel.clear ( ) ; modelItems = ( ( java.util.Collection < T > ) ( model.getItems ( ) ) ) ; if ( ( modelItems ) == null ) { modelItems = new java.util.LinkedList < T > ( ) ; model.setItems ( modelItems ) ; return ; } for ( T value : modelItems ) { addEntry ( value ) ; } T additionalValue = addGhostEntry ( ) . getFirst ( ) ; modelItems.add ( additionalValue ) ; }
Source:
private void readUsbItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { _vm.getStaticData ( ) . setUsbPolicy ( org.ovirt.engine.core.common.businessentities.UsbPolicy.forStringValue ( node.SelectSingleNode ( "rasd:UsbPolicy" , _xmlNS ) . innerText ) ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return true ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; return supportedStorageFormats.contains ( storageFormat ) ; }

Target:
public org.ovirt.engine.core.bll.validator.storage.StorageDomainToPoolRelationValidator getAttachDomainValidator ( ) { return new org.ovirt.engine.core.bll.validator.storage.StorageDomainToPoolRelationValidator ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getTargetStoragePool ( ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.String retval = org.ovirt.engine.core.compat.StringFormat.format ( "body = '%1$s' , startPos = %2$s , endPos = %3$s, type = %4$s" , mBody , mPos [ 0 ] , mPos [ 1 ] , mType ) ; return retval ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "body" , mBody ) . append ( "startPos" , mPos [ 0 ] ) . append ( "endPos" , mPos [ 1 ] ) . append ( "type" , mType ) . build ( ) ; }
Source:
public void testCloneTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "a" , "b" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "c" , "d" ) ; tag.getChildren ( ) . add ( tag2 ) ; tag2.setparent_id ( tag.gettag_id ( ) ) ; org.apache.commons.collections.Transformer cloner = org.apache.commons.collections.TransformerUtils.cloneTransformer ( ) ; org.ovirt.engine.core.common.businessentities.Tags newTag = ( ( org.ovirt.engine.core.common.businessentities.Tags ) ( cloner.transform ( tag ) ) ) ; org.junit.Assert.assertEquals ( 1 , newTag.getChildren ( ) . size ( ) ) ; }

Target:
public void testCloneTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "a" , "b" ) ; org.ovirt.engine.core.common.businessentities.Tags tag2 = createTag ( "c" , "d" ) ; tag.getChildren ( ) . add ( tag2 ) ; tag2.setParentId ( tag.getTagId ( ) ) ; org.apache.commons.collections.Transformer cloner = org.apache.commons.collections.TransformerUtils.cloneTransformer ( ) ; org.ovirt.engine.core.common.businessentities.Tags newTag = ( ( org.ovirt.engine.core.common.businessentities.Tags ) ( cloner.transform ( tag ) ) ) ; org.junit.Assert.assertEquals ( 1 , newTag.getChildren ( ) . size ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpActionExpectations ( VdcActionType.EditIscsiBond , org.ovirt.engine.core.common.action.EditIscsiBondParameters.class , new java.lang.String [ ] { "IscsiBond" } , new java.lang.Object [ ] { getIscsiBondWithNoNetworks ( ) } , true , true , null ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; assertNotNull ( response ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
protected void setUpEntityQueryExpectations ( int times , org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , iscsiBond ) ; } }
Source:
public void testUpdate ( ) { java.lang.String oldName = existingVdsGroup.getName ( ) ; existingVdsGroup.setName ( "This is the new name" ) ; existingVdsGroup.setVirtService ( false ) ; existingVdsGroup.setGlusterService ( true ) ; dao.update ( existingVdsGroup ) ; org.ovirt.engine.core.common.businessentities.VDSGroup result = dao.get ( existingVdsGroup.getId ( ) ) ; assertCorrectVDSGroup ( result ) ; result = dao.getByName ( oldName ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testUpdate ( ) { java.lang.String oldName = existingCluster.getName ( ) ; existingCluster.setName ( "This is the new name" ) ; existingCluster.setVirtService ( false ) ; existingCluster.setGlusterService ( true ) ; dao.update ( existingCluster ) ; org.ovirt.engine.core.common.businessentities.Cluster result = dao.get ( existingCluster.getId ( ) ) ; assertCorrectCluster ( result ) ; result = dao.getByName ( oldName ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
public void setValue ( T value ) { if ( value != null ) { super . setValue ( value , true ) ; } }

Target:
public void setValue ( final T value ) { if ( value != null ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.widget.editor.GroupedListModelListBox.super . setValue ( value , true ) ; } } ) ; } }