auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; int threadsPerCore = vm.getThreadsPerCpu ( ) ; int cpuPerSocket = vm.getCpuPerSocket ( ) ; maxVCpus = ( cpuPerSocket * threadsPerCore ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( cpuPerSocket * threadsPerCore ) ) ) ) ; return maxVCpus ; }

Target:
public java.lang.Integer calcMaxVCpu ( ) { return org.ovirt.engine.core.common.utils.VmCpuCountHelper.calcMaxVCpu ( vm.getStaticData ( ) , vm.getClusterCompatibilityVersion ( ) ) ; }
Source:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { addCanDoActionMessage ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } return false ; } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED , java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > existing = asCollection ( org.ovirt.engine.core.common.businessentities.storage_domains.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getconnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getconnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }

Target:
private org.ovirt.engine.api.model.StorageDomain getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > existing = asCollection ( org.ovirt.engine.api.model.StorageDomain.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getconnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getconnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid perm = org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getDbFacade ( ) . getEntityPermissions ( org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getAdElementId ( ) , ActionGroup.RECONNECT_TO_VM , org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getObjectId ( ) , VdcObjectType.VM ) ; org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getQueryReturnValue ( ) . setReturnValue ( ( perm != null ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid perm = org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getDbFacade ( ) . getPermissionDao ( ) . getEntityPermissions ( org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getAdElementId ( ) , ActionGroup.RECONNECT_TO_VM , org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getObjectId ( ) , VdcObjectType.VM ) ; org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getQueryReturnValue ( ) . setReturnValue ( ( perm != null ) ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) . addValue ( "migration" , cluster.isMigration ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertnetwork_cluster" , parameterSource ) ; }

Target:
public void setNetworkExclusivelyAsGluster ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid networkId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "network_id" , networkId ) ; getCallsHandler ( ) . executeModification ( "set_network_exclusively_as_gluster" , parameterSource ) ; }
Source:
public void testPatternBasedNameFails ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( initializeMock ( 1 , 1 ) ) ; cmd.getParameters ( ) . getVm ( ) . setName ( "aa-??bb" ) ; junit.framework.Assert.assertFalse ( "Pattern-based name should not be supported for VM" , cmd.validateInputs ( ) ) ; }

Target:
public void testPatternBasedNameFails ( ) { mockOsRepository ( ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( initializeMock ( 1 , 1 ) ) ; cmd.getParameters ( ) . getVm ( ) . setName ( "aa-??bb" ) ; org.junit.Assert.assertFalse ( "Pattern-based name should not be supported for VM" , cmd.validateInputs ( ) ) ; }
Source:
private void initializeCommand ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.common.businessentities.VolumeType volumeType ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setStorageDomainId ( storageId ) ; if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskCommandTest.createPreallocDiskImage ( ) ) ; } else if ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskCommandTest.createSparseDiskImage ( ) ) ; } initializeCommand ( storageId , parameters ) ; }

Target:
private void initializeCommand ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setStorageDomainId ( storageId ) ; if ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Preallocated ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskCommandTest.createPreallocDiskImage ( ) ) ; } else if ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) { parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskCommandTest.createSparseDiskImage ( ) ) ; } initializeCommand ( storageId , parameters ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > returnVMs = new java.util.HashMap < > ( ) ; for ( int idx = 0 ; idx < ( vmListReturn.infoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm vmInternalData = createVdsmVm ( vmListReturn.infoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.getBroker ( ) . getAllVmStats ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetAllVmStatsVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > returnVMs = new java.util.HashMap < > ( ) ; for ( int idx = 0 ; idx < ( vmListReturn.infoList.length ) ; ++ idx ) { org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm vmInternalData = createVdsmVm ( vmListReturn.infoList [ idx ] ) ; returnVMs.put ( vmInternalData.getVmDynamic ( ) . getId ( ) , vmInternalData ) ; } setReturnValue ( returnVMs ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return getDetailModel ( ) . isDiskPluggedToVm ( object ) ? getCommonResources ( ) . upImage ( ) : getCommonResources ( ) . downImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { boolean isDiskPlugged = getDetailModel ( ) . isDiskPluggedToVm ( object ) ; setTitle ( ( isDiskPlugged ? constants.activeDisk ( ) : constants.unactiveDisk ( ) ) ) ; return isDiskPlugged ? getCommonResources ( ) . upImage ( ) : getCommonResources ( ) . downImage ( ) ; }
Source:
public org.ovirt.engine.core.aaa.AuthenticationResult authenticate ( java.lang.String user , java.lang.String password ) { java.lang.String adminName = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminUser ) ; java.lang.String adminPassword = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminPassword ) ; return new org.ovirt.engine.core.aaa.result.BooleanAuthenticationResult ( ( ( org.apache.commons.lang.ObjectUtils.equals ( user , adminName ) ) && ( org.apache.commons.lang.ObjectUtils.equals ( password , adminPassword ) ) ) ) ; }

Target:
public void authenticate ( java.lang.String user , java.lang.String password ) { java.lang.String adminName = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminUser ) ; java.lang.String adminPassword = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminPassword ) ; if ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( user , adminName ) ) ) || ( ! ( org.apache.commons.lang.ObjectUtils.equals ( password , adminPassword ) ) ) ) { throw new org.ovirt.engine.api.extensions.AAAExtensionException ( AAAExtensionException.AAAExtensionError.INCORRECT_CREDENTIALS , "" ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getParameters ( ) . getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation ) { violations.add ( violation ) ; }

Target:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation , java.lang.String violatingEntity ) { java.util.List < java.lang.String > violatingEntities = violations.get ( violation ) ; if ( violatingEntities == null ) { violatingEntities = new java.util.ArrayList < java.lang.String > ( ) ; violations.put ( violation , violatingEntities ) ; } violatingEntities.add ( violatingEntity ) ; }
Source:
public boolean isStatusUp ( ) { return org.ovirt.engine.core.common.businessentities.VM.isStatusUp ( getstatus ( ) ) ; }

Target:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.Set < java.lang.String > labels = org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllNetworkLabelsForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getParameters ( ) . getId ( ) ) ; labels.addAll ( org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getDbFacade ( ) . getInterfaceDao ( ) . getAllNetworkLabelsForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getParameters ( ) . getId ( ) ) ) ; org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getQueryReturnValue ( ) . setReturnValue ( labels ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Set < java.lang.String > labels = networkDao.getAllNetworkLabelsForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getParameters ( ) . getId ( ) ) ; labels.addAll ( interfaceDao.getAllNetworkLabelsForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getParameters ( ) . getId ( ) ) ) ; org.ovirt.engine.core.bll.network.dc.GetNetworkLabelsByDataCenterIdQuery.getQueryReturnValue ( ) . setReturnValue ( labels ) ; }
Source:
void registerPluginEventHandlerObject ( java.lang.String pluginName , com.google.gwt.core.client.JavaScriptObject pluginEventHandlerObject ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; if ( ( plugin == null ) || ( pluginEventHandlerObject == null ) ) { return ; } if ( ( plugin.getEventHandlerObject ( ) ) == null ) { plugin.setEventHandlerObject ( pluginEventHandlerObject ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.info ( ( ( "Plugin [" + pluginName ) + "] has registered the event handler object" ) ) ; } else { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Plugin [" + pluginName ) + "] has already registered the event handler object" ) ) ; } }

Target:
void registerPluginEventHandlerObject ( java.lang.String pluginName , com.google.gwt.core.client.JavaScriptObject eventHandlerObject ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; if ( ( plugin == null ) || ( eventHandlerObject == null ) ) { return ; } if ( ( plugin.getEventHandlerObject ( ) ) == null ) { plugin.setEventHandlerObject ( eventHandlerObject ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.info ( ( ( "Plugin [" + pluginName ) + "] has registered the event handler object" ) ) ; } else { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Plugin [" + pluginName ) + "] has already registered the event handler object" ) ) ; } }
Source:
protected void initializeStorageDomain ( ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; if ( ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getWipeAfterDelete ( ) ) == null ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . setWipeAfterDelete ( org.ovirt.engine.core.bll.utils.WipeAfterDeleteUtils.getDefaultWipeAfterDeleteFlag ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getStorageType ( ) ) ) ; } }

Target:
protected void updateStorageDomainWipeAfterDelete ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getWipeAfterDelete ( ) ) == null ) { org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . setWipeAfterDelete ( org.ovirt.engine.core.bll.utils.WipeAfterDeleteUtils.getDefaultWipeAfterDeleteFlag ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) . getStorageType ( ) ) ) ; } }
Source:
private void createVDSandStoragePool ( ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsId ) ; vds.setVdsName ( "TestVDS" ) ; vds.setStoragePoolId ( storagePoolId ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSpmStatus ( VdsSpmStatus.None ) ; vds.setVdsSpmPriority ( 10 ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; }

Target:
private void createVDSandStoragePool ( ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsId ) ; vds.setVdsName ( "TestVDS" ) ; vds.setStoragePoolId ( storagePoolId ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterSupportsVirtService ( true ) ; vds.setSpmStatus ( VdsSpmStatus.None ) ; vds.setVdsSpmPriority ( 10 ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup getValidCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotSyncJobTest.CLUSTER_ID_1 ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_5 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster getValidCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotSyncJobTest.CLUSTER_ID_1 ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_5 ) ; return cluster ; }
Source:
private void writeCData ( java.lang.String text ) { try { writer.writeCData ( text ) ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new java.lang.IllegalStateException ( ( ( "Can\'t write text \"" + text ) + "\"" ) , exception ) ; } }

Target:
private void writeParameter ( org.ovirt.api.metamodel.concepts.Parameter parameter ) { writer.writeStartElement ( "parameter" ) ; writeCommon ( parameter ) ; writer.writeElement ( "in" , java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writer.writeElement ( "out" , java.lang.Boolean.toString ( parameter.isIn ( ) ) ) ; writeTypeRef ( parameter.getType ( ) ) ; writer.writeEndElement ( ) ; }
Source:
public void testUpdateVolumeStatus ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterVolumeStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterVolumeStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatus ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }
Source:
public void isValidVmNetworkForNonVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.Network network = createNewNetwork ( false , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertFalse ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }

Target:
public void isValidVmNetworkForNonVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( false , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertFalse ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }
Source:
public void removeAsyncRunningCommand ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = backend.getResourceManager ( ) . RemoveAsyncRunningCommand ( vmId ) ; if ( command != null ) { command.reportCompleted ( ) ; } }

Target:
public void rerun ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = vdsBroker.GetAsyncCommandForVm ( vmId ) ; if ( command != null ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { command.rerun ( ) ; } } ) ; } }
Source:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStatisticsDAO ( ) . save ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStatisticsDao ( ) . save ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . stateChanged ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain getMasterDomain ( ) { if ( ( masterDomainForPool ) == null ) { org.ovirt.engine.core.compat.Guid masterId = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStorageDomainDAO ( ) . getMasterStorageDomainIdForPool ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStoragePoolId ( ) ) ; if ( Guid.Empty.equals ( masterId ) ) { masterDomainForPool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStorageDomainDAO ( ) . get ( masterId ) ; } } return masterDomainForPool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain getMasterDomain ( ) { if ( ( masterDomainForPool ) == null ) { org.ovirt.engine.core.compat.Guid masterId = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStorageDomainDao ( ) . getMasterStorageDomainIdForPool ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStoragePoolId ( ) ) ; if ( Guid.Empty.equals ( masterId ) ) { masterDomainForPool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStorageDomainDao ( ) . get ( masterId ) ; } } return masterDomainForPool ; }
Source:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) , vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }

Target:
private static java.util.Set < java.lang.String > getSupportedEmulatedMachinesAsSet ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; }
Source:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; vfsTypeEditor.addContentWidgetContainerStyleName ( style.vfsTypeTextBoxEditor ( ) ) ; mountOptionsEditor.addContentWidgetContainerStyleName ( style.mountOptionsTextBoxEditor ( ) ) ; }

Target:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; vfsTypeEditor.addContentWidgetContainerStyleName ( style.vfsTypeTextBoxEditor ( ) ) ; mountOptionsEditor.addContentWidgetContainerStyleName ( style.mountOptionsTextBoxEditor ( ) ) ; glusterVolumesEditor.addContentWidgetContainerStyleName ( style.glusterVolumesEditor ( ) ) ; linkGlusterVolumeEditor.addContentWidgetContainerStyleName ( style.linkGlusterVolumeEditor ( ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getHostById ( 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.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult submitEventSync ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = submitTaskInternal ( event , callable ) ; if ( task != null ) { try { return task.get ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.eventqueue.EventQueueMonitor.log.errorFormat ( "Failed at submitEventSync, for pool {0} with exception {1}" , event.getStoragePoolId ( ) , e ) ; } } return null ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult submitEventSync ( org.ovirt.engine.core.common.eventqueue.Event event , java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > callable ) { java.util.concurrent.FutureTask < org.ovirt.engine.core.common.eventqueue.EventResult > task = submitTaskInternal ( event , callable ) ; if ( task != null ) { try { return task.get ( ) ; } catch ( java.util.concurrent.CancellationException e ) { org.ovirt.engine.core.bll.eventqueue.EventQueueMonitor.log.debugFormat ( "CancellationException at submitEventSync, for pool {0} with details {1}" , event.getStoragePoolId ( ) , e ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.eventqueue.EventQueueMonitor.log.errorFormat ( "Failed at submitEventSync, for pool {0} with exception {1}" , event.getStoragePoolId ( ) , e ) ; } } return null ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { org.ovirt.engine.core.common.queries.GetUnregisteredDiskQueryParameters params = ( ( org.ovirt.engine.core.common.queries.GetUnregisteredDiskQueryParameters ) ( invocation.getArguments ( ) [ 1 ] ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue unregDiskReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; unregDiskReturnValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.DiskImage newDiskImage = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ; org.mockito.Mockito.when ( newDiskImage.getId ( ) ) . thenReturn ( params.getDiskId ( ) ) ; unregDiskReturnValue.setReturnValue ( newDiskImage ) ; return unregDiskReturnValue ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { org.ovirt.engine.core.common.queries.GetUnregisteredDiskQueryParameters params = ( ( org.ovirt.engine.core.common.queries.GetUnregisteredDiskQueryParameters ) ( invocation.getArguments ( ) [ 1 ] ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue unregDiskReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; unregDiskReturnValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage newDiskImage = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ; org.mockito.Mockito.when ( newDiskImage.getId ( ) ) . thenReturn ( params.getDiskId ( ) ) ; unregDiskReturnValue.setReturnValue ( newDiskImage ) ; return unregDiskReturnValue ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.IPv4Address newPrimaryAddress ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface targetNic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setGateway ( targetNic.getGateway ( ) ) ; primaryAddress.setNetmask ( targetNic.getSubnet ( ) ) ; primaryAddress.setAddress ( targetNic.getAddress ( ) ) ; primaryAddress.setBootProtocol ( targetNic.getBootProtocol ( ) ) ; return primaryAddress ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.IPv4Address newPrimaryAddress ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface targetNic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setBootProtocol ( targetNic.getBootProtocol ( ) ) ; if ( ( primaryAddress.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { primaryAddress.setGateway ( targetNic.getGateway ( ) ) ; primaryAddress.setNetmask ( targetNic.getSubnet ( ) ) ; primaryAddress.setAddress ( targetNic.getAddress ( ) ) ; } return primaryAddress ; }
Source:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { java.lang.String dragDropEventData = event.getData ( "Text" ) ; java.lang.String type = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.getType ( dragDropEventData ) ; java.lang.String data = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.getData ( dragDropEventData ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , type , null , null , isDrop ) ) { animatedPanel.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }

Target:
private void doDrag ( com.google.gwt.event.dom.client.DragDropEventBase < ? > event , boolean isDrop ) { java.lang.String dragDropEventData = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.getDragDropEventData ( event , isDrop ) ; java.lang.String type = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.getType ( dragDropEventData ) ; java.lang.String data = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.getData ( dragDropEventData ) ; if ( data != null ) { if ( setupModel.candidateOperation ( data , type , null , null , isDrop ) ) { animatedPanel.getElement ( ) . addClassName ( style.networkGroupDragOver ( ) ) ; event.preventDefault ( ) ; } } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAdGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
private void discoverHostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost dhost = ( ( org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost ) ( getExternalDiscoveredHosts ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; if ( dhost != null ) { vds.setVdsName ( dhost.getName ( ) ) ; vds.setHostName ( dhost.getIp ( ) ) ; } updateModelFromVds ( vds , null , false , null ) ; getName ( ) . setIsChangable ( true ) ; }

Target:
private void externalHostGroups_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.ExternalHostGroup dhg = ( ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup ) ( getExternalHostGroups ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; if ( dhg != null ) { vds.setVdsName ( getName ( ) . getEntity ( ) ) ; vds.setHostName ( ( ( ( getName ( ) . getEntity ( ) ) + "." ) + ( dhg.getDomainName ( ) ) ) ) ; } updateModelFromVds ( vds , null , false , null ) ; }
Source:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( network , context , managementNetworkUtil ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters , context ) ; } }

Target:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder.class ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( network , nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , parameters , context ) ; } }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) ) , vmId ) ; }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }
Source:
public org.ovirt.engineextensions.aaa.ldap.ASN1OctetString decode ( java.lang.String value , org.ovirt.engineextensions.aaa.ldap.MapProperties props ) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat ( "yyyyMMddHHmmss" ) ; sdf.setTimeZone ( java.util.TimeZone.getTimeZone ( "UTC" ) ) ; return new org.ovirt.engineextensions.aaa.ldap.ASN1OctetString ( ( ( sdf.format ( new java.util.Date ( java.lang.Long.valueOf ( value ) ) ) ) + "Z" ) ) ; }

Target:
public com.unboundid.asn1.ASN1OctetString decode ( java.lang.String value , org.ovirt.engineextensions.aaa.ldap.MapProperties props ) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat ( "yyyyMMddHHmmss" ) ; sdf.setTimeZone ( java.util.TimeZone.getTimeZone ( "UTC" ) ) ; return new com.unboundid.asn1.ASN1OctetString ( ( ( sdf.format ( new java.util.Date ( java.lang.Long.valueOf ( value ) ) ) ) + "Z" ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult managementNetworkRequired ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . when ( ( ( networkCluster.isManagement ( ) ) && ( ! ( networkCluster.isRequired ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult managementNetworkRequired ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . when ( ( ( networkCluster.isManagement ( ) ) && ( ! ( networkCluster.isRequired ( ) ) ) ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getPredefinedProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; getPredefinedProperties ( version , vmStatic , map ) ; return map ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getVMProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { separeteCustomPropertiesToUserAndPredefined ( version , vmStatic ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; getPredefinedProperties ( version , vmStatic , map ) ; getUserDefinedProperties ( version , vmStatic , map ) ; return map ; }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.OriginType type , java.lang.String incoming ) { return type.name ( ) . toLowerCase ( ) ; }

Target:
private static java.lang.String getEffectiveSpiceProxy ( org.ovirt.engine.api.model.VM entity ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVmPoolSpiceProxy ( ) ) ) { return entity.getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVdsGroupSpiceProxy ( ) ) ) { return entity.getVdsGroupSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }
Source:
public void testUpdateCantDo ( ) { try { update ( false , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.jupiter.api.Assertions.assertNotNull ( e.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testUpdateCantDo ( ) { try { update ( false , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { verifyBadRequest ( e ) ; } }