auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ; if ( networkAttachment == null ) { return failCanDoAction ( VdcBllMessages.NETWORK_ATTACHMENT_NOT_SPECIFIED ) ; } if ( ( networkAttachment.getId ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.NETWORK_ATTACHMENT_NOT_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ; if ( networkAttachment == null ) { return failCanDoAction ( EngineMessage.NETWORK_ATTACHMENT_NOT_SPECIFIED ) ; } if ( ( networkAttachment.getId ( ) ) == null ) { return failCanDoAction ( EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; } return true ; }
Source:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }

Target:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }
Source:
private void MoveVMsToUnknown ( ) { addMigratedVmsNotUpYet ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVmList ( ) ) { destroyVmOnDestination ( vm ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }

Target:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.infoFormat ( "Fence failed on vds {0} which is spm of pool {1} - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.errorFormat ( "Failed to run Fence script on vds:{0}." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.AlertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }
Source:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , vm ) ; } }

Target:
protected void setGetVmQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , vm ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } else if ( getAddImportCommand ( ) . equals ( command ) ) { addImport ( ) ; } else if ( getCancelImportCommand ( ) . equals ( command ) ) { cancelImport ( ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { vmDevice.setIsPlugged ( ( ( getParameters ( ) . getAction ( ) ) == ( org.ovirt.engine.core.common.action.PlugAction.PLUG ) ? true : false ) ) ; getVmDeviceDao ( ) . update ( vmDevice ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( getVm ( ) . getStaticData ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { vmDevice.setIsPlugged ( ( ( getParameters ( ) . getAction ( ) ) == ( org.ovirt.engine.core.common.action.PlugAction.PLUG ) ? true : false ) ) ; getVmDeviceDao ( ) . update ( vmDevice ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrder ( getVm ( ) . getId ( ) ) ; return null ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , boolean reply , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply , errorMessage ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean valid , boolean success , boolean reply , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , valid , success , null , reply , errorMessage ) ; }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.dao.network.DnsResolverConfigurationDao dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao ( ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDAO ( ) . get ( org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmTemplateQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmt ) ; org.ovirt.engine.core.bll.GetVmTemplateQuery.getQueryReturnValue ( ) . setReturnValue ( vmt ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmTemplateQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmt ) ; org.ovirt.engine.core.bll.GetVmTemplateQuery.getQueryReturnValue ( ) . setReturnValue ( vmt ) ; }
Source:
public void init ( ) { admin = new org.ovirt.engine.core.aaa.DirectoryUser ( getProfileName ( ) , org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory.ADMIN_ID , org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory.ADMIN_NAME ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }

Target:
public void init ( ) { admin = new org.ovirt.engine.core.aaa.DirectoryUser ( getName ( ) , org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory.ADMIN_ID , getAdminName ( ) ) ; admin.setAdmin ( true ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VDS value ) { java.lang.String maintenanceReason = value.getMaintenanceReason ( ) ; if ( ( maintenanceReason != null ) && ( ! ( maintenanceReason.trim ( ) . isEmpty ( ) ) ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( maintenanceReason ) ; } return null ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.businessentities.VDS value ) { java.lang.String maintenanceReason = value.getMaintenanceReason ( ) ; if ( ( maintenanceReason != null ) && ( ! ( maintenanceReason.trim ( ) . isEmpty ( ) ) ) ) { return maintenanceReason ; } return "" ; }
Source:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false , null ) ; }

Target:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false , null ) ; }
Source:
private static void detachNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allNics , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bridge = networkToDetach.getBridge ( ) ; if ( ( bridge.getName ( ) . indexOf ( '.' ) ) > 0 ) { allNics.remove ( bridge.getEntity ( ) ) ; } networkToDetach.detach ( ) ; }

Target:
private static void detachNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allNics , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bridge = networkToDetach.getVlanNic ( ) ; if ( ( bridge.getName ( ) . indexOf ( '.' ) ) > 0 ) { allNics.remove ( bridge.getEntity ( ) ) ; } networkToDetach.detach ( ) ; }
Source:
protected boolean isFenceAgentValid ( org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getUser ( ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getPassword ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS ) ; return false ; } else { return true ; } }

Target:
protected boolean isFenceAgentValid ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getUser ( ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getPassword ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS ) ; return false ; } else { return true ; } }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { networkEditor.setLabel ( constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( constants.descriptionVnicProfile ( ) ) ; portMirroringEditor.setLabel ( constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( constants.profileQoSInstanceTypeLabel ( ) ) ; }

Target:
private void localize ( ) { networkEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.descriptionVnicProfile ( ) ) ; portMirroringEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.profileQoSInstanceTypeLabel ( ) ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.OriginType type , java.lang.String incoming ) { return type.name ( ) . toLowerCase ( ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( GraphicsType.SPICE ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; } if ( graphicsInfos.containsKey ( GraphicsType.VNC ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; } } return null ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { int selectedIndex = bootSequenceBox.getSelectedIndex ( ) ; bootSequenceModel.setSelectedItem ( bootSequenceModel.getItems ( ) . get ( selectedIndex ) ) ; bootSequenceUpButton.setEnabled ( bootSequenceModel.getMoveItemUpCommand ( ) . getIsExecutionAllowed ( ) ) ; bootSequenceDownButton.setEnabled ( bootSequenceModel.getMoveItemDownCommand ( ) . getIsExecutionAllowed ( ) ) ; localizeBootSequenceButtons ( ) ; }

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 ) { boolean isEnabled = bootSequenceModel.getNetworkOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getNetworkOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }
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.common.businessentities.storage.LUNs lunFromVG , org.ovirt.engine.core.common.businessentities.storage.LUNs lunFromDB ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Collections.singletonList ( lunFromVG ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Collections.singletonList ( lunFromDB ) ; return command.getLunsToUpdateInDb ( lunsFromVgInfo , lunsFromDb ) ; }

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 ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Collections.singletonList ( lunFromVg ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Collections.singletonList ( lunFromDb ) ; return command.getLunsToUpdateInDb ( lunsFromVgInfo , lunsFromDb ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( vm.getRunOnVds ( ) . toString ( ) ) ) ; if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) && ( ( getVdsDynamic ( vm.getRunOnVds ( ) ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void initializeResouceIcons ( org.ovirt.engine.ui.common.CommonApplicationResources resources ) { numaPanel.setPinnedPartialVNumaIcon ( resources.pinnedPartialVNumaIcon ( ) ) ; numaPanel.setPinnedVNumaIcon ( resources.pinnedVNumaIcon ( ) ) ; numaPanel.setPartialVNumaIcon ( resources.partialVNumaIcon ( ) ) ; numaPanel.setvNumaIcon ( resources.vNumaIcon ( ) ) ; }

Target:
private void initializeResouceIcons ( ) { numaPanel.setPinnedPartialVNumaIcon ( org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.resources.pinnedPartialVNumaIcon ( ) ) ; numaPanel.setPinnedVNumaIcon ( org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.resources.pinnedVNumaIcon ( ) ) ; numaPanel.setPartialVNumaIcon ( org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.resources.partialVNumaIcon ( ) ) ; numaPanel.setvNumaIcon ( org.ovirt.engine.ui.common.view.popup.numa.DraggableVirtualNumaPanel.resources.vNumaIcon ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( isAddingNewVm ) { org.ovirt.engine.core.common.action.VmOperationParameterBase reorderParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ReorderVmNics , reorderParams , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } ) ; } else { callback.vnicCreated ( vmId ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_DISK ; } else { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; } case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private static void assertGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
private static void assertGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : result ) { org.junit.Assert.assertEquals ( "Template generation wasn't loaded as expected" , 1 , template.getDbGeneration ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { slaveVolume = getSlaveVolume ( ) ; if ( ( slaveVolume ) != null ) { setGlusterVolumeId ( slaveVolume.getId ( ) ) ; setVdsGroupId ( slaveVolume.getClusterId ( ) ) ; } else { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; } if ( ( slaveVolume.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { slaveVolume = getSlaveVolume ( ) ; if ( ( slaveVolume ) != null ) { setGlusterVolumeId ( slaveVolume.getId ( ) ) ; setVdsGroupId ( slaveVolume.getClusterId ( ) ) ; } else { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; } if ( ( slaveVolume.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return super . canDoAction ( ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { setBootProtocolsAvailable ( ( ( java.lang.Boolean ) ( value ) ) ) ; } }

Target:
public void setEntity ( java.lang.Object value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { setBootProtocolsAvailable ( ( ( java.lang.Boolean ) ( value ) ) ) ; if ( ! ( ( java.lang.Boolean ) ( value ) ) ) { revertChanges ( ) ; } else { saveOriginalNetworkParameters ( ) ; } } }
Source:
private void logProxySelection ( java.lang.String proxy , java.lang.String origin , java.lang.String command ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Proxy" , proxy ) ; logable.addCustomValue ( "Origin" , origin ) ; logable.addCustomValue ( "Command" , command ) ; logable.setVdsId ( _vds.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.PROXY_HOST_SELECTION ) ; org.ovirt.engine.core.bll.FenceExecutor.log.infoFormat ( "Using Host {0} from {1} as proxy to execute {2} command on Host {3}" , proxy , origin , command , _vds.getName ( ) ) ; }

Target:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( ( "Executing <{}> Power Management command, Proxy Host:{}, " + "Agent:{}, Agent Type:{}, Target Host:{}, Management IP:{}, User:{}, Options:{}, Fencing policy:{}" ) , action , getNameOrId ( proxyHost ) , agent.getId ( ) , org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) , getNameOrId ( _vds ) , agent.getIp ( ) , agent.getUser ( ) , getOptions ( agent ) , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }
Source:
private static void assertCorrectGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONFIGURE_VM_STORAGE , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.Assert.assertEquals ( existingDomain.getId ( ) , domain.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , domain.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , domain.getActualImagesSize ( ) ) ; }
Source:
public void testStderr ( ) throws java.lang.Throwable { org.ovirt.engine.core.utils.ssh.SSHDialogTest.Sink sink = new org.ovirt.engine.core.utils.ssh.SSHDialogTest.Sink ( new java.lang.String [ ] { "start" , "text1" , "text2" } , new java.lang.String [ ] { "text1" , "text2" } ) ; _sshdialog.connect ( ) ; _sshdialog.authenticate ( ) ; _sshdialog.executeCommand ( sink , "echo message >&2 && cat" , new java.io.InputStream [ ] { new java.io.ByteArrayInputStream ( "start\n" . getBytes ( "UTF-8" ) ) } ) ; sink.exception ( ) ; }

Target:
public void testStderr ( ) throws java.lang.Throwable { try ( final java.io.InputStream start = new java.io.ByteArrayInputStream ( "start\n" . getBytes ( "UTF-8" ) ) ) { org.ovirt.engine.core.utils.ssh.SSHDialogTest.Sink sink = new org.ovirt.engine.core.utils.ssh.SSHDialogTest.Sink ( new java.lang.String [ ] { "start" , "text1" , "text2" } , new java.lang.String [ ] { "text1" , "text2" } ) ; _sshdialog.connect ( ) ; _sshdialog.authenticate ( ) ; _sshdialog.executeCommand ( sink , "echo message >&2 && cat" , new java.io.InputStream [ ] { start } ) ; sink.exception ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Arrays.asList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; return sd ; }
Source:
private java.lang.String getConnectionDescription ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections , java.lang.String connectionId ) { org.ovirt.engine.core.compat.Guid connectionIdGuid = org.ovirt.engine.core.compat.Guid.createGuidFromString ( connectionId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { org.ovirt.engine.core.compat.Guid connectionGuid = org.ovirt.engine.core.compat.Guid.createGuidFromString ( connection.getid ( ) ) ; if ( connectionGuid.equals ( connectionIdGuid ) ) { java.lang.String desc = connection.getconnection ( ) ; if ( ( connection.getiqn ( ) ) != null ) { desc += " " + ( connection.getiqn ( ) ) ; } return desc ; } } return "" ; }

Target:
private java.lang.String getConnectionDescription ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections , java.lang.String connectionId ) { org.ovirt.engine.core.compat.Guid connectionIdGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connectionId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { org.ovirt.engine.core.compat.Guid connectionGuid = org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( connection.getid ( ) ) ; if ( connectionGuid.equals ( connectionIdGuid ) ) { java.lang.String desc = connection.getconnection ( ) ; if ( ( connection.getiqn ( ) ) != null ) { desc += " " + ( connection.getiqn ( ) ) ; } return desc ; } } return "" ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > getItems ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation operation ) { if ( containsKey ( operation ) ) { return get ( operation ) ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > menuItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > ( ) ; put ( operation , menuItems ) ; return menuItems ; }

Target:
private void addToOperationMultiMap ( java.util.Map < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > > operationsMap , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation operation , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand command ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand > menuItems = operationsMap.get ( operation ) ; if ( menuItems == null ) { menuItems = new java.util.ArrayList < > ( ) ; operationsMap.put ( operation , menuItems ) ; } menuItems.add ( command ) ; }
Source:
public void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void testValidateGatewayWhenGatewayIsNotSpecified ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.getIpConfiguration ( ) . getPrimaryAddress ( ) . setGateway ( "" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . validateGateway ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenRelatedNetworkIsManagementNetwork ( ) throws java.lang.Exception { doTestValidateGateway ( "someGateway" , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . getImageGroupID ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.sortImageList ( images ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . setImageIds ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getDiskImageIds ( images ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = diskImageDao.getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . getImageGroupID ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.sortImageList ( images ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . setImageIds ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getDiskImageIds ( images ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupVolumesDataCommand.setSucceeded ( true ) ; }
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.Guid poolId , java.util.ArrayList < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) , messages ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; org.junit.Assert.assertNotNull ( disk ) ; }