auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.String join ( java.util.List < java.lang.String > list , java.lang.String delimiter ) { if ( list == null ) { return "" ; } java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; java.util.Iterator < java.lang.String > iter = list.iterator ( ) ; while ( iter.hasNext ( ) ) { builder.append ( iter.next ( ) ) ; if ( ! ( iter.hasNext ( ) ) ) { break ; } builder.append ( delimiter ) ; } return builder.toString ( ) ; }

Target:
public static java.lang.String join ( java.lang.Iterable < java.lang.String > list , java.lang.String delimiter ) { if ( list == null ) { return "" ; } java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; java.util.Iterator < java.lang.String > iter = list.iterator ( ) ; while ( iter.hasNext ( ) ) { builder.append ( iter.next ( ) ) ; if ( ! ( iter.hasNext ( ) ) ) { break ; } builder.append ( delimiter ) ; } return builder.toString ( ) ; }
Source:
private void removeListeners ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model ) { if ( ( viewUpdatingListener ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = extractSpice ( model ) ; if ( spice == null ) { return ; } spice.getUsbAutoShareChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANColorDepthChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANDisableEffectsChangeEvent ( ) . removeListener ( viewUpdatingListener ) ; }

Target:
private void removeListeners ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { if ( ( viewUpdatingListener ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = extractSpice ( model ) ; if ( spice == null ) { return ; } spice.getUsbAutoShareChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANColorDepthChangedEvent ( ) . removeListener ( viewUpdatingListener ) ; spice.getWANDisableEffectsChangeEvent ( ) . removeListener ( viewUpdatingListener ) ; }
Source:
private void setIsoPrefixVDSMethod ( java.lang.String isoPrefix ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue isoPrefixReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; isoPrefixReturnValue.setReturnValue ( isoPrefix ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsoPrefix ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters.class ) ) ) . thenReturn ( isoPrefixReturnValue ) ; }

Target:
protected void mockVmRunHandler ( ) { org.mockito.Mockito.doReturn ( vmRunHandler ) . when ( command ) . getVmRunHandler ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( vmRunHandler ) . performImageChecksForRunningVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.RunVmParams.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.Disk.class ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( vmRunHandler ) . isVmInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void testContainsKeyReturnsTrueForExistingId ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , null ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.junit.Assert.assertThat ( map.containsKey ( itemId ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testContainsKeyReturnsTrueForExistingId ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , null ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.hamcrest.MatcherAssert.assertThat ( map.containsKey ( itemId ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { driver.edit ( object ) ; cpuPanel.setVisible ( object.isCpuPluggable ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { driver.edit ( object ) ; cpuPanel.setVisible ( object.isCpuPluggable ( ) ) ; com.google.gwt.safehtml.shared.SafeHtmlBuilder changedFieldsBuilder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String field : object.getChangedFields ( ) ) { java.lang.String escapedField = com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( field ) ; changedFieldsBuilder.append ( listItem ( escapedField , templates ) ) ; } changedFields.setHTML ( changedFieldsBuilder.toSafeHtml ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }
Source:
public void testChangeValueAfterAdd ( ) { org.ovirt.engine.core.common.businessentities.tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.AddTag ( tag ) ; tag.settag_name ( "tag2" ) ; org.ovirt.engine.core.common.businessentities.tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( "tag1" , tagFromDirector.gettag_name ( ) ) ; }

Target:
public void testChangeValueAfterAdd ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.AddTag ( tag ) ; tag.settag_name ( "tag2" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( "tag1" , tagFromDirector.gettag_name ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
protected java.lang.String processResponseHeaderValue ( org.apache.commons.httpclient.HttpMethodBase method , java.lang.String headerName , java.lang.String expectedValue ) { org.apache.commons.httpclient.Header header = method.getResponseHeader ( headerName ) ; if ( header == null ) { throwVdsErrorException ( ( "response was missing the following header: " + headerName ) , VdcBllErrors.GeneralException ) ; } if ( ( expectedValue != null ) && ( ! ( expectedValue.equals ( header.getValue ( ) ) ) ) ) { throwVdsErrorException ( ( "response header value unexpected for header: " + headerName ) , VdcBllErrors.GeneralException ) ; } return header.getValue ( ) ; }

Target:
protected java.lang.String processResponseHeaderValue ( org.apache.commons.httpclient.HttpMethodBase method , java.lang.String headerName , java.lang.String expectedValue ) { org.apache.commons.httpclient.Header header = method.getResponseHeader ( headerName ) ; if ( header == null ) { throwVdsErrorException ( ( "response was missing the following header: " + headerName ) , EngineError.GeneralException ) ; } if ( ( expectedValue != null ) && ( ! ( expectedValue.equals ( header.getValue ( ) ) ) ) ) { throwVdsErrorException ( ( "response header value unexpected for header: " + headerName ) , EngineError.GeneralException ) ; } return header.getValue ( ) ; }
Source:
private static void setCdPath ( java.util.Map < java.lang.String , java.lang.Object > specParams , java.lang.String srcCdPath , java.lang.String isoPath ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( isoPath ) ) ) { specParams.put ( VdsProperties.Path , isoPath ) ; } else if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( srcCdPath ) ) ) { specParams.put ( VdsProperties.Path , srcCdPath ) ; } else { specParams.put ( VdsProperties.Path , "" ) ; } }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getCdDeviceSpecParams ( java.lang.String srcCdPath , java.lang.String dstCdPath ) { return java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( VdsProperties.Path , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getCdPath ( srcCdPath , dstCdPath ) ) ; }
Source:
private void onRemove ( ) { setConfirmWindow ( null ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > params = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.MacPool > ) ( getSelectedItems ( ) ) ) ) { params.add ( new org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters ( macPool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveMacPool , params ) ; }

Target:
private void onRemove ( ) { cancel ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > params = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.MacPool > ) ( getSelectedItems ( ) ) ) ) { params.add ( new org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters ( macPool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveMacPool , params ) ; }
Source:
private void initListBoxEditors ( ) { destClusterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( object ) ) . getname ( ) ; } } ) ; destStorageEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( object ) ) . getstorage_name ( ) ; } } ) ; }

Target:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.Quota ) ( object ) ) . getQuotaName ( ) ; }
Source:
public void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }

Target:
public void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.PropertyName ) ) { if ( ( loginModel.getProgress ( ) ) != null ) { com.google.gwt.user.client.ui.RootPanel.getBodyElement ( ) . getStyle ( ) . setCursor ( Cursor.WAIT ) ; } else { com.google.gwt.user.client.ui.RootPanel.getBodyElement ( ) . getStyle ( ) . clearCursor ( ) ; } } }

Target:
protected void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( command == ( loginModel.getLoginCommand ( ) ) ) { lockInteractionManager.showLoadingIndicator ( ) ; } super . executeCommand ( command ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entity ) { getCallsHandler ( ) . executeModification ( "Insertimage_storage_domain_map" , getCustomMapSqlParameterSource ( ) . addValue ( "image_id" , entity.getimage_id ( ) ) . addValue ( "storage_domain_id" , entity.getstorage_domain_id ( ) ) . addValue ( "quota_id" , entity.getQuotaId ( ) ) . addValue ( "disk_profile_id" , entity.getDiskProfileId ( ) ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map entity ) { getCallsHandler ( ) . executeModification ( "Insertimage_storage_domain_map" , getCustomMapSqlParameterSource ( ) . addValue ( "image_id" , entity.getimage_id ( ) ) . addValue ( "storage_domain_id" , entity.getstorage_domain_id ( ) ) . addValue ( "quota_id" , entity.getQuotaId ( ) ) . addValue ( "disk_profile_id" , entity.getDiskProfileId ( ) ) ) ; }
Source:
private void resetIsEmpty ( ) { if ( ( getItems ( ) ) != null ) { java.util.Iterator enumerator = getItems ( ) . iterator ( ) ; if ( enumerator.hasNext ( ) ) { setIsEmpty ( false ) ; } } }

Target:
private void resetIsEmpty ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getItems ( ) ) != null ) { java.util.Iterator enumerator = org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getItems ( ) . iterator ( ) ; if ( enumerator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setIsEmpty ( false ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_domains expectGetStorageDomain ( org.ovirt.engine.core.compat.Guid domId , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainDAO ( ) ) . thenReturn ( dao ) ; org.ovirt.engine.core.common.businessentities.storage_domains dom = getStorageDomain ( domId , poolId , type , storageType ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( domId , poolId ) ) . thenReturn ( dom ) ; return dom ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage_domains expectGetStorageDomain ( org.ovirt.engine.core.compat.Guid domId , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainDao ( ) ) . thenReturn ( dao ) ; org.ovirt.engine.core.common.businessentities.storage_domains dom = getStorageDomain ( domId , poolId , type , storageType ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( domId , poolId ) ) . thenReturn ( dom ) ; return dom ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void translateVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.create ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class ) ; if ( translator.containsKey ( volumeEntity.getVolumeType ( ) ) ) { getDetailModel ( ) . setVolumeTypeSilently ( translator.get ( volumeEntity.getVolumeType ( ) ) ) ; } }

Target:
private void translateVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicompat.EnumTranslator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; if ( translator.containsKey ( volumeEntity.getVolumeType ( ) ) ) { getDetailModel ( ) . setVolumeTypeSilently ( translator.translate ( volumeEntity.getVolumeType ( ) ) ) ; } }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfile > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , true , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean valid , boolean success ) { return setUpActionExpectations ( task , clz , names , values , valid , success , null , true , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { disableRemoveBrickStatusPopUpActions ( ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.gluster.ReplaceBrickModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.ReplaceBrickModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setWindow ( null ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { disableRemoveBrickStatusPopUpActions ( ) ; } }
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.LoginUserParameters > 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 login: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( 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 logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; }
Source:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( executor.findProxyHost ( ) ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = executor.fence ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; vdsProxyFound = true ; } }

Target:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) ) ; vdsProxyFound = new org.ovirt.engine.core.bll.FenceProxyLocator ( getVds ( ) ) . isProxyHostAvailable ( ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( vdsProxyFound ) ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = executor.checkStatus ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , VdcActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , ActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmJobsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildInterfaceStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmJobsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildInterfaceStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmBalloonInfo ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }
Source:
private boolean hotPlugNic ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { return runVdsCommand ( VDSCommandType.HotPlugNic , new org.ovirt.engine.core.common.vdscommands.HotPlugUnplgNicVDSParameters ( vmDynamic.getrun_on_vds ( ) . getValue ( ) , vmDynamic.getId ( ) , org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) , vmDevice ) ) . getSucceeded ( ) ; }

Target:
private boolean hotPlugNic ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ! ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.canPerformHotPlug ( ) ) ) { return false ; } else { return runVdsCommand ( VDSCommandType.HotPlugNic , new org.ovirt.engine.core.common.vdscommands.HotPlugUnplgNicVDSParameters ( vmDynamic.getrun_on_vds ( ) . getValue ( ) , vmDynamic.getId ( ) , org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) , vmDevice ) ) . getSucceeded ( ) ; } }
Source:
public int getavailableMacsCount ( ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager::getAvailableMacsCount - entered" ) ; lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager:: AvailableMacsCount = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public int getAvailableMacsCount ( ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager::getAvailableMacsCount - entered" ) ; lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager:: AvailableMacsCount = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . isStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }

Target:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . isStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.error ( "Error in StoragePoolUpEvent: {}" , exp.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.debug ( "Exception" , exp ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepPause ( masterVolumeName , slaveHost , slaveVolumeName , force ) ) ; } 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 glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionPause ( masterVolumeName , slaveHost , slaveVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void executeQueryCommand ( ) { final org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.dao.DbGroupDAO dao = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getDbFacade ( ) . getDbGroupDao ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbGroup group = dao.get ( id ) ; org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; }

Target:
protected void executeQueryCommand ( ) { final org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.dao.DbGroupDao dao = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getDbFacade ( ) . getDbGroupDao ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbGroup group = dao.get ( id ) ; org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedCustomMacs.contains ( mac ) ) { allocatedCustomMacs.remove ( mac ) ; } else if ( allocatedMacs.contains ( mac ) ) { allocatedMacs.remove ( mac ) ; availableMacs.add ( mac ) ; } }

Target:
public boolean addMac ( java.lang.String mac ) { boolean retVal = false ; lockObj.writeLock ( ) . lock ( ) ; try { if ( availableMacs.contains ( mac ) ) { retVal = commitNewMac ( mac ) ; } else if ( allocatedMacs.containsKey ( mac ) ) { retVal = addMacToMap ( allocatedMacs , mac ) ; } else { retVal = addMacToMap ( allocatedCustomMacs , mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } return retVal ; }
Source:
private void setSdDiscardSupport ( boolean sdSupportsDiscard , boolean sdDiscardZeroesData ) { storageDomain.setSupportsDiscard ( sdSupportsDiscard ) ; storageDomain.setSupportsDiscardZeroesData ( sdDiscardZeroesData ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }