auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.lang.String localeName = localeBox.getValue ( localeBox.getSelectedIndex ( ) ) ; java.lang.String localeString = "" ; if ( ! ( localeName.equals ( "default" ) ) ) { localeString = "?locale=" + localeName ; } com.google.gwt.user.client.Window.open ( ( ( org.ovirt.engine.ui.frontend.utils.FrontendUrlUtils.getCurrentPageURL ( ) ) + localeString ) , "_self" , "" ) ; }

Target:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.lang.String localeQueryParam = com.google.gwt.i18n.client.LocaleInfo.getLocaleQueryParam ( ) ; java.lang.String localeString = ( ( "?" + localeQueryParam ) + "=" ) + ( localeBox.getValue ( localeBox.getSelectedIndex ( ) ) ) ; com.google.gwt.user.client.Window.open ( ( ( org.ovirt.engine.ui.frontend.utils.FrontendUrlUtils.getCurrentPageURL ( ) ) + localeString ) , "_self" , "" ) ; }
Source:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } }

Target:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }
Source:
public void testGetWithPassthrough ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE , result.getId ( ) ) ; org.junit.Assert.assertTrue ( result.isPassthrough ( ) ) ; }

Target:
public void testGetWithPassthrough ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PASSTHROUGH_PROFILE , result.getId ( ) ) ; org.junit.Assert.assertTrue ( result.isPassthrough ( ) ) ; org.junit.Assert.assertFalse ( result.isMigratable ( ) ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.FencingPolicy ) ) { return false ; } org.ovirt.engine.core.common.businessentities.FencingPolicy other = ( ( org.ovirt.engine.core.common.businessentities.FencingPolicy ) ( obj ) ) ; return ( ( ( skipFencingIfSDActive ) == ( other.skipFencingIfSDActive ) ) && ( ( skipFencingIfConnectivityBroken ) == ( other.skipFencingIfConnectivityBroken ) ) ) && ( ( hostsWithBrokenConnectivityThreshold ) == ( other.hostsWithBrokenConnectivityThreshold ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.FencingPolicy ) ) { return false ; } org.ovirt.engine.core.common.businessentities.FencingPolicy other = ( ( org.ovirt.engine.core.common.businessentities.FencingPolicy ) ( obj ) ) ; return ( ( ( ( fencingEnabled ) == ( other.fencingEnabled ) ) && ( ( skipFencingIfSDActive ) == ( other.skipFencingIfSDActive ) ) ) && ( ( skipFencingIfConnectivityBroken ) == ( other.skipFencingIfConnectivityBroken ) ) ) && ( ( hostsWithBrokenConnectivityThreshold ) == ( other.hostsWithBrokenConnectivityThreshold ) ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > > groupTasksByRootCommandId ( java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > tasksInDB ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > > rootCommandIdToCommandsMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks task : tasksInDB ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( task.getRootCommandId ( ) , task , rootCommandIdToCommandsMap ) ; } return rootCommandIdToCommandsMap ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > > groupTasksByRootCommandId ( java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > tasksInDB ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > > rootCommandIdToCommandsMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTask task : tasksInDB ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( task.getRootCommandId ( ) , task , rootCommandIdToCommandsMap ) ; } return rootCommandIdToCommandsMap ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAdGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Network model = org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( ( java.lang.Boolean ) ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddSeconds ( logType.getDuplicateEventsIntervalValue ( ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( ( ( java.lang.System.currentTimeMillis ( ) ) + ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( duplicateEventsIntrvalValue ) ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getById ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , createGlusterHookIdParams ( id ) ) ; if ( glusterHook != null ) { getGlusterServerHook ( glusterHook , null ) ; } return glusterHook ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getById ( org.ovirt.engine.core.compat.Guid id , boolean eagerLoad ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , createIdParameterMapper ( id ) . addValue ( "includeContent" , eagerLoad ) ) ; if ( eagerLoad ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = getCallsHandler ( ) . executeReadList ( "GetGlusterServerHooksById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , createIdParameterMapper ( id ) ) ; if ( serverHooks != null ) { glusterHook.setServerHooks ( serverHooks ) ; } } return glusterHook ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , new java.util.Date ( ) . getTime ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; model.postInitStorageDomains ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenter ( dataCenter ) ; model.setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; model.postInitStorageDomains ( ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . fullList ( org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getBroker ( ) . fullList ( org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.getParameters ( ) . getVmIds ( ) . stream ( ) . map ( Guid :: toString ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.vmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVDSCommand.setReturnValue ( struct ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( vmId ) ; vm.setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( vmId ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( vmId ) ; vm.setStoragePoolId ( spId ) ; vm.setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( vmId ) ) . thenReturn ( vm ) ; return vm ; }
Source:
public boolean StorageDomainRemoved ( org.ovirt.engine.core.common.businessentities.storage_domain_static storageDomain ) { int numOfRemovedLuns = removeStorageDomainLuns ( storageDomain ) ; if ( numOfRemovedLuns > 0 ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getstorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection : FilterConnectionsUsedByOthers ( list , storageDomain.getstorage ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { int numOfRemovedLuns = removeStorageDomainLuns ( storageDomain ) ; if ( numOfRemovedLuns > 0 ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getstorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : FilterConnectionsUsedByOthers ( list , storageDomain.getstorage ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } return true ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void validateBootPrefixForInitrdAndKernelImage ( ) throws java.lang.Exception { java.lang.String initrd = "/boot" ; java.lang.String kernelImage = "/boot" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelImage ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , kernelImage ) ; }

Target:
public void validateBootPrefixForInitrdAndKernelImage ( ) throws java.lang.Exception { java.lang.String initrd = "/boot" ; java.lang.String kernelImage = "/boot" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelImage ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , kernelImage ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel lookupEntity ( java.lang.String id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > labels = getHostNicLabels ( nicId ) ; for ( org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel label : labels ) { if ( java.util.Objects.equals ( label.getId ( ) , id ) ) { return label ; } } return null ; }

Target:
public org.ovirt.engine.api.model.NetworkLabel lookupEntity ( java.lang.String id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { java.util.List < org.ovirt.engine.api.model.NetworkLabel > labels = getHostNicLabels ( nicId ) ; for ( org.ovirt.engine.api.model.NetworkLabel label : labels ) { if ( java.util.Objects.equals ( label.getId ( ) , id ) ) { return label ; } } return null ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { return coCoAsyncTaskHelper.createTask ( taskId , command , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; }

Target:
public org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.ActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { return coCoAsyncTaskHelper.createTask ( taskId , command , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( ( ( rs.getString ( "config_possible_values" ) ) != null ? java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) : null ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( sessionId ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( ( ( rs.getString ( "config_possible_values" ) ) != null ? java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) : null ) ) ; return entity ; }
Source:
public void validateSucceedsWhenGlusterServerHasPeersThatExistInDB ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void validateSucceedsWhenGlusterServerHasPeersThatExistInDB ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( true ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; }
Source:
protected void buildVmBootSequence ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDAO ( ) . getVmDeviceByVmId ( vm.getId ( ) ) ; java.lang.String bootSeqInDB = org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getBootSequence ( devices ) . toString ( ) . toLowerCase ( ) ; java.lang.String bootSeqInBE = vm.getboot_sequence ( ) . toString ( ) . toLowerCase ( ) ; if ( bootSeqInBE.equals ( bootSeqInDB ) ) createInfo.add ( VdsProperties.Boot , bootSeqInDB ) ; else createInfo.add ( VdsProperties.Boot , bootSeqInBE ) ; }

Target:
protected void buildVmBootSequence ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmId ( vm.getId ( ) ) ; java.lang.String bootSeqInDB = org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getBootSequence ( devices ) . toString ( ) . toLowerCase ( ) ; java.lang.String bootSeqInBE = vm.getboot_sequence ( ) . toString ( ) . toLowerCase ( ) ; if ( bootSeqInBE.equals ( bootSeqInDB ) ) createInfo.add ( VdsProperties.Boot , bootSeqInDB ) ; else createInfo.add ( VdsProperties.Boot , bootSeqInBE ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.TagModelProvider modelProvider ) { org.ovirt.engine.ui.webadmin.widget.tags.TagList.TagTreeResources res = com.google.gwt.core.client.GWT.create ( org.ovirt.engine.ui.webadmin.widget.tags.TagList.TagTreeResources.class ) ; com.google.gwt.user.cellview.client.CellTree display = new com.google.gwt.user.cellview.client.CellTree ( modelProvider , null , res ) ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; modelProvider.setDisplay ( display ) ; return display ; }

Target:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.TagModelProvider modelProvider ) { com.google.gwt.user.cellview.client.CellTree display = new org.ovirt.engine.ui.common.widget.tree.ElementIdCellTree < org.ovirt.engine.ui.webadmin.uicommon.model.TagModelProvider > ( modelProvider , null , org.ovirt.engine.ui.webadmin.widget.tags.TagList.res ) ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }
Source:
private void retryCall ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request , final org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = new org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking ( request , call , new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryContext ( policy ) , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.getTimeout ( this . policy.getRetryTimeOut ( ) , this . policy.getTimeUnit ( ) ) , this . client , ( ( request.getMethod ( ) ) != "Host.ping" ) ) ; this . tracker.registerTrackingRequest ( request , tracking ) ; }

Target:
private void retryCall ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request , final org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = new org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking ( request , call , new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryContext ( policy ) , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.getTimeout ( this . policy.getRetryTimeOut ( ) , this . policy.getTimeUnit ( ) ) , this . client , ( ! ( java.util.Objects.equals ( request.getMethod ( ) , "Host.ping" ) ) ) ) ; this . tracker.registerTrackingRequest ( request , tracking ) ; }
Source:
public void testMigrateNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVM" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } ) ) ; verifyActionResponse ( resource.migrate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testMigrateNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } ) ) ; verifyActionResponse ( resource.migrate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
private void UpdateActionAvailability ( ) { getNewCommand ( ) . setIsExecutionAllowed ( ( ( getSelectedItem ( ) ) != null ) ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( getSelectedItem ( ) . getType ( ) ) == ( TagModelType.Regular ) ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( getSelectedItem ( ) . getType ( ) ) == ( TagModelType.Regular ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { getNewCommand ( ) . setIsExecutionAllowed ( ( ( getSelectedItem ( ) ) != null ) ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( getSelectedItem ( ) . getType ( ) ) == ( TagModelType.Regular ) ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( getSelectedItem ( ) . getType ( ) ) == ( TagModelType.Regular ) ) ) ) ; }
Source:
public void testIsNotHeHostWithVmCountOfZeroAndNoHeVmAssigned ( ) { final int vmCount = 0 ; final boolean isHostedEngine = false ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.Assert.assertFalse ( isHostedEngineHost ) ; }

Target:
public void testIsNotHeHostWithVmCountOfZeroAndNoHeVmAssigned ( ) { final int vmCount = 0 ; final boolean isHostedEngine = false ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( isHostedEngineHost ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryDumpDisk ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) != ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryDumpDisk ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) != ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateForImage ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { return null ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) ) . values ( ) ; return ! ( templates.isEmpty ( ) ) ? templates.iterator ( ) . next ( ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateForImage ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { return null ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getImageId ( ) ) . values ( ) ; return ! ( templates.isEmpty ( ) ) ? templates.iterator ( ) . next ( ) : null ; }
Source:
public void testDisksUsagesWithNullEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }

Target:
public void testDisksUsages ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.initDisksUsageData ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , map ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; returnValue = false ; } if ( returnValue && ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { AddErrorMessages ( VdcBllMessages.VAR__ACTION__ACTIVATE , VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; returnValue = false ; } if ( returnValue && ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { AddErrorMessages ( VdcBllMessages.VAR__ACTION__ACTIVATE , VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; returnValue = false ; } return returnValue ; }
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { java.lang.String data = event.getData ( NetworkItemPanel.SETUP_NETWORKS_DATA ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , null , isDrop ) ) { animatedPanel.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }

Target:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { java.lang.String data = event.getData ( NetworkItemPanel.SETUP_NETWORKS_DATA ) ; java.lang.String type = event.getData ( NetworkItemPanel.SETUP_NETWORKS_TYPE ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , type , null , null , isDrop ) ) { animatedPanel.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }
Source:
private static java.lang.String getDeviceType ( java.util.Map device ) { return ( ( java.lang.String ) ( device.get ( VdsProperties.Device ) ) ) ; }

Target:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = ( ( java.lang.String ) ( device.get ( VdsProperties.Device ) ) ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }
Source:
public boolean isMonitoringNeeded ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) || ( ( vds.getVmCount ( ) ) > 0 ) ; }

Target:
public boolean isMonitoringNeeded ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) || ( ( vds.getVmCount ( ) ) > 0 ) ) || ( ( ( vds.getNonOperationalReason ( ) ) != null ) && ( vds.getNonOperationalReason ( ) . shouldCollectStats ( ) ) ) ; }