auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void removeVmInitFromDB ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.dao.VmInitDAO db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; db.remove ( vm.getId ( ) ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > getVmInitByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , boolean secure ) { org.ovirt.engine.core.dao.VmInitDao db = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmInitDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmInit > all = db.getVmInitByIds ( ids ) ; for ( org.ovirt.engine.core.common.businessentities.VmInit vmInit : all ) { if ( secure ) { vmInit.setPasswordAlreadyStored ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmInit.getRootPassword ( ) ) ) ) ) ; vmInit.setRootPassword ( null ) ; } else { vmInit.setPasswordAlreadyStored ( false ) ; } } return all ; }
Source:
public void getVmNicList ( 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 ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private boolean validateCrossAttachments ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > expectedAttachments = org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getDbFacade ( ) . getNetworkAttachmentDao ( ) . getAllForHost ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsId ( ) ) ; expectedAttachments.add ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator crossAttachmentsValidator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( expectedAttachments , org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsGroupId ( ) ) ) ) ; return validate ( crossAttachmentsValidator.validateNetworkExclusiveOnNics ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter completer = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter ( getHostInterfaces ( ) ) ; completer.completeNetworkAttachment ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ; if ( networkAttachment == null ) { return failCanDoAction ( VdcBllMessages.NETWORK_ATTACHMENT_NOT_SPECIFIED ) ; } if ( ( networkAttachment.getId ( ) ) != null ) { return failCanDoAction ( VdcBllMessages.NETWORK_ATTACHMENT_CANNOT_BE_CREATED_WITH_SPECIFIC_ID ) ; } return true ; }
Source:
public java.util.concurrent.Future < java.lang.Void > close ( ) { for ( java.lang.String subscribtionId : subscriptionIds ) { send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . unsubscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , subscribtionId ) . build ( ) ) ; } send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . disconnect ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_RECEIPT , java.util.UUID.randomUUID ( ) . toString ( ) ) . build ( ) ) ; return super . close ( ) ; }

Target:
public java.util.concurrent.Future < java.lang.Void > close ( ) { subscriptionIds.stream ( ) . forEach ( ( subscriptionId ) -> send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . unsubscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , subscriptionId ) . build ( ) ) ) ; send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . disconnect ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_RECEIPT , java.util.UUID.randomUUID ( ) . toString ( ) ) . build ( ) ) ; return super . close ( ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue value = new org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue ( securityCheckbox.getValue ( ) , bugCheckbox.getValue ( ) , enhancementCheckbox.getValue ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue > ( value ) { } ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { 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.uicommonweb.models.ErrataFilterValue value = new org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue ( securityCheckbox.isActive ( ) , bugCheckbox.isActive ( ) , enhancementCheckbox.isActive ( ) ) ; handler.onValueChange ( new com.google.gwt.event.logical.shared.ValueChangeEvent < org.ovirt.engine.ui.uicommonweb.models.ErrataFilterValue > ( value ) { } ) ; } } ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; newUser.setNamespace ( "*" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }
Source:
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 ) { updateFencingPolicyContent ( ( ( getVersion ( ) ) == null ? null : getVersion ( ) . getSelectedItem ( ) ) ) ; }

Target:
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 ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }
Source:
protected void expectGetVds ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.dao.VdsDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( db.getVdsDAO ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( id ) ) . thenReturn ( getVds ( id ) ) ; }

Target:
protected void expectGetVds ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.dao.VdsDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( db.getVdsDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( id ) ) . thenReturn ( getVds ( id ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForNewDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( disksList ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksList ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForNewDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( disksImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksList ) ; } ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VDSGroup group ) { java.util.Map < java.lang.String , java.lang.Object > dbResults = getCallsHandler ( ) . executeModification ( "InsertVdsGroups" , getVdsGroupParamSource ( group ) ) ; group.setvds_group_id ( new org.ovirt.engine.core.compat.Guid ( dbResults.get ( "vds_group_id" ) . toString ( ) ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VDSGroup group ) { org.ovirt.engine.core.compat.Guid id = group.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; group.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertVdsGroups" , getVdsGroupParamSource ( group ) ) ; }
Source:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = backend.RunAction ( task , sessionize ( taskParams ) ) ; if ( ! ( createResult.getCanDoAction ( ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BackendFailureException ( localize ( createResult.getCanDoActionMessages ( ) ) ) ; } else if ( ! ( createResult.getSucceeded ( ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BackendFailureException ( localize ( createResult.getExecuteFailedMessages ( ) ) ) ; } return createResult ; }

Target:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { return performCreation ( task , taskParams , entityResolver , expectBlocking ( ) , suggestedParentType ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > pmTypes = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; updatePmTypeList ( pmTypes , getPmType ( ) ) ; updatePmTypeList ( pmTypes , getPmSecondaryType ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDisksList ( ) { if ( ( cachedSelectedActiveDisks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAndCinderForVm = getFilteredDisksForSnapshot ( ) ; if ( ( getParameters ( ) . getDisks ( ) ) == null ) { cachedSelectedActiveDisks = imagesAndCinderForVm ; } else { cachedSelectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.imagesIntersection ( imagesAndCinderForVm , getParameters ( ) . getDisks ( ) ) ; } } return cachedSelectedActiveDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( disks , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { allDisks.add ( org.ovirt.engine.core.bll.ImagesHandler.getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return allDisks ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { removeListeners ( model ) ; getView ( ) . flush ( ) ; org.ovirt.engine.ui.userportal.section.main.presenter.popup.console.ConsoleModelChangedEvent.fire ( getEventBus ( ) , ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getSelectedItem ( ) ) ) ) ; hideAndUnbind ( ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . rdpSelected ( event.getValue ( ) ) ; getView ( ) . spiceSelected ( ( ! ( event.getValue ( ) ) ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( ! ( event.getValue ( ) ) ) ) ) ; }
Source:
public void initMigrationPolicies ( boolean isEdit ) { java.util.List < org.ovirt.engine.core.common.migration.MigrationPolicy > policies = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMigrationPolicies ( ) ; getMigrationPolicies ( ) . setItems ( policies ) ; if ( isEdit ) { for ( org.ovirt.engine.core.common.migration.MigrationPolicy policy : policies ) { if ( java.util.Objects.equals ( policy.getId ( ) , getEntity ( ) . getMigrationPolicyId ( ) ) ) { getMigrationPolicies ( ) . setSelectedItem ( policy ) ; break ; } } } }

Target:
private org.ovirt.engine.core.common.migration.MigrationPolicy findFirstNonEmptyMigrationPolicy ( java.util.List < org.ovirt.engine.core.common.migration.MigrationPolicy > policies ) { for ( org.ovirt.engine.core.common.migration.MigrationPolicy policy : policies ) { if ( ! ( java.util.Objects.equals ( policy.getId ( ) , NoMigrationPolicy.ID ) ) ) { return policy ; } } return null ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createSnapshotMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_SNAPSHOT_MEMORY_DISK_ALIAS ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_SNAPSHOT_MEMORY_DISK_DESCRIPTION ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createSnapshotMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_SNAPSHOT_MEMORY_DISK_ALIAS ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_SNAPSHOT_MEMORY_DISK_DESCRIPTION ) ; return image ; }
Source:
private static java.util.Set < java.lang.String > getClusterEmulatedMachines ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { if ( ( cluster.getEmulatedMachine ( ) ) == null ) { return new java.util.HashSet < > ( ) ; } else { return new java.util.HashSet ( java.util.Arrays.asList ( cluster.getEmulatedMachine ( ) . split ( "," ) ) ) ; } }

Target:
private static java.util.Set < java.lang.String > getClusterEmulatedMachines ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( ( cluster.getEmulatedMachine ( ) ) == null ) { return new java.util.HashSet < > ( ) ; } else { return new java.util.HashSet ( java.util.Arrays.asList ( cluster.getEmulatedMachine ( ) . split ( "," ) ) ) ; } }
Source:
public void twoNetworkInterfacesWithDifferentIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.IP_1 ) ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.IP_2 ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }

Target:
public void twoNetworkInterfacesWithDifferentIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.createVdsNetworkInterfaceWithStaticIp ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.IP_1 ) ) ; listOfInterfaces.add ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.createVdsNetworkInterfaceWithStaticIp ( org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.IP_2 ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }
Source:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }

Target:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }
Source:
protected void updateBricksWithTaskID ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickEntity : getParameters ( ) . getBricks ( ) ) { brickEntity.getAsyncTask ( ) . setTaskId ( asyncTask.getTaskId ( ) ) ; } getGlusterBrickDao ( ) . updateBrickTasksInBatch ( getParameters ( ) . getBricks ( ) ) ; getGlusterVolumeDao ( ) . updateVolumeTask ( getGlusterVolumeId ( ) , asyncTask.getTaskId ( ) ) ; }

Target:
protected void updateBricksWithTaskID ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickEntity : getParameters ( ) . getBricks ( ) ) { brickEntity.getAsyncTask ( ) . setTaskId ( asyncTask.getTaskId ( ) ) ; } getGlusterBrickDao ( ) . updateBrickTasksInBatch ( getParameters ( ) . getBricks ( ) ) ; glusterVolumeDao.updateVolumeTask ( getGlusterVolumeId ( ) , asyncTask.getTaskId ( ) ) ; }
Source:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) || ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ) ; }

Target:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) || ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test32BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_0 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_32_BIT ) + 1 ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.mcr.mockConfigValue ( ConfigValues.VM32BitMaxMemorySizeInMB , Version.v4_0 , 20480 ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingVdsGroup.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotSame ( preUpdate , updateValue ) ; dao.setEmulatedMachine ( existingVdsGroup.getId ( ) , existingVdsGroup.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingVdsGroup.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }

Target:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotSame ( preUpdate , updateValue ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String size , int volFormat , int diskType , java.lang.String volUUID , java.lang.String descr , java.lang.String srcImgGUID , java.lang.String srcVolUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVolumeContainer ( sdUUID , imgGUID , size , volFormat , diskType , volUUID , descr , srcImgGUID , srcVolUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturnForXmlRpc getQemuImageInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmpRpcReturnValue = vdsServer.getQemuImageInfo ( sdUUID , spUUID , imgUUID , volUUID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturnForXmlRpc ( xmpRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void removedLabelExistsOnTheHostNotExistValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; nic.setLabels ( createSet ( "lbl1" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( nics ) . removedLabelExistsOnTheHost ( "lbl1" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void removedLabelExistsOnTheHostNotExistValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; nic.setLabels ( createSet ( "lbl1" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; org.hamcrest.MatcherAssert.assertThat ( createNicLabelValidator ( nics ) . removedLabelExistsOnTheHost ( "lbl1" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void tJDBCOutput_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.TalendException { end_Hash.put ( "tJDBCOutput_6" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_6_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tRowGenerator_1_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.TalendException { end_Hash.put ( "tRowGenerator_1" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tRowGenerator_1_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAsStateless ( ) ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }

Target:
protected org.ovirt.engine.core.compat.Guid getPredefinedVdsIdToRunOn ( ) { return ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) ) != null ? org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) : super . getPredefinedVdsIdToRunOn ( ) ; }
Source:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmTemplate getEntityStronglyTyped ( ) { java.lang.Object tempVar = getEntity ( ) ; return ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( tempVar instanceof org.ovirt.engine.core.common.businessentities.VmTemplate ? tempVar : null ) ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntity ( ) , getEntity ( ) . getStoragePoolId ( ) , cluster.getCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.DEACTIVATED ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.DEACTIVATED ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
public void failOnStoppedVm ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.SPICE ) ; mockVm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( getQuery ( ) ) . getCachedVm ( ) ; getQuery ( ) . validateInputs ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void failOnStoppedVm ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.ovirt.engine.core.common.businessentities.VM mockVm = mockVm ( GraphicsType.SPICE ) ; mockVm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( mockVm ) . when ( getQuery ( ) ) . getCachedVm ( ) ; getQuery ( ) . validateInputs ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; org.ovirt.engine.core.dao.SnapshotDao snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; org.ovirt.engine.core.dao.SnapshotDao snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }
Source:
public void testListGlobalLimit ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }

Target:
public void testListGlobalLimit ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaCluster ( getClusterGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaClusterLimits clusterLimits = collection.list ( ) ; assertClusterLimitsFound ( clusterLimits , 1 ) ; org.ovirt.engine.api.model.QuotaClusterLimit clusterLimit = clusterLimits.getQuotaClusterLimits ( ) . get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 20 , clusterLimit.getVcpuLimit ( ) . intValue ( ) ) ; }
Source:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( object ) ) . getname ( ) ; }

Target:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { return ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getCluster ( ) . getname ( ) ) + "/" ) + ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getDataCenter ( ) . getname ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdownHost ( int reboot ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdownHost ( reboot ) ; 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.StatusOnlyReturnForXmlRpc glusterHookUpdate ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName , java.lang.String content , java.lang.String checksum ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookUpdate ( glusterCommand , stage , hookName , content , checksum ) ; 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 ) ; } }
Source:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN , VDSCommandType.GetIsoList ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , fileListRefreshed , ImageFileType.ISO , fileStatsFromVDSReturnValue ( fileStats ) ) ; }

Target:
private boolean updateFloppyListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FLOPPY_VDSM_FILE_PATTERN , VDSCommandType.GetFloppyList ) ; return updateFloppyListFromVDSM ( repoStoragePoolId , repoStorageDomainId , fileStatsFromVDSReturnValue ( fileStats ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc heartBeat ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.heartBeat ( ) ; 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.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( userName , remoteGroupName , remoteVolumeName , partial ) ; 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 ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . getVolumeOption ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateOptionInDb ( getParameters ( ) . getVolumeOption ( ) ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . getVolumeOption ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateOptionInDb ( getParameters ( ) . getVolumeOption ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }