auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object a : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( a ) ) ; pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( network.getstorage_pool_id ( ) . getValue ( ) , network ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; sourceListModel.setConfirmWindow ( null ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object a : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( a ) ) ; pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( network.getstorage_pool_id ( ) . getValue ( ) , network ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; sourceListModel.setConfirmWindow ( null ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }
Source:
private void extractBondSlave ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = bonds.get ( iface.getBondName ( ) ) ; if ( slaves == null ) { slaves = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; bonds.put ( iface.getBondName ( ) , slaves ) ; } slaves.add ( iface ) ; }

Target:
private void extractBondSlave ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = bonds.get ( iface.getBondName ( ) ) ; if ( slaves == null ) { slaves = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; bonds.put ( iface.getBondName ( ) , slaves ) ; } slaves.add ( iface ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( ActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalAction ( ActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { runInternalAction ( ActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( result ) ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }
Source:
protected java.lang.String getText ( org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > entity ) { return ( entity.getSecond ( ) . getDescription ( ) ) == null ? org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupView.constants.notAvailableLabel ( ) : entity.getSecond ( ) . getDescription ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > > object ) { return ( object.getEntity ( ) . getSecond ( ) . getDescription ( ) ) == null ? org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupView.constants.notAvailableLabel ( ) : object.getEntity ( ) . getSecond ( ) . getDescription ( ) ; }
Source:
public void moveMacsOfUpdatedCluster ( org.ovirt.engine.core.common.businessentities.Cluster sourceCluster , org.ovirt.engine.core.compat.Guid targetMacPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.Objects.requireNonNull ( sourceCluster ) ; java.util.Objects.requireNonNull ( targetMacPoolId ) ; org.ovirt.engine.core.compat.Guid sourceMacPoolId = sourceCluster.getMacPoolId ( ) ; org.ovirt.engine.core.compat.Guid clusterId = sourceCluster.getId ( ) ; java.util.Objects.requireNonNull ( sourceMacPoolId ) ; java.util.Objects.requireNonNull ( clusterId ) ; if ( needToMigrateMacs ( sourceMacPoolId , targetMacPoolId ) ) { java.util.List < java.lang.String > macsToMigrate = vmNicDao.getAllMacsByClusterId ( clusterId ) ; migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , commandContext ) ; } }

Target:
public void moveMacsOfUpdatedCluster ( org.ovirt.engine.core.common.businessentities.Cluster sourceCluster , org.ovirt.engine.core.compat.Guid targetMacPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.Objects.requireNonNull ( sourceCluster ) ; java.util.Objects.requireNonNull ( targetMacPoolId ) ; org.ovirt.engine.core.compat.Guid sourceMacPoolId = sourceCluster.getMacPoolId ( ) ; org.ovirt.engine.core.compat.Guid clusterId = sourceCluster.getId ( ) ; java.util.Objects.requireNonNull ( sourceMacPoolId ) ; java.util.Objects.requireNonNull ( clusterId ) ; if ( needToMigrateMacs ( sourceMacPoolId , targetMacPoolId ) ) { java.util.List < java.lang.String > macsToMigrate = vmNicDao.getAllMacsByClusterId ( clusterId ) ; migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; } }
Source:
public void tMap_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.statisticssync_3_6.StatisticsSync.TalendException { end_Hash.put ( "tMap_6" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_12_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tMap_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.statisticssync_3_6.StatisticsSync.TalendException { end_Hash.put ( errorComponent , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_12_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected boolean isDataOperationsByHSM ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic targetSd ) { return ( ( org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) && ( ! ( targetSd.getStorageType ( ) . isLocal ( ) ) ) ) && ( targetSd.getStorageDomainType ( ) . isDataDomain ( ) ) ; }

Target:
protected boolean isDataOperationsByHSM ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic targetSd ) { return ( org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) && ( targetSd.getStorageDomainType ( ) . isDataDomain ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskPluggedTo ( ) { if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVmDAO ( ) . getForDisk ( getOldDisk ( ) . getId ( ) ) . get ( java.lang.Boolean.TRUE ) ; if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = java.util.Collections.emptyList ( ) ; } } return vmsDiskPluggedTo ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskPluggedTo ( ) { return vmsDiskPluggedTo ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { if ( ( mImage ) == null ) { org.ovirt.engine.core.common.businessentities.DiskImage image = getDiskImageDao ( ) . get ( getImageId ( ) ) ; if ( image != null ) { mImage = image ; } else { image = getDiskImageDao ( ) . getSnapshotById ( getImageId ( ) ) ; if ( image != null ) { image.setvm_guid ( getImageContainerId ( ) ) ; mImage = image ; } } } return mImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { if ( ( mImage ) == null ) { org.ovirt.engine.core.common.businessentities.DiskImage image = getDiskImageDao ( ) . get ( getImageId ( ) ) ; if ( image != null ) { mImage = image ; } else { image = getDiskImageDao ( ) . getSnapshotById ( getImageId ( ) ) ; if ( image != null ) { mImage = image ; } } } return mImage ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) . getState ( ) , dataCenterStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) , dataCenterStatus ) ; }
Source:
public void testDoGetServeFaviconNotFound ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getCascadingResource ( "favicon" ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }

Target:
public void testDoGetServeFaviconNotFound ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockBrandingManager.getBrandingRootPath ( ) ) . thenReturn ( new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . sendError ( HttpServletResponse.SC_NOT_FOUND ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.NONE ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }

Target:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }
Source:
public void executeQueryCommandWithNull ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.Guid ( "ee655a4d-effc-4aab-be2b-2f80ff40cd1c" ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( java.util.List < ? > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }

Target:
public void executeQueryCommandWithNull ( ) { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( java.util.List < ? > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = qosB ; org.mockito.Mockito.when ( hostNetworkQosDaoMock.get ( qos.getId ( ) ) ) . thenReturn ( qos ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( testIface.isBridged ( ) , testIface.getMtu ( ) , testIface.getVlanId ( ) ) ; calculateNetworkImplementationDetailsAndAssertSync ( testIface , false , qos , network ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = qosB ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( testIface.isBridged ( ) , testIface.getMtu ( ) , testIface.getVlanId ( ) ) ; calculateNetworkImplementationDetailsAndAssertSync ( testIface , false , qos , network ) ; }
Source:
public void testVmDuringMigration ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ) . when ( vmValidator ) . vmNotDuringMigration ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS.name ( ) ) ) ; }

Target:
public void testVmDuringMigration ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ) . when ( vmValidator ) . vmNotDuringMigration ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS.name ( ) ) ) ; }
Source:
public void testDoGet_CalculateMd5_ResourceModifiedEtagResponse ( ) throws java.io.IOException , java.security.NoSuchAlgorithmException , javax.servlet.ServletException { java.lang.String md5sum = "md5sum" ; org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.doReturn ( md5sum ) . when ( testServlet ) . getMd5Sum ( mockRequest ) ; org.mockito.Mockito.when ( mockRequest.getHeader ( GwtDynamicHostPageServlet.IF_NONE_MATCH_HEADER ) ) . thenReturn ( null ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . addHeader ( GwtDynamicHostPageServlet.ETAG_HEADER , md5sum ) ; }

Target:
public void testDoGet_CalculateMd5_ResourceModifiedEtagResponse ( ) throws java.io.IOException , java.security.NoSuchAlgorithmException , javax.servlet.ServletException { java.lang.String md5sum = "md5sum" ; org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.doReturn ( md5sum ) . when ( testServlet ) . getMd5Sum ( mockRequest ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . addHeader ( GwtDynamicHostPageServlet.ETAG_HEADER , md5sum ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackSubnet subnet ) { validateEnums ( org.ovirt.engine.api.model.OpenStackSubnet.class , subnet ) ; org.ovirt.engine.core.common.action.AddExternalSubnetParameters parameters = new org.ovirt.engine.core.common.action.AddExternalSubnetParameters ( ) ; parameters.setSubnet ( map ( subnet ) ) ; parameters.setProviderId ( asGuid ( providerId ) ) ; parameters.setNetworkId ( networkId ) ; return performCreate ( VdcActionType.AddSubnetToProvider , parameters , new org.ovirt.engine.api.restapi.resource.openstack.BackendOpenStackSubnetsResource.SubnetNameResolver ( subnet.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackSubnet subnet ) { org.ovirt.engine.core.common.action.AddExternalSubnetParameters parameters = new org.ovirt.engine.core.common.action.AddExternalSubnetParameters ( ) ; parameters.setSubnet ( map ( subnet ) ) ; parameters.setProviderId ( asGuid ( providerId ) ) ; parameters.setNetworkId ( networkId ) ; return performCreate ( VdcActionType.AddSubnetToProvider , parameters , new org.ovirt.engine.api.restapi.resource.openstack.BackendOpenStackSubnetsResource.SubnetNameResolver ( subnet.getName ( ) ) ) ; }
Source:
private void initVm ( org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid runOnVds , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( vmStatus ) ; vm.setRunOnVds ( runOnVds ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( diskImageId ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; }

Target:
private void initVm ( org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid runOnVds , org.ovirt.engine.core.compat.Guid diskImageId ) { initVm ( vmStatus , runOnVds , diskImageId , true , null , false ) ; }
Source:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public void testCompareToVmIdsAreEqual ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId1 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.compat.Guid deviceId2 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2465" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId1 , vmId ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId2 , vmId ) ; assertCompareTo ( device1 , device2 ) ; }

Target:
public void testCompareToVmIdsAreEqual ( ) { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId1 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.compat.Guid deviceId2 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2465" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId1 , vmId ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId2 , vmId ) ; assertCompareTo ( device1 , device2 ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public static void initDefaultOSes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.defaultOSes = ( ( java.util.HashMap < org.ovirt.engine.core.common.businessentities.ArchitectureType , java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDefaultOSes ) , callback ) ; }

Target:
public static void initDefaultOSes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.defaultOSes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDefaultOSes ) , callback ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) { container.insert ( content , 0 ) ; } else if ( slot == ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.TYPE_SetActionPanel ) ) { if ( content != null ) { container.insert ( content , 0 ) ; this . actionPanel = content ; } else if ( ( this . actionPanel ) != null ) { container.remove ( this . actionPanel ) ; } } else { super . setInSlot ( slot , content ) ; } }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.TYPE_SetActionPanel ) ) { if ( content != null ) { container.insert ( content , 0 ) ; this . actionPanel = content ; } else if ( ( this . actionPanel ) != null ) { container.remove ( this . actionPanel ) ; } } else { super . setInSlot ( slot , content ) ; } }
Source:
private void createVmDiskOnSd ( boolean wipeAfterDelete , boolean passDiscard ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; disk.setId ( diskId ) ; disk.setWipeAfterDelete ( wipeAfterDelete ) ; storageDomainDisks.add ( disk ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , passDiscard ) ) ; }

Target:
private org.ovirt.engine.core.compat.Guid createVmDiskOnSd ( boolean wipeAfterDelete , boolean passDiscard ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; disk.setId ( diskId ) ; disk.setWipeAfterDelete ( wipeAfterDelete ) ; storageDomainDisks.add ( disk ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , passDiscard ) ) ; return diskId ; }
Source:
private boolean validateNames ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( getItems ( ) ) ) ) { if ( ( ! ( importVmData.getClone ( ) . getEntity ( ) ) ) && ( ( importVmData.getError ( ) ) != null ) ) { onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "InvalidVm" ) ) ; return false ; } } return true ; }

Target:
protected boolean validateNames ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData > ) ( getItems ( ) ) ) ) { if ( ( ! ( importVmData.getClone ( ) . getEntity ( ) ) ) && ( ( importVmData.getError ( ) ) != null ) ) { onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "InvalidVm" ) ) ; return false ; } } return true ; }
Source:
private org.ovirt.engine.api.model.GlusterVolume createModel ( ) { org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setName ( "testVol1" ) ; volume.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; volume.getCluster ( ) . setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; volume.setVolumeType ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE.toString ( ) ) ; volume.setBricks ( new org.ovirt.engine.api.model.GlusterBricks ( ) ) ; volume.getBricks ( ) . getGlusterBricks ( ) . add ( createBrick ( "/export/vol1/brick1" ) ) ; return volume ; }

Target:
private org.ovirt.engine.api.model.GlusterVolume createModel ( ) { org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setName ( "testVol1" ) ; volume.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; volume.getCluster ( ) . setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; volume.setVolumeType ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE ) ; volume.setBricks ( new org.ovirt.engine.api.model.GlusterBricks ( ) ) ; volume.getBricks ( ) . getGlusterBricks ( ) . add ( createBrick ( "/export/vol1/brick1" ) ) ; return volume ; }
Source:
public void storagePoolName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStoragePool ( p ) ; final java.lang.String s = b.getStoragePoolName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }

Target:
public void storagePoolName ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStoragePool ( p ) ; final java.lang.String s = b.getStoragePoolName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }
Source:
private void verifyAsyncActionStartedButNotCompleted ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState ) ) ; }

Target:
private void verifyAsyncActionStartedButNotCompleted ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , false ) ) ; }
Source:
public int getCountByTypeAndSeverity ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType type , org.ovirt.engine.core.common.businessentities.Erratum.ErrataSeverity severity ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( ( e.getType ( ) ) == type ) && ( ( e.getSeverity ( ) ) == severity ) ) { count ++ ; } } return count ; }

Target:
public int getCountByTypeAndSeverity ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType type , org.ovirt.engine.core.common.businessentities.Erratum.ErrataSeverity severity ) { if ( ( ( errata ) == null ) || ( errata.isEmpty ( ) ) ) { return 0 ; } int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( ( e.getType ( ) ) == type ) && ( ( e.getSeverity ( ) ) == severity ) ) { count ++ ; } } return count ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) throws org.ovirt.engine.core.common.errors.EngineException { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = getBackendResourceManager ( ) . RunVdsCommand ( commandType , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getVdsError ( ) . getCode ( ) , returnValue.getVdsError ( ) . getMessage ( ) ) ; } return returnValue ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) throws org.ovirt.engine.core.common.errors.EngineException { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = super . runVdsCommand ( commandType , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getVdsError ( ) . getCode ( ) , returnValue.getVdsError ( ) . getMessage ( ) ) ; } return returnValue ; }
Source:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation , java.lang.String violatingEntity ) { java.util.List < java.lang.String > violatingEntities = violations.get ( violation ) ; if ( violatingEntities == null ) { violatingEntities = new java.util.LinkedList < java.lang.String > ( ) ; violations.put ( violation , violatingEntities ) ; } violatingEntities.add ( violatingEntity ) ; }

Target:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation , java.lang.String violatingEntity ) { java.util.List < java.lang.String > violatingEntities = violations.get ( violation ) ; if ( violatingEntities == null ) { violatingEntities = new java.util.ArrayList < java.lang.String > ( ) ; violations.put ( violation , violatingEntities ) ; } violatingEntities.add ( violatingEntity ) ; }
Source:
public static org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary getStorageSummary ( javax.sql.DataSource dataSource ) throws java.sql.SQLException , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary result = new org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary ( new org.ovirt.engine.ui.frontend.server.dashboard.StorageUtilization ( ) ) ; result.setPhysicalTotal ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getTotalStorageCount ( dataSource ) ) ; result.setHistory ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getHourlyStorageHistory ( result , dataSource ) ) ; result.setUsed ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getLast5MinutesStorageAverage ( dataSource ) ) ; org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getVirtualStorageCount ( result , dataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.UtilizationHelper.populateStorageUtilization ( result.getUtilization ( ) , dataSource ) ; return result ; }

Target:
public static org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary getStorageSummary ( javax.sql.DataSource dataSource ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary result = new org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary ( new org.ovirt.engine.ui.frontend.server.dashboard.StorageUtilization ( ) ) ; result.setPhysicalTotal ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getTotalStorageCount ( dataSource ) ) ; result.setHistory ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getHourlyStorageHistory ( dataSource ) ) ; result.setUsed ( org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getLast5MinutesStorageAverage ( dataSource ) ) ; org.ovirt.engine.ui.frontend.server.dashboard.HourlySummaryHelper.getVirtualStorageCount ( result , dataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.UtilizationHelper.populateStorageUtilization ( result.getUtilization ( ) , dataSource ) ; return result ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; if ( ( quotaList != null ) && ( ! ( quotaList.isEmpty ( ) ) ) ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > comparator = ( ( topId ) == null ) ? org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.NAME : org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.withTopId ( topId , QuotaComparator.NAME ) ; java.util.Collections.sort ( quotaList , comparator ) ; } return quotaList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > convert ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; if ( ( quotaList != null ) && ( ! ( quotaList.isEmpty ( ) ) ) ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > comparator = ( ( topId ) == null ) ? org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.NAME : org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.withTopId ( topId , QuotaComparator.NAME ) ; java.util.Collections.sort ( quotaList , comparator ) ; } return quotaList ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }