auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getVdsDAO ( ) . getAllForVdsGroupWithStatus ( getVdsGroupId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS newUpServer = null ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { if ( ( ! ( getVdsId ( ) . equals ( vds.getId ( ) ) ) ) && ( ! ( upServer.getId ( ) . equals ( vds.getId ( ) ) ) ) ) { newUpServer = vds ; break ; } } return newUpServer ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getVdsDao ( ) . getAllForVdsGroupWithStatus ( getVdsGroupId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS newUpServer = null ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { if ( ( ! ( getVdsId ( ) . equals ( vds.getId ( ) ) ) ) && ( ! ( upServer.getId ( ) . equals ( vds.getId ( ) ) ) ) ) { newUpServer = vds ; break ; } } return newUpServer ; }
Source:
public void testRemoveWithoutParam ( ) { container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; container.removeSession ( ) ; org.junit.Assert.assertEquals ( "Get should return the value since the session was not removed" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; container.removeSession ( ) ; org.junit.Assert.assertNull ( "Get should return the value since the session was removed" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }

Target:
public void testGetDataAndSetDataWithEmptySession ( ) { org.junit.Assert.assertNull ( "Get should return null with an empty session" , container.getData ( "" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }

Target:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }
Source:
public void testSubscribe ( ) { dao.subscribe ( newSubscription ) ; java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( newSubscription.getsubscriber_id ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { assertEquals ( newSubscriber , subscription.getsubscriber_id ( ) ) ; } }

Target:
public void testGetEventMapByNameWithInvalidName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.EventMap > result = dao.getEventMapByName ( "farkle" ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
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 getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void extractRemovedNetworks ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String net = iface.getNetworkName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( net ) ) && ( ! ( attachedNetworksNames.contains ( net ) ) ) ) { removedNetworks.add ( net ) ; } } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( params.getVdsId ( ) , removedNetworks ) ; for ( java.lang.String vmName : vmNames ) { addViolation ( VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , vmName ) ; } }

Target:
private void extractRemovedNetworks ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String net = iface.getNetworkName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( net ) ) && ( ! ( attachedNetworksNames.contains ( net ) ) ) ) { removedNetworks.add ( net ) ; } } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( params.getVdsId ( ) , removedNetworks ) ; for ( java.lang.String vmName : vmNames ) { addViolation ( EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , vmName ) ; } }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.setSucceeded ( true ) ; }
Source:
public void testDoGet_ExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }

Target:
public void testDoGetExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }
Source:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.DiskImage > Cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { if ( ( disk.getimageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.OK ) ) { return false ; } } return true ; }

Target:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.DiskImage > Cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { if ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.OK ) ) { return false ; } } return true ; }
Source:
public void Template_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VmBase vmBase = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; setupWindowModelFrom ( vmBase ) ; }

Target:
public void Template_SelectedItemChanged ( ) { super . Template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getdedicated_vm_for_vds ( ) ) ; }
Source:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }

Target:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; dataCenterGuideModel.clusters = clusters ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; dataCenterGuideModel.clusters = clusters ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } return null ; } } ) ; }

Target:
private void cancelTasks ( ) { if ( hasTasks ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } } } ) ; } }
Source:
public void testEjectCd ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO , VMStatus.Up ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO ) ; cdrom = resource.update ( cdrom ) ; assertNull ( cdrom.getFile ( ) ) ; }

Target:
public void testEjectCd ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO , VMStatus.Up ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.Assert.assertNull ( cdrom.getFile ( ) ) ; }
Source:
private boolean isRemoveCommandAvailable ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { boolean isImageLocked = ( disk.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ; if ( isImageLocked ) { return false ; } } return true ; }

Target:
private boolean isRemoveCommandAvailable ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { boolean isImageLocked = ( disk.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ; if ( isImageLocked ) { return false ; } } return true ; }
Source:
private void DontMigrateVM_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getDontMigrateVM ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }

Target:
private void DontMigrateVM_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getDontMigrateVM ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } behavior.updateCpuPinningVisibility ( ) ; }
Source:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private boolean configuredNetworkNotAssignedToCluster ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > targetNetworksByName , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByNetwork , org.ovirt.engine.core.common.businessentities.network.Network net ) { return ( nicsByNetwork.containsKey ( net.getName ( ) ) ) && ( ! ( targetNetworksByName.containsKey ( net.getName ( ) ) ) ) ; }

Target:
private boolean isNetworkAssignedToNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.lang.String networkName , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByNetwork ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicToWhichNetworkIsAssigned = nicsByNetwork.get ( networkName ) ; java.lang.String baseNicNameToWhichNetworkIsAssigned = ( nicToWhichNetworkIsAssigned == null ) ? null : org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( nicToWhichNetworkIsAssigned ) ; return nic.getName ( ) . equals ( baseNicNameToWhichNetworkIsAssigned ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getBroker ( ) . disconnectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.BuildStructFromConnectionListObject ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( _result.convertToStatusList ( ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getBroker ( ) . disconnectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.BuildStructFromConnectionListObject ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStorageServerVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( _result.convertToStatusList ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "id|name" ) ; if ( ! ( tag.isSetId ( ) ) ) { tag = lookupTagByName ( tag.getName ( ) ) ; } return performCreation ( attachAction , getAttachParams ( tag.getId ( ) ) , new org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResource.TagIdResolver ( asGuid ( tag.getId ( ) ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "id|name" ) ; if ( ! ( tag.isSetId ( ) ) ) { tag = lookupTagByName ( tag.getName ( ) ) ; } return performCreate ( attachAction , getAttachParams ( tag.getId ( ) ) , new org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResource.TagIdResolver ( asGuid ( tag.getId ( ) ) ) ) ; }
Source:
public void init ( final java.util.List < org.ovirt.engine.core.common.businessentities.VM > externalVms , final org.ovirt.engine.core.compat.Guid storageDomainId ) { withDataCenterLoaded ( storageDomainId , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { doInit ( ) ; } } , externalVms ) ; } } ) ; }

Target:
public void init ( final java.util.List < org.ovirt.engine.core.common.businessentities.VM > externalVms , final org.ovirt.engine.core.compat.Guid storageDomainId ) { withDataCenterLoaded ( storageDomainId , new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > returnValue ) { setItems ( new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { doInit ( ) ; } } , externalVms ) ; } } ) ; }
Source:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
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 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 ) ; }
Source:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }

Target:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }
Source:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ; if ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getprevious_status ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) ; }

Target:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ; if ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getPreviousStatus ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) ; }
Source:
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 ( propertyNamesMap.containsKey ( propertyName ) ) { org.ovirt.engine.ui.common.widget.form.FormItem item = propertyNamesMap.get ( propertyName ) ; formPanel.removeFormItem ( item ) ; if ( item.isVisible ( ) ) { formPanel.addFormItem ( item ) ; } } }

Target:
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 ( propertyNamesMap.containsKey ( propertyName ) ) { org.ovirt.engine.ui.common.widget.form.FormItem item = propertyNamesMap.get ( propertyName ) ; formPanel.removeFormItem ( item ) ; if ( ( item.getIsAvailable ( ) ) && ( item.isVisible ( ) ) ) { formPanel.addFormItem ( item ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( args instanceof org.ovirt.engine.core.compat.PropertyChangedEventArgs ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Disks" . equals ( changedArgs.PropertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( changedArgs.PropertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Disks" . equals ( changedArgs.PropertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( changedArgs.PropertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } }
Source:
public void testGetNotFound ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true , null ) ; } }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } fireAsyncActionFailedEvent ( state ) ; }
Source:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "NETWORK_ATTACHMENT_IN_BOTH_LISTS_ENTITY" , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }
Source:
public void testNotLinkedToExternalNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllExternalNetworksLinkedToPhysicalNetwork ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.notLinkedToExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotLinkedToExternalNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllExternalNetworksLinkedToPhysicalNetwork ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notLinkedToExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats profileDetails = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ( obj ) ) ; if ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getName ( ) , profileDetails.getName ( ) ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getProfileStats ( ) , profileDetails.getProfileStats ( ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats profileDetails = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ( obj ) ) ; if ( ! ( java.util.Objects.equals ( getName ( ) , profileDetails.getName ( ) ) ) ) { return false ; } if ( ! ( java.util.Objects.equals ( getProfileStats ( ) , profileDetails.getProfileStats ( ) ) ) ) { return false ; } return true ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void isVmNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }