auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao , org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorHelper.class ) ) ; return validator.validate ( ) ; }
Source:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/LockManager" ) ) ; addBeanJNDIName ( BeanType.EVENTQUEUE_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/EventQueue" ) ) ; }

Target:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/LockManager" ) ) ; addBeanJNDIName ( BeanType.EVENTQUEUE_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/EventQueue" ) ) ; }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { context = inputMap.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getDirectoryName ( ) ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Kerberos/Ldap Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , configuration.get ( "config.query.filter.size" ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( "*" ) ) ; }

Target:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { context = inputMap.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getDirectoryName ( ) ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Kerberos/Ldap Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , configuration.get ( "config.query.filter.size" ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( "*" ) ) ; }
Source:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getNetworksTableItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkManageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; if ( canEditAssign ( clusterNetworkManageModel ) ) { changeIsAttached ( clusterNetworkManageModel , value ) ; } } refreshNetworksTable ( ) ; }

Target:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel , java.lang.Boolean value ) { clusterNetworkModel.setAttached ( value ) ; if ( ( ! value ) && ( clusterNetworkModel.isDisplayNetwork ( ) ) ) { clusterNetworkModel.setDisplayNetwork ( false ) ; } if ( ( ! value ) && ( clusterNetworkModel.isRequired ( ) ) ) { clusterNetworkModel.setRequired ( false ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmQualifiedForSnapshotMerge ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( vm.isQualifiedForSnapshotMerge ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmQualifiedForSnapshotMerge ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { if ( ! ( vm.isQualifiedForSnapshotMerge ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP , java.lang.String.format ( "$VmName %s" , vm.getName ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void queryNetworks ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; queryInterfaces ( ) ; } } ; org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterNetworkList ( asyncQuery , vds.getVdsGroupId ( ) ) ; }

Target:
private void queryNetworks ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; queryInterfaces ( ) ; } } ; org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterNetworkList ( asyncQuery , vds.getClusterId ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterVolumeCreate ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount , int stripeCount , java.lang.String [ ] transportList ) { try { return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( vdsServer.glusterVolumeCreate ( volumeName , brickList , replicaCount , stripeCount , transportList ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc glusterVolumeInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumesList ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getCluster ( ) . getSelectedItem ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getModel ( ) . getCluster ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; }

Target:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { editor.setValue ( ( ( T ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { T selectedItem = ( ( T ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) . getSelectedItem ( ) ) ) ; if ( ( editor instanceof org.ovirt.engine.ui.common.widget.editor.TakesConstrainedValueListEditor ) && ( ( ownerModels.get ( absolutePath ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.ListModel ) ) { editor.setValue ( ( ( T ) ( java.util.Arrays.asList ( selectedItem ) ) ) ) ; } else { editor.setValue ( selectedItem ) ; } }
Source:
private void validateGateway ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( iface.getGateway ( ) ) ) && ( ! ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , vds.getVdsGroupId ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( vds.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { addViolation ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY , iface.getNetworkName ( ) ) ; } }

Target:
private void validateNetworkExclusiveOnIface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.bll.validator.network.NetworkType networkType ) { java.lang.String ifaceName = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface ) ; java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > networksOnIface = ifacesWithExclusiveNetwork.get ( ifaceName ) ; if ( networksOnIface == null ) { networksOnIface = new java.util.ArrayList < > ( ) ; ifacesWithExclusiveNetwork.put ( ifaceName , networksOnIface ) ; } networksOnIface.add ( networkType ) ; if ( ! ( networkExclusivenessValidator.isNetworkExclusive ( networksOnIface ) ) ) { addViolation ( networkExclusivenessValidator.getViolationMessage ( ) , ifaceName ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsMigrationSupported" . equals ( propName ) ) { migratePanel.setVisible ( object.isMigrationSupported ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsMigrationSupported" . equals ( propName ) ) { migratePanel.setVisible ( object.isMigrationSupported ( ) ) ; } }
Source:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getLock ( ) ) ) ; } }

Target:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getContext ( ) . withCompensationContext ( null ) ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }
Source:
private void savePosixStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SavePosix" } ) ) ) . Run ( ) ; }

Target:
private void savePosixStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SavePosix" } ) ) ) . Run ( ) ; }
Source:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
protected void prepareMocks ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.mockito.Mockito.when ( cmd.getCluster ( ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.doReturn ( vds ) . when ( cmd ) . getVds ( ) ; org.mockito.Mockito.doReturn ( status ) . when ( vds ) . getStatus ( ) ; mockIsGlusterEnabled ( true ) ; org.mockito.Mockito.doReturn ( glusterUtil ) . when ( cmd ) . getGlusterUtil ( ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3NIC v3Nic ) { org.ovirt.engine.api.model.Nic v4Nic = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Nic ) ; org.ovirt.engine.api.v3.helpers.V3NICHelper.setVnicProfile ( vmId , v3Nic , v4Nic ) ; try { return adaptResponse ( delegate.add ( v4Nic ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3NIC v3Nic ) { org.ovirt.engine.api.model.Nic v4Nic = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Nic ) ; org.ovirt.engine.api.v3.helpers.V3NICHelper.setVnicProfile ( vmId , v3Nic , v4Nic ) ; try { return adaptResponse ( getDelegate ( ) . add ( v4Nic ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return null ; } return super . getValue ( vm ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return null ; } if ( ( vm.getBackgroundOperationDescription ( ) ) != null ) { return null ; } return super . getValue ( vm ) ; }
Source:
protected boolean checkCanBeMoveInVm ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsForDisk = getVmsWithVmDeviceInfoForDiskId ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : vmsForDisk ) { org.ovirt.engine.core.common.businessentities.VM currVm = pair.getFirst ( ) ; if ( ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) != ( currVm.getStatus ( ) ) ) { if ( pair.getSecond ( ) . getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } return true ; }

Target:
protected boolean checkCanBeMoveInVm ( ) { return validate ( new org.ovirt.engine.core.bll.validator.DiskValidator ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) . isDiskPluggedToVmsThatAreNotDown ( false , getVmsWithVmDeviceInfoForDiskId ( ) ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , false , VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.common.businessentities.LdapUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDomainControler ( ) , directoryUser.getUserId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.authentication.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectory ( ) . getName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }
Source:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = dbFacade.getVmTemplateDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = dbFacade.getVmTemplateDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > domainStaticEntries = getDbFacade ( ) . getStorageDomainStaticDao ( ) . getAllByStorage ( provider.getId ( ) . toString ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStaticEntry : domainStaticEntries ) { getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; } }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry : storageDomains ) { org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.core.common.businessentities.AuditLog model , int index ) { assertNotNull ( model.getaudit_log_id ( ) ) ; assertNotNull ( model.getseverity ( ) ) ; assertNotNull ( model.getmessage ( ) ) ; assertNotNull ( model.getOrigin ( ) ) ; assertNotNull ( model.getCustomEventId ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( VdcActionType.RemoveExternalEvent , org.ovirt.engine.core.common.action.RemoveExternalEventParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] } , true , true , false ) ; setUpQueryExpectations ( "" ) ; verifyRemove ( collection.remove ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] ) ) ) ; }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getTaskID ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to entity '{1}'." , asyncTask.getTaskID ( ) , getContainerId ( ) ) ; _listTasks.put ( asyncTask.getTaskID ( ) , asyncTask ) ; } } }

Target:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to entity '{1}'." , asyncTask.getVdsmTaskId ( ) , getContainerId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }
Source:
private void AddNetworkPostData ( ) { if ( ( nics ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , nics , this ) ; setWindow ( model ) ; StopProgress ( ) ; }

Target:
private void addNetworkPostData ( ) { if ( ( nics ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , nics , this ) ; setWindow ( model ) ; stopProgress ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fence ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { if ( ( ( fencedHost.getFenceAgents ( ) ) == null ) || ( fencedHost.getFenceAgents ( ) . isEmpty ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN , java.lang.String.format ( "Invalid fence agents defined for host '%s'." , fencedHost.getHostName ( ) ) ) ; } return fence ( fenceAction , fencedHost.getFenceAgents ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fence ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > fenceAgents = getDbFacade ( ) . getFenceAgentDao ( ) . getFenceAgentsForHost ( fencedHost.getId ( ) ) ; if ( ( fenceAgents == null ) || ( fenceAgents.isEmpty ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN , java.lang.String.format ( "Invalid fence agents defined for host '%s'." , fencedHost.getHostName ( ) ) ) ; } return fence ( fenceAction , fenceAgents ) ; }
Source:
public void testGetByNameReturnsNullIfNotExist ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.junit.Assert.assertThat ( map.get ( "different name" ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void testGetByNameReturnsNullIfNotExist ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.hamcrest.MatcherAssert.assertThat ( map.get ( "different name" ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNotInVfsConfig ( org.ovirt.engine.core.compat.Guid networkId ) { java.lang.String networkName = getNetwork ( networkId ) . getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NETWORK_NAME_REPLACEMENT , networkName ) ) . when ( oldVfsConfig.getNetworks ( ) . contains ( networkId ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotInVfsConfig ( org.ovirt.engine.core.compat.Guid networkId ) { java.lang.String networkName = getNetwork ( networkId ) . getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NETWORK_NAME_REPLACEMENT , networkName ) ) . when ( oldVfsConfig.getNetworks ( ) . contains ( networkId ) ) ; }
Source:
public final void onBootstrap ( ) { java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger ( "" ) ; initLocalStorageLogHandler ( rootLogger ) ; java.util.logging.Logger remoteLogger = java.util.logging.Logger.getLogger ( "remote" ) ; remoteLogger.addHandler ( new com.google.gwt.logging.client.SimpleRemoteLogHandler ( ) ) ; initUncaughtExceptionHandler ( rootLogger , remoteLogger ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { performBootstrap ( ) ; } } ) ; }

Target:
public void onUncaughtException ( java.lang.Throwable t ) { applicationLogManager.logUncaughtException ( t ) ; if ( org.ovirt.engine.ui.common.DisplayUncaughtUIExceptions.getValue ( ) ) { alertManager.showUncaughtExceptionAlert ( t ) ; } }
Source:
public void tRowGenerator_4_onSubJobError ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.historyetl_3_2.HistoryETL.TalendException { resumeUtil.addLog ( "SYSTEM_LOG" , ( "NODE:" + errorComponent ) , "" , ( ( java.lang.Thread.currentThread ( ) . getId ( ) ) + "" ) , "FATAL" , "" , exception.getMessage ( ) , ovirt_engine_dwh.historyetl_3_2.ResumeUtil.getExceptionStackTrace ( exception ) , "" ) ; }

Target:
public void tRunJob_2_onSubJobError ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.historyetl_3_2.HistoryETL.TalendException { resumeUtil.addLog ( "SYSTEM_LOG" , ( "NODE:" + errorComponent ) , "" , ( ( java.lang.Thread.currentThread ( ) . getId ( ) ) + "" ) , "FATAL" , "" , exception.getMessage ( ) , ovirt_engine_dwh.historyetl_3_2.ResumeUtil.getExceptionStackTrace ( exception ) , "" ) ; }
Source:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }

Target:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( poolId , VMStatus.Up ) ; int prestartedVmsInPool = 0 ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { prestartedVmsInPool ++ ; } } } return prestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult typeMatchesProfile ( ) { boolean profilePassthrough = ( ( getVnicProfile ( ) ) != null ) && ( getVnicProfile ( ) . isPassthrough ( ) ) ; boolean typePassthrough = VmInterfaceType.pciPassthrough.equals ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_NOT_MATCH_PROFILE ) . when ( ( profilePassthrough ^ typePassthrough ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult typeMatchesProfile ( ) { boolean profilePassthrough = ( ( getVnicProfile ( ) ) != null ) && ( getVnicProfile ( ) . isPassthrough ( ) ) ; boolean typePassthrough = ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.pciPassthrough ) == ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_NOT_MATCH_PROFILE ) . when ( ( profilePassthrough ^ typePassthrough ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( USED_SPACE_GB ) + ( AVAILABLE_SPACE_GB ) ) ) ; i.setactual_size ( ( ( ( ( REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( STORAGE_DOMAIN_ID ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setactual_size ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }
Source:
public static VdsNetworkInterface.NetworkImplementationDetails calculateNetworkImplementationDetails ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getNetworkName ( ) ) ) { return null ; } if ( network != null ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isNetworkInSync ( iface , network , qos ) ) { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( true , true ) ; } else { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( false , true ) ; } } else { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( ) ; } }

Target:
public static VdsNetworkInterface.NetworkImplementationDetails calculateNetworkImplementationDetails ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getNetworkName ( ) ) ) { return null ; } if ( network != null ) { if ( new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( iface , network , hostNetworkQos ) . isNetworkInSync ( ) ) { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( true , true ) ; } else { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( false , true ) ; } } else { return new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails ( ) ; } }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) { org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) { org.junit.jupiter.api.Assertions.assertNotNull ( collection ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }
Source:
public void testUpdate ( ) { existingAuditLog.setmessage ( existingAuditLog.getmessage ( ) . toUpperCase ( ) ) ; existingAuditLog.setseverity ( AuditLogSeverity.ERROR ) ; dao.update ( existingAuditLog ) ; org.ovirt.engine.core.common.businessentities.AuditLog result = dao.get ( existingAuditLog.getaudit_log_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingAuditLog , result ) ; }

Target:
public void testRemoveAllOfTypeForVds ( ) throws java.lang.Exception { dao.removeAllOfTypeForVds ( org.ovirt.engine.core.dao.AuditLogDAOTest.VDS_ID , AuditLogType.IRS_DISK_SPACE_LOW_ERROR.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; }
Source:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; return false ; } return true ; }

Target:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }