auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) { return org.ovirt.engine.core.bll.RebootVmCommand.failVmStatusIllegal ( ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringUp ) ) ) { return org.ovirt.engine.core.bll.RebootVmCommand.failVmStatusIllegal ( ) ; } return true ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.TEMPLATE , getTemplateExclusiveLockMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplate ( ) ) != null ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.TEMPLATE , getTemplateExclusiveLockMessage ( ) ) ) ; } return null ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getEntityIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }
Source:
public void testExistingDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { setSdFullDiscardFunctionality ( ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }
Source:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; getImageTransferDao ( ) . remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endWithFailure ( ) ; log.error ( "Failed to upload (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }

Target:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully uploaded (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failCanDoAction ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failValidation ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getSourceStorageDomainId ( org.ovirt.engine.api.model.Disk disk ) { return asGuid ( disk.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getSourceStorageDomainId ( org.ovirt.engine.api.model.Disk disk ) { if ( disk.isSetStorageDomains ( ) ) { org.ovirt.engine.api.model.StorageDomain storageDomain = disk.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) ; if ( storageDomain != null ) { return asGuid ( storageDomain.getId ( ) ) ; } } return null ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( emptyParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.network.NicLabel > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( nullParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.network.NicLabel > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateGateway ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ATTACH_ILLEGAL_GATEWAY ) . when ( ( ( ( ( ipConfiguration != null ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( ipConfiguration.getGateway ( ) ) ) ) && ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( ) { return networkNotUsedByVms ( getNetwork ( ) . getName ( ) ) ; }
Source:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private boolean noChangesDetected ( ) { return ( ( ( getNetworks ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBonds ( ) . isEmpty ( ) ) ; }

Target:
private java.util.Set < java.lang.String > getRemovedBondNames ( ) { if ( ( removedBondNames ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingVdsInterfaceToBeRemoved = getRemovedBonds ( ) ; java.util.Set < java.lang.String > removedBondNames = new java.util.HashSet ( existingVdsInterfaceToBeRemoved.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface removedBondInterface : existingVdsInterfaceToBeRemoved ) { removedBondNames.add ( removedBondInterface.getName ( ) ) ; } this . removedBondNames = removedBondNames ; } return removedBondNames ; }
Source:
public boolean validate ( ) { super . validate ( ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; setIsValid ( ( ( getIsValid ( ) ) && ( getName ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }

Target:
public boolean validate ( ) { super . validate ( ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getDescription ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation ( ) } ) ; setIsValid ( ( ( getIsValid ( ) ) && ( getName ( ) . getIsValid ( ) ) ) ) ; return getIsValid ( ) ; }
Source:
private java.lang.String handleExcpetionalCases ( java.lang.String s , java.lang.String prefix ) { if ( s.equals ( "BaseDevice" ) ) { if ( prefix.contains ( "cdroms" ) ) { return "CdRom" ; } if ( prefix.contains ( "nics" ) ) { return "NIC" ; } if ( prefix.contains ( "disks" ) ) { return "Disk" ; } } return s ; }

Target:
private java.lang.String handleExcpetionalCases ( java.lang.String s , java.lang.String prefix ) { if ( s.equals ( "BaseDevice" ) ) { if ( prefix.contains ( "cdroms" ) ) { return "CdRom" ; } if ( prefix.contains ( "nics" ) ) { return "NIC" ; } if ( prefix.contains ( "disks" ) ) { return "Disk" ; } if ( prefix.contains ( "watchdogs" ) ) { return "WatchDog" ; } } return s ; }
Source:
public void testReadLatency ( ) { java.lang.String doulbeValue = "2" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doulbeValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getReadLatency ( ) , new java.lang.Double ( "0.000000002" ) ) ; }

Target:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getReadLatency ( ) , new java.lang.Double ( "0.000000002" ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return getPermissionList ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = getPermissionList ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) ; if ( hasHostExternalStatus ( ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getVdsId ( ) , org.ovirt.engine.core.common.VdcObjectType.VDS , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_HOST_CONFIGURATION ) ) ; } return permissionList ; }
Source:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setname ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; if ( returnStatus != ( org.ovirt.engine.core.common.errors.VdcBllErrors.Done ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.log.error ( "IrsBroker::getImageInfo::Failed getting image info imageId='{}' does not exist on domainName='{}', domainId='{}', error code: '{}', message: {}" , org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) . getStorageName ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) , returnStatus , imageInfoReturn.getXmlRpcStatus ( ) . mMessage ) ; throw new org.ovirt.engine.core.vdsbroker.irsbroker.IRSErrorException ( returnStatus.toString ( ) ) ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; if ( returnStatus != ( org.ovirt.engine.core.common.errors.EngineError.Done ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.log.error ( "IrsBroker::getImageInfo::Failed getting image info imageId='{}' does not exist on domainName='{}', domainId='{}', error code: '{}', message: {}" , org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) . getStorageName ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) , returnStatus , imageInfoReturn.getXmlRpcStatus ( ) . mMessage ) ; throw new org.ovirt.engine.core.vdsbroker.irsbroker.IRSErrorException ( returnStatus.toString ( ) ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult ( queryType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( f ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.Bond ) ) return false ; if ( ! ( super . equals ( o ) ) ) return false ; org.ovirt.engine.core.common.businessentities.network.Bond bond = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( o ) ) ; return java.util.Objects.equals ( getSlaves ( ) , bond.getSlaves ( ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.Bond ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.Bond other = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( slaves , other.slaves ) ) ; }
Source:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( boolean displayNetwork , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplayIsFalse ( displayNetwork , matcher , network , attachment ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; if ( ( imageTransfer.isSetDirection ( ) ) && ( ( imageTransfer.getDirection ( ) ) == ( org.ovirt.engine.api.model.ImageTransferDirection.DOWNLOAD ) ) ) { params.setTransferType ( TransferType.Download ) ; } params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.ImageTransfer imageTransfer ) { org.ovirt.engine.core.common.action.TransferDiskImageParameters params = new org.ovirt.engine.core.common.action.TransferDiskImageParameters ( ) ; if ( ( imageTransfer.isSetDirection ( ) ) && ( ( imageTransfer.getDirection ( ) ) == ( org.ovirt.engine.api.model.ImageTransferDirection.DOWNLOAD ) ) ) { params.setTransferType ( TransferType.Download ) ; } params.setImageId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( imageTransfer.getImage ( ) . getId ( ) ) ) ; return performCreate ( ActionType.TransferDiskImage , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetImageTransferById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void cleanup ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Start deleteAgedOutAuditLogs" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; auditLogDao.removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Finished deleteAgedOutAuditLogs" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "deleteAgedOutAuditLog failed with exception" , e ) ; } }

Target:
public void cleanup ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Start cleanup" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; auditLogDao.removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Finished cleanup" ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "Exception in performing audit log cleanup: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Exception" , t ) ; } }
Source:
public void replaceWithNameableCollection ( ) { org.ovirt.engine.core.common.businessentities.Nameable item = new org.ovirt.engine.core.common.businessentities.Nameable ( ) { @ java.lang.Override public java.lang.String getName ( ) { return org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_VALUE ; } } ; java.util.List < org.ovirt.engine.core.common.businessentities.Nameable > items = java.util.Collections.< org.ovirt.engine.core.common.businessentities.Nameable > singletonList ( item ) ; java.lang.String [ ] messageItems = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) ; validateMessageItems ( messageItems , items ) ; }

Target:
public void replaceWithNameableCollection ( ) { org.ovirt.engine.core.common.businessentities.Nameable item = new org.ovirt.engine.core.common.businessentities.Nameable ( ) { @ java.lang.Override public java.lang.String getName ( ) { return org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_VALUE ; } } ; java.util.List < org.ovirt.engine.core.common.businessentities.Nameable > items = java.util.Collections.< org.ovirt.engine.core.common.businessentities.Nameable > singletonList ( item ) ; validateReplacements ( org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) , items ) ; }
Source:
protected void updateConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { super . updateConsoleModel ( item ) ; if ( ( ( item.getEntity ( ) ) != null ) && ( ( item.getDefaultConsoleModel ( ) ) != null ) ) { item.getDefaultConsoleModel ( ) . setForceVmStatusUp ( true ) ; } }

Target:
public void forceRefresh ( ) { super . forceRefresh ( ) ; getvmBasicDiskListModel ( ) . forceRefresh ( ) ; }
Source:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.PoweredDown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDao ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }

Target:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.PoweredDown ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( args instanceof org.ovirt.engine.core.compat.PropertyChangedEventArgs ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( changedArgs.PropertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( changedArgs.PropertyName.contains ( "Alert" ) ) { updateAlerts ( getView ( ) , model ) ; } } }
Source:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
public void testDefaultRouteNonDefaultRouteNetworkIsIgnored ( ) { iface.setIpv4DefaultRoute ( true ) ; network.setDnsResolverConfiguration ( sampleDnsResolverConfiguration ) ; org.junit.Assert.assertThat ( createTestedInstance ( false , sampleDnsResolverConfiguration ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
private void testDnsResolverConfiguration ( org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration vdsDnsResolver , org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration networkDnsResolver , org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration attachmentDnsResolver , boolean expectedInSync ) { iface.setIpv4DefaultRoute ( true ) ; iface.setIpv4BootProtocol ( Ipv4BootProtocol.DHCP ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setBootProtocol ( Ipv4BootProtocol.DHCP ) ; testedNetworkAttachment.getIpConfiguration ( ) . setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; network.setDnsResolverConfiguration ( networkDnsResolver ) ; testedNetworkAttachment.setDnsResolverConfiguration ( attachmentDnsResolver ) ; org.junit.Assert.assertThat ( createTestedInstance ( true , vdsDnsResolver ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( expectedInSync ) ) ; }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getoVirtISOsList ( 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 != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private boolean isNetworkSubnetInSync ( ) { return getsSubnetUtilsInstance ( ) . equalSubnet ( iface.getIpv4Subnet ( ) , getPrimaryAddress ( ) . getNetmask ( ) ) ; }

Target:
private boolean isIpv4GatewayInSync ( ) { java.lang.String gatewayDesiredValue = getIpv4PrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv4Gateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { modelCommandInvoker.invokeDefaultCommand ( ) ; } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { getView ( ) . fireChangeEventsOnFields ( ) ; getView ( ) . flush ( ) ; modelCommandInvoker.invokeDefaultCommand ( ) ; } }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
private void updateTooltips ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.NewClusterPolicyModel model ) { org.ovirt.engine.core.common.scheduling.PolicyUnit selectedItem = ( ( org.ovirt.engine.core.common.scheduling.PolicyUnit ) ( model.getLoadBalanceList ( ) . getSelectedItem ( ) ) ) ; if ( selectedItem != null ) { loadBalanceListEditor.getElement ( ) . setTitle ( selectedItem.getDescription ( ) ) ; } }

Target:
private void updateTooltips ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.NewClusterPolicyModel model ) { org.ovirt.engine.core.common.scheduling.PolicyUnit selectedItem = ( ( org.ovirt.engine.core.common.scheduling.PolicyUnit ) ( model.getLoadBalanceList ( ) . getSelectedItem ( ) ) ) ; if ( selectedItem != null ) { loadBalanceListEditor.getElement ( ) . setTitle ( selectedItem.getDescription ( ) ) ; if ( selectedItem.isInternal ( ) ) { externalLabel.setText ( "" ) ; } else { externalLabel.setText ( constants.externalPolicyUnitLabel ( ) ) ; } } }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_6 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
private org.w3c.dom.Document generateSchema ( ) { org.w3c.dom.Document document = parser.newDocument ( ) ; javax.xml.transform.dom.DOMResult result = new javax.xml.transform.dom.DOMResult ( document ) ; try ( org.ovirt.api.metamodel.tool.XmlWriter writer = new org.ovirt.api.metamodel.tool.XmlWriter ( result ) ) { writer.setPrefix ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_PREFIX , org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI ) ; writer.setPrefix ( org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_PREFIX , org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_URI ) ; writeSchema ( writer ) ; return document ; } }

Target:
private org.w3c.dom.Document generateSchema ( ) { org.w3c.dom.Document document = parser.newDocument ( ) ; javax.xml.transform.dom.DOMResult result = new javax.xml.transform.dom.DOMResult ( document ) ; try ( org.ovirt.api.metamodel.tool.XmlWriter tmp = new org.ovirt.api.metamodel.tool.XmlWriter ( result ) ) { writer = tmp ; writer.setPrefix ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_PREFIX , org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI ) ; writer.setPrefix ( org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_PREFIX , org.ovirt.api.metamodel.tool.SchemaGenerator.JAXB_URI ) ; writeSchema ( ) ; return document ; } }
Source:
private void initAdvancedParameterExpanders ( ) { authenticationExpander.initWithContent ( authenticationExpanderContent.getElement ( ) ) ; networkExpander.initWithContent ( networkExpanderContent.getElement ( ) ) ; customScriptExpander.initWithContent ( customScriptExpanderContent.getElement ( ) ) ; sysprepScriptExpander.initWithContent ( sysprepScriptExpanderContent.getElement ( ) ) ; }

Target:
private void initAdvancedParameterExpanders ( ) { authenticationExpander.initWithContent ( authenticationExpanderContent.getElement ( ) ) ; networkExpander.initWithContent ( networkExpanderContent.getElement ( ) ) ; customScriptExpander.initWithContent ( customScriptExpanderContent.getElement ( ) ) ; sysprepScriptExpander.initWithContent ( sysprepScriptExpanderContent.getElement ( ) ) ; sysprepPasswordExpander.initWithContent ( sysprepPasswordExpanderContent.getElement ( ) ) ; sysprepInputsExpander.initWithContent ( sysprepInputsExpanderContent.getElement ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk populate ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk entity ) { org.ovirt.engine.api.model.Disk populatedDisk = super . populate ( model , entity ) ; populatedDisk.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; populatedDisk.getStorageDomain ( ) . setId ( this . storageDomainId.toString ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Disk deprecatedPopulate ( org.ovirt.engine.api.model.Disk model , org.ovirt.engine.api.model.Disk entity ) { org.ovirt.engine.api.model.Disk populatedDisk = super . doPopulate ( model , entity ) ; populatedDisk.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; populatedDisk.getStorageDomain ( ) . setId ( this . storageDomainId.toString ( ) ) ; return model ; }
Source:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( templateDiskImage.getId ( ) , templateId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , java.lang.Boolean.FALSE , null ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( templateDiskImage.getId ( ) , templateId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , java.lang.Boolean.FALSE , null ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpGetEntityExpectations ( 2 ) ; initParetResource ( resource.parent , uriInfo ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGet ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , false ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 1 ) ; }
Source:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void testNotificationService ( ) { org.ovirt.engine.core.notifier.NotificationService notificationService = null ; try { java.io.File config = new java.io.File ( "src/test/resources/conf/notifier.conf" ) ; org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( config.getAbsolutePath ( ) , null ) ; notificationService = new org.ovirt.engine.core.notifier.NotificationService ( org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ) ; } catch ( org.ovirt.engine.core.notifier.NotificationServiceException e ) { e.printStackTrace ( ) ; } org.junit.Assert.assertNotNull ( notificationService ) ; notificationService.run ( ) ; }

Target:
public void testNotificationService ( ) { org.ovirt.engine.core.notifier.NotificationService notificationService = null ; try { java.io.File config = new java.io.File ( "src/test/resources/conf/notifier.conf" ) ; org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( config.getAbsolutePath ( ) , null ) ; notificationService = new org.ovirt.engine.core.notifier.NotificationService ( org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ) ; } catch ( org.ovirt.engine.core.notifier.NotificationServiceException e ) { e.printStackTrace ( ) ; } org.junit.jupiter.api.Assertions.assertNotNull ( notificationService ) ; notificationService.run ( ) ; }
Source:
protected void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; decreasePendingVms ( vdsId , vm.getNumOfCpus ( ) , vm.getMinAllocatedMem ( ) , vm.getName ( ) ) ; }

Target:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }