auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( "DISK_TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( "DISK_TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } else if ( ( "BOOTABLE" . equals ( fieldName ) ) || ( "SHAREABLE" . equals ( fieldName ) ) ) { return new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return null ; }
Source:
protected void HandleUserSession ( org.ovirt.engine.core.common.businessentities.AdUser adUser ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.user_sessions user_sessions = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( "" , "" , new java.util.Date ( ) , "" , org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) , adUser.getUserId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDAO ( ) . saveSession ( user_sessions ) ; } }

Target:
protected void HandleUserSession ( org.ovirt.engine.core.common.businessentities.AdUser adUser ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.user_sessions user_sessions = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( "" , "" , new java.util.Date ( ) , "" , org.ovirt.engine.core.bll.LoginBaseCommand.getParameters ( ) . getHttpSessionId ( ) , adUser.getUserId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . saveSession ( user_sessions ) ; } }
Source:
public void testResetOption ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ResetGlusterVolumeOptions , org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters.class , new java.lang.String [ ] { "VolumeId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setOption ( new org.ovirt.engine.api.model.Option ( ) ) ; action.getOption ( ) . setName ( "auth.allow" ) ; verifyActionResponse ( resource.resetOption ( action ) ) ; }

Target:
public void testResetOption ( ) throws java.lang.Exception { setupParentExpectations ( ) ; resource.setParent ( volumesResourceMock ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ResetGlusterVolumeOptions , org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters.class , new java.lang.String [ ] { "VolumeId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setOption ( new org.ovirt.engine.api.model.Option ( ) ) ; action.getOption ( ) . setName ( "auth.allow" ) ; verifyActionResponse ( resource.resetOption ( action ) ) ; }
Source:
protected boolean isDiskExist ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { if ( ( disk == null ) || ( ! ( isDiskExistInVm ( disk ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean isDiskExist ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( disk ) ; if ( ! ( validate ( diskValidator.isDiskExists ( ) ) ) ) { return false ; } if ( ! ( isDiskExistInVm ( disk ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } return true ; }
Source:
public void testMigrateWithHostId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithHostId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createAllSnapshotsFromVmParameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , "stateless snapshot" ) ; createAllSnapshotsFromVmParameters.setShouldBeLogged ( false ) ; createAllSnapshotsFromVmParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; createAllSnapshotsFromVmParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; createAllSnapshotsFromVmParameters.setEntityId ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityId ( ) ) ; createAllSnapshotsFromVmParameters.setSnapshotType ( SnapshotType.STATELESS ) ; return createAllSnapshotsFromVmParameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createAllSnapshotsFromVmParameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , "stateless snapshot" ) ; createAllSnapshotsFromVmParameters.setShouldBeLogged ( false ) ; createAllSnapshotsFromVmParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; createAllSnapshotsFromVmParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; createAllSnapshotsFromVmParameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; createAllSnapshotsFromVmParameters.setSnapshotType ( SnapshotType.STATELESS ) ; return createAllSnapshotsFromVmParameters ; }
Source:
public static java.lang.String encryptPassword ( java.lang.String password ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) { return password ; } org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; java.lang.String keyFile = config.getPKIEngineStore ( ) . getAbsolutePath ( ) ; java.lang.String passwd = config.getPKIEngineStorePassword ( ) ; java.lang.String alias = config.getPKIEngineStoreAlias ( ) ; try { return org.ovirt.engine.core.utils.crypt.EncryptionUtils.encrypt ( password , keyFile , passwd , alias ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }

Target:
public static java.lang.String encryptPassword ( java.lang.String password ) { try { return org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.encrypt ( password ) ; } catch ( java.lang.Exception e ) { throw new java.lang.SecurityException ( e ) ; } }
Source:
private void addQuotaToStorageQuotaList ( org.ovirt.engine.core.common.businessentities.QuotaUsagePerUser quotaPerUserUsageEntity ) { org.ovirt.engine.ui.userportal.widget.QuotaProgressBar storageQuotaProgressBar = new org.ovirt.engine.ui.userportal.widget.QuotaProgressBar ( QuotaProgressBar.QuotaType.STORAGE ) ; storageQuotaProgressBar.setValues ( quotaPerUserUsageEntity.getStorageLimit ( ) , ( ( quotaPerUserUsageEntity.getStorageTotalUsage ( ) ) - ( quotaPerUserUsageEntity.getStorageUsageForUser ( ) ) ) , quotaPerUserUsageEntity.getStorageUsageForUser ( ) ) ; addQuotaRow ( storageQuotasList , quotaPerUserUsageEntity.getQuotaName ( ) , storageQuotaProgressBar ) ; }

Target:
private void addQuotaToStorageQuotaList ( org.ovirt.engine.core.common.businessentities.QuotaUsagePerUser quotaPerUserUsageEntity ) { org.ovirt.engine.ui.userportal.widget.QuotaProgressBar storageQuotaProgressBar = new org.ovirt.engine.ui.userportal.widget.QuotaStorageProgressBar ( quotaPerUserUsageEntity ) ; addQuotaRow ( storageQuotasList , quotaPerUserUsageEntity.getQuotaName ( ) , storageQuotaProgressBar ) ; }
Source:
private void buildVmData ( ) { builder.buildVmProperties ( ) ; builder.buildVmVideoCards ( ) ; builder.buildVmCD ( ) ; builder.buildVmFloppy ( ) ; builder.buildVmDrives ( ) ; builder.buildVmNetworkInterfaces ( ) ; builder.buildVmNetworkCluster ( ) ; builder.buildVmBootSequence ( ) ; builder.buildVmBootOptions ( ) ; builder.buildVmSoundDevices ( ) ; builder.buildVmTimeZone ( ) ; builder.buildVmUsbDevices ( ) ; builder.buildVmMemoryBalloon ( ) ; builder.buildUnmanagedDevices ( ) ; }

Target:
private void buildVmData ( ) { builder.buildVmProperties ( ) ; builder.buildVmVideoCards ( ) ; builder.buildVmCD ( ) ; builder.buildVmFloppy ( ) ; builder.buildVmDrives ( ) ; builder.buildVmNetworkInterfaces ( ) ; builder.buildVmNetworkCluster ( ) ; builder.buildVmBootSequence ( ) ; builder.buildVmBootOptions ( ) ; builder.buildVmSoundDevices ( ) ; builder.buildVmTimeZone ( ) ; builder.buildVmUsbDevices ( ) ; builder.buildVmMemoryBalloon ( ) ; builder.buildVmWatchdog ( ) ; builder.buildUnmanagedDevices ( ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( imageTemplates.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { if ( removeVmTemplateImages ( ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } return null ; } } ) ; } else { HandleEndAction ( ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { if ( ( ! ( imageTemplates.isEmpty ( ) ) ) && ( removeVmTemplateImages ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } if ( ! ( cinderDisks.isEmpty ( ) ) ) { removeCinderDisks ( cinderDisks ) ; setSucceeded ( true ) ; } return null ; }
Source:
private java.lang.Object getBackendParameter ( final org.ovirt.engine.core.common.config.ConfigValues key ) throws javax.servlet.ServletException { final org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ) ; parameters.setConfigValue ( key ) ; parameters.setVersion ( ConfigCommon.defaultConfigurationVersion ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue value = backend.runPublicQuery ( QueryType.GetConfigurationValue , parameters ) ; if ( ! ( value.getSucceeded ( ) ) ) { throw new javax.servlet.ServletException ( ( ( "Can\'t get value of backend parameter \"" + key ) + "\"." ) ) ; } return value.getReturnValue ( ) ; }

Target:
private java.lang.Object getBackendParameter ( final org.ovirt.engine.core.common.config.ConfigValues key ) throws javax.servlet.ServletException { final org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ) ; parameters.setConfigValue ( key ) ; parameters.setVersion ( ConfigCommon.defaultConfigurationVersion ) ; org.ovirt.engine.core.common.queries.QueryReturnValue value = backend.runPublicQuery ( QueryType.GetConfigurationValue , parameters ) ; if ( ! ( value.getSucceeded ( ) ) ) { throw new javax.servlet.ServletException ( ( ( "Can\'t get value of backend parameter \"" + key ) + "\"." ) ) ; } return value.getReturnValue ( ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action suspend ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/suspend" ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action suspend ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/suspend" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) || ( ! ( vmDevice.getIsManaged ( ) ) ) ) { return true ; } return ( ( vmDevice.getSnapshotId ( ) ) == null ) && ( getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) . isAllowSnapshot ( ) ) ; }

Target:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) || ( ! ( vmDevice.isManaged ( ) ) ) ) { return true ; } return ( ( vmDevice.getSnapshotId ( ) ) == null ) && ( getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) . isAllowSnapshot ( ) ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getUpdate ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.io.IOException , java.security.GeneralSecurityException { this . provider = new org.ovirt.vdsm.jsonrpc.client.TestManagerProvider ( java.lang.ClassLoader.getSystemResourceAsStream ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.KEYSTORE_NAME ) , java.lang.ClassLoader.getSystemResourceAsStream ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.TRUSTSTORE_NAME ) , org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.PASSWORD ) ; javax.net.ssl.SSLContext context = this . provider.getSSLContext ( ) ; this . listeningReactor = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompReactor ( context ) ; this . sendingReactor = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompReactor ( context ) ; }

Target:
public static org.ovirt.vdsm.jsonrpc.client.TestManagerProvider createProvider ( ) { return new org.ovirt.vdsm.jsonrpc.client.TestManagerProvider ( java.lang.ClassLoader.getSystemResourceAsStream ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.KEYSTORE_NAME ) , java.lang.ClassLoader.getSystemResourceAsStream ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.TRUSTSTORE_NAME ) , org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClientTestCase.PASSWORD ) ; }
Source:
private void addNetworkToHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getVdsGroupId ( ) , getNetwork ( ) . getLabel ( ) ) ; org.ovirt.engine.core.bll.network.AddNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.AddNetworkParametersBuilder ( getNetwork ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }

Target:
private void addNetworkToHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesByLabelForCluster ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getVdsGroupId ( ) , getPersistedNetwork ( ) . getLabel ( ) ) ; org.ovirt.engine.core.bll.network.AddNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.AddNetworkParametersBuilder ( getPersistedNetwork ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDAO vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }
Source:
public void saveJobSubjectEntity ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitybeforeSave = dao.getJobSubjectEntityByJobId ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID ) ; org.junit.Assert.assertTrue ( ( ! ( entitybeforeSave.isEmpty ( ) ) ) ) ; dao.save ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID , org.ovirt.engine.core.compat.Guid.newGuid ( ) , VdcObjectType.VmPool ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityAfterSave = dao.getJobSubjectEntityByJobId ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID ) ; org.junit.Assert.assertEquals ( "Job subject entities before and after adding new entity" , ( ( entitybeforeSave.size ( ) ) + 1 ) , entityAfterSave.size ( ) ) ; }

Target:
public void saveJobSubjectEntity ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitybeforeSave = dao.getJobSubjectEntityByJobId ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ! ( entitybeforeSave.isEmpty ( ) ) ) ) ; dao.save ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID , org.ovirt.engine.core.compat.Guid.newGuid ( ) , VdcObjectType.VmPool ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityAfterSave = dao.getJobSubjectEntityByJobId ( org.ovirt.engine.core.dao.JobSubjectEntityDaoTest.EXISTING_JOB_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( ( entitybeforeSave.size ( ) ) + 1 ) , entityAfterSave.size ( ) , "Job subject entities before and after adding new entity" ) ; }
Source:
protected void EndImportCommand ( ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { setVm ( null ) ; } EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getVm ( ) . getvds_group_id ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( ( value == null ? null : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( value ) ) . getVm ( ) ) ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportInterfaceListModel vmImportInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel vmAppListModel ) { getClusterQuota ( ) . setIsAvailable ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( vmImportInterfaceListModel ) ; list.add ( importDiskListModel ) ; list.add ( vmAppListModel ) ; setDetailModels ( list ) ; }
Source:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk , org.ovirt.engine.core.common.businessentities.ImageOperation imageOperation ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters diskParameters = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( disk.getImageId ( ) , sourceStorageDomainGuid , destStorageDomainGuid , imageOperation ) ; diskParameters.setQuotaId ( disk.getQuotaId ( ) ) ; parameters.add ( diskParameters ) ; }

Target:
protected abstract org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters createParameters ( org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) ;
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.GetDiskByDiskIdParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.compat.Version clusterVersion ) { if ( ( org.ovirt.engine.core.common.FeatureSupported.antiMacSpoofing ( clusterVersion ) ) && ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }

Target:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.fetchVnicProfileNetworkFilter ( vmNic ) ; if ( networkFilter != null ) { final java.lang.String networkFilterName = networkFilter.getName ( ) ; struct.put ( VdsProperties.NW_FILTER , networkFilterName ) ; } }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel poolVmListModel , final org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel permissionListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( poolGeneralModel ) ; list.add ( poolVmListModel ) ; list.add ( permissionListModel ) ; setDetailModels ( list ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel systemPermissionListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel ) ( model ) ) ; systemPermissionListModel.setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; params.setRefresh ( false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSystemPermissions , params , new org.ovirt.engine.ui.uicommonweb.models.configure.SetItemsAsyncQuery ( ) ) ; }
Source:
public void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { addImage ( image , active , imageStorageDomainMap ) ; addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_INTERFACE_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.io.IOException { java.lang.System.out.println ( ( "Copying rsdl.xml, rsdl_gluster.xml, api.xsd to: " + ( args [ 0 ] ) ) ) ; org.ovirt.engine.api.rsdl.RsdlIOManager.copyRsdl ( args [ 0 ] ) ; }

Target:
private static void exportResource ( java.lang.String apiVersion , java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { java.lang.String resourcePath = java.lang.String.format ( "/v%s/%s" , apiVersion , resourceName ) ; java.io.InputStream inputResource = org.ovirt.engine.api.rsdl.RsdlIOManager.class . getResourceAsStream ( resourcePath ) ; java.io.File outputFile = new java.io.File ( outputDirectory , resourceName ) ; java.lang.System.out.printf ( "Copying resource \"%s\" to file \"%s\"\n" , resourcePath , outputFile.getAbsolutePath ( ) ) ; org.apache.commons.io.FileUtils.copyInputStreamToFile ( inputResource , outputFile ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > createQueryResultList ( final org.ovirt.engine.core.common.queries.VdcQueryReturnValue resultValue , int count ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( resultValue ) ; } return result ; }

Target:
private java.util.List < org.ovirt.engine.core.common.queries.QueryReturnValue > createQueryResultList ( final org.ovirt.engine.core.common.queries.QueryReturnValue resultValue , int count ) { java.util.List < org.ovirt.engine.core.common.queries.QueryReturnValue > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( resultValue ) ; } return result ; }
Source:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
com.google.gwt.user.cellview.client.Header < ? > createSafeHtmlHeader ( final com.google.gwt.safehtml.shared.SafeHtml text ) { return new com.google.gwt.user.cellview.client.Header < com.google.gwt.safehtml.shared.SafeHtml > ( new org.ovirt.engine.ui.common.widget.table.column.SafeHtmlCellWithTooltip ( ) ) { @ java.lang.Override public com.google.gwt.safehtml.shared.SafeHtml getValue ( ) { if ( ( text != null ) && ( applyResizableHeaderStyle ) ) { return templates.nonResizeableColumnHeader ( text ) ; } return text ; } } ; }

Target:
com.google.gwt.user.cellview.client.Header < ? > createSafeHtmlHeader ( final com.google.gwt.safehtml.shared.SafeHtml text ) { return new com.google.gwt.user.cellview.client.Header < com.google.gwt.safehtml.shared.SafeHtml > ( new org.ovirt.engine.ui.common.widget.table.cell.SafeHtmlCellWithTooltip ( ) ) { @ java.lang.Override public com.google.gwt.safehtml.shared.SafeHtml getValue ( ) { if ( ( text != null ) && ( applyResizableHeaderStyle ) ) { return templates.nonResizeableColumnHeader ( text ) ; } return text ; } } ; }
Source:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private void handleQxlClusterLevel ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; getBehavior ( ) . enableSinglePCI ( ( ( isLinux && isQxl ) && clusterSupportsSinglePci ) ) ; }

Target:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( isLinux && isQxl ) && clusterSupportsSinglePci ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getParametersForTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommandType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { if ( parentCommandType == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { return parameters ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = parameters.getParentParameters ( ) ; if ( parentParameters == null ) { java.lang.String msg = "No parameters exist for " + parentCommandType ; log.error ( msg ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NO_PARAMETERS_FOR_TASK , msg ) ; } parentParameters.setExecutionReason ( parameters.getExecutionReason ( ) ) ; return parentParameters ; }

Target:
private void revertPreviousHandlers ( ) { getParameters ( ) . decrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) >= 0 ) { log.errorFormat ( "Reverting task handler: {0}" , getCurrentTaskHandler ( ) . getClass ( ) . getName ( ) ) ; getParameters ( ) . setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; getCurrentTaskHandler ( ) . compensate ( ) ; if ( ! ( hasRevertTask ( ) ) ) { revertPreviousHandlers ( ) ; } } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }