auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testHostsRuleStructureNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.POSITIVE , entity.getVdsAffinityRule ( ) ) ; assertEquals ( false , entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructureNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( false , entity.isVdsEnforcing ( ) ) ; }
Source:
private void HandleEndAction ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getParameters ( ) . isRemoveTemplateFromDb ( ) ) { RemoveTemplateFromDb ( ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }

Target:
private void HandleEndAction ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getParameters ( ) . isRemoveTemplateFromDb ( ) ) { removeTemplateFromDb ( ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }
Source:
public void setEntity ( java.lang.Object value ) { super . setEntity ( ( value == null ? null : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( value ) ) . getTemplate ( ) ) ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportInterfaceListModel templateImportInterfaceListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( templateImportInterfaceListModel ) ; list.add ( templateImportDiskListModel ) ; setDetailModels ( list ) ; }
Source:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNetworkInterfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces != null ) ? vmNetworkInterfaces : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } return _vmInterfaces ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmNetworkInterfaces = org.ovirt.engine.core.bll.AddVmCommand.getVmNicDao ( ) . getAllForTemplate ( vmInterfacesSourceId ) ; _vmInterfaces = ( vmNetworkInterfaces == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) : vmNetworkInterfaces ; } return _vmInterfaces ; }
Source:
public void testFindDefaultManagementNetworkDefault ( ) { org.mockito.Mockito.when ( mockManagementNetworkUtil.getDefaultManagementNetworkName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME ) ; org.mockito.Mockito.when ( mockNetworkDao.getByNameAndDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( mockDefaultEngineNetwork ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockDefaultEngineNetwork ) ; }

Target:
public void testFindDefaultManagementNetworkDefault ( ) { org.mockito.Mockito.when ( mockManagementNetworkUtil.getDefaultManagementNetworkName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME ) ; org.mockito.Mockito.when ( mockNetworkDao.getByNameAndDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( mockDefaultEngineNetwork ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.jupiter.api.Assertions.assertSame ( actual , mockDefaultEngineNetwork ) ; }
Source:
private java.lang.String addPrefixToLogMessage ( java.lang.Object logMessage ) { java.lang.String correlationId = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getCorrelationId ( ) ; if ( correlationId == null ) { if ( logMessage == null ) { return null ; } else { return logMessage.toString ( ) ; } } return java.lang.String.format ( org.ovirt.engine.core.utils.log.Log.CORRELATION_ID_MESSAGE_FORMAT , correlationId , logMessage ) ; }

Target:
private java.lang.String convertToString ( java.lang.Object logMessage ) { return logMessage == null ? null : logMessage.toString ( ) ; }
Source:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }

Target:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }
Source:
private static int GetNextImage ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.common.businessentities.storage.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int getNextImage ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.common.businessentities.storage.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 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.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void acquireLockWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.debugFormat ( "Before acquiring and wait lock {0}" , lock ) ; validateLockForAcquireAndWait ( lock ) ; globalLock.lock ( ) ; try { while ( ! ( acquireLockInternal ( lock ) . getFirst ( ) ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.infoFormat ( "Failed to acquire lock and wait lock {0}" , lock ) ; releasedLock.await ( ) ; } } catch ( java.lang.InterruptedException e ) { } finally { globalLock.unlock ( ) ; } }

Target:
public void acquireLockWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.debug ( "Before acquiring and wait lock '{}'" , lock ) ; validateLockForAcquireAndWait ( lock ) ; globalLock.lock ( ) ; try { while ( ! ( acquireLockInternal ( lock ) . getFirst ( ) ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.info ( "Failed to acquire lock and wait lock '{}'" , lock ) ; releasedLock.await ( ) ; } } catch ( java.lang.InterruptedException e ) { } finally { globalLock.unlock ( ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpManagementNetworkExpectation ( ) ; control.replay ( ) ; final org.ovirt.engine.api.model.Cluster cluster = resource.get ( ) ; verifyModel ( cluster , 0 ) ; verifyManagementNetwork ( cluster ) ; }
Source:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.DisplayType type , java.lang.String incoming ) { switch ( type ) { case cirrus : return DisplayType.VNC.value ( ) ; case qxl : return DisplayType.SPICE.value ( ) ; default : return null ; } }

Target:
private static java.lang.String getEffectiveSpiceProxy ( org.ovirt.engine.api.model.VM entity ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVmPoolSpiceProxy ( ) ) ) { return entity.getVmPoolSpiceProxy ( ) ; } if ( org.apache.commons.lang.StringUtils.isNotBlank ( entity.getVdsGroupSpiceProxy ( ) ) ) { return entity.getVdsGroupSpiceProxy ( ) ; } java.lang.String globalSpiceProxy = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.SpiceProxyDefault ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( globalSpiceProxy ) ) { return globalSpiceProxy ; } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , DiskInterface.VirtIO_SCSI ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; }
Source:
public void validateIsoPrefixForInitrdAndNoPrefixForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , kernel ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , kernel ) ; }

Target:
public void validateIsoPrefixForInitrdAndNoPrefixForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , kernel ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , kernel ) ; }
Source:
public void testGetAllWithPermissionsForPriviligedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmTemplateDAOTest.NUMBER_OF_TEMPLATES_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingTemplate ) ; }

Target:
public void testGetAllWithPermissionsForUnpriviligedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > result = dao.getAll ( org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ID , true , VmEntityType.TEMPLATE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; }

Target:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( ( commandContext ) == null ) || ( ( commandContext.getExecutionContext ( ) ) == null ) ) || ( commandContext.getExecutionContext ( ) . isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; }

Target:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( ( commandContext ) == null ) || ( ( commandContext.getExecutionContext ( ) ) == null ) ) || ( commandContext.getExecutionContext ( ) . isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.CorrelationIdTracker.setCorrelationId ( command.getCorrelationId ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; }
Source:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( getDisk ( ) . getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }

Target:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( getDisk ( ) . getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }
Source:
public void testGetLunsThatBreakDiscardFunctionalityFullDiscardFunctionalityBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardFunctionality ( 0L , false ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardZeroesTheDataSupport = createLunWithDiscardFunctionality ( 1024L , false ) ; assertGetLunsThatBreakDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , lunThatBreaksDiscardSupport , lunThatBreaksDiscardZeroesTheDataSupport ) , java.util.Arrays.asList ( lunThatBreaksDiscardSupport , lunThatBreaksDiscardZeroesTheDataSupport ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityFullDiscardFunctionalityBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardFunctionality ( 0L , false ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardZeroesTheDataSupport = createLunWithDiscardFunctionality ( 1024L , false ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , lunThatBreaksDiscardSupport , lunThatBreaksDiscardZeroesTheDataSupport ) , java.util.Arrays.asList ( lunThatBreaksDiscardSupport , lunThatBreaksDiscardZeroesTheDataSupport ) ) ; }
Source:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( vm.isRunningOrPaused ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }

Target:
public static boolean isVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( vm.isRunningOrPaused ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , false , VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return createNetworkAttachment ( network , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { diskModels.add ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel.diskToModel ( disk ) ) ; } return diskModels ; }

Target:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { return disks.stream ( ) . map ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel :: diskToModel ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void testStorageLinks ( ) { org.ovirt.engine.api.model.HostStorage storage = new org.ovirt.engine.api.model.HostStorage ( ) ; storage.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_ID ) ; storage.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; storage.getHost ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storage ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_HREF , storage.getHref ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_HREF , storage.getHost ( ) . getHref ( ) ) ; }

Target:
public void testStorageLinks ( ) { org.ovirt.engine.api.model.HostStorage storage = new org.ovirt.engine.api.model.HostStorage ( ) ; storage.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_ID ) ; storage.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; storage.getHost ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storage ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_HREF , storage.getHref ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.HOST_HREF , storage.getHost ( ) . getHref ( ) ) ; }
Source:
private boolean vmDeviceChanged ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) , deviceType , device ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
private void addLogMessages ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase ) { if ( ! ( returnValueBase.getSucceeded ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.NUMA_UPDATE_VM_NUMA_NODE_FAILED ) ; } }
Source:
public org.ovirt.engine.api.model.VmPools list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( QueryType.GetAllVmPoolsAttachedToUser , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , SearchType.VmPools ) ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; } }

Target:
public org.ovirt.engine.api.model.VmPools list ( ) { if ( isFiltered ( ) ) { if ( isSortedAndMaxResults ( ) ) { return getVmPoolsFilteredAndSorted ( ) ; } else { return mapCollection ( getBackendCollection ( QueryType.GetAllVmPoolsAttachedToUser , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , SearchType.VmPools ) ) ; } } else { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; } }
Source:
protected void enableDisableBySync ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceModel model ) { boolean bootProtocolsAvailable = model.getBootProtocolsAvailable ( ) ; bootProtocolLabel.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; customPropertiesLabel.setEnabled ( bootProtocolsAvailable ) ; customPropertiesWidget.setEnabled ( bootProtocolsAvailable ) ; }

Target:
protected void enableDisableByBootProtocol ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceModel model ) { boolean bootProtocolsAvailable = model.getBootProtocolsAvailable ( ) ; bootProtocolLabel.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; }
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Cluster > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public java.lang.Boolean isMemoryHotUnplugSupportedByArchitecture ( org.ovirt.engine.core.common.businessentities.ArchitectureType architecture , org.ovirt.engine.core.compat.Version version ) { return memoryHotUnplugSupport.get ( architecture ) . get ( version ) ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , true ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertSame ( listOfRepoFiles.isEmpty ( ) , false ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDAOTest.getNewIsoRepoFile ( ) ; repoFileMetaDataDao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOAMIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface createNetworkInSyncWithVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( nic , network , hostNetworkQos ) ; }

Target:
org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface createNetworkInSyncWithVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( nic , network , hostNetworkQos , ( networkAttachment == null ? null : networkAttachment.getIpConfiguration ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { nicToVfsConfig.put ( vfsConfig.getNicId ( ) , vfsConfig ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }
Source:
public void setStreams ( java.io.InputStream incoming , java.io.OutputStream outgoing ) { _incoming = ( incoming == null ) ? null : new java.io.BufferedReader ( new java.io.InputStreamReader ( incoming , java.nio.charset.Charset.forName ( "UTF-8" ) ) , org.ovirt.engine.core.uutils.ssh.SSHDialogTest.BUFFER_SIZE ) ; _outgoing = ( outgoing == null ) ? null : new java.io.PrintWriter ( new java.io.OutputStreamWriter ( outgoing , java.nio.charset.Charset.forName ( "UTF-8" ) ) , true ) ; }

Target:
public void setStreams ( java.io.InputStream incoming , java.io.OutputStream outgoing ) { _incoming = ( incoming == null ) ? null : new java.io.BufferedReader ( new java.io.InputStreamReader ( incoming , java.nio.charset.StandardCharsets.UTF_8 ) , org.ovirt.engine.core.uutils.ssh.SSHDialogTest.BUFFER_SIZE ) ; _outgoing = ( outgoing == null ) ? null : new java.io.PrintWriter ( new java.io.OutputStreamWriter ( outgoing , java.nio.charset.StandardCharsets.UTF_8 ) , true ) ; }
Source:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainParametersBase ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand ( parameters , null ) ) ; lunFromVg = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromDb = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; }

Target:
private org.ovirt.engine.core.common.action.StorageDomainParametersBase createParameters ( ) { org.ovirt.engine.core.common.action.StorageDomainParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainParametersBase ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return params ; }
Source:
public org.ovirt.engine.core.common.businessentities.tags_vm_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.tags_vm_map entity = new org.ovirt.engine.core.common.businessentities.tags_vm_map ( ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; entity.setvm_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_id" ) ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.TagsVmMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmMap ( ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; entity.setvm_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_id" ) ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; return entity ; }
Source:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ; } return isVnc ; }

Target:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vga ) ; } return isVnc ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.lang.String localeName = localeBox.getValue ( localeBox.getSelectedIndex ( ) ) ; java.lang.String localeString = "" ; if ( ! ( localeName.equals ( "default" ) ) ) { localeString = "?locale=" + localeName ; } com.google.gwt.user.client.Window.open ( ( ( org.ovirt.engine.ui.common.view.AbstractLoginPopupView.getHostPageLocation ( ) ) + localeString ) , "_self" , "" ) ; }

Target:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.lang.String localeName = localeBox.getValue ( localeBox.getSelectedIndex ( ) ) ; java.lang.String localeString = "" ; if ( ! ( localeName.equals ( "default" ) ) ) { localeString = "?locale=" + localeName ; } com.google.gwt.user.client.Window.open ( ( ( org.ovirt.engine.ui.frontend.utils.FrontendUrlUtils.getCurrentPageURL ( ) ) + localeString ) , "_self" , "" ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public java.nio.channels.SocketChannel call ( ) throws java.io.IOException { java.net.InetAddress address = java.net.InetAddress.getByName ( hostname ) ; org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.info ( ( "Connecting to " + address ) ) ; final java.net.InetSocketAddress addr = new java.net.InetSocketAddress ( address , port ) ; final java.nio.channels.SocketChannel socketChannel = java.nio.channels.SocketChannel.open ( ) ; socketChannel.connect ( addr ) ; socketChannel.configureBlocking ( false ) ; return socketChannel ; }

Target:
public java.nio.channels.SocketChannel call ( ) throws java.io.IOException { java.net.InetAddress address = java.net.InetAddress.getByName ( hostname ) ; org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.info ( ( "Connecting to " + address ) ) ; final java.net.InetSocketAddress addr = new java.net.InetSocketAddress ( address , port ) ; final java.nio.channels.SocketChannel socketChannel = java.nio.channels.SocketChannel.open ( ) ; socketChannel.connect ( addr ) ; socketChannel.configureBlocking ( false ) ; updateLastHeartbeat ( ) ; return socketChannel ; }