auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetWithPassthrough ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE , result.getId ( ) ) ; org.junit.Assert.assertTrue ( result.isPassthrough ( ) ) ; org.junit.Assert.assertFalse ( result.isMigratable ( ) ) ; }

Target:
public void testGetWithPassthrough ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE , result.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.isPassthrough ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isMigratable ( ) ) ; }
Source:
protected void setUpGetNetworksByDataCenterExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getEntityList ( ) , failure ) ; } }

Target:
protected void setUpGetNetworksByDataCenterExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getEntityList ( ) , failure ) ; } }
Source:
protected java.util.Collection < org.ovirt.engine.core.bll.AutoStartVmToRestart > getInitialVmsToStart ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > failedAutoStartVms = getVmDao ( ) . getAllFailedAutoStartVms ( ) ; java.util.ArrayList < org.ovirt.engine.core.bll.AutoStartVmToRestart > initialFailedVms = new java.util.ArrayList ( failedAutoStartVms.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : failedAutoStartVms ) { log.info ( "Found HA VM which is down because of an error, trying to restart it, VM '{}' ({})" , vm.getName ( ) , vm.getId ( ) ) ; initialFailedVms.add ( new org.ovirt.engine.core.bll.AutoStartVmToRestart ( vm.getId ( ) ) ) ; } return initialFailedVms ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.bll.AutoStartVmToRestart > getInitialVmsToStart ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > failedAutoStartVms = vmDao.getAllFailedAutoStartVms ( ) ; java.util.ArrayList < org.ovirt.engine.core.bll.AutoStartVmToRestart > initialFailedVms = new java.util.ArrayList ( failedAutoStartVms.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : failedAutoStartVms ) { log.info ( "Found HA VM which is down because of an error, trying to restart it, VM '{}' ({})" , vm.getName ( ) , vm.getId ( ) ) ; initialFailedVms.add ( new org.ovirt.engine.core.bll.AutoStartVmToRestart ( vm.getId ( ) ) ) ; } return initialFailedVms ; }
Source:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setSourceVolid ( cinderDisk.getId ( ) . toString ( ) ) ; return proxy.createVolume ( cinderVolume ) ; }

Target:
public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setSourceVolid ( cinderDisk.getImageId ( ) . toString ( ) ) ; return proxy.createVolume ( cinderVolume ) ; }
Source:
public java.lang.Object runInTransaction ( ) { map = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( getStorageDomain ( ) . getId ( ) , getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ; getStoragePoolIsoMapDAO ( ) . save ( map ) ; getCompensationContext ( ) . snapshotNewEntity ( map ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getStorageDomain ( ) . getId ( ) , getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ; getStoragePoolIsoMapDAO ( ) . save ( map ) ; getCompensationContext ( ) . snapshotNewEntity ( map ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public static java.lang.String getTokenContent ( java.lang.String token ) { java.lang.String [ ] s = token.split ( "\\|" , 2 ) ; if ( ( s.length ) != 2 ) { throw new java.lang.IllegalArgumentException ( "Invalid session token format" ) ; } if ( ! ( "0" . equals ( s [ 0 ] ) ) ) { throw new java.lang.IllegalArgumentException ( "Invalid session token version" ) ; } if ( s [ 1 ] . isEmpty ( ) ) { throw new java.lang.IllegalArgumentException ( "Invalid session token format" ) ; } return s [ 1 ] ; }

Target:
public static java.lang.String getEngineSsoUrl ( javax.servlet.http.HttpServletRequest request ) { if ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getBoolean ( "ENGINE_SSO_INSTALLED_ON_ENGINE_HOST" ) ) { return java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_SERVICE_URI" ) ) ; } return org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_AUTH_URL" ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster model = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster model = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }
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 getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDAO ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permissions = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permissions = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }
Source:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ; backend.runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; org.mockito.Mockito.when ( mock.getFromCache ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
private void initAutoStartVmsToRestart ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > failedAutoStartVms = getVmDao ( ) . getAllFailedAutoStartVms ( ) ; java.util.ArrayList < org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart > initialFailedVms = new java.util.ArrayList ( failedAutoStartVms.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : failedAutoStartVms ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.log.info ( "Found HA VM which is down because of an error, trying to restart it, VM '{}' ({})" , vm.getName ( ) , vm.getId ( ) ) ; initialFailedVms.add ( new org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ( vm.getId ( ) ) ) ; } autoStartVmsToRestart = new java.util.concurrent.CopyOnWriteArraySet < > ( initialFailedVms ) ; }

Target:
private void init ( ) { autoStartVmsToRestart = new java.util.concurrent.CopyOnWriteArraySet < > ( getInitialVmsToStart ( ) ) ; int autoStartVmsRunnerIntervalInSeconds = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AutoStartVmsRunnerIntervalInSeconds ) ; schedulerUtil.scheduleAFixedDelayJob ( this , "startFailedAutoStartVms" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , autoStartVmsRunnerIntervalInSeconds , autoStartVmsRunnerIntervalInSeconds , java.util.concurrent.TimeUnit.SECONDS ) ; }
Source:
public void testValidModifiedBondsFailsWhenBondIsNullOrUnnamed ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; doTestValidModifiedBonds ( bond , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST , false , false ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void PostOnNew ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; } }

Target:
public void PostOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.All ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { Cancel ( ) ; } }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private boolean noChangesDetected ( ) { return ( ( ( ( getNetworksToConfigure ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBondNames ( ) . isEmpty ( ) ) ) && ( getRemovedUnmanagedNetworks ( ) . isEmpty ( ) ) ; }
Source:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Collections.singletonList ( networkAttachment ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap , networkExclusivenessValidator ) . validateNetworkExclusiveOnNics ( ) ; }

Target:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Collections.singletonList ( networkAttachment ) ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap , networkExclusivenessValidator ) . validateNetworkExclusiveOnNics ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { try { model.getAutoConnectableConsoles ( ) . get ( 0 ) . connect ( ) ; alreadyOpened = true ; } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { errorPopupManager.show ( e.getLocalizedErrorMessage ( ) ) ; } } unregisterModels ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { connect ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getIsPasswordDelegationPossible ( asyncQuery ) ; } }
Source:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }

Target:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }
Source:
private void updateBadge ( ) { badge.setVisible ( ( ( count ) != 1 ) ) ; badgeText.setText ( java.lang.String.valueOf ( count ) ) ; if ( badge.isVisible ( ) ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder builder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( com.google.gwt.safehtml.shared.SafeHtml message : messagesList ) { builder.append ( message ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.updateTooltipContent ( builder.toSafeHtml ( ) , getElement ( ) ) ; } }

Target:
private void updateBadge ( ) { badge.setVisible ( ( ( count ) != 1 ) ) ; badgeText.setText ( java.lang.String.valueOf ( count ) ) ; if ( badge.isVisible ( ) ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder builder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( com.google.gwt.safehtml.shared.SafeHtml message : messagesList ) { builder.append ( message ) ; } alertTooltip.setHtml ( builder.toSafeHtml ( ) ) ; } }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostPopupView ) ( getView ( ) ) ) . rbProvisionedHost.asRadioButton ( ) . getValue ( ) ) { model.getIsDiscoveredHosts ( ) . setEntity ( false ) ; } }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections getStorageServerConnection ( java.lang.String id ) { return getEntity ( org.ovirt.engine.core.common.businessentities.StorageServerConnections.class , VdcQueryType.GetStorageServerConnectionById , new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) , ( "Storage server connection: id=" + id ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections getStorageServerConnection ( java.lang.String id ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetStorageServerConnectionById , new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ) ; if ( ( result.getSucceeded ( ) ) && ( ( result.getReturnValue ( ) ) != null ) ) { return ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( result.getReturnValue ( ) ) ) ; } throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( null , ( ( "Can't find storage server connection for id '" + id ) + "'." ) , javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ) ; }
Source:
public void updateSpecificActionJobCompleted ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.action.VdcActionType actionType , boolean status ) { try { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = jobRepository.getJobsByEntityAndAction ( entityId , actionType ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { if ( ( job.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { job.markJobEnded ( status ) ; } jobRepository.updateCompletedJobAndSteps ( job ) ; } } catch ( java.lang.RuntimeException e ) { log.error ( "Exception" , e ) ; } }

Target:
public void updateSpecificActionJobCompleted ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.action.ActionType actionType , boolean status ) { try { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = jobRepository.getJobsByEntityAndAction ( entityId , actionType ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { if ( ( job.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { job.markJobEnded ( status ) ; } jobRepository.updateCompletedJobAndSteps ( job ) ; } } catch ( java.lang.RuntimeException e ) { log.error ( "Exception" , e ) ; } }
Source:
public void testIsmonitoringNeededTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; vds.setVmCount ( 1 ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; }

Target:
public void testIsmonitoringNeededTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; vds.setVmCount ( 1 ) ; org.junit.jupiter.api.Assertions.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.jupiter.api.Assertions.assertTrue ( strategy.isMonitoringNeeded ( vds ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces != null ) ? vmNetworkInterfaces : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } return _vmInterfaces ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces != null ) ? vmNetworkInterfaces : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } return _vmInterfaces ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.NetworkLabel model = new org.ovirt.engine.api.model.NetworkLabel ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkLabel" , "add" , "id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.NetworkLabel model = new org.ovirt.engine.api.model.NetworkLabel ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkLabel" , "add" , "id" ) ; } }
Source:
private void setVmWatchdogToParams ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.action.VmManagementParametersBase updateVmParams ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType wdModel = model.getWatchdogModel ( ) . getSelectedItem ( ) ; updateVmParams.setUpdateWatchdog ( true ) ; if ( wdModel != null ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; vmWatchdog.setAction ( model.getWatchdogAction ( ) . getSelectedItem ( ) ) ; vmWatchdog.setModel ( wdModel ) ; updateVmParams.setWatchdog ( vmWatchdog ) ; } }

Target:
private void setObjectName ( java.lang.Object object , java.lang.String input , boolean isSuffix ) { java.lang.String nameForTheClonedVm = ( isSuffix ) ? ( getObjectName ( object ) ) + input : input ; setObjectName ( object , nameForTheClonedVm ) ; assignedVmNames.add ( nameForTheClonedVm ) ; }
Source:
private boolean shouldUpdateImageProperties ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean shouldUpdateImageProperties ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Collections.singletonList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Collections.singletonList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.DbUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; return obj ; }

Target:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; return obj ; }
Source:
private void SetDefaultNames7 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetStorageDomainList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.storageList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; SetDefaultNames8 ( ) ; } } , frontendHash ) ) ; }

Target:
private void setDefaultNames7 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.storageList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; setDefaultNames8 ( ) ; } } , frontendHash ) ) ; }
Source:
private static java.lang.String generateParentClassIdentifiers ( int num ) { java.lang.String res = "self" ; for ( int i = 0 ; i < num ; i ++ ) { res += ".parentclass" ; } res += ".get_id()" ; return res ; }

Target:
private static java.lang.String generateParentClassIdentifiers ( int num ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "self" ) ; for ( int i = 0 ; i < num ; i ++ ) { buffer.append ( ".parentclass" ) ; } buffer.append ( ".get_id()" ) ; return buffer.toString ( ) ; }
Source:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getAdjustedDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; adjustDisksImageConfiguration ( diskImagesFromConfiguration ) ; } return diskImagesFromConfiguration ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getAdjustedDiskImagesFromConfiguration ( ) { if ( ( diskImagesFromConfiguration ) == null ) { diskImagesFromConfiguration = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmFromConfiguration.getDiskMap ( ) . values ( ) , false , true , true ) ; diskImagesFromConfiguration.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( vmFromConfiguration.getDiskMap ( ) . values ( ) , true ) ) ; adjustDisksImageConfiguration ( diskImagesFromConfiguration ) ; } return diskImagesFromConfiguration ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "StorageDomainId" , "RepoImageId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.IMAGE_ID.toString ( ) } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.Image image = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.verifyModelSpecific ( image , 1 ) ; verifyLinks ( image ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "StorageDomainId" , "RepoImageId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.IMAGE_ID.toString ( ) } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.Image image = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.verifyModelSpecific ( image , 1 ) ; verifyLinks ( image ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setOs ( org.ovirt.engine.core.common.businessentities.VmOsType.valueOf ( node.InnerText ) ) ; } else { _vmTemplate.setOs ( VmOsType.Unassigned ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }
Source:
public static void IsCustomPropertiesAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . existingNetworkAttachments = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ; queryVfsConfig ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }
Source:
protected void loadPayloadDevice ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = getVmPayloadByDeviceType ( VmDeviceType.CDROM ) ; if ( payload != null ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( payload ) ; } else { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( getVmPayloadByDeviceType ( VmDeviceType.FLOPPY ) ) ; } }

Target:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( ( disk.isManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ) ; break ; } } }
Source:
private void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; updateTemplateInSpm ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }

Target:
private void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }
Source:
public java.net.URI constructURI ( java.lang.String protocol , java.lang.String address ) throws java.net.URISyntaxException { java.lang.String [ ] parts = address.split ( "\\.:" ) ; if ( ( parts.length ) != 2 ) { throw new java.lang.IllegalArgumentException ( "the address in SRV record should contain host and port" ) ; } java.lang.StringBuilder uriSB = new java.lang.StringBuilder ( protocol ) ; uriSB.append ( "://" ) . append ( parts [ 0 ] ) . append ( ":" ) . append ( parts [ 1 ] ) ; return new java.net.URI ( uriSB.toString ( ) ) ; }

Target:
public java.net.URI constructURI ( java.lang.String protocol , java.lang.String address ) throws java.net.URISyntaxException { java.lang.String [ ] parts = address.split ( "\\:" ) ; if ( ( parts.length ) != 2 ) { throw new java.lang.IllegalArgumentException ( "the address in SRV record should contain host and port" ) ; } java.lang.StringBuilder uriSB = new java.lang.StringBuilder ( protocol ) ; uriSB.append ( "://" ) . append ( parts [ 0 ] ) . append ( ":" ) . append ( parts [ 1 ] ) ; return new java.net.URI ( uriSB.toString ( ) ) ; }