auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; vmDeviceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDeviceDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDaoMock ) ; }

Target:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; vmDeviceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDeviceDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDaoMock ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBonded ( true ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBonded ( true ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.IPV4_BOOT_PROTOCOL ) ; entity.setIpv6BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.IPV6_BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmGuideModel.disks = disks ; vmGuideModel.updateOptionsPostData ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { updateOptionsPostData ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { revealStorageView ( disk ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { if ( disk.getIsValid ( ) ) { attachPanelWidget.markAsValid ( ) ; } else { attachPanelWidget.markAsInvalid ( disk.getInvalidityReasons ( ) ) ; } } }
Source:
public void getAuditLogTypeValueTest ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setSucceeded ( true ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_ADDED_CPU_PROFILE , org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; returnValueBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_FAILED_TO_ADD_CPU_PROFILE , org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; }

Target:
public void getAuditLogTypeValueTest ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setSucceeded ( true ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_ADDED_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; returnValueBase.setSucceeded ( false ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_FAILED_TO_ADD_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; }
Source:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , 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 , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public java.lang.String getTemplate ( java.lang.String headerParamType , java.lang.String headerParamName ) { org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper templateWrapper = new org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper ( getTemplate ( ) , true ) ; templateWrapper.set ( "headerParamType" , headerParamType ) ; templateWrapper.set ( "headerParamName" , headerParamName ) ; return templateWrapper.toString ( ) ; }

Target:
public java.lang.String getTemplate ( java.lang.String type , java.lang.String name ) { org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate paramTemplate = new org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate ( ) ; java.lang.String param = paramTemplate.getTemplate ( type , name ) ; org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper templateWrapper = new org.ovirt.engine.sdk.codegen.utils.StringTemplateWrapper ( getTemplate ( ) , true ) ; templateWrapper.set ( "param" , param ) ; return templateWrapper.toString ( ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testNoAffinityGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( host1 , host2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.Integer > scores = collectScores ( policyUnit.score ( cluster , hosts , newVm , null ) ) ; org.junit.Assert.assertEquals ( scores.get ( host1.getId ( ) ) , scores.get ( host2.getId ( ) ) ) ; }

Target:
public void testNoAffinityGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( host1 , host2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.Integer > scores = collectScores ( policyUnit.score ( cluster , hosts , newVm , null ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( scores.get ( host1.getId ( ) ) , scores.get ( host2.getId ( ) ) ) ; }
Source:
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 ) ; }

Target:
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 ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > createStorageDomains ( org.ovirt.engine.core.compat.Guid sdIdToBeSelected ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd1 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.LOW_SPACE_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd2 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.LOW_SPACE_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd3 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( sdIdToBeSelected , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.ENOUGH_SPACE_IN_GB ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( sd1 , sd2 , sd3 ) ; return storageDomains ; }

Target:
private void initStorageDomainValidator ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator , org.ovirt.engine.core.bll.ValidationResult validationResult ) { org.mockito.Mockito.when ( storageDomainValidator.isDomainWithinThresholds ( ) ) . thenReturn ( validationResult ) ; org.mockito.Mockito.when ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) . thenReturn ( validationResult ) ; }
Source:
public boolean isStorageActive ( ) { return ( ( ( getStorage ( ) ) == null ) || ( ( getStorage ( ) . getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) ) || ( ( getStorage ( ) . getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Mixed ) ) ; }

Target:
public boolean isNewStorage ( ) { return ( getStorage ( ) ) == null ; }
Source:
public void testRemoveAllOfTypeForVds ( ) throws java.lang.Exception { dao.removeAllOfTypeForVds ( org.ovirt.engine.core.dao.AuditLogDAOTest.VDS_ID , AuditLogType.IRS_DISK_SPACE_LOW_ERROR.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; }

Target:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }
Source:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 1 ) ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object other ) { return ( ( other != null ) && ( ( getClass ( ) ) == ( other.getClass ( ) ) ) ) && ( uuid.equals ( ( ( org.ovirt.engine.api.extensions.ExtUUID ) ( other ) ) . uuid ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.api.extensions.ExtUUID ) ) { return false ; } org.ovirt.engine.api.extensions.ExtUUID other = ( ( org.ovirt.engine.api.extensions.ExtUUID ) ( obj ) ) ; return java.util.Objects.equals ( uuid , other.uuid ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForRemove ( ) ; mockBackend ( false , VdcBllErrors.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVE_FAILED ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( getVnicProfile ( ) . isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( getVnicProfile ( ) . isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFORM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private static int setNetworkBootOrder ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice pluggedInterface : org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.sortInterfacesByName ( vm , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getPluggedManagedInterfaces ( devices ) ) ) { pluggedInterface.setBootOrder ( ( ++ bootOrder ) ) ; } return bootOrder ; }

Target:
private static int setNetworkBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice pluggedInterface : org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.sortInterfacesByName ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getPluggedManagedInterfaces ( devices ) , interfaces ) ) { pluggedInterface.setBootOrder ( ( ++ bootOrder ) ) ; } return bootOrder ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.parseLong ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) ? java.lang.Long.parseLong ( parameters.get ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }
Source:
private void MoveVdssToGoingToMaintananceMode ( ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdssToMaintenance.values ( ) ) { if ( ( ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) ; } } }

Target:
private void setVdsStatusToPrepareForMaintaice ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) && ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) ; } }
Source:
protected void composeCoresAndSocketsWhenDontFitInto ( int totalCpuCores ) { java.util.List < java.lang.Integer > possibleSockets = findIndependentPossibleValues ( maxNumOfSockets ) ; java.util.List < java.lang.Integer > possibleCoresPerSocket = findIndependentPossibleValues ( maxCpusPerSocket ) ; java.util.Collections.reverse ( possibleSockets ) ; for ( java.lang.Integer socket : possibleSockets ) { for ( java.lang.Integer coresPerSocket : possibleCoresPerSocket ) { if ( ( socket * coresPerSocket ) == totalCpuCores ) { getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( coresPerSocket ) ; getModel ( ) . getNumOfSockets ( ) . setSelectedItem ( socket ) ; return ; } } } }

Target:
protected void setCpuChangeability ( ) { getModel ( ) . getThreadsPerCore ( ) . setIsChangeable ( true ) ; getModel ( ) . getCoresPerSocket ( ) . setIsChangeable ( true ) ; getModel ( ) . getNumOfSockets ( ) . setIsChangeable ( true ) ; }
Source:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand < org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( cmd ) . getStoragePoolDAO ( ) ; }

Target:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand < org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( cmd ) . getStoragePoolDAO ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain createDataStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( name ) ; storageDomain.setStatus ( status ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setId ( HE_SD_ID ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain createDataStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name , org.ovirt.engine.core.compat.Guid sdId ) { final org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( name ) ; storageDomain.setStatus ( status ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setId ( sdId ) ; return storageDomain ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( engineSessionId ) == null ? 0 : engineSessionId.hashCode ( ) ) ; result = ( prime * result ) + ( ( userId ) == null ? 0 : userId.hashCode ( ) ) ; return result ; }

Target:
public void setSourceIp ( java.lang.String sourceIp ) { this . sourceIp = sourceIp ; }
Source:
public void validateCoherentNicIdentificationTest ( ) { org.ovirt.engine.core.bll.network.host.NicLabelValidator validator = org.mockito.Mockito.spy ( createNicLabelValidator ( ) ) ; org.ovirt.engine.core.bll.ValidationResult validationReuslt = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.Unassigned ) ; org.mockito.Mockito.doReturn ( validationReuslt ) . when ( validator ) . validateCoherentIdentification ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( validationReuslt , validator.validateCoherentNicIdentification ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( ) ) ) ; }

Target:
public void validateCoherentNicIdentificationTest ( ) { org.ovirt.engine.core.bll.network.host.NicLabelValidator validator = org.mockito.Mockito.spy ( createNicLabelValidator ( ) ) ; org.ovirt.engine.core.bll.ValidationResult validationReuslt = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.Unassigned ) ; org.mockito.Mockito.doReturn ( validationReuslt ) . when ( validator ) . validateCoherentIdentification ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( validationReuslt , validator.validateCoherentNicIdentification ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( ) ) ) ; }
Source:
protected void setUpGetHostIdExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }

Target:
protected void setUpGetHostByNameExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }
Source:
public static void IsCustomPropertiesAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { 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.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }
Source:
public void getSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.hosts.FenceAgentModel model ) { super . init ( model ) ; provider.initializeModel ( model ) ; addTestButtonListener ( ) ; addCiscoUcsPmTypeListener ( model ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.hosts.FenceAgentModel model ) { super . init ( model ) ; provider.initializeModel ( model ) ; addTestButtonListener ( ) ; addCiscoUcsPmTypeListener ( model ) ; registerHandler ( getView ( ) . getFencingOptionsAnchor ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.user.client.Window.open ( dynamicMessages.fencingOptionsUrl ( ) , "_blank" , null ) ; } } ) ) ; }
Source:
protected void onEntityContentChanged ( ) { super . onEntityContentChanged ( ) ; if ( ( ( getEntity ( ) ) != null ) && ( ! ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) ) ) { getSearchCommand ( ) . Execute ( ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityContentChanged ( ) { super . onEntityContentChanged ( ) ; if ( ( ( getEntity ( ) ) != null ) && ( ! ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) ) ) { getSearchCommand ( ) . execute ( ) ; } else { setItems ( null ) ; } }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getVmName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setName ( getVm ( ) . getName ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "NetworkClusterList" . equals ( propertyName ) ) { getView ( ) . setNetworkClusterList ( model.getNetworkClusterList ( ) ) ; } else if ( "Message" . equals ( propertyName ) ) { getView ( ) . setMessageLabel ( model.getMessage ( ) ) ; } }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkModel model ) { super . init ( model ) ; model.getApplyCommand ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propertyName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsExecutionAllowed" . equals ( propertyName ) ) { getView ( ) . setApplyEnabled ( model.getApplyCommand ( ) . getIsExecutionAllowed ( ) ) ; } } } ) ; }
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:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
private static void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; builder.append ( key ) . append ( '=' ) . append ( value ) . append ( DELIMITER ) ; }

Target:
private void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; final char NAME_VALUE_SEPARATOR = '=' ; if ( ( builder.length ( ) ) > 0 ) { builder.append ( DELIMITER ) ; } builder.append ( key ) . append ( NAME_VALUE_SEPARATOR ) . append ( value ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc validateStorageServerConnection ( int serverType , java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > [ ] args ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageServerConnection ( serverType , spUUID , args ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( java.util.Map networks , java.util.Map bonds , java.util.Map options ) { return vdsServer.futureSetupNetworks ( networks , bonds , options ) ; }
Source:
public java.util.List getClusterLevelsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; return resultList ; }

Target:
public java.util.List getClusterLevelsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; resultList.add ( "3.6" ) ; return resultList ; }
Source:
public void testGetAllForSubscriberWithNoSubscriptions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; assertNotNull ( result ) ; assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForSubscriber ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( existingSubscriber ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { org.junit.Assert.assertEquals ( existingSubscriber , subscription.getsubscriber_id ( ) ) ; } }
Source:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getClustersTableItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( model ) ) ; if ( networkClusterModel.getIsChangable ( ) ) { networkClusterModel.setAttached ( value ) ; } } refreshClustersTable ( ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { for ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel : getClustersTableItems ( ) ) { networkClusterModel.setRequired ( ( ! ( event.getValue ( ) ) ) ) ; refreshClustersTable ( ) ; } }