auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Void runInTransaction ( ) { if ( ( ! ( imageTemplates.isEmpty ( ) ) ) && ( removeVmTemplateImages ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } if ( ! ( cinderDisks.isEmpty ( ) ) ) { removeCinderDisks ( cinderDisks ) ; setSucceeded ( true ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ( ! ( diskImages.isEmpty ( ) ) ) && ( removeVmTemplateImages ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } if ( ! ( cinderDisks.isEmpty ( ) ) ) { removeCinderDisks ( cinderDisks ) ; setSucceeded ( true ) ; } return null ; }
Source:
public void setItems ( java.util.Collection value ) { if ( value == null ) { super . setItems ( null ) ; return ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) ; super . setItems ( disks ) ; }

Target:
public void setItems ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks == null ) { super . setItems ( null ) ; return ; } super . setItems ( disks ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.setTicket" ) . withParameter ( "vmID" , vmId ) . withParameter ( "password" , otp64 ) . withParameter ( "ttl" , sec ) . withParameter ( "existingConnAction" , connectionAction ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
private void waitUntilCheck ( java.util.function.Predicate < org.ovirt.vdsm.jsonrpc.client.JsonRpcClient > check , java.lang.String formatBefore , java.lang.String formatAfter ) throws java.lang.InterruptedException { java.lang.String hostname = client.getHostname ( ) ; org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatBefore , hostname ) ; int retries = 50 ; while ( check.test ( this . client ) ) { if ( retries == 0 ) { throw new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( ( ( "Unable to reconnect to " + hostname ) + " after policy reset" ) ) ; } retries -- ; java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( 200 ) ; } org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcVdsServer.logger.debug ( formatAfter , hostname ) ; }
Source:
private void removeNodes ( java.util.List < org.codehaus.jackson.JsonNode > nodes , org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse errorResponse ) { for ( org.codehaus.jackson.JsonNode id : nodes ) { remove ( this . map.get ( id ) , id , errorResponse ) ; } }

Target:
private void removeNodes ( java.util.List < org.codehaus.jackson.JsonNode > nodes , org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse errorResponse ) { for ( org.codehaus.jackson.JsonNode id : nodes ) { if ( org.codehaus.jackson.node.NullNode.class . isInstance ( id ) ) continue ; remove ( this . map.get ( id ) , id , errorResponse ) ; } }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getTemplateNicList ( 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 < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.RunVmCommandBase.getVdsBroker ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmOnDown ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.RunVmCommandBase.getVdsBroker ( ) . removeAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmOnDown ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public void testMissingParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "VM" , "name" , "host" , "status" ) ; } }

Target:
public void testMissingParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host" , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "name" , "host" , "status" ) ; } }
Source:
private java.lang.Integer getPmPrimaryPortAsInteger ( ) { if ( ( ( getPmPort ( ) ) != null ) && ( ( getPmPort ( ) . getEntity ( ) ) != null ) ) { return java.lang.Integer.valueOf ( getPmPort ( ) . getEntity ( ) ) ; } else { return null ; } }

Target:
public void resetKernelCmdline ( ) { setKernelCmdlineParsable ( true ) ; kernelCmdlineListener.whilePaused ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { getKernelCmdline ( ) . setEntity ( "" ) ; } } ) ; resetKernelCmdlineCheckboxes ( ) ; }
Source:
public boolean addOperationList ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > > operationList ) { boolean allowed = true ; for ( org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation : operationList ) { if ( ! ( addOperationImpl ( operation ) ) ) { allowed = false ; } } processor.processOperation ( this ) ; return allowed ; }

Target:
public void addOperationList ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > > operationList ) { operationList.stream ( ) . forEach ( this :: addOperation ) ; processor.processOperation ( this ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; getView ( ) . getTestButton ( ) . getCommand ( ) . execute ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }
Source:
public static void GetMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { macPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; final org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacadeMock ) ; org.mockito.Mockito.when ( dbFacadeMock.getMacPoolDao ( ) ) . thenReturn ( macPoolDaoMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { this . macPoolValidator = createMacPoolValidator ( macPool ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getMacPoolDao ( ) ) . thenReturn ( macPoolDaoMock ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = vmPoolDao.getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }
Source:
public void validateCantUploadDiskAttached ( ) { initializeSuppliedImage ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_ATTACHED_TO_VMS , "" ) ) . when ( diskValidator ) . isDiskAttachedToAnyNonDownVm ( ) ; getCommand ( ) . validate ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "Can't start a transfer for an image that is attached to any VMs." , getCommand ( ) , EngineMessage.ACTION_TYPE_FAILED_DISK_ATTACHED_TO_VMS ) ; }

Target:
public void validateCantUploadDiskAttached ( ) { initializeSuppliedImage ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_ATTACHED_TO_VMS , "" ) ) . when ( diskValidator ) . isDiskAPluggedToAnyNonDownVm ( ) ; getCommand ( ) . validate ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "Can't start a transfer for an image that is attached to any VMs." , getCommand ( ) , EngineMessage.ACTION_TYPE_FAILED_DISK_ATTACHED_TO_VMS ) ; }
Source:
public void testValidModifiedBondsFailsWhenInsufficientNumberOfSlaves ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , bond.getName ( ) ) ) , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }
Source:
private void UpdateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.ArrayList selectedItems = ( ( java.util.ArrayList ) ( ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.ArrayList selectedItems = ( ( java.util.ArrayList ) ( ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }
Source:
public void initOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }

Target:
public void initOsNames ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { osNames = returnValue.getReturnValue ( ) ; initOsIds ( ) ; } } ) ) ; }
Source:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return "" ; } return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.cdPathWindowsToLinux ( windowsPath , ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.VdsAndPoolIDVDSParametersBase ( vdsId , storagePoolId ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > destStorages ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getStoragePoolId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages ) ; }
Source:
public void testListLimitResultsBadFormat ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; org.junit.Assert.fail ( "Expected WebFaultException" ) ; }

Target:
public void testListLimitResultsBadFormat ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; org.junit.jupiter.api.Assertions.assertThrows ( org.ovirt.engine.api.restapi.resource.BaseBackendResource.WebFaultException.class , this :: getCollection ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; } return vms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; } return vms ; }
Source:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host" , e ) ; return null ; } }

Target:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host with message {0}" , e.getMessage ( ) ) ; return null ; } }
Source:
public void glusterServiceSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void glusterServiceSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static java.util.Date UtcDateStringToLocaDate ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isBlank ( str ) ) { return null ; } try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e1 ) { try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcFallbackDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e ) { org.ovirt.engine.core.utils.ovf.OvfParser.log.error ( "OVF DateTime format error: '{}', Expected: yyyy/M/dd hh:mm:ss" , e.getMessage ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfParser.log.debug ( "Exception" , e ) ; return null ; } } }

Target:
public static java.util.Date utcDateStringToLocaDate ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isBlank ( str ) ) { return null ; } try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e1 ) { try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcFallbackDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e ) { org.ovirt.engine.core.utils.ovf.OvfParser.log.error ( "OVF DateTime format error: '{}', Expected: yyyy/M/dd hh:mm:ss" , e.getMessage ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfParser.log.debug ( "Exception" , e ) ; return null ; } } }
Source:
protected boolean canDoAction ( ) { return ( ( ( super . canDoAction ( ) ) && ( vdsGroupExists ( ) ) ) && ( changesAreClusterCompatible ( ) ) ) && ( logicalNetworkExists ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) ) ; return ( ( ( vdsGroupExists ( ) ) && ( changesAreClusterCompatible ( ) ) ) && ( logicalNetworkExists ( ) ) ) && ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) ; }
Source:
public void successfulFenceWith1stSuccess ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }

Target:
public void successfulFenceWith1stSuccess ( ) { mockFenceAgents ( ) ; mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; mockFenceResult ( agentExecutor2 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.STATUS ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } return results ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }
Source:
private void createSnapshot ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; if ( ( vm == null ) || ( ( getWindow ( ) ) != null ) ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel.createNewSnapshotModel ( this ) ; model.setValidateByVmSnapshots ( true ) ; setWindow ( model ) ; model.setVm ( vm ) ; model.initialize ( ) ; }

Target:
private void newVm ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ( ) , this ) ; setupNewVmModel ( model , VmType.Server , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
public void deleteJob ( java.lang.String jobId ) { try { sched.deleteJob ( org.quartz.JobKey.jobKey ( jobId , Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( ( "failed to delete a job with id=" + jobId ) , se ) ; } }

Target:
public void pauseJob ( java.lang.String jobId ) { try { sched.pauseJob ( org.quartz.JobKey.jobKey ( jobId , Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to pause a job with id={}: {}" , jobId , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( final org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , java.lang.String name ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVdsGroupId ( host.getVdsGroupId ( ) ) ; vm.setRunOnVds ( host.getId ( ) ) ; vm.setStatus ( vmStatus ) ; vm.setName ( name ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVM ( final org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , java.lang.String name ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setClusterId ( host.getClusterId ( ) ) ; vm.setRunOnVds ( host.getId ( ) ) ; vm.setStatus ( vmStatus ) ; vm.setName ( name ) ; return vm ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private static void doTestNoStringSubstitution ( java.lang.String name ) { java.util.Locale locale = java.util.Locale.ENGLISH ; try { java.util.Locale.setDefault ( java.util.Locale.ENGLISH ) ; org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.lang.String error = et.TranslateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error ) ; } finally { java.util.Locale.setDefault ( locale ) ; } }

Target:
private static void doTestNoStringSubstitution ( java.lang.String name ) { java.util.Locale locale = java.util.Locale.ENGLISH ; try { java.util.Locale.setDefault ( java.util.Locale.ENGLISH ) ; org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.lang.String error = et.translateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error ) ; } finally { java.util.Locale.setDefault ( locale ) ; } }
Source:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }

Target:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { addViolation ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { addViolation ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_dynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
public void managementNetworkAttachmentInvalid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( networkCluster.isRequired ( ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.junit.Assert.assertThat ( validator.managementNetworkAttachment ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }

Target:
public void managementNetworkAttachmentInvalid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( networkCluster.isRequired ( ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.junit.Assert.assertThat ( validator.managementNetworkAttachment ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTest.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { final boolean managementNetwork1 = net1.getCluster ( ) . isManagement ( ) ; final boolean managementNetwork2 = net2.getCluster ( ) . isManagement ( ) ; if ( ( ! managementNetwork1 ) && ( ! managementNetwork2 ) ) { return lexoNumeric.compare ( net1.getName ( ) , net2.getName ( ) ) ; } else { return managementNetwork1 ? - 1 : 1 ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { final boolean managementNetwork1 = net1.getCluster ( ) . isManagement ( ) ; final boolean managementNetwork2 = net2.getCluster ( ) . isManagement ( ) ; int retVal = ( - 1 ) * ( java.lang.Boolean.compare ( managementNetwork1 , managementNetwork2 ) ) ; if ( retVal != 0 ) { return retVal ; } return lexoNumeric.compare ( net1.getName ( ) , net2.getName ( ) ) ; }
Source:
public void testGetDeviceListWithDeviceListAndLunsIds ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setId ( "lun1" ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setId ( "lun2" ) ; parameters.setDeviceList ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; java.util.List < java.lang.String > lunsIds = java.util.Collections.singletonList ( "lun2" ) ; org.junit.Assert.assertEquals ( command.getDeviceList ( lunsIds ) , java.util.Collections.singletonList ( lun2 ) ) ; }

Target:
public void testValidateStoragePoolRandomStoragePoolId ( ) { command.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( command.validateStoragePool ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }
Source:
private void auditLogFailedToStoreDiskFields ( java.lang.String diskAlias , java.lang.String diskFieldsNames ) { java.util.Map < java.lang.String , java.lang.String > customValues = new java.util.HashMap < > ( ) ; customValues.put ( "DiskAlias" , diskAlias ) ; customValues.put ( "DiskFieldsNames" , diskFieldsNames ) ; auditLog ( customValues , AuditLogType.FAILED_TO_STORE_DISK_FIELDS_IN_DISK_DESCRIPTION_METADATA ) ; }

Target:
private void auditLogFailedToStoreDiskFields ( java.lang.String diskAlias , java.lang.String diskFieldsNames ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = createDiskEvent ( diskAlias ) ; logable.addCustomValue ( "DiskFieldsNames" , diskFieldsNames ) ; getAuditLogDirector ( ) . log ( logable , AuditLogType.FAILED_TO_STORE_DISK_FIELDS_IN_DISK_DESCRIPTION_METADATA ) ; }
Source:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.requestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }

Target:
private void startRefresh ( ) { if ( ( getTimer ( ) ) != null ) { getTimer ( ) . start ( ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc importCandidate ( java.lang.String sdUUID , java.lang.String vmGUID , java.lang.String templateGUID , java.lang.String templateVolGUID , java.lang.String path , java.lang.String type , java.lang.String force ) { return null ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ResizeStorageDomainPVMapReturnForXmlRpc resizeStorageDomainPV ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String device ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.resizePV" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "guid" , device ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "size" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.ResizeStorageDomainPVMapReturnForXmlRpc ( response ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getvds_group_id ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }