auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > parent = constructor.create ( ) ; parent.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( parentId ) ) ; org.ovirt.engine.api.restapi.resource.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( entity ) . removeEntity ( parent ) . build ( ) ; return performAction ( VdcActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > parent = constructor.create ( ) ; parent.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( parentId ) ) ; org.ovirt.engine.api.restapi.resource.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( entity ) . removeEntity ( parent ) . build ( ) ; return performAction ( ActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }
Source:
public void testFetchSpecificQuotaUsageForSpecificVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( FixturesTool.VDS_GROUP_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( quotaVdsGroup.getVirtualCpu ( ) , java.lang.Integer.valueOf ( 10 ) ) ; }

Target:
public void testFetchSpecificQuotaUsageForSpecificCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( true , ( ( quotaClusterList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( quotaCluster.getVirtualCpu ( ) , java.lang.Integer.valueOf ( 10 ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.setUpStorageServerConnection ( ) ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainsResourceTest.verifyStorageDomain ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; verifyStorageDomain ( resource.get ( ) ) ; }
Source:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; if ( ( getMemSize ( ) . getEntity ( ) ) != null ) { maxMemorySize.setEntity ( ( ( getMemSize ( ) . getEntity ( ) ) * ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.DEFAULT_MAX_MEMORY_RATIO ) ) ) ; } }

Target:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; if ( ( getMemSize ( ) . getEntity ( ) ) != null ) { setNumaChanged ( true ) ; maxMemorySize.setEntity ( ( ( getMemSize ( ) . getEntity ( ) ) * ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.DEFAULT_MAX_MEMORY_RATIO ) ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionPause ( masterVolumeName , slaveHost , slaveVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.api.model.Cdrom get ( ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters parameters = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) ; org.ovirt.engine.core.common.businessentities.VmTemplate entity = getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , parameters , templateId.toString ( ) , true ) ; return addLinks ( populate ( map ( entity ) , entity ) ) ; }

Target:
public org.ovirt.engine.api.model.Cdrom get ( ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters parameters = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) ; org.ovirt.engine.core.common.businessentities.VmTemplate entity = getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , QueryType.GetVmTemplate , parameters , templateId.toString ( ) , true ) ; return addLinks ( populate ( map ( entity ) , entity ) ) ; }
Source:
public void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getCluster ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getCluster ( ) . getId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setnetwork_id ( network.getId ( ) ) ; network.getCluster ( ) . setcluster_id ( cluster.getVDSGroup ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getVDSGroup ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; updateWipeAfterDelete ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; }
Source:
public void updatePosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . InitializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void updatePosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . InitializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) . addValue ( "migration" , cluster.isMigration ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster" , parameterSource ) ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createAllFieldsParameterSource ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) . addValue ( "migration" , cluster.isMigration ( ) ) . addValue ( "management" , cluster.isManagement ( ) ) ; return parameterSource ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterIdAndServerId ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; params.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void testCanDoActionVmUpLiveMergeNotSupported ( ) { prepareForVmValidatorTests ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isDiskPlugged ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( cmd ) . isLiveMergeSupported ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void testValidateVmUpLiveMergeNotSupported ( ) { prepareForVmValidatorTests ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isDiskPlugged ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( cmd ) . isLiveMergeSupported ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
private void UpdateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . isDisplay ( ) ) ) ) && ( ( network.getCluster ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . isDisplay ( ) ) ) ) && ( ( network.getCluster ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Job add ( org.ovirt.engine.sdk.decorators.Job job ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , job , org.ovirt.engine.sdk.entities.Job.class , org.ovirt.engine.sdk.decorators.Job.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Job add ( org.ovirt.engine.sdk.decorators.Job job ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , job , org.ovirt.engine.sdk.entities.Job.class , org.ovirt.engine.sdk.decorators.Job.class , headers ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangable ( ( ! entity ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangable ( ( ! entity ) ) ; }
Source:
protected void EndWithFailure ( ) { org.ovirt.engine.core.compat.Guid previouslyActiveSnapshotId = getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.PREVIEW , SnapshotStatus.LOCKED ) ; getSnapshotDao ( ) . remove ( previouslyActiveSnapshotId ) ; getSnapshotDao ( ) . remove ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ) ; snapshotsManager.addActiveSnapshot ( previouslyActiveSnapshotId , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; super . EndWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.compat.Guid previouslyActiveSnapshotId = getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.PREVIEW , SnapshotStatus.LOCKED ) ; getSnapshotDao ( ) . remove ( previouslyActiveSnapshotId ) ; getSnapshotDao ( ) . remove ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ) ; snapshotsManager.addActiveSnapshot ( previouslyActiveSnapshotId , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; super . endWithFailure ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.KatelloErratum model , int index ) { org.junit.Assert.assertEquals ( NAMES [ index ] , org.ovirt.engine.api.restapi.utils.HexUtils.hex2string ( model.getId ( ) ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.KatelloErratum model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , org.ovirt.engine.api.restapi.utils.HexUtils.hex2string ( model.getId ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; verifyLinks ( model ) ; }
Source:
boolean contentOverflows ( com.google.gwt.dom.client.Element elm ) { java.lang.String overflowValue = elm.getStyle ( ) . getOverflow ( ) ; elm.getStyle ( ) . setProperty ( "overflow" , "auto" ) ; boolean overflowX = ( elm.getScrollWidth ( ) ) > ( elm.getClientWidth ( ) ) ; boolean overflowY = ( elm.getScrollHeight ( ) ) > ( elm.getClientHeight ( ) ) ; elm.getStyle ( ) . setProperty ( "overflow" , overflowValue ) ; return overflowX || overflowY ; }

Target:
com.google.gwt.safehtml.shared.SafeHtml getEscapedValue ( java.lang.String value ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value ) ; }
Source:
protected void updateSnapshotVmConfiguration ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getImageIds ( ) . get ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getExecutionIndex ( ) ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshotWithoutImage = prepareSnapshotConfigWithoutImageSingleImage ( getSnapshotId ( ) , imageId ) ; org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getSnapshotDao ( ) . update ( snapshotWithoutImage ) ; }

Target:
protected void updateSnapshotVmConfiguration ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getImageIds ( ) . get ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getParameters ( ) . getExecutionIndex ( ) ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getSnapshotDao ( ) . get ( getSnapshotId ( ) ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshotWithoutImage = org.ovirt.engine.core.bll.ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage ( snapshot , imageId ) ; org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getSnapshotDao ( ) . update ( snapshotWithoutImage ) ; }
Source:
public void testRemoveAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertFalse ( featuresSupported.isEmpty ( ) ) ; dao.removeAllSupportedHostFeature ( FixturesTool.HOST_ID , featuresSupported ) ; java.util.Set < java.lang.String > featuresSupportedAfterDeletion = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertTrue ( "Failed to remove addtional supported features" , featuresSupportedAfterDeletion.isEmpty ( ) ) ; }

Target:
public void testRemoveAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.jupiter.api.Assertions.assertFalse ( featuresSupported.isEmpty ( ) ) ; dao.removeAllSupportedHostFeature ( FixturesTool.HOST_ID , featuresSupported ) ; java.util.Set < java.lang.String > featuresSupportedAfterDeletion = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( featuresSupportedAfterDeletion.isEmpty ( ) , "Failed to remove addtional supported features" ) ; }
Source:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endWithFailure ( ) ; log.error ( "Failed to upload (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }

Target:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageTransfer id {}" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.endWithFailure ( ) ; log.error ( "Failed to transfer. (command id '{}')" , getTransferDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void addCustomValueDoesNotHandleNullKeys ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }

Target:
public void customValue ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsmanager = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.vdsbroker.ResourceManager.class ) . getVdsManager ( vdsId ) ; if ( vdsmanager == null ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.RESOURCE_MANAGER_VDS_NOT_FOUND , java.lang.String.format ( "Vds with id: %1$s was not found" , vdsId ) ) ; } setVdsAndVdsStatic ( vdsmanager.getCopyVds ( ) ) ; return vdsmanager.getVdsProxy ( ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsmanager = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVdsManager ( vdsId ) ; if ( vdsmanager == null ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.RESOURCE_MANAGER_VDS_NOT_FOUND , java.lang.String.format ( "Vds with id: %1$s was not found" , vdsId ) ) ; } setVdsAndVdsStatic ( vdsmanager.getCopyVds ( ) ) ; return vdsmanager.getVdsProxy ( ) ; }
Source:
public static java.nio.ByteBuffer cloneBuffer ( java.nio.ByteBuffer original ) { java.nio.ByteBuffer clone = java.nio.ByteBuffer.allocate ( original.capacity ( ) ) ; clone.put ( original ) ; clone.flip ( ) ; return clone ; }

Target:
public static java.nio.ByteBuffer cloneBuffer ( java.nio.ByteBuffer original ) { int pos = original.position ( ) ; original.clear ( ) ; java.nio.ByteBuffer clone = java.nio.ByteBuffer.allocate ( original.capacity ( ) ) ; clone.put ( original ) ; clone.flip ( ) ; clone.position ( pos ) ; return clone ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public int getAvailableMacsCount ( ) { int availableMacsSize = macsStorage.getAvailableMacsCount ( ) ; org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges.log.debug ( "Number of available Mac addresses = {}" , availableMacsSize ) ; return availableMacsSize ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacsStorage createMacsStorage ( java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpool.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges.log.debug ( "Adding range to pool {}." , range , this ) ; macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.MAC_POOL_INITIALIZATION_FAILED ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; cancelConfirm ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; if ( ( ( result.getReturnValue ( ) ) != null ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancelConfirm ( ) ; } }
Source:
protected java.util.Set < org.ovirt.engine.core.compat.Guid > getExcludeUsers ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > excludeUsers = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( java.lang.Object item : getExcludeItems ( ) ) { org.ovirt.engine.core.common.businessentities.DbUser a = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( item ) ) ; excludeUsers.add ( a.getId ( ) ) ; } } return excludeUsers ; }

Target:
protected java.util.Set < org.ovirt.engine.core.common.utils.ExternalId > getExcludeUsers ( ) { java.util.Set < org.ovirt.engine.core.common.utils.ExternalId > excludeUsers = new java.util.HashSet < org.ovirt.engine.core.common.utils.ExternalId > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( java.lang.Object item : getExcludeItems ( ) ) { org.ovirt.engine.core.common.businessentities.DbUser a = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( item ) ) ; excludeUsers.add ( a.getExternalId ( ) ) ; } } return excludeUsers ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( isLinux && isQxl ) && clusterSupportsSinglePci ; }

Target:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( extractSelectedDisplayTypeEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }
Source:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
public void isAnyHostUpInCluster ( 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 ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void isAnyHostUpInCluster ( 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 ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = adjustReturnValue ( returnValue ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = adjustReturnValue ( returnValue ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }
Source:
public static java.lang.Object [ ] [ ] namesParams ( ) { return new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , false } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , true } } ; }

Target:
public void testCopyOf ( boolean boot ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dve.setBoot ( boot ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement copy = org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.copyOf ( dve ) ; org.junit.jupiter.api.Assertions.assertEquals ( copy , dve ) ; org.junit.jupiter.api.Assertions.assertNotSame ( copy , dve ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { dataCenterGuideModel.localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainById ( 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( this . getStoragePool ( ) . isLocal ( ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }

Target:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( this . getStoragePool ( ) . isLocal ( ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( EngineMessage.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }