auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public static void initNicHotplugSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.nicHotplugSupportMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetNicHotplugSupportMap ) , callback ) ; }

Target:
private void initSuspendSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { suspendSupport = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetArchitectureCapabilities , new org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters ( org.ovirt.engine.core.common.queries.ArchCapabilitiesParameters.ArchCapabilitiesVerb.GetSuspendSupport ) , callback ) ; }
Source:
public 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 ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
private void addNonManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( false ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }

Target:
private void addNetworksToPool ( int numberOfNetworks , boolean isManagement ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( isManagement ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
public void testValidUpdateOfEditableFieldOnDownHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names in down status" , updateIsValid ) ; }

Target:
public void testValidUpdateOfEditableFieldOnDownHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic src = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic dest = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; boolean updateIsValid = vdsHandler.isUpdateValid ( src , dest , VDSStatus.Down ) ; org.junit.jupiter.api.Assertions.assertTrue ( updateIsValid , "Update should be valid for different names in down status" ) ; }
Source:
protected void mockOsRepository ( ) { org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; org.mockito.Mockito.when ( osRepository.isWindows ( 0 ) ) . thenReturn ( true ) ; }

Target:
protected void mockOsRepository ( ) { org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; org.mockito.Mockito.when ( osRepository.isWindows ( 0 ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.isCpuSupported ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { model.setIsEveryoneSelected ( false ) ; model.setIsMyGroupsSelected ( true ) ; getView ( ) . changeStateOfElementsWhenAccessIsForEveryoneOrMyGroups ( false , true ) ; getModel ( ) . getSearchMyGroupsCommand ( ) . execute ( ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { model.setSearchType ( AdSearchType.MY_GROUPS ) ; getView ( ) . changeStateOfElementsWhenAccessIsForEveryoneOrMyGroups ( false , true ) ; getModel ( ) . getSearchMyGroupsCommand ( ) . execute ( ) ; getView ( ) . userTypeChanged ( UserOrGroup.User , false ) ; model.setItems ( null ) ; getView ( ) . setLoadingState ( LoadingState.LOADING ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setLoginName ( NAMES [ index ] ) ; entity.setGroupNames ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.NAMESPACE ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setLoginName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.NAMESPACE ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }
Source:
public void testAttachSuccess ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( VdcActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( connection ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testAttachSuccess ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( ActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( connection ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void teardownImage ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.TeardownImage , new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( vdsId , storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) ) ; }

Target:
public void teardownImage ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid vdsId ) { resourceManager.runVdsCommand ( VDSCommandType.TeardownImage , new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( vdsId , storagePoolId , newStorageDomainID , newImageGroupId , newImageId ) ) ; }
Source:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionAvailability ( ) ; }

Target:
private void createVMFromTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSaveVm" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; setupNewVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmFromTemplateModelBehavior ( template ) , this ) , template.getVmType ( ) , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.GetRootTag ( ) . gettag_id ( ) ) ; return tag ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.getRootTag ( ) . gettag_id ( ) ) ; return tag ; }
Source:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateEnums ( org.ovirt.engine.api.model.Template.class , incoming ) ; return performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateEnums ( org.ovirt.engine.api.model.Template.class , incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }
Source:
public void unsubscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . getAsString ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }

Target:
public void unsubscribe ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getEventUpName ( ) ) . addValue ( "notification_method" , subscriber.getEventNotificationMethod ( ) . getAsString ( ) ) . addValue ( "subscriber_id" , subscriber.getSubscriberId ( ) ) . addValue ( "tag_name" , subscriber.getTagName ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }
Source:
public static void getVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , 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 executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
public static java.lang.String mapToJson ( java.util.Map < java.lang.String , java.lang.Object > input , boolean prettyPrint ) throws java.io.IOException { org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; org.codehaus.jackson.JsonFactory factory = new org.codehaus.jackson.JsonFactory ( ) ; java.io.StringWriter writer = new java.io.StringWriter ( ) ; org.codehaus.jackson.JsonGenerator generator = factory.createJsonGenerator ( writer ) ; if ( prettyPrint ) { generator.useDefaultPrettyPrinter ( ) ; } mapper.writeValue ( generator , input ) ; return writer.toString ( ) ; }

Target:
public static java.lang.String objectToJson ( java.lang.Object input , boolean prettyPrint ) throws java.io.IOException { org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; org.codehaus.jackson.JsonFactory factory = new org.codehaus.jackson.JsonFactory ( ) ; java.io.StringWriter writer = new java.io.StringWriter ( ) ; org.codehaus.jackson.JsonGenerator generator = factory.createJsonGenerator ( writer ) ; if ( prettyPrint ) { generator.useDefaultPrettyPrinter ( ) ; } mapper.writeValue ( generator , input ) ; return writer.toString ( ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network x , org.ovirt.engine.core.common.businessentities.network.Network y ) { return x.getName ( ) . compareTo ( y.getName ( ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( target.getLoginName ( ) , "*" ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }
Source:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }
Source:
private void addNonManagementNetworksToPool ( int numberOfNetwworks ) { for ( int i = 0 ; i < numberOfNetwworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( false ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }

Target:
private void addNonManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( false ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; queryResult.setSucceeded ( true ) ; queryResult.setReturnValue ( setUpStats ( ) ) ; }

Target:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( QueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; queryResult.setSucceeded ( true ) ; queryResult.setReturnValue ( setUpStats ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getParameters ( ) . getVolumeId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getGlusterVolume ( ) ) == null ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; return false ; } return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getParameters ( ) . getVolumeId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getGlusterVolume ( ) ) == null ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; return false ; } return super . validate ( ) ; }
Source:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }
Source:
private void listenOnSelectedItemChanged ( org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } } } ) ; }

Target:
void addSelectedItemChangeHandler ( ) { selectedItemChangeListener = new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } } } ; listModel.getSelectedItemChangedEvent ( ) . addListener ( selectedItemChangeListener ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendDeviceResource < org.ovirt.engine.api.model.CdRom , org.ovirt.engine.api.model.CdRoms , org.ovirt.engine.core.common.businessentities.VM > resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , VMStatus.Down ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendDeviceResource < org.ovirt.engine.api.model.Cdrom , org.ovirt.engine.api.model.Cdroms , org.ovirt.engine.core.common.businessentities.VM > resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , VMStatus.Down ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
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.StoragePoolQueryParametersBase ( dataCenterId ) , 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.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.HostDevice generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; device.setHostId ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID ) ; device.setDeviceName ( ( ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) + "___child" ) ) ; device.setParentDeviceName ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) ; device.setCapability ( "pci" ) ; return device ; }

Target:
protected org.ovirt.engine.core.common.businessentities.HostDevice generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; device.setHostId ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID ) ; device.setDeviceName ( ( ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) + "___child" ) ) ; device.setParentDeviceName ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) ; device.setCapability ( "pci" ) ; device.setDriver ( "mock driver" ) ; return device ; }
Source:
private void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { final char DELIMITER = ',' ; final char NAME_VALUE_SEPARATOR = '=' ; if ( ( builder.length ( ) ) > 0 ) { builder.append ( DELIMITER ) ; } builder.append ( key ) . append ( NAME_VALUE_SEPARATOR ) . append ( value ) ; }

Target:
private static void compose ( java.lang.StringBuilder builder , java.lang.String key , java.lang.String value ) { if ( ( builder.length ( ) ) > 0 ) { builder.append ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventKeyComposer.KEY_PARTS_DELIMITER ) ; } builder.append ( key ) . append ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventKeyComposer.NAME_VALUE_SEPARATOR ) . append ( value ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( PropertyChangedEventArgs.PROGRESS.equals ( pcArgs.propertyName ) ) { externalDiskPanel.clear ( ) ; if ( ( sanStorageModel.getProgress ( ) ) != null ) { externalDiskPanel.add ( progressContent ) ; } else { externalDiskPanel.add ( storageView ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( PropertyChangedEventArgs.PROGRESS.equals ( args.propertyName ) ) { externalDiskPanel.clear ( ) ; if ( ( sanStorageModel.getProgress ( ) ) != null ) { externalDiskPanel.add ( progressContent ) ; } else { externalDiskPanel.add ( storageView ) ; } } }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap = createNicNameToNetworkTypesMap ( ) ; java.util.List < java.lang.String > violatedNics = findViolatedNics ( nicNameToNetworkTypesMap ) ; if ( violatedNics.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , violatedNics ) ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap = createNicNameToNetworkTypesMap ( ) ; java.util.List < java.lang.String > violatedNics = findViolatedNics ( nicNameToNetworkTypesMap ) ; if ( violatedNics.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.VAR_NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK_LIST , violatedNics ) ) ; } }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public 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 ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { chainedCallback.onSuccess ( model , ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.info ( "-- executeIrsBrokerCommand: Attempting on storage pool '{}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( resourceManager.runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.info ( "-- executeIrsBrokerCommand: Attempting on storage pool '{}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( resourceManager.runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxy ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , org.ovirt.engine.core.common.scheduling.PerHostMessages messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getPolicyUnit ( ) . getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , org.ovirt.engine.core.common.scheduling.PerHostMessages messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' filter is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; return hosts ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.AddCustomValue ( "VmName" , iface.getVmName ( ) ) ; log ( logable , AuditLogType.MAC_ADDRESS_IS_IN_USE ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "VmName" , iface.getVmName ( ) ) ; log ( logable , AuditLogType.MAC_ADDRESS_IS_IN_USE ) ; return null ; }
Source:
public static void GetDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetDataCenterMaxNameLength ( 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.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected boolean checkQuotaValidationCommon ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { if ( quota == null ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString ( ) ) ; return false ; } if ( ( ( ! ( checkQuotaNameExisting ( quota , messages ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaStorageLimitation ( quota , messages ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaVdsGroupLimitation ( quota , messages ) ) ) ) { return false ; } return true ; }

Target:
protected boolean checkQuotaValidationCommon ( org.ovirt.engine.core.common.businessentities.Quota quota , java.util.List < java.lang.String > messages ) { if ( quota == null ) { messages.add ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString ( ) ) ; return false ; } if ( ( ( ! ( checkQuotaNameExisting ( quota , messages ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaStorageLimitation ( quota , messages ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.QuotaCRUDCommand.validateQuotaClusterLimitation ( quota , messages ) ) ) ) { return false ; } return true ; }
Source:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.Qos qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; return hostNIC ; }

Target:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.Qos qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; model.setBootProtocol ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.BootProtocol.class , BootProtocol.AUTOCONF ) ) ; return hostNIC ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , getVm ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { null } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , getVm ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { null } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVdsGroup , org.ovirt.engine.core.common.action.VdsGroupParametersBase.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }