auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > volumeOptionsEnabled = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( volume.getOptions ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = volumeOptionsEnabled ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } if ( ( filteredOptions.size ( ) ) > 0 ) { return true ; } return false ; }

Target:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > volumeOptionsEnabled = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( volume.getOptions ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = volumeOptionsEnabled ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } return ! ( filteredOptions.isEmpty ( ) ) ; }
Source:
private boolean handleLibvirtSecrets ( org.ovirt.engine.core.bll.context.CommandContext cmdContext , org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( poolId ) ; if ( ( ! ( libvirtSecrets.isEmpty ( ) ) ) && ( ! ( registerLibvirtSecretsImpl ( vds , libvirtSecrets , false ) ) ) ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.log.error ( "Failed to register libvirt secret on vds {}." , vds.getName ( ) ) ; setNonOperational ( cmdContext , vds.getId ( ) , NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE ) ; return false ; } return true ; }

Target:
private boolean handleLibvirtSecrets ( org.ovirt.engine.core.bll.context.CommandContext cmdContext , org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( poolId ) ; if ( ( ! ( libvirtSecrets.isEmpty ( ) ) ) && ( ! ( registerLibvirtSecretsImpl ( vds , libvirtSecrets ) ) ) ) { org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.log.error ( "Failed to register libvirt secret on vds {}." , vds.getName ( ) ) ; setNonOperational ( cmdContext , vds.getId ( ) , NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE ) ; return false ; } return true ; }
Source:
public void ipChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void ipChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; if ( useCopyImages ) { moveOrCopyAllImageGroups ( ) ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.lockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; if ( useCopyImages ) { moveOrCopyAllImageGroups ( ) ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { addNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { addDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { addDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { tagModelProvider.getSelectionModel ( ) . setSelected ( tagModelProvider.getModel ( ) . getRootNode ( ) , true ) ; tagModelProvider.getModel ( ) . executeCommand ( tagModelProvider.getModel ( ) . getNewCommand ( ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { tagModelProvider.getModel ( ) . getSelectionModel ( ) . setSelected ( tagModelProvider.getModel ( ) . getRootNode ( ) , true ) ; tagModelProvider.getModel ( ) . executeCommand ( tagModelProvider.getModel ( ) . getNewCommand ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } throw new java.lang.IllegalArgumentException ( ( "Unable to find network attachment for network id " + networkId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } return null ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( vds.getDynamicData ( ) , vds.getstatus ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; return null ; }
Source:
void addItems ( org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel model ) { listPanel.clear ( ) ; for ( final org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel itemModel : ( ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel > ) ( model.getItems ( ) ) ) ) { org.ovirt.engine.ui.common.widget.uicommon.popup.quota.ChangeQuotaItemView itemView = new org.ovirt.engine.ui.common.widget.uicommon.popup.quota.ChangeQuotaItemView ( constants ) ; itemView.edit ( itemModel ) ; listPanel.add ( itemView ) ; } }

Target:
void addItems ( org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel model ) { listPanel.clear ( ) ; for ( final org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel itemModel : ( ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel > ) ( model.getItems ( ) ) ) ) { org.ovirt.engine.ui.common.widget.uicommon.popup.quota.ChangeQuotaItemView itemView = new org.ovirt.engine.ui.common.widget.uicommon.popup.quota.ChangeQuotaItemView ( ) ; itemView.edit ( itemModel ) ; listPanel.add ( itemView ) ; } }
Source:
private void checkFloat ( ) { checkNumeric ( ) ; if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.DECIMAL_FLOAT ) ) { } else if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.HEXADECIMAL_FLOAT ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.PARENTHESES , org.ovirt.engine.core.compat.FormatterJava.Flags.GROUP ) ; } else if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.SCIENTIFIC ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.GROUP ) ; } else if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.GENERAL ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.ALTERNATE ) ; } }

Target:
private void checkFloat ( ) { checkNumeric ( ) ; if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.HEXADECIMAL_FLOAT ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.PARENTHESES , org.ovirt.engine.core.compat.FormatterJava.Flags.GROUP ) ; } else if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.SCIENTIFIC ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.GROUP ) ; } else if ( ( c ) == ( org.ovirt.engine.core.compat.FormatterJava.Conversion.GENERAL ) ) { checkBadFlags ( org.ovirt.engine.core.compat.FormatterJava.Flags.ALTERNATE ) ; } }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , org.ovirt.engine.core.sso.servlets.OpenIdUtils.getJson ( buildResponse ( request ) ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonDataWithMessage ( response , SsoConstants.ERR_CODE_SERVER_ERROR , ex ) ; } }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { try { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , org.ovirt.engine.core.sso.servlets.OpenIdUtils.getJson ( buildResponse ( request ) ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonDataWithMessage ( request , response , SsoConstants.ERR_CODE_SERVER_ERROR , ex ) ; } }
Source:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = new java.util.ArrayList < > ( ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByStoragePoolGuid ( storagePoolUUID ) ) . thenReturn ( quotaList ) ; org.mockito.Mockito.when ( quotaDao.isQuotaInUse ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Quota.class ) ) ) . thenReturn ( false ) ; }

Target:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = new java.util.ArrayList < > ( ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByStoragePoolGuid ( storagePoolUUID ) ) . thenReturn ( quotaList ) ; org.mockito.Mockito.when ( quotaDao.isQuotaInUse ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( false ) ; }
Source:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( ( ( T ) ( result.getActionReturnValue ( ) ) ) ) ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.handleError ( e , false ) ; } }

Target:
protected < T > Q resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver ) { try { return entityResolver.resolve ( result.getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.handleError ( e , false ) ; } }
Source:
public void getVmTemplateWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmtGuid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.Assert.assertNotNull ( t ) ; }

Target:
public void getVmTemplateWithVm ( ) { b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmtGuid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.Assert.assertNotNull ( t ) ; }
Source:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }
Source:
protected boolean allowedStorageDomain ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { boolean isTemplate = isTemplateDisk ( diskImage ) ; if ( isTemplate && ( sourceActiveStorageDomains.contains ( sd ) ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , diskImage , templateDisk , sd ) ; }

Target:
protected boolean allowedStorageDomain ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { boolean isTemplate = isTemplateDisk ( diskImage ) ; if ( isTemplate && ( sourceActiveStorageDomains.contains ( sd ) ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , diskImage , templateDisk , sd ) ; }
Source:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cluster ) ; java.lang.String name = cluster.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.CLUSTER_ID , VdcObjectType.Cluster ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cluster ) ; java.lang.String name = cluster.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.CLUSTER_ID , VdcObjectType.Cluster ) ) ; }
Source:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeReadAndReturnMap ( procedureName , mapper , parameterSource ) ; java.util.List < ? > resultList = ( ( java.util.List < ? > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; return resultList != null ? ( ( java.util.List < T > ) ( resultList ) ) : null ; }

Target:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeReadAndReturnMap ( procedureName , mapper , parameterSource ) ; return ( ( java.util.List < T > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , setNetwork ( nic , entity ) , ( nic.isSetNetwork ( ) ? entity.getNetworkName ( ) : null ) , ( nic.isSetPortMirroring ( ) ? entity.isPortMirroring ( ) : false ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , entity ) ; }
Source:
public static < M extends org.ovirt.engine.ui.uicommonweb.models.SearchableListModel > M getMainListModel ( org.ovirt.engine.ui.uicommonweb.models.CommonModel commonModel , java.lang.Class < M > mainModelClass ) { assert commonModel != null : "CommonModel must not be null" ; for ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel list : commonModel.getItems ( ) ) { if ( ( list != null ) && ( list.getClass ( ) . equals ( mainModelClass ) ) ) { return ( ( M ) ( list ) ) ; } } throw new java.lang.IllegalStateException ( ( ( "Cannot resolve main list model [" + mainModelClass ) + "]" ) ) ; }

Target:
public static < M extends org.ovirt.engine.ui.uicommonweb.models.SearchableListModel > M getMainListModel ( org.ovirt.engine.ui.uicommonweb.models.CommonModel commonModel , java.lang.Class < M > mainModelClass ) { if ( commonModel == null ) { return null ; } for ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel list : commonModel.getItems ( ) ) { if ( ( list != null ) && ( list.getClass ( ) . equals ( mainModelClass ) ) ) { return ( ( M ) ( list ) ) ; } } throw new java.lang.IllegalStateException ( ( ( "Cannot resolve main list model [" + mainModelClass ) + "]" ) ) ; }
Source:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworks ) { networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }

Target:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworks ) { networkModels.put ( network.getName ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; }
Source:
public void failWhenStartupTimeoutHasNotPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; mcr.mockConfigValue ( ConfigValues.DisableFenceAtStartupInSec , 5 ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( new java.util.Date ( ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL" , messages.get ( 0 ) ) ; org.junit.Assert.assertFalse ( result ) ; }

Target:
public void failWhenStartupTimeoutHasNotPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( new java.util.Date ( ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL" , messages.get ( 0 ) ) ; org.junit.Assert.assertFalse ( result ) ; }
Source:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }

Target:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }
Source:
public org.ovirt.engine.sdk.entities.Action setupnetworks ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + "setupnetworks" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action setupnetworks ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + "setupnetworks" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean vmAssignedToUser = false ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { vmAssignedToUser = true ; if ( messages != null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; } } return vmAssignedToUser ; }

Target:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; return true ; } return false ; }
Source:
public void nGuidGuidCtorNullGuid ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }

Target:
public void nGuidGuidCtorNullGuid ( ) { b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , null ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; final org.ovirt.engine.core.compat.Guid gu = b.getVmId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , gu ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.VnicProfileValidator validator = new org.ovirt.engine.core.bll.validator.VnicProfileValidator ( vmDao , org.ovirt.engine.core.bll.network.vm.RemoveVnicProfileCommand.getVnicProfile ( ) ) ; return ( ( ( validate ( validator.vnicProfileIsSet ( ) ) ) && ( validate ( validator.vnicProfileExists ( ) ) ) ) && ( validate ( validator.vnicProfileNotUsedByVms ( ) ) ) ) && ( validate ( validator.vnicProfileNotUsedByTemplates ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.VnicProfileValidator validator = new org.ovirt.engine.core.bll.validator.VnicProfileValidator ( vmDao , org.ovirt.engine.core.bll.network.vm.RemoveVnicProfileCommand.getVnicProfile ( ) ) ; return ( ( ( validate ( validator.vnicProfileIsSet ( ) ) ) && ( validate ( validator.vnicProfileExists ( ) ) ) ) && ( validate ( validator.vnicProfileNotUsedByVms ( ) ) ) ) && ( validate ( validator.vnicProfileNotUsedByTemplates ( ) ) ) ; }
Source:
private void updateOptionsLocalFSData ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getLocalStorageHost ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; clusterGuideModel.localStorageHost = localStorageHost ; clusterGuideModel.updateOptionsLocalFS ( ) ; } } ) , dataCenter.getName ( ) ) ; }

Target:
private void updateOptionsLocalFSData ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getLocalStorageHost ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; clusterGuideModel.localStorageHost = localStorageHost ; clusterGuideModel.updateOptionsLocalFS ( ) ; } } ) , dataCenter.getName ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( violatingEntityId , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }
Source:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { if ( ! smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }

Target:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; if ( ! smartcardEnabled ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else if ( vmDevices.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "SEVERITY" ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.AuditLogSeverity.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "TIME" ) ) { return new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else { return null ; } }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "SEVERITY" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.AuditLogSeverity.class ) ; } else if ( "TIME" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else { return null ; } }
Source:
protected org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig getConfig ( ) { if ( ( config ) != null ) { config = new org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) , getOptions ( ) . getHost ( ) ) ; } return config ; }

Target:
protected org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig getConfig ( ) { if ( ( config ) == null ) { config = new org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) , getOptions ( ) . getHost ( ) ) ; } return config ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) . getValue ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) , unitVmModel.getIsNew ( ) ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) , unitVmModel ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }
Source:
public void testGetIdsForOvfDeletionOneToDelete ( ) { org.ovirt.engine.core.dao.VmDao vmDao = dbFacade.getVmDao ( ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = vmAndTemplatesGenerationsDao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "there should be 1 ovf for deletion" , 1 , guidsToDelete.size ( ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain the expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; }

Target:
public void testGetIdsForOvfDeletionOneToDelete ( ) { vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = vmAndTemplatesGenerationsDao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "there should be 1 ovf for deletion" , 1 , guidsToDelete.size ( ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain the expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap < java.lang.String , java.lang.String > ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap < java.lang.String , java.lang.String > ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) , ( ( cluster.supportsGlusterService ( ) ) && ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil.isStopGlusterProcessesSupported ( cluster.getCompatibilityVersion ( ) ) ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) , cluster.supportsGlusterService ( ) ) ; } }
Source:
public void testValidateNotRemovingUsedNetworkByVmsWhenNotUsedByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ) ; org.mockito.Mockito.when ( findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.validateNotRemovingUsedNetworkByVms ( "removedNet" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateNotRemovingUsedNetworkByVmsWhenNotUsedByVms ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ) ; org.junit.Assert.assertThat ( validator.validateNotRemovingUsedNetworkByVms ( "removedNet" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.String > getAllVmProperties ( ) { java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.String > allVmPropertiesString = new java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > entry : allVmProperties.entrySet ( ) ) { allVmPropertiesString.put ( entry.getKey ( ) , convertProperties ( entry.getValue ( ) ) ) ; } return allVmPropertiesString ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > getAllVmProperties ( ) { return allVmProperties ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.eq ( cluster2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.eq ( cluster2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected boolean isPayloadExists ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { if ( ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPayload ( ) ) != null ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPayload ( ) . getDeviceType ( ) . equals ( deviceType ) ) ) { return true ; } return false ; }

Target:
protected boolean isPayloadExists ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { return ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPayload ( ) ) != null ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPayload ( ) . getDeviceType ( ) . equals ( deviceType ) ) ; }