auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void anyCombinationOfDefaulfAndOverriddenHostsAreMismatched ( org.ovirt.engine.core.bll.IsDisplayAddressConsistentInClusterQueryTest.DefaultConsoleAddress defaultAddress , org.ovirt.engine.core.bll.IsDisplayAddressConsistentInClusterQueryTest.OverriddenConsoleAddress overriddenAddress ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mergedAddresses = new java.util.ArrayList < > ( ) ; mergedAddresses.addAll ( defaultAddress.getAllVds ( ) ) ; mergedAddresses.addAll ( overriddenAddress.getAllVds ( ) ) ; org.junit.Assert.assertThat ( getQuery ( ) . isDisplayAddressPartiallyOverridden ( mergedAddresses ) , org.hamcrest.core.Is.is ( true ) ) ; }

Target:
public void anyCombinationOfDefaulfAndOverriddenHostsAreMismatched ( org.ovirt.engine.core.bll.IsDisplayAddressConsistentInClusterQueryTest.DefaultConsoleAddress defaultAddress , org.ovirt.engine.core.bll.IsDisplayAddressConsistentInClusterQueryTest.OverriddenConsoleAddress overriddenAddress ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mergedAddresses = new java.util.ArrayList < > ( ) ; mergedAddresses.addAll ( defaultAddress.getAllVds ( ) ) ; mergedAddresses.addAll ( overriddenAddress.getAllVds ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( getQuery ( ) . isDisplayAddressPartiallyOverridden ( mergedAddresses ) , org.hamcrest.core.Is.is ( true ) ) ; }
Source:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( NGuid.Empty.equals ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.failTaskWithoutVdsmId ( task ) ; } } }

Target:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void setSupportBridgesReportByVDSM ( boolean isSupportBridgesReportByVDSM ) { if ( ! isSupportBridgesReportByVDSM ) { getIsVmNetwork ( ) . setEntity ( true ) ; getIsVmNetwork ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bridlessNetworkNotSupported ( getSelectedDc ( ) . getCompatibilityVersion ( ) . toString ( ) ) ) ; getIsVmNetwork ( ) . setIsChangeable ( false ) ; } else { if ( ( this . isSupportBridgesReportByVDSM ) != isSupportBridgesReportByVDSM ) { initIsVm ( ) ; } getIsVmNetwork ( ) . setIsChangeable ( true ) ; } this . isSupportBridgesReportByVDSM = isSupportBridgesReportByVDSM ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.Provider > getNonReadOnlyExternalNetworkProviders ( java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = new java.util.LinkedList ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider provider : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ) { if ( isExternalNetworkProviderReadOnly ( provider ) ) { continue ; } providers.add ( provider ) ; } return providers ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" , null ) ; }
Source:
public static java.lang.String getOsName ( java.lang.Integer osId ) { if ( osId == null ) { return "" ; } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( osId ) ; }

Target:
private static void initOsIds ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds = new java.util.ArrayList < java.lang.Integer > ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) ) ; java.util.Collections.sort ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds , new java.util.Comparator < java.lang.Integer > ( ) { @ java.lang.Override public int compare ( java.lang.Integer o1 , java.lang.Integer o2 ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o1 ) . compareTo ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.get ( o2 ) ) ; } } ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingInterface : existingInterfaces ) { if ( nic.getName ( ) . equals ( existingInterface.getBaseInterface ( ) ) ) { result.add ( existingInterface ) ; } } return result ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( attachment.getId ( ) ) , attachment.getNicId ( ) , attachment.getNicName ( ) , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY , existingInterfacesMap ) ; }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; if ( getIsNew ( ) ) { getIsWipeAfterDelete ( ) . setEntity ( selectedStorage.getWipeAfterDelete ( ) ) ; } } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateCinderVolumeTypes ( ) ; updatePassDiscardAvailability ( ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; if ( getIsNew ( ) ) { getIsWipeAfterDelete ( ) . setEntity ( selectedStorage.getWipeAfterDelete ( ) ) ; } } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateCinderVolumeTypes ( ) ; updatePassDiscardAvailability ( ) ; updatePassDiscardChangeability ( ) ; updateWipeAfterDeleteChangeability ( ) ; }
Source:
public void testAttachedStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; storageDomain.getDataCenter ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , storageDomain ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.ATTACHED_STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; }

Target:
public void testAttachedStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; storageDomain.getDataCenter ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , storageDomain ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.ATTACHED_STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; }
Source:
public void flushToPrivateModel ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , useLocalDrives , wanEnabled , disableSmartcard ) ; }

Target:
public void flushToPrivateModel ( ) { flushCheckBoxes ( ctrlAltDel , enableUsbAutoshare , openInFullScreen , useLocalDrives , wanEnabled , disableSmartcard ) ; if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; } }
Source:
public void testDoGet_ServeFaviconNotFound ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getCascadingResource ( "favicon" ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }

Target:
public void testDoGetServeFaviconNotFound ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getCascadingResource ( "favicon" ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }
Source:
public void testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo ( ) { org.ovirt.engine.core.compat.Guid lunFromDbId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , lunFromDbId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsToRemoveFromDb = lunsToUpdateInDb.get ( command.removeLunsHandler ) ; org.junit.Assert.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( lunsToRemoveFromDb , lunFromDbId ) ; }

Target:
public void testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo ( ) { org.ovirt.engine.core.compat.Guid lunFromDbId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , lunFromDbId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsToRemoveFromDb = lunsToUpdateInDb.get ( command.removeLunsHandler ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( lunsToRemoveFromDb , lunFromDbId ) ; }
Source:
public void testAllEmpty ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testExtraVariables ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) , new org.ovirt.engine.core.common.utils.Pair ( "c" , "3" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , "--extra-vars=a=1" , "--extra-vars=b=2" , "--extra-vars=c=3" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
private void testUpdateManagementNetworkChange ( boolean managementBefore , boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( oldNetworkCluster.isManagement ( ) ) . thenReturn ( managementBefore ) ; org.mockito.Mockito.when ( networkCluster.isManagement ( ) ) . thenReturn ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }

Target:
private void testUpdateManagementNetworkChange ( boolean managementBefore , boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { oldNetworkCluster.setManagement ( managementBefore ) ; networkCluster.setManagement ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { getQosModel ( ) . setIsChangable ( getQosOverridden ( ) . getEntity ( ) ) ; } }
Source:
public void violationAppearsTwice ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic1 = createNic ( "nic0" , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic2 = createNic ( "nic1" , null ) ; mockExistingIfaces ( nic1 , nic2 ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic1 , nic1 , nic2 , nic2 ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_ALREADY_SPECIFIED , nic1.getName ( ) , nic2.getName ( ) ) ; }

Target:
public void violationAppearsTwice ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic1 = createNic ( "nic0" , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic2 = createNic ( "nic1" , null ) ; mockExistingIfaces ( nic1 , nic2 ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic1 , nic1 , nic2 , nic2 ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_ALREADY_SPECIFIED , nic1.getName ( ) , nic2.getName ( ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot ) { return getCustomMapSqlParameterSource ( ) . addValue ( "snapshot_id" , snapshot.getSnapshotId ( ) ) . addValue ( "snapshot_name" , snapshot.getSnapshotName ( ) ) . addValue ( "volume_id" , snapshot.getVolumeId ( ) ) . addValue ( "description" , snapshot.getDescription ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( snapshot.getStatus ( ) ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot ) { return getCustomMapSqlParameterSource ( ) . addValue ( "snapshot_id" , snapshot.getSnapshotId ( ) ) . addValue ( "snapshot_name" , snapshot.getSnapshotName ( ) ) . addValue ( "volume_id" , snapshot.getVolumeId ( ) ) . addValue ( "description" , snapshot.getDescription ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( snapshot.getStatus ( ) ) ) . addValue ( "_create_date" , snapshot.getCreatedAt ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ! ( isEditConsoleEnabled ( modelProvider.getModel ( ) . getSelectedItem ( ) ) ) ) { return ; } modelProvider.getModel ( ) . getEditConsoleCommand ( ) . execute ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { getView ( ) . clear ( ) ; return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; getView ( ) . displayVmOsImages ( true ) ; setupDisks ( modelProvider ) ; setupConsole ( modelProvider ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.V2VJobInfo buildV2VJobData ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.V2VJobInfo job = new org.ovirt.engine.core.common.businessentities.V2VJobInfo ( ) ; job.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( jobId ) ) ; job.setStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getV2VJobStatusValue ( xmlRpcStruct ) ) ; job.setDescription ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringValue ( xmlRpcStruct , VdsProperties.v2vDescription ) ) ; job.setProgress ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignIntValue ( xmlRpcStruct , VdsProperties.v2vProgress ) ) ; return job ; }

Target:
private static org.ovirt.engine.core.common.businessentities.V2VJobInfo buildV2VJobData ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.V2VJobInfo job = new org.ovirt.engine.core.common.businessentities.V2VJobInfo ( ) ; job.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( jobId ) ) ; job.setStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getV2VJobStatusValue ( xmlRpcStruct ) ) ; job.setDescription ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.assignStringValue ( xmlRpcStruct , VdsProperties.v2vDescription ) ) ; job.setProgress ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.assignIntValue ( xmlRpcStruct , VdsProperties.v2vProgress ) ) ; return job ; }
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 void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void setUpTestServlet ( ) throws java.security.NoSuchAlgorithmException { testServlet = getTestServletSpy ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( ) ; org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.doReturn ( mockDigest ) . when ( testServlet ) . createMd5Digest ( ) ; }

Target:
protected void setUpTestServlet ( ) throws java.security.NoSuchAlgorithmException { testServlet = getTestServletSpy ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( ) ; testServlet.setBrandingManager ( mockBrandingManager ) ; org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.doReturn ( mockDigest ) . when ( testServlet ) . createMd5Digest ( ) ; }
Source:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return addValidationGroup ( org.ovirt.engine.core.common.validation.group.ImportClonedEntity.class ) ; } return addValidationGroup ( org.ovirt.engine.core.common.validation.group.ImportEntity.class ) ; }

Target:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getVmDynamicDAO ( ) . save ( tempVar ) ; org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extendImageTransferSession ( java.lang.String ticketId , long expiration ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extendImageTransferSession ( ticketId , expiration ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void handleCommunicationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable cause ) { org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandler.log.error ( ( "Error in communicating with LDAP server " + ( cause.getMessage ( ) ) ) ) ; response.setServerScore ( Score.LOW ) . setTryNextServer ( true ) . setTranslatedException ( ( ( java.lang.Exception ) ( cause ) ) ) ; }

Target:
private void handleCommunicationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable cause ) { org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandler.log.error ( ( "Error in communicating with LDAP server " + ( cause.getMessage ( ) ) ) ) ; response.setOrderingAlgorithm ( OrderingAlgorithmType.PUT_LAST ) . setTryNextServer ( true ) . setTranslatedException ( ( ( java.lang.Exception ) ( cause ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( RegistrationResult.RetrievedEventDefinition ) ) { AsyncResult_Retrieved ( ) ; } if ( ev.matchesDefinition ( ProvideTickEvent.Definition ) ) { SyncSearch ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( RegistrationResult.RetrievedEventDefinition ) ) { AsyncResult_Retrieved ( ) ; } if ( ev.matchesDefinition ( ProvideTickEvent.Definition ) ) { syncSearch ( ) ; } }
Source:
public static void getVmSnapshotList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }

Target:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( ! ( refreshRepos ( storageDomainId , imageType , forceRefresh ) ) ) { return false ; } return true ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static 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.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:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.bll.context.CommandContext rollbackContext ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , rollbackContext ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context.clone ( ) ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }
Source:
public void testFindMappingEntryEmptyExternal ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }

Target:
public void testFindMappingEntryEmptyExternal ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE1_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.jupiter.api.Assertions.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) ) { items.add ( org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel.createUserGroup ( groupFullName ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) ) { items.add ( createUserGroup ( groupFullName , getEntity ( ) . getNamespace ( ) , getEntity ( ) . getDomain ( ) ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJobAborted ( ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP ) ; }
Source:
private com.woorea.openstack.base.client.OpenStackTokenProvider getTokenProvider ( ) { if ( ( ( tokenProvider ) == null ) && ( getProvider ( ) . isRequiringAuthentication ( ) ) ) { java.lang.String tenantName = provider.getAdditionalProperties ( ) . getTenantName ( ) ; tokenProvider = new com.woorea.openstack.keystone.utils.KeystoneTokenProvider ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.KeystoneAuthUrl ) , getProvider ( ) . getUsername ( ) , getProvider ( ) . getPassword ( ) ) . getProviderByTenant ( tenantName ) ; } return tokenProvider ; }

Target:
private com.woorea.openstack.base.client.OpenStackTokenProvider getTokenProvider ( ) { if ( ( ( tokenProvider ) == null ) && ( getProvider ( ) . isRequiringAuthentication ( ) ) ) { java.lang.String tenantName = provider.getAdditionalProperties ( ) . getTenantName ( ) ; tokenProvider = new com.woorea.openstack.keystone.utils.KeystoneTokenProvider ( getProvider ( ) . getAuthUrl ( ) , getProvider ( ) . getUsername ( ) , getProvider ( ) . getPassword ( ) ) . getProviderByTenant ( tenantName ) ; } return tokenProvider ; }
Source:
public static java.lang.String map ( java.lang.Integer type ) { switch ( type ) { case 0 : return NicInterface.RTL8139_VIRTIO.value ( ) ; case 1 : return NicInterface.RTL8139.value ( ) ; case 2 : return NicInterface.E1000.value ( ) ; case 3 : return NicInterface.VIRTIO.value ( ) ; case 4 : return NicInterface.SPAPR_VLAN.value ( ) ; case 5 : return NicInterface.PCI_PASSTHROUGH.value ( ) ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.NicInterface map ( java.lang.Integer type ) { switch ( type ) { case 0 : return org.ovirt.engine.api.model.NicInterface.RTL8139_VIRTIO ; case 1 : return org.ovirt.engine.api.model.NicInterface.RTL8139 ; case 2 : return org.ovirt.engine.api.model.NicInterface.E1000 ; case 3 : return org.ovirt.engine.api.model.NicInterface.VIRTIO ; case 4 : return org.ovirt.engine.api.model.NicInterface.SPAPR_VLAN ; case 5 : return org.ovirt.engine.api.model.NicInterface.PCI_PASSTHROUGH ; default : return null ; } }
Source:
public static void GetMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static 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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.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 org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.labels.list.ClusterAffinityLabelListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
protected org.ovirt.engine.core.common.queries.VdcQueryType getEntityExportDomain ( ) { return org.ovirt.engine.core.common.queries.VdcQueryType.GetVmsFromExportDomain ; }
Source:
protected boolean isFilterDestinationDomainsBySourceType ( ) { return false ; }

Target:
private boolean isAllVmsDown ( java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap ) { if ( ( vmsMap.get ( java.lang.Boolean.TRUE ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsMap.get ( java.lang.Boolean.TRUE ) ) { if ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { return false ; } } } return true ; }