auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , vmId , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , "" , new java.util.Date ( ) , "" ) ; setUpDAOMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , vmId , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , "" , new java.util.Date ( ) , "" ) ; setUpDAOMocks ( ) ; }
Source:
public void getVdsGroupNotNull ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; b.setVdsGroup ( g ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup gr = b.getVdsGroup ( ) ; org.junit.Assert.assertEquals ( g , gr ) ; }

Target:
public void getClusterNotNull ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; b.setCluster ( g ) ; final org.ovirt.engine.core.common.businessentities.Cluster gr = b.getCluster ( ) ; org.junit.Assert.assertEquals ( g , gr ) ; }
Source:
public static void getUpHostListByCluster ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getDiskList ( 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > externalVms = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm ( vm ) ) ; } this . externalVms.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; }
Source:
protected boolean checkNumberOfMonitors ( ) { return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getnum_of_monitors ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkNumberOfMonitors ( ) { return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.ABORTED , false , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.ABORTED ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( false ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.ABORTED , false , null ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.ABORTED ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( false ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; entity.setQosName ( rs.getString ( "qos_name" ) ) ; return entity ; }
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
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 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 ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.network.Network otherNetwork : getNetworks ( ) ) { if ( ( otherNetwork.getName ( ) . equals ( network.getName ( ) ) ) && ( ! ( otherNetwork.getId ( ) . equals ( network.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.network.Network otherNetwork : getNetworks ( ) ) { if ( ( otherNetwork.getName ( ) . equals ( network.getName ( ) ) ) && ( ! ( otherNetwork.getId ( ) . equals ( network.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.scheduling.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { java.lang.Integer cores = org.ovirt.engine.core.bll.scheduling.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; commentEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; incraseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; }

Target:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; commentEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; incraseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; templateWithVersionEditor.setEnabled ( true ) ; }
Source:
public static void IsStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }

Target:
public static void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . detachVmFromTag ( tagVm.getTagId ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; initNetworkInterfaces ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateOSValues ( ) ; instanceTypeManager.updateAll ( ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( 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 ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ! ( getIsConnected ( ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) && ( IsVmConnectReady ( ) ) ) ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskVmElement.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.CinderProviderSupported , storagePool.getCompatibilityVersion ( ) . toString ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel providerModel = ( ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel ) ( model ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; dataCenters.add ( noneStoragePool ) ; providerModel.getDataCenter ( ) . setItems ( dataCenters ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StringHelper.EqOp ( fieldName , "TYPE" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StringHelper.EqOp ( fieldName , "STATUS" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.StorageDomainSharedStatus.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else { } return retval ; }
Source:
private boolean shouldPerformMetadataUpdate ( ) { return ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) && ( ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskAlias ( ) , getNewDisk ( ) . getDiskAlias ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getOldDisk ( ) . getDiskDescription ( ) , getNewDisk ( ) . getDiskDescription ( ) ) ) ) ) ; }

Target:
private boolean shouldPerformMetadataUpdate ( ) { return ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) && ( ( ! ( java.util.Objects.equals ( getOldDisk ( ) . getDiskAlias ( ) , getNewDisk ( ) . getDiskAlias ( ) ) ) ) || ( ! ( java.util.Objects.equals ( getOldDisk ( ) . getDiskDescription ( ) , getNewDisk ( ) . getDiskDescription ( ) ) ) ) ) ; }
Source:
public void rollback ( ) { super . rollback ( ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.getInstance ( ) . removePool ( getMacPool ( ) . getId ( ) ) ; }

Target:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( isConsoleEnabled ( model ) ) { sb.appendHtmlConstant ( ( ( ( ( ( ( "<div id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" title=\"" ) + ( title ) ) + "\" class=\"" ) + ( enabledCss ) ) + "\"/>" ) ) ; } else { sb.appendHtmlConstant ( ( ( "<div class=\"" + ( disabledCss ) ) + "\" />" ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( org.ovirt.engine.ui.userportal.widget.extended.vm.ConsoleButtonCell.template.consoleButton ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , title , ( isConsoleEnabled ( model ) ? enabledCss : disabledCss ) ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; }
Source:
public int getWidgetIndex ( com.google.gwt.user.client.ui.Widget child ) { throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel value , org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget widget , boolean becomingGhost ) { widget.setEnabled ( ( ( ! becomingGhost ) && ( enabled ) ) ) ; widget.keyField.setEnabled ( enabled ) ; setButtonEnabled ( widget , ( ( ! becomingGhost ) && ( enabled ) ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { clusterModel.getEnableGlusterService ( ) . setIsChangable ( true ) ; } }

Target:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( result ) ) ; if ( ( vmList.size ( ) ) > 0 ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; } } }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
private void reloadConfigurations ( ) throws java.io.IOException { java.lang.String user = parser.getUser ( ) ; java.lang.String adminPassFile = parser.getAdminPassFile ( ) ; java.lang.String pass = null ; if ( user == null ) { user = startUserDialog ( ) ; pass = startPasswordDialog ( user ) ; } else if ( adminPassFile == null ) { pass = startPasswordDialog ( user ) ; } else { pass = getPassFromFile ( adminPassFile ) ; } loginAndReload ( user , pass ) ; }

Target:
private void reloadConfigurations ( ) throws java.io.IOException { java.lang.String user = parser.getUser ( ) ; java.lang.String adminPassFile = parser.getAdminPassFile ( ) ; java.lang.String pass = null ; if ( user == null ) { user = startUserDialog ( ) ; pass = org.ovirt.engine.core.config.EngineConfigLogic.startPasswordDialog ( user ) ; } else if ( adminPassFile == null ) { pass = org.ovirt.engine.core.config.EngineConfigLogic.startPasswordDialog ( user ) ; } else { pass = org.ovirt.engine.core.config.EngineConfigLogic.getPassFromFile ( adminPassFile ) ; } loginAndReload ( user , pass ) ; }
Source:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync foundService ) { foundService.logOff ( new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onFailure ( caught ) ; } } ) ; }

Target:
public void logout ( final org.ovirt.engine.ui.frontend.communication.UserCallback callback ) { xsrfRequestBuilder.setXsrfToken ( null ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; retVal.setSucceeded ( true ) ; callback.onSuccess ( retVal ) ; }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( isSpiceSupportedByClient ( ) ) && ( ! ( getIsConnected ( ) ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ) ) && ( IsVmConnectReady ( ) ) ) ) ; }

Target:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ! ( getIsConnected ( ) ) ) && ( ( getEntity ( ) ) != null ) ) && ( ( getEntity ( ) . getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) && ( IsVmConnectReady ( ) ) ) ) ; }
Source:
public void testExecuteQuery ( ) throws java.lang.Exception { mockDAOForQuery ( ) ; vm = mockVmAndReturnFromDAO ( ) ; java.lang.String diskAliasName = ( VM_NAME ) + "_Disk1" ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskAliasName , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) . toString ( ) ) ; }

Target:
public void testExecuteQueryVmWithNoDisks ( ) throws java.lang.Exception { mockDAOForQuery ( ) ; vm = mockVmAndReturnFromDAO ( ) ; java.lang.String diskAliasName = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( vm.getName ( ) , "1" ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskAliasName , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) . toString ( ) ) ; }
Source:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { java.lang.Integer cores = org.ovirt.engine.core.bll.scheduling.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { java.lang.Integer cores = org.ovirt.engine.core.bll.scheduling.SlaValidator.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( command.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }

Target:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }
Source:
protected void endSuccessfully ( ) { if ( ! ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.endVmCommand ( ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.setSucceeded ( true ) ; }
Source:
public void testReadAllTextTonSOfTimes ( ) throws java.lang.Exception { java.io.File iFile = java.io.File.createTempFile ( "Test" , ".txt" ) ; java.io.FileWriter iFileWriter = new java.io.FileWriter ( iFile ) ; iFileWriter.write ( "This is a test" ) ; iFileWriter.close ( ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { java.lang.String data = org.ovirt.engine.core.utils.FileUtil.readAllText ( iFile.getAbsolutePath ( ) ) ; assertEquals ( "Data should be equal" , "This is a test" , data ) ; } }

Target:
public void testReadAllTextTonSOfTimes ( ) throws java.lang.Exception { java.io.File iFile = java.io.File.createTempFile ( "Test" , ".txt" ) ; java.io.FileWriter iFileWriter = new java.io.FileWriter ( iFile ) ; iFileWriter.write ( "This is a test" ) ; iFileWriter.close ( ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { java.lang.String data = org.ovirt.engine.core.utils.FileUtil.readAllText ( iFile.getAbsolutePath ( ) ) ; org.junit.Assert.assertEquals ( "Data should be equal" , "This is a test" , data ) ; } }
Source:
public void testUpdateStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.Assert.assertNotNull ( "storage device doesn't exists" , storageDevice ) ; storageDevice.setSize ( 1234567L ) ; storageDevice.setMountPoint ( "/gluster-bricks/brick1" ) ; storageDevice.setFsType ( "xfs" ) ; dao.update ( storageDevice ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDeviceFromDB = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.Assert.assertEquals ( "Failed to update Storage Device" , storageDevice , storageDeviceFromDB ) ; }

Target:
public void testUpdateStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( storageDevice , "storage device doesn't exists" ) ; storageDevice.setSize ( 1234567L ) ; storageDevice.setMountPoint ( "/gluster-bricks/brick1" ) ; storageDevice.setFsType ( "xfs" ) ; dao.update ( storageDevice ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDeviceFromDB = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( storageDevice , storageDeviceFromDB , "Failed to update Storage Device" ) ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.Assert.assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setText ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; }

Target:
protected void doEdit ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel model ) { driver.edit ( model ) ; monitorCount.setText ( java.lang.Integer.toString ( getModel ( ) . getMonitorCount ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getModel ( ) . getOS ( ) ) ) ; defaultHost.setTitle ( getModel ( ) . getDefaultHost ( ) ) ; }
Source:
private void setVmTemplateIdParameter ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplateDAO ( ) . getAllForImage ( getDiskImage ( ) . getImageId ( ) ) ; if ( ! ( templateMap.isEmpty ( ) ) ) { setVmTemplateId ( templateMap.values ( ) . iterator ( ) . next ( ) . getId ( ) ) ; } }

Target:
private void setVmTemplateIdParameter ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplateDao ( ) . getAllForImage ( getDiskImage ( ) . getImageId ( ) ) ; if ( ! ( templateMap.isEmpty ( ) ) ) { setVmTemplateId ( templateMap.values ( ) . iterator ( ) . next ( ) . getId ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; setItems ( disks ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( disks ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.NetworkDAOTest.EXISTING_NETWORK_NAME ) ; before.setdescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.NetworkDAOTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.NetworkDAOTest.EXISTING_NETWORK_NAME ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.NetworkDAOTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notIscsiBondNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = getDbFacade ( ) . getIscsiBondDao ( ) . getIscsiBondsByNetworkId ( network.getId ( ) ) ; if ( ! ( iscsiBonds.isEmpty ( ) ) ) { java.util.Collection < java.lang.String > replaceNameables = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "IscsiBonds" , iscsiBonds ) ; replaceNameables.add ( getNetworkNameReplacement ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_REMOVE_ISCSI_BOND_NETWORK , replaceNameables ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notIscsiBondNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = getDbFacade ( ) . getIscsiBondDao ( ) . getIscsiBondsByNetworkId ( network.getId ( ) ) ; if ( ! ( iscsiBonds.isEmpty ( ) ) ) { java.util.Collection < java.lang.String > replaceNameables = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "IscsiBonds" , iscsiBonds ) ; replaceNameables.add ( getNetworkNameReplacement ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_ISCSI_BOND_NETWORK , replaceNameables ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }