auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; onImportSourceChanged ( ) ; }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getEntityWithDetails ( int index ) { return setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) , index , true ) ; }

Target:
private void setupParentPopulateExpectations ( boolean notFound ) { org.easymock.EasyMock.expect ( bricksResourceMock.populateAdvancedDetails ( org.easymock.EasyMock.isA ( org.ovirt.engine.api.model.GlusterBrick.class ) , org.easymock.EasyMock.isA ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) ) ) . andDelegateTo ( new org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResource ( ) { @ java.lang.Override protected org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { model.setPort ( GlusterTestHelper.BRICK_PORT ) ; model.setMntOptions ( GlusterTestHelper.BRICK_MNT_OPT ) ; return model ; } } ) . anyTimes ( ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else { } return retval ; }
Source:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable e ) { java.lang.String msg = "Failed to encrypt the current value" ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }

Target:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable exception ) { java.lang.String msg = "Failed to encrypt the current value." ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.console.writeLine ( msg ) ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( msg , exception ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }

Target:
public void setUp ( ) { comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isShareable ( ) ? constants.shareable ( ) : null ) ) ; return disk.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel getSanTargetModelByConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel targetModel : getTargets ( ) . getItems ( ) ) { if ( targetModel.getEntity ( ) . getiqn ( ) . equals ( connection.getiqn ( ) ) ) { return targetModel ; } } return null ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel getSanTargetModelByConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel targetModel : getTargets ( ) . getItems ( ) ) { if ( targetModel.getEntity ( ) . getIqn ( ) . equals ( connection.getIqn ( ) ) ) { return targetModel ; } } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ) { return ; } org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( ( "ImportExportEntities" . equals ( changedArgs.propertyName ) ) && ( ( model.getEntities ( ) ) != null ) ) { imageList.setRowData ( model.getEntities ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( ( "ImportExportEntities" . equals ( args.propertyName ) ) && ( ( model.getEntities ( ) ) != null ) ) { imageList.setRowData ( model.getEntities ( ) ) ; } }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected boolean pciAndIdeWithinLimit ( org.ovirt.engine.core.common.businessentities.VmStatic vm , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > allInterfaces ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allDisks = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) ; return checkPciAndIdeLimit ( vm.getNumOfMonitors ( ) , allInterfaces , allDisks , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean pciAndIdeWithinLimit ( org.ovirt.engine.core.common.businessentities.VmStatic vm , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > allInterfaces ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allDisks = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) ; return checkPciAndIdeLimit ( vm.getNumOfMonitors ( ) , allInterfaces , allDisks , org.ovirt.engine.core.bll.utils.VmDeviceUtils.isVirtioScsiControllerAttached ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
private org.ovirt.engine.api.model.WatchDog getModel ( int i ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.IB700.name ( ) . toLowerCase ( ) ) ; watchDog.setId ( org.ovirt.engine.api.restapi.resource.PARENT_ID.toString ( ) ) ; return watchDog ; }

Target:
private org.ovirt.engine.api.model.WatchDog getModel ( int i ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; watchDog.setId ( org.ovirt.engine.api.restapi.resource.PARENT_ID.toString ( ) ) ; return watchDog ; }
Source:
private java.util.Map < java.util.function.Consumer < java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid lunFromVgLunId , org.ovirt.engine.core.compat.Guid lunFromDbLunId , org.ovirt.engine.core.compat.Guid lunFromVgPvId , org.ovirt.engine.core.compat.Guid lunFromDbPvId ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lunFromVG = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromVG.setLUNId ( lunFromVgLunId.toString ( ) ) ; lunFromVG.setPhysicalVolumeId ( lunFromVgPvId.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunFromDB = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromDB.setLUNId ( lunFromDbLunId.toString ( ) ) ; lunFromDB.setPhysicalVolumeId ( lunFromDbPvId.toString ( ) ) ; return getLunsToUpdateInDb ( lunFromVG , lunFromDB ) ; }

Target:
private java.util.Map < java.util.function.Consumer < java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid lunFromVgLunId , org.ovirt.engine.core.compat.Guid lunFromDbLunId , org.ovirt.engine.core.compat.Guid lunFromVgPvId , org.ovirt.engine.core.compat.Guid lunFromDbPvId ) { setLunsIds ( lunFromVgLunId , lunFromDbLunId , lunFromVgPvId , lunFromDbPvId ) ; return getLunsToUpdateInDb ( ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { return new org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommandCallback ( ) ; }

Target:
private org.ovirt.engine.core.common.action.ColdMergeCommandParameters buildColdMergeParameters ( org.ovirt.engine.core.compat.Guid baseVolumeId , org.ovirt.engine.core.compat.Guid topVolumeId ) { org.ovirt.engine.core.common.businessentities.SubchainInfo subchainInfo = new org.ovirt.engine.core.common.businessentities.SubchainInfo ( org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommand.getDiskImage ( ) . getStorageIds ( ) . get ( 0 ) , org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommand.getImageGroupId ( ) , baseVolumeId , topVolumeId ) ; org.ovirt.engine.core.common.action.ColdMergeCommandParameters parameters = new org.ovirt.engine.core.common.action.ColdMergeCommandParameters ( org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommand.getDiskImage ( ) . getStoragePoolId ( ) , subchainInfo ) ; parameters.setEndProcedure ( VdcActionParametersBase.EndProcedure.COMMAND_MANAGED ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.snapshots.ColdMergeSnapshotSingleDiskCommand.getParameters ( ) ) ; return parameters ; }
Source:
private void initCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( getCPU ( ) . getItems ( ) ) ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }

Target:
private void initCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }
Source:
public static org.ovirt.engine.api.model.Architecture map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return org.ovirt.engine.api.model.Architecture.UNDEFINED ; case x86_64 : return org.ovirt.engine.api.model.Architecture.X86_64 ; case ppc64 : return org.ovirt.engine.api.model.Architecture.PPC64 ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.api.model.Architecture map ( org.ovirt.engine.core.common.businessentities.ArchitectureType model , java.lang.String template ) { if ( model != null ) { switch ( model ) { case undefined : return org.ovirt.engine.api.model.Architecture.UNDEFINED ; case x86_64 : return org.ovirt.engine.api.model.Architecture.X86_64 ; case ppc64 : return org.ovirt.engine.api.model.Architecture.PPC64 ; case s390x : return org.ovirt.engine.api.model.Architecture.S390X ; default : return null ; } } return null ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.CloneVmModel object ) { driver.edit ( object ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.CloneVmModel object ) { driver.edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( object.getMessage ( ) ) ; } } } ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > getNetworkTypesList ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes , java.lang.String nicName ) { if ( nicName == null ) { throw new java.lang.IllegalArgumentException ( "nic name cannot be null" ) ; } java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > result = nicNameToNetworkTypes.get ( nicName ) ; if ( result == null ) { result = new java.util.ArrayList < > ( ) ; nicNameToNetworkTypes.put ( nicName , result ) ; } return result ; }

Target:
public java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( validateNetworkTypesOnNic ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetTagExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachUserFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID ) } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetTagExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachUserFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID ) } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private void updateActionAvailability ( ) { boolean hasSelectedItems = ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( hasSelectedItems ) ; }

Target:
private void updateActionAvailability ( ) { boolean hasSelectedItems = ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( hasSelectedItems && ( ! ( selectionContainsPlaceholderDevices ( ) ) ) ) ) ; }
Source:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.dao.StorageServerConnectionDao setUpStorageServerConnectionDao ( ) { storageServerConnectionDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageServerConnectionDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; return storageServerConnectionDao ; }

Target:
protected void expectGetConnections ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( setUpConnection ( i ) ) ; } }
Source:
public void canDetectMissingRequiredHostNumaNodes ( ) { updatedNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNodeWithId ( 3 , vdsNumaNodes , org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommandTest.NODE_ID_3 ) ) ; existingNumaNodes.addAll ( updatedNumaNodes ) ; vm.setvNumaNodeList ( existingNumaNodes ) ; vdsNumaNodes.remove ( 0 ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VM_NUMA_NODE_HOST_NODE_INVALID_INDEX ) ; }

Target:
public void canDetectMissingRequiredHostNumaNodes ( ) { updatedNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNodeWithId ( 0 , vdsNumaNodes , org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommandTest.NODE_ID_0 ) ) ; vm.setvNumaNodeList ( existingNumaNodes ) ; vdsNumaNodes.remove ( 0 ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VM_NUMA_NODE_HOST_NODE_INVALID_INDEX ) ; }
Source:
public void execute ( ) { org.ovirt.engine.core.bll.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , enclosingCommand.getCompensationContext ( ) ) ; if ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( enclosingCommand.getContext ( ) ) ) ; enclosingCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void execute ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , enclosingCommand.getCompensationContext ( ) ) ; if ( enclosingCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( enclosingCommand.getContext ( ) ) ) ; enclosingCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private boolean isNicActuallyExistsOrReferencesNewBond ( java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { return org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.isNicActuallyExistsOrReferencesNewBond ( existingInterfacesMap , bondsMap , nicName , nicId ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getCancelCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getStopCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getRemoveVolumeCommand ( ) ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.common.businessentities.AsyncTasks task , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { try { if ( task != null ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . saveOrUpdate ( task , entityType , entityIds ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , task.getTaskId ( ) ) , e ) ; } }

Target:
private static void addOrUpdateTaskInDB ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; }
Source:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; }

Target:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v3_3 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( cachedStorageDomainId ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskDummiesForMemSize = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , diskDummiesForMemSize ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( cachedStorageDomainId ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskDummiesForMemSize = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , diskDummiesForMemSize ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createAllSnapshotsFromVmParameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , "stateless snapshot" ) ; createAllSnapshotsFromVmParameters.setShouldBeLogged ( false ) ; createAllSnapshotsFromVmParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; createAllSnapshotsFromVmParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; createAllSnapshotsFromVmParameters.setEntityId ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityId ( ) ) ; createAllSnapshotsFromVmParameters.setSnapshotType ( SnapshotType.STATELESS ) ; return createAllSnapshotsFromVmParameters ; }
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 ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . 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:
public int compare ( org.ovirt.engine.core.common.businessentities.VDS o1 , org.ovirt.engine.core.common.businessentities.VDS o2 ) { return java.lang.Integer.valueOf ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.VdsCpuUsageComparator.calculateCpuUsage ( o1 ) ) . compareTo ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.VdsCpuUsageComparator.calculateCpuUsage ( o2 ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }
Source:
public void unmanagedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( "net" ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER ) ; }

Target:
public void unmanagedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( "net" ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , nic.getNetworkName ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewViewableInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName , boolean pluggedInterface ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewViewableInterface ( pluggedInterface ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }
Source:
protected boolean updateBrickServerName ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick , boolean addCanDoActionMessage ) { org.ovirt.engine.core.common.businessentities.VdsStatic server = getVdsStaticDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( server == null ) || ( ! ( server.getVdsGroupId ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ) ) ) { if ( addCanDoActionMessage ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID ) ; } return false ; } brick.setServerName ( server.getHostName ( ) ) ; return true ; }

Target:
protected boolean updateBrickServerName ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick , boolean addCanDoActionMessage ) { org.ovirt.engine.core.common.businessentities.VdsStatic server = org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsStaticDAO ( ) . get ( brick.getServerId ( ) ) ; if ( ( server == null ) || ( ! ( server.getVdsGroupId ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ) ) ) { if ( addCanDoActionMessage ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INVALID_BRICK_SERVER_ID ) ; } return false ; } brick.setServerName ( server.getHostName ( ) ) ; return true ; }
Source:
public void asMapTwoInits ( ) { schedule.addInitStep ( new org.ovirt.engine.core.common.migration.ConvergenceItem ( "action" , 10 ) ) . addInitStep ( new org.ovirt.engine.core.common.migration.ConvergenceItem ( "action2" , 15 ) ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.bll.migration.ConvergenceScheduleTest.ExpectedConvergence ( ) . addInit ( "action" , 10 ) . addInit ( "action2" , 15 ) , schedule.asMap ( ) ) ; }

Target:
public void asMapTwoInits ( ) { schedule.addInitStep ( new org.ovirt.engine.core.common.migration.ConvergenceItem ( "action" , 10 ) ) . addInitStep ( new org.ovirt.engine.core.common.migration.ConvergenceItem ( "action2" , 15 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( new org.ovirt.engine.core.bll.migration.ConvergenceScheduleTest.ExpectedConvergence ( ) . addInit ( "action" , 10 ) . addInit ( "action2" , 15 ) , schedule.asMap ( ) ) ; }
Source:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; return obj ; }

Target:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; obj.put ( "isAdmin" , loggedInUser.isAdmin ( ) ) ; return obj ; }