auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.core.common.businessentities.VmDynamic dynamicVm ) { org.easymock.classextension.EasyMock.expect ( entity.getQueryableId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.VM_ID ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getDynamicData ( ) ) . andReturn ( dynamicVm ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getAppList ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.getAppList ( ) ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.core.common.businessentities.VmDynamic dynamicVm ) { org.easymock.EasyMock.expect ( entity.getQueryableId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.VM_ID ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDynamicData ( ) ) . andReturn ( dynamicVm ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getAppList ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.getAppList ( ) ) . anyTimes ( ) ; return entity ; }
Source:
public static org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategy returnedStrategy = org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategyFactory.virtMonitoringStrategy ; org.ovirt.engine.core.compat.Guid clusterId = vds.getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategyFactory.clusterDao.get ( clusterId ) ; if ( ( cluster.supportsVirtService ( ) ) && ( cluster.supportsGlusterService ( ) ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategyFactory.multipleMonitoringStrategy ; } else if ( cluster.supportsVirtService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategyFactory.virtMonitoringStrategy ; } else if ( cluster.supportsGlusterService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategyFactory.glusterMonitoringStrategy ; } return returnedStrategy ; }

Target:
public org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( vds.getClusterId ( ) ) ; if ( ( cluster.supportsVirtService ( ) ) && ( cluster.supportsGlusterService ( ) ) ) { return multipleMonitoringStrategy ; } if ( cluster.supportsVirtService ( ) ) { return virtMonitoringStrategy ; } if ( cluster.supportsGlusterService ( ) ) { return glusterMonitoringStrategy ; } return virtMonitoringStrategy ; }
Source:
private void setupNetworkValidator ( boolean valid ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.NetworkValidator.class ) ; org.mockito.Mockito.when ( validator.canNetworkCompatabilityBeDecreased ( ) ) . thenReturn ( valid ) ; org.mockito.Mockito.when ( cmd.getNetworkValidator ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validator ) ; }

Target:
private void setupNetworkValidator ( boolean valid ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.NetworkValidator.class ) ; org.mockito.Mockito.when ( validator.canNetworkCompatibilityBeDecreased ( ) ) . thenReturn ( valid ) ; org.mockito.Mockito.when ( cmd.getNetworkValidator ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validator ) ; }
Source:
private com.google.gwt.user.client.ui.IsWidget createSlavesAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > slaves = getEntity ( ) . getInterfaces ( ) ; slavesExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( org.ovirt.engine.ui.webadmin.widget.host.HostNetworkInterfaceBondedListViewItem.messages.slaves ( slaves.size ( ) ) ) ; getClickHandlerRegistrations ( ) . add ( slavesExpand.addClickHandler ( this ) ) ; panel.add ( slavesExpand ) ; return panel ; }

Target:
private com.google.gwt.user.client.ui.IsWidget createSlavesAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > slaves = getEntity ( ) . getInterfaces ( ) ; slavesExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.webadmin.widget.host.HostNetworkInterfaceBondedListViewItem.messages.slaves ( slaves.size ( ) ) ) ) ; getClickHandlerRegistrations ( ) . add ( slavesExpand.addClickHandler ( this ) ) ; panel.add ( slavesExpand ) ; return panel ; }
Source:
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.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getNetworkList ( 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.permissions > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.permissions entity : entities ) { if ( ( entity.getObjectType ( ) ) != ( org.ovirt.engine.core.common.VdcObjectType.System ) ) { org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getad_element_id ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } } return collection ; }

Target:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.Set < org.ovirt.engine.core.common.businessentities.permissions > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.permissions entity : entities ) { castEveryonePermissionsToUser ( entity ) ; org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getad_element_id ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc glusterVolumeRebalanceStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.rebalanceStatus" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturn glusterVolumeRebalanceStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.rebalanceStatus" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturn ( response ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice rngDevice = getRngDevices ( ) . get ( 0 ) ; rngDevice.setSpecParams ( getParameters ( ) . getRngDevice ( ) . generateSpecParams ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( rngDevice ) ; setSucceeded ( true ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( isRngSupportedByCluster ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }
Source:
protected org.ovirt.engine.api.model.SSHPublicKeys mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.UserProfile > entities ) { org.ovirt.engine.api.model.SSHPublicKeys collection = new org.ovirt.engine.api.model.SSHPublicKeys ( ) ; for ( org.ovirt.engine.core.common.businessentities.UserProfile entity : entities ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getSshPublicKey ( ) ) ) ) { collection.getSSHPublicKeys ( ) . add ( addParents ( addLinks ( map ( entity ) ) ) ) ; } } return collection ; }

Target:
protected org.ovirt.engine.api.model.SshPublicKeys mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.UserProfile > entities ) { org.ovirt.engine.api.model.SshPublicKeys collection = new org.ovirt.engine.api.model.SshPublicKeys ( ) ; for ( org.ovirt.engine.core.common.businessentities.UserProfile entity : entities ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getSshPublicKey ( ) ) ) ) { collection.getSshPublicKeys ( ) . add ( addParents ( addLinks ( map ( entity ) ) ) ) ; } } return collection ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Vm > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.Vm vm : collection ) { org.junit.Assert.assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Vm > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.Vm vm : collection ) { org.junit.jupiter.api.Assertions.assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }
Source:
private void initTableColumns ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getServerName ( ) ; } } , constants.sourceGlusterHook ( ) ) ; contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelEnumColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus getEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getStatus ( ) ; } } , constants.statusGlusterHook ( ) ) ; }

Target:
private void initTableColumns ( ) { contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.sourceGlusterHook ( ) ) ; contentSourcesTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelEnumColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus getEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity ) { return entity.getStatus ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.GlusterHookResolveConflictsPopupView.constants.statusGlusterHook ( ) ) ; }
Source:
private boolean noChangesDetected ( ) { return ( ( ( ( getNetworks ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBonds ( ) . isEmpty ( ) ) ) && ( getRemovedUnmanagedNetworks ( ) . isEmpty ( ) ) ; }

Target:
private void clearLabelsFromRemovedBonds ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsToConfigureByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingBondToRemove : getRemovedBonds ( ) ) { nicsToConfigureByName.get ( existingBondToRemove.getName ( ) ) . setLabels ( null ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { org.ovirt.engine.core.bll.ValidationResult result = validatePluginType ( ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } result = validateAuthentication ( ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } return super . validateAddProvider ( ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { org.ovirt.engine.core.bll.ValidationResult pluginTypeValidation = validatePluginType ( ) ; if ( ! ( pluginTypeValidation.isValid ( ) ) ) { return pluginTypeValidation ; } org.ovirt.engine.core.bll.ValidationResult authValidation = validateAuthentication ( ) ; if ( ! ( authValidation.isValid ( ) ) ) { return authValidation ; } return super . validateAddProvider ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStatisticsDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setVdsGroupId ( existingVds.getVdsGroupId ( ) ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStatisticsDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setVdsGroupId ( existingVds.getVdsGroupId ( ) ) ; newStaticVds.setProtocol ( VdsProtocol.STOMP ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }
Source:
private com.google.gwt.safehtml.shared.SafeHtml toUnorderedList ( java.util.List < java.lang.String > stringItems ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder builder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String stringItem : stringItems ) { builder.append ( templates.listItem ( stringItem ) ) ; } return templates.unorderedList ( builder.toSafeHtml ( ) ) ; }

Target:
public void markAsValid ( ) { super . markAsValid ( ) ; errorMessage.setVisible ( false ) ; getValidatedWidgetStyle ( ) . setBorderColor ( "transparent" ) ; }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createAllSnapshotsFromVmParameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , "stateless snapshot" ) ; createAllSnapshotsFromVmParameters.setShouldBeLogged ( false ) ; createAllSnapshotsFromVmParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; createAllSnapshotsFromVmParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; createAllSnapshotsFromVmParameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; createAllSnapshotsFromVmParameters.setSnapshotType ( SnapshotType.STATELESS ) ; return createAllSnapshotsFromVmParameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.RunVmCommand.STATELESS_SNAPSHOT_DESCRIPTION ) ; parameters.setShouldBeLogged ( false ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; parameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; parameters.setSnapshotType ( SnapshotType.STATELESS ) ; return parameters ; }
Source:
public void CloneRole ( ) { commandType = org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel.CommandType.Clone ; org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( getSelectedItem ( ) ) ) ; InitRoleDialog ( role ) ; }

Target:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } cancel ( ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
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 ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
private boolean isCompatibleAgentExists ( java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > fenceAgents , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.util.List < java.lang.String > messages ) { for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : fenceAgents ) { if ( isFenceAgentVersionCompatible ( agent , vdsGroup.getcompatibility_version ( ) . toString ( ) , messages ) ) { return true ; } } return false ; }

Target:
private boolean isCompatibleAgentExists ( java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > fenceAgents , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.util.List < java.lang.String > messages ) { for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : fenceAgents ) { if ( isFenceAgentVersionCompatible ( agent , vdsGroup.getCompatibilityVersion ( ) . toString ( ) , messages ) ) { return true ; } } return false ; }
Source:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) ) { @ java.lang.Override protected void executeCommand ( ) { } } ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }

Target:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = mockScheduler ( ) ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }
Source:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( storage.getSelectedItem ( ) ) ) ) ; } } return importData ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( storage.getSelectedItem ( ) ) ) ) ; } } return importData ; }
Source:
private boolean evaluateHostUpgradeInternalCommandProgress ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds , org.ovirt.engine.core.bll.CommandBase < ? > rootCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity upgradeCommand = getHostUpgradeInternalCommand ( childCmdIds ) ; if ( upgradeCommand == null ) { return false ; } switch ( upgradeCommand.getCommandStatus ( ) ) { case ACTIVE : case NOT_STARTED : case FAILED : case FAILED_RESTARTED : case UNKNOWN : rootCommand.setCommandStatus ( CommandStatus.FAILED ) ; return true ; case SUCCEEDED : rootCommand.setCommandStatus ( CommandStatus.SUCCEEDED ) ; return true ; } return true ; }

Target:
private boolean evaluateHostUpgradeInternalCommandProgress ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds , org.ovirt.engine.core.bll.CommandBase < ? > rootCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity upgradeCommand = getHostUpgradeInternalCommand ( childCmdIds ) ; if ( upgradeCommand == null ) { return false ; } switch ( upgradeCommand.getCommandStatus ( ) ) { case ACTIVE : case NOT_STARTED : return false ; case FAILED : case FAILED_RESTARTED : case ENDED_WITH_FAILURE : case UNKNOWN : rootCommand.setCommandStatus ( CommandStatus.FAILED ) ; return true ; case SUCCEEDED : case ENDED_SUCCESSFULLY : rootCommand.setCommandStatus ( CommandStatus.SUCCEEDED ) ; return true ; } return true ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "vds::Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getvds_name ( ) ) ; } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getvds_name ( ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_pool setUpStoragePool ( int index ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = control.createMock ( org.ovirt.engine.core.common.businessentities.storage_pool.class ) ; org.ovirt.engine.api.model.Version version = new org.ovirt.engine.api.model.Version ( 2 , 2 ) ; if ( index != ( - 1 ) ) { org.easymock.classextension.EasyMock.expect ( pool.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; } org.easymock.classextension.EasyMock.expect ( pool.getcompatibility_version ( ) ) . andReturn ( version ) . anyTimes ( ) ; return pool ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StoragePool setUpStoragePool ( int index ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = control.createMock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.ovirt.engine.api.model.Version version = new org.ovirt.engine.api.model.Version ( 2 , 2 ) ; if ( index != ( - 1 ) ) { org.easymock.classextension.EasyMock.expect ( pool.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; } org.easymock.classextension.EasyMock.expect ( pool.getcompatibility_version ( ) ) . andReturn ( version ) . anyTimes ( ) ; return pool ; }
Source:
public void validateMultiDisksWithNotEnoughSpaceOnDomains ( ) { mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , 95 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void validateDomainNotWithinThreshold ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
public void testDoGet_ExistingFile ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/ui/frontend/server/gwt/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . getFile ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }

Target:
public void testDoGet_ExistingFile ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/utils/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . getFile ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }
Source:
public void testGetByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertNotNull ( snapshots ) ; org.junit.Assert.assertEquals ( 2 , snapshots.size ( ) ) ; org.junit.Assert.assertTrue ( snapshots.contains ( existingSnapshot ) ) ; }

Target:
public void testGetByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( snapshots ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , snapshots.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( snapshots.contains ( existingSnapshot ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Bond createBond ( org.ovirt.engine.core.compat.Guid id , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves ) { org.ovirt.engine.core.common.businessentities.network.Bond result = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; result.setId ( id ) ; result.setName ( bondName ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave : slaves ) { slave.setBondName ( bondName ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.action.CreateOrUpdateBond createBond ( org.ovirt.engine.core.compat.Guid id , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves ) { org.ovirt.engine.core.common.action.CreateOrUpdateBond result = new org.ovirt.engine.core.common.action.CreateOrUpdateBond ( ) ; result.setId ( id ) ; result.setName ( bondName ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave : slaves ) { result.getSlaves ( ) . add ( slave.getName ( ) ) ; } return result ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }
Source:
protected void verifyBuiltVmBase ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { verifyBuiltCommonVm ( vm ) ; verifyBuiltKernelOptions ( vm ) ; verifyBuiltMigrationOptions ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.HOST_ID , vm.getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.VM_NAME , vm.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.USB_POLICY , vm.getUsbPolicy ( ) ) ; }

Target:
protected void verifyBuiltVmBase ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { verifyBuiltCommonVm ( vm ) ; verifyBuiltKernelOptions ( vm ) ; verifyBuiltMigrationOptions ( vm ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.HOST_ID , vm.getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.VM_NAME , vm.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.USB_POLICY , vm.getUsbPolicy ( ) ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > getPayloadForToken ( java.lang.String token ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SSOOAuthServiceUtils.getTokenInfo ( token ) ; org.ovirt.engine.core.aaa.filters.FiltersHelper.isStatusOk ( response ) ; response.put ( SessionConstants.SSO_TOKEN_KEY , token ) ; return response ; }

Target:
public static java.util.Map < java.lang.String , java.lang.Object > getPayloadForToken ( java.lang.String token ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SsoOAuthServiceUtils.getTokenInfo ( token ) ; org.ovirt.engine.core.aaa.filters.FiltersHelper.isStatusOk ( response ) ; response.put ( SessionConstants.SSO_TOKEN_KEY , token ) ; return response ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > getJobSubjectEntityByJobId ( org.ovirt.engine.core.compat.Guid jobId ) { java.util.List < org.ovirt.engine.core.common.job.JobSubjectEntity > list = multipleResults ( entityManager.createNamedQuery ( "JobSubjectEntity.getJobSubjectEntityByJobId" , org.ovirt.engine.core.common.job.JobSubjectEntity.class ) . setParameter ( "jobId" , jobId ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.common.job.JobSubjectEntity jobSubjectEntity : list ) { entityMap.put ( jobSubjectEntity.getEntityId ( ) , jobSubjectEntity.getEntityType ( ) ) ; } return entityMap ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > getJobSubjectEntityByJobId ( org.ovirt.engine.core.compat.Guid jobId ) { java.util.List < org.ovirt.engine.core.common.job.JobSubjectEntity > list = multipleResults ( getEntityManager ( ) . createNamedQuery ( "JobSubjectEntity.getJobSubjectEntityByJobId" , org.ovirt.engine.core.common.job.JobSubjectEntity.class ) . setParameter ( "jobId" , jobId ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.common.job.JobSubjectEntity jobSubjectEntity : list ) { entityMap.put ( jobSubjectEntity.getEntityId ( ) , jobSubjectEntity.getEntityType ( ) ) ; } return entityMap ; }
Source:
public void setup ( ) { try { org.quartz.SchedulerFactory sf = new org.quartz.impl.StdSchedulerFactory ( ) ; sched = sf.getScheduler ( ) ; sched.start ( ) ; sched.getListenerManager ( ) . addJobListener ( new org.ovirt.engine.core.utils.timer.FixedDelayJobListener ( this ) , org.quartz.impl.matchers.GroupMatcher.jobGroupEquals ( Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "there is a problem with the underlying Scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }

Target:
public void setup ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.instance = this ; try { org.quartz.SchedulerFactory sf = new org.quartz.impl.StdSchedulerFactory ( ) ; sched = sf.getScheduler ( ) ; sched.start ( ) ; sched.getListenerManager ( ) . addJobListener ( new org.ovirt.engine.core.utils.timer.FixedDelayJobListener ( this ) , org.quartz.impl.matchers.GroupMatcher.jobGroupEquals ( Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "there is a problem with the underlying Scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setStorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setStorageType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setStorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setStorageType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { removeEntry ( item ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { ( ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget < M , T , V > . AddRemoveRowPanel ) ( widget.getParent ( ) ) ) . swapButton ( createButton ( item ) ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }
Source:
public void deleteCompletedJobs ( final java.util.Date succeededJobs , final java.util.Date failedJobs ) { updateQuery ( entityManager.createNamedQuery ( "Job.deleteCompletedJobs" ) . setParameter ( "successEndTime" , succeededJobs ) . setParameter ( "failedEndTime" , failedJobs ) . setParameter ( "failStatus" , java.util.EnumSet.of ( JobExecutionStatus.FAILED , JobExecutionStatus.ABORTED , JobExecutionStatus.UNKNOWN ) ) . setParameter ( "successStatus" , JobExecutionStatus.FINISHED ) ) ; }

Target:
public void deleteCompletedJobs ( final java.util.Date succeededJobs , final java.util.Date failedJobs ) { updateQuery ( getEntityManager ( ) . createNamedQuery ( "Job.deleteCompletedJobs" ) . setParameter ( "successEndTime" , succeededJobs ) . setParameter ( "failedEndTime" , failedJobs ) . setParameter ( "failStatus" , java.util.EnumSet.of ( JobExecutionStatus.FAILED , JobExecutionStatus.ABORTED , JobExecutionStatus.UNKNOWN ) ) . setParameter ( "successStatus" , JobExecutionStatus.FINISHED ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.image ( imageHtml ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.volumeActivityMenu ( imageHtml ) ) ; }
Source:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { super . search ( ) ; } }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVnicProfilesByNetworkId ( asyncQuery , getEntity ( ) . getId ( ) ) ; }