auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isRoot ( org.ovirt.engine.core.common.businessentities.DiskImage candidate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { if ( candidate.getParentId ( ) . equals ( image.getImageId ( ) ) ) { return false ; } } return true ; }

Target:
private boolean isRoot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage candidate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( candidate.getParentId ( ) . equals ( image.getImageId ( ) ) ) { return false ; } } return true ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbGroupDao ( ) ; newGroup = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( 0 ) ) ; newGroup.setDomain ( "domain" ) ; newGroup.setName ( "name" ) ; newGroup.setActive ( true ) ; existingGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbGroupDao ( ) ; newGroup = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setExternalId ( "0" ) ; newGroup.setDomain ( "domain" ) ; newGroup.setName ( "name" ) ; newGroup.setActive ( true ) ; existingGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }
Source:
public void initTable ( ) { super . initTable ( ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumn ( portMirroringColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroring ( ) , "85px" ) ; }

Target:
public org.ovirt.engine.ui.common.widget.listgroup.PatternflyListViewItem < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > createListViewItem ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface selectedItem ) { return new org.ovirt.engine.ui.common.widget.uicommon.vm.VmInterfaceListGroupItem ( selectedItem , getDetailModel ( ) . getGuestAgentData ( ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { boolean isDiskPlugged = getDetailModel ( ) . isDiskPluggedToVm ( object ) ; setTitle ( ( isDiskPlugged ? constants.activeDisk ( ) : constants.inactiveDisk ( ) ) ) ; return isDiskPlugged ? getCommonResources ( ) . upImage ( ) : getCommonResources ( ) . downImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { boolean isDiskPlugged = getDetailModel ( ) . isDiskPluggedToVm ( object ) ; setTitle ( ( isDiskPlugged ? constants.active ( ) : constants.inactive ( ) ) ) ; return isDiskPlugged ? getCommonResources ( ) . upImage ( ) : getCommonResources ( ) . downImage ( ) ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( getMemCommited ( ) ) ) - ( getReservedMem ( ) ) ) - ( getPendingVmemSize ( ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }

Target:
public float getFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { float freeMemory = ( ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( getMemCommited ( ) ) ) - ( getReservedMem ( ) ) ; return freeMemory > 0 ? freeMemory : 0 ; } else { return 0 ; } }
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel object ) { org.ovirt.engine.ui.common.widget.table.column.ScrollableTextCell.CellTemplate template = com.google.gwt.core.client.GWT.create ( ScrollableTextCell.CellTemplate.class ) ; java.lang.String color = "" ; if ( object != null ) { if ( ( object.getIsIncluded ( ) ) || ( object.getIsSelected ( ) ) ) { color = "black" ; } else if ( ! ( object.getIsAccessible ( ) ) ) { color = "orange" ; } else { color = "grey" ; } } return template.input ( getRawValue ( object ) , ( "color:" + color ) ) ; }

Target:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel object ) { org.ovirt.engine.ui.common.widget.table.column.ScrollableTextCell.CellTemplate template = com.google.gwt.core.client.GWT.create ( ScrollableTextCell.CellTemplate.class ) ; java.lang.String color = "" ; if ( object != null ) { if ( object.getIsGrayedOut ( ) ) { color = "gray" ; } else if ( ! ( object.getIsAccessible ( ) ) ) { color = "orange" ; } else { color = "black" ; } } return template.input ( getRawValue ( object ) , ( "color:" + color ) ) ; }
Source:
protected boolean ValidConnection ( org.ovirt.engine.core.common.businessentities.StorageType type , java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > connections ) { return ( connections != null ) && ( ( connections.isEmpty ( ) ) || ( org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( type ) . ValidateStoragePoolConnectionsInHost ( org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getVds ( ) , connections , org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getStoragePool ( ) . getId ( ) ) ) ) ; }

Target:
protected boolean ValidConnection ( org.ovirt.engine.core.common.businessentities.StorageType type , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { return ( connections != null ) && ( ( connections.isEmpty ( ) ) || ( org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( type ) . validateStoragePoolConnectionsInHost ( org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getVds ( ) , connections , org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getStoragePool ( ) . getId ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , org.ovirt.engine.ui.userportal.section.main.view.tab.extended.SideTabExtendedVirtualMachineView.vmTableResources , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getClientStorage ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getClientStorage ( ) ) ) ; }
Source:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( "AppErrors" ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }

Target:
public void testNoStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ) ; assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; assertEquals ( "String should equal" , "VM not found" , error.get ( 0 ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) && ( isEnabled ( value ) ) ) { onClick ( value ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) && ( isEnabled ( value ) ) ) { onClick ( value ) ; } }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; if ( getIsNew ( ) ) { getIsWipeAfterDelete ( ) . setEntity ( selectedStorage.getWipeAfterDelete ( ) ) ; } } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateCinderVolumeTypes ( ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; if ( getIsNew ( ) ) { getIsWipeAfterDelete ( ) . setEntity ( selectedStorage.getWipeAfterDelete ( ) ) ; } } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateCinderVolumeTypes ( ) ; updatePassDiscardAvailability ( ) ; }
Source:
private static void initProviderSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_ADDED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_ADDITION_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_UPDATED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_UPDATE_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_REMOVED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_REMOVAL_FAILED , AuditLogSeverity.ERROR ) ; }

Target:
private static void initProviderSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_ADDED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_ADDITION_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_UPDATED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_UPDATE_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_REMOVED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_REMOVAL_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_CERTIFICATE_CHAIN_IMPORTED , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.PROVIDER_CERTIFICATE_CHAIN_IMPORT_FAILED , AuditLogSeverity.ERROR ) ; }
Source:
public void checkValidIpConfigurationStaticBootProtocol ( ) { initIpConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , true , true ) ; org.ovirt.engine.core.bll.ValidationResult actual = underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , actual ) ; }

Target:
private void checkIncompatibleIpv6AddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol ipv6BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( ipv6BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv6BootProtocol.getDisplayName ( ) ) ) ) ; }
Source:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( ActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.ActionReturnValue actionReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( ActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( actionReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SSOSession ssoSession ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SSOConstants.JSON_ACCESS_TOKEN , ssoSession.getAccessToken ( ) ) ; payload.put ( SSOConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SSOConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) ) ; payload.put ( SSOConstants.JSON_TOKEN_TYPE , "bearer" ) ; return payload ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( org.ovirt.engine.core.sso.utils.SsoSession ssoSession ) { java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( SsoConstants.JSON_ACCESS_TOKEN , ssoSession.getAccessToken ( ) ) ; payload.put ( SsoConstants.JSON_SCOPE , ( org.apache.commons.lang.StringUtils.isEmpty ( ssoSession.getScope ( ) ) ? "" : ssoSession.getScope ( ) ) ) ; payload.put ( SsoConstants.JSON_EXPIRES_IN , ssoSession.getValidTo ( ) ) ; payload.put ( SsoConstants.JSON_TOKEN_TYPE , "bearer" ) ; return payload ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getStatusRebalanceCommand ( ) ) ) { return rebalanceStatusPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
private void styleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxOnlyEditor editor , boolean enabled ) { if ( ! enabled ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.Object > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }

Target:
private < T > void styleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxOnlyEditor < T > editor , boolean enabled ) { if ( ! enabled ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < T > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }
Source:
public void refreshImportedNetworks ( ) { importedNetworks.edit ( importedNetworks.flush ( ) ) ; }

Target:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > getAllImportedNetworks ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = importedNetworks.asEditor ( ) . flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorages ( long storageSize , double storageSizeUsed ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > ( ) ; quotaStorages.add ( getQuotaStorage ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.UNLIMITED_STORAGE , 0 ) ) ; quotaStorages.add ( getQuotaStorage ( 50 , 5 ) ) ; quotaStorages.get ( 0 ) . setStorageId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; quotaStorages.get ( 1 ) . setStorageId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; quotaStorages.add ( getQuotaStorage ( storageSize , storageSizeUsed ) ) ; return quotaStorages ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorages ( long storageSize , double storageSizeUsed ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > ( ) ; quotaStorages.add ( getQuotaStorage ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.UNLIMITED_STORAGE , 0 ) ) ; quotaStorages.add ( getQuotaStorage ( 50 , 5 ) ) ; quotaStorages.get ( 0 ) . setStorageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quotaStorages.get ( 1 ) . setStorageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quotaStorages.add ( getQuotaStorage ( storageSize , storageSizeUsed ) ) ; return quotaStorages ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getOs ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } switch ( vm.getStaticData ( ) . getOs ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }
Source:
private void releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; } } }

Target:
private void releaseUsedHostDevices ( ) { if ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) ) ) { try { hostDeviceManager.acquireHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; hostDeviceManager.freeVmHostDevices ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; } finally { hostDeviceManager.releaseHostDevicesLock ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ; } } }
Source:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryGroupById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Namespace" , "Id" } , new java.lang.Object [ ] { DOMAIN , "" , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetDirectoryGroupById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Namespace" , "Id" } , new java.lang.Object [ ] { DOMAIN , "" , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getClusterCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }

Target:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { if ( ! ( getParameters ( ) . isLeaveLocked ( ) ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDestinationDiskImage ( ) ; if ( diskImage != null ) { getImageDao ( ) . updateStatus ( diskImage.getImage ( ) . getId ( ) , ImageStatus.OK ) ; } unLockImage ( ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { if ( ! ( getParameters ( ) . isLeaveLocked ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDestinationDiskImage ( ) ; if ( diskImage != null ) { getImageDao ( ) . updateStatus ( diskImage.getImage ( ) . getId ( ) , ImageStatus.OK ) ; } unLockImage ( ) ; } return null ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
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 > diskImages = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( diskImages ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForDisksWithSnapshots ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( diskList ) ; } ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public void testConnection ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExternalProvider , buildGetVmsFromExternalProviderQueryParameters ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , retVal.getExceptionString ( ) ) ; } }

Target:
public void testConnection ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExternalProvider , buildGetVmsFromExternalProviderQueryParameters ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , retVal.getExceptionString ( ) ) ; } }
Source:
private void OnSaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.Validate ( ) ) ) ) { return ; } CancelConfirm ( ) ; getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveSan" } ) ) ) . Run ( ) ; }

Target:
private void onSaveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveSan" } ) ) ) . Run ( ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( value ) ) ; java.util.Collections.sort ( itemList , new java.util.Comparator < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.VmTemplate paramT1 , org.ovirt.engine.core.common.businessentities.VmTemplate paramT2 ) { return paramT1.getName ( ) . compareTo ( paramT2.getName ( ) ) ; } } ) ; } super . setItems ( value ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( value ) ) ; java.util.Collections.sort ( itemList , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; } super . setItems ( value ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.Disks list ( ) { boolean unregistered = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.AbstractBackendStorageDomainDisksResource.UNREGISTERED , true , false ) ; if ( unregistered ) { org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.api.restapi.resource.BackendDataCenterHelper.lookupByStorageDomainId ( this , storageDomainId ) ; return mapCollection ( getBackendCollection ( VdcQueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , dataCenterId ) ) ) ; } else { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) ) ) ; } }

Target:
public org.ovirt.engine.api.model.Disks list ( ) { boolean unregistered = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.AbstractBackendStorageDomainDisksResource.UNREGISTERED , true , false ) ; if ( unregistered ) { org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.api.restapi.resource.BackendDataCenterHelper.lookupByStorageDomainId ( this , storageDomainId ) ; return mapCollection ( getBackendCollection ( QueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , dataCenterId ) ) ) ; } else { return mapCollection ( getBackendCollection ( QueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) ) ) ; } }
Source:
private void onImportSourceChanged ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource source = importSources.getSelectedItem ( ) ; if ( source == null ) { return ; } importedVmModels.setItems ( null ) ; externalVmModels.setItems ( null ) ; switch ( source ) { case EXPORT_DOMAIN : onExportDomainChosen ( ) ; break ; default : } }

Target:
private void clearVms ( ) { importedVmModels.setItems ( null ) ; externalVmModels.setItems ( null ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getTagId ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getVmId ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getTagId ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getVmId ( ) ) ; if ( tagsVmMap == null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getStartedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( volumeId ) ; volume.setStatus ( GlusterVolumeStatus.UP ) ; volume.setClusterId ( CLUSTER_ID ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getGlusterVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volumeEntity.setId ( volumeId ) ; volumeEntity.setName ( "test-vol" ) ; volumeEntity.addAccessProtocol ( AccessProtocol.GLUSTER ) ; volumeEntity.addTransportType ( TransportType.TCP ) ; volumeEntity.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volumeEntity.setStatus ( ( volumeId.equals ( startedVolumeId ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.DOWN ) ) ; volumeEntity.setClusterId ( CLUSTER_ID ) ; return volumeEntity ; }
Source:
private void mockGraphicsDevice ( ) { org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( command ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; }

Target:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static org.ovirt.engine.api.model.Disk map ( org.ovirt.engine.api.model.DiskSnapshot diskSnapshot , org.ovirt.engine.api.model.Disk template ) { org.ovirt.engine.core.common.businessentities.DiskImage engineDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( diskSnapshot , template ) ) ) ; engineDisk.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( diskSnapshot.getId ( ) ) ) ; if ( diskSnapshot.isSetDisk ( ) ) { engineDisk.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( diskSnapshot.getDisk ( ) . getId ( ) ) ) ; } return engineDisk ; }

Target:
public static org.ovirt.engine.api.model.Disk map ( org.ovirt.engine.api.model.DiskSnapshot diskSnapshot , org.ovirt.engine.api.model.Disk template ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage engineDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( diskSnapshot , template ) ) ) ; engineDisk.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( diskSnapshot.getId ( ) ) ) ; if ( diskSnapshot.isSetDisk ( ) ) { engineDisk.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( diskSnapshot.getDisk ( ) . getId ( ) ) ) ; } return engineDisk ; }