auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalAction ( VdcActionType.AddVmFromScratch , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getExecutionContext ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void getDataCenterListByName ( 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 ) { 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: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; }
Source:
private void updateSnapshotDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > filterNonSnapableDisks ( disks ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }

Target:
private void updateSnapshotDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > filterNonSnapableDisks ( disks ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolRepresentants = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > poolRepresentantsRetval = result.getReturnValues ( ) ; for ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue poolRepresentant : poolRepresentantsRetval ) { poolRepresentants.add ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( poolRepresentant.getReturnValue ( ) ) ) ) ; } consoleModelsCache.updatePoolCache ( poolRepresentants ) ; finishSearch ( all ) ; }

Target:
public void onSuccess ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > idToIconMap ) { finishSearch ( all ) ; }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList ( potentialNetworks ) , allNics ) ; }

Target:
private void commitNetworkChanges ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networks ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bondModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( bondModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( networks ) , hostSetupNetworksParametersData ) ; }
Source:
private static java.lang.Integer getIntegerOrNull ( java.sql.ResultSet rs , java.lang.String columnName ) throws java.sql.SQLException { int i = rs.getInt ( columnName ) ; return rs.wasNull ( ) ? null : i ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQos ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource map = super . createFullParametersMapper ( networkQos ) ; map.addValue ( "inbound_average" , networkQos.getInboundAverage ( ) ) ; map.addValue ( "inbound_peak" , networkQos.getInboundPeak ( ) ) ; map.addValue ( "inbound_burst" , networkQos.getInboundBurst ( ) ) ; map.addValue ( "outbound_average" , networkQos.getOutboundAverage ( ) ) ; map.addValue ( "outbound_peak" , networkQos.getOutboundPeak ( ) ) ; map.addValue ( "outbound_burst" , networkQos.getOutboundBurst ( ) ) ; return map ; }
Source:
public void shouldDetectNeverStartedVM ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.assertj.core.api.Assertions.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) ) . containsExactly ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ; }

Target:
public void shouldWeightNewestHostsBetterOnVmStarts ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.assertj.core.api.Assertions.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) ) . contains ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BAD_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ; }
Source:
public void freeMac ( java.lang.String mac ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public boolean addMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } }
Source:
public void diskImagesNotLockedBothLocked ( ) { disk1.setImageStatus ( ImageStatus.LOCKED ) ; disk2.setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertThat ( validator.diskImagesNotLocked ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesNotLockedBothLocked ( ) { disk1.setImageStatus ( ImageStatus.LOCKED ) ; disk2.setImageStatus ( ImageStatus.LOCKED ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesNotLocked ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
protected void setUpCommand ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . initTemplate ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVm ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }

Target:
public void setupMocks ( ) { setUpCommand ( ) ; mockGetStorageDomainList ( ) ; mockDbDao ( ) ; org.mockito.Mockito.when ( vmHandler.verifyMacPool ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( vmHandler.isVmPriorityValueLegal ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; command.init ( ) ; }
Source:
public void testValidUpdateOfEditableFieldOnTemplateVm ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmTemplateHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs" , updateIsValid ) ; }

Target:
public void testValidUpdateOfEditableFieldOnTemplateVm ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmTemplateHandler.isUpdateValid ( src , dest ) ; org.junit.jupiter.api.Assertions.assertTrue ( updateIsValid , "Update should be valid for different cluster IDs" ) ; }
Source:
public void shouldDetectInsufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 500 ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_MEMORY_ERROR ) ; }

Target:
public void shouldDetectTooMuchVmNumaNodes ( ) { vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }
Source:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.reportingVdsStatus ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }

Target:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.reportingVdsStatus ) ) && ( vds.getVdsGroupSupportsVirtService ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }
Source:
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 ) ; }

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.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.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:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }

Target:
private boolean containsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }
Source:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; }

Target:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( ( network != null ) && ( network.isSetProfileRequired ( ) ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return parameters ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageFormatType map ( org.ovirt.engine.api.model.StorageFormat model , org.ovirt.engine.core.common.businessentities.StorageFormatType template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V1 ; case V2 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V2 ; case V3 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V3 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageFormatType map ( org.ovirt.engine.api.model.StorageFormat model , org.ovirt.engine.core.common.businessentities.StorageFormatType template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V1 ; case V2 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V2 ; case V3 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V3 ; case V4 : return org.ovirt.engine.core.common.businessentities.StorageFormatType.V4 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }
Source:
public void canDoActionCanNotFindTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public void testKeyStrings ( ) throws java.lang.Exception { for ( java.lang.String [ ] key : org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.KEYS ) { org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testKeyString ( key [ 0 ] , key [ 2 ] ) ; } }

Target:
public void testFingerprintStrings ( ) throws java.lang.Exception { for ( java.lang.String [ ] key : org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.KEYS ) { org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testFingerprintString ( key [ 0 ] , key [ 1 ] , "MD5" ) ; org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testFingerprintString ( key [ 0 ] , key [ 2 ] , "SHA-256" ) ; } }
Source:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getSupportedCpuList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ServerCpu > > aQuery , java.lang.String cpuName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSupportedCpuList , new org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters ( cpuName ) , aQuery ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , 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:
public static void initTestCase ( ) throws java.lang.Exception { if ( ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) == null ) { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.ejbRule.mockResource ( ContainerManagedResourceType.DATA_SOURCE , org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , org.ovirt.engine.core.dao.BaseDAOTestCase.dataset ) ; org.springframework.mock.jndi.SimpleNamingContextBuilder builder = new org.springframework.mock.jndi.SimpleNamingContextBuilder ( ) ; builder.bind ( "java:/ENGINEDataSource" , org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ; builder.activate ( ) ; } }

Target:
public static void initTestCase ( ) throws java.lang.Exception { if ( ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) == null ) { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.ejbRule.mockResource ( ContainerManagedResourceType.DATA_SOURCE , org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ; final org.dbunit.dataset.IDataSet dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , dataset ) ; org.springframework.mock.jndi.SimpleNamingContextBuilder builder = new org.springframework.mock.jndi.SimpleNamingContextBuilder ( ) ; builder.bind ( "java:/ENGINEDataSource" , org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ; builder.activate ( ) ; } }
Source:
private static void CloneNetworkStatisticss ( org.ovirt.engine.core.common.businessentities.network.NetworkStatistics instance , org.ovirt.engine.core.common.businessentities.network.NetworkStatistics obj ) { obj.setId ( instance.getId ( ) ) ; obj.setReceiveDropRate ( instance.getReceiveDropRate ( ) ) ; obj.setReceiveRate ( instance.getReceiveRate ( ) ) ; obj.setTransmitDropRate ( instance.getTransmitDropRate ( ) ) ; obj.setTransmitRate ( instance.getTransmitRate ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; }

Target:
private static void cloneNetworkStatisticss ( org.ovirt.engine.core.common.businessentities.network.NetworkStatistics instance , org.ovirt.engine.core.common.businessentities.network.NetworkStatistics obj ) { obj.setId ( instance.getId ( ) ) ; obj.setReceiveDropRate ( instance.getReceiveDropRate ( ) ) ; obj.setReceiveRate ( instance.getReceiveRate ( ) ) ; obj.setTransmitDropRate ( instance.getTransmitDropRate ( ) ) ; obj.setTransmitRate ( instance.getTransmitRate ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , VdcActionType.RunVm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , VdcActionType.RunVm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void logAgentFailure ( final org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result ) { if ( ! ( wasSkippedDueToPolicy ( result ) ) ) { log.error ( "Failed to VDS using fence agent (if other agents are running, may still succeed)." , getAction ( ) . name ( ) . toLowerCase ( ) , ( ( result.getFenceAgentUsed ( ) . getId ( ) ) == null ? "New Agent (no ID)" : result.getFenceAgentUsed ( ) . getId ( ) ) , getAction ( ) . name ( ) . toLowerCase ( ) ) ; } }

Target:
private void logAgentFailure ( final org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result ) { if ( ! ( wasSkippedDueToPolicy ( result ) ) ) { log.error ( "Failed to host using fence agent (if other agents are running, may still succeed)." , getAction ( ) . name ( ) . toLowerCase ( ) , ( ( result.getFenceAgentUsed ( ) . getId ( ) ) == null ? "New Agent (no ID)" : result.getFenceAgentUsed ( ) . getId ( ) ) , getAction ( ) . name ( ) . toLowerCase ( ) ) ; } }
Source:
private void initIpConfigurationBootProtocol ( boolean sameBootProtocol ) { initIpConfiguration ( ) ; org.mockito.Mockito.when ( mockedIPv4Address.getBootProtocol ( ) ) . thenReturn ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL ) ; org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol ifaceBootProtocol = ( sameBootProtocol ) ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL : org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ; iface.setBootProtocol ( ifaceBootProtocol ) ; }

Target:
private void initIpConfigurationBootProtocol ( boolean sameBootProtocol ) { initIpConfiguration ( ) ; org.mockito.Mockito.when ( mockedIPv4Address.getBootProtocol ( ) ) . thenReturn ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL ) ; org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol ifaceBootProtocol = ( sameBootProtocol ) ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL : org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ; iface.setIpv4BootProtocol ( ifaceBootProtocol ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallbackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommands ( boolean onlyWithCallbackEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( ( ! onlyWithCallbackEnabled ) || ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public void getDataCenterListByName ( 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 ) { 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: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getConfiguredVmHostDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmHostDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( getName ( ) ) . append ( " {id=" ) . append ( getId ( ) ) . append ( ", description=" ) . append ( getDescription ( ) ) . append ( ", profile type=" ) . append ( getProfileType ( ) . name ( ) ) . append ( ", qosId=" ) . append ( getQosId ( ) ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) ) . build ( ) ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard ) ; } else { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getDashboardFromCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory ; synchronized ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_LOCK ) { dashboard = dashboardCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY ) ; if ( dashboard == null ) { dashboard = populateUtilizationCache ( ) ; } inventory = inventoryCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY ) ; if ( inventory == null ) { inventory = populateInventoryCache ( ) ; } } dashboard.setInventory ( inventory ) ; return dashboard ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > interfaces = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String diskIfs : interfaces ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.valueOf ( diskIfs ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > convert ( java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > interfaces = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String diskIfs : interfaces ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.valueOf ( diskIfs ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } return interfaceTypes ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity createBrick ( org.ovirt.engine.core.compat.Guid existingVolDistId , org.ovirt.engine.core.common.businessentities.VDS server , java.lang.String brickDir ) { return new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( existingVolDistId , server.getStaticData ( ) , brickDir , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity createBrick ( org.ovirt.engine.core.compat.Guid existingVolDistId , org.ovirt.engine.core.common.businessentities.VDS server , java.lang.String brickDir ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( existingVolDistId ) ; brick.setServerId ( server.getId ( ) ) ; brick.setServerName ( server.getHostName ( ) ) ; brick.setBrickDirectory ( brickDir ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( "unexpected propagate errors" , model.isPropagateErrors ( ) , transform.isPropagateErrors ( ) ) ; assertEquals ( "unexpected wipe after delete" , model.isWipeAfterDelete ( ) , transform.isWipeAfterDelete ( ) ) ; assertEquals ( "unexpected shareable" , model.isShareable ( ) , transform.isShareable ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( "unexpected propagate errors" , model.isPropagateErrors ( ) , transform.isPropagateErrors ( ) ) ; org.junit.Assert.assertEquals ( "unexpected wipe after delete" , model.isWipeAfterDelete ( ) , transform.isWipeAfterDelete ( ) ) ; org.junit.Assert.assertEquals ( "unexpected shareable" , model.isShareable ( ) , transform.isShareable ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; return ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . isMacInUse ( getMacAddress ( ) ) ) && ( ! allowDupMacs ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; return ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getMacPool ( ) . isMacInUse ( getMacAddress ( ) ) ) && ( ! allowDupMacs ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_MAC_ADDRESS_IN_USE ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }