auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }

Target:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.isFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQueryTest.EXISTING_VM_NAME ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; org.mockito.Mockito.when ( getQuery ( ) . getSnapshotVmConfigurationHelper ( ) ) . thenReturn ( snapshotVmConfigurationHelper ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDAOMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQueryTest.EXISTING_VM_NAME ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; org.mockito.Mockito.when ( getQuery ( ) . getSnapshotVmConfigurationHelper ( ) ) . thenReturn ( snapshotVmConfigurationHelper ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDaoMocks ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setNetworkStaticDetailsStyle ( ( ( ( model.getNetworkDhcp ( ) . getEntity ( ) ) == null ) || ( ! ( model.getNetworkDhcp ( ) . getEntity ( ) ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setNetworkDetailsStyle ( ( ( model.getNetworkList ( ) . getSelectedItem ( ) ) != null ) ) ; }
Source:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.singletonList ( networkAttachment ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworkValidator ( networkAttachments ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosNotPartiallyConfiguredWhenBothHasQos ( ) { testValidateQosNotPartiallyConfigured ( true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private java.lang.String getDirectoryUserSearchPattern ( java.lang.String username , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.DbUser.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.BackendUsersResource.DIRECTORY_USER_SEARCH_TEMPLATE , ( ( parent ) != null ? parent.getDirectory ( ) . getName ( ) : domain ) ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=" + username : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getDirectoryUserSearchPattern ( java.lang.String username , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbUser.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.BackendUsersResource.DIRECTORY_USER_SEARCH_TEMPLATE , ( ( parent ) != null ? parent.getDirectory ( ) . getName ( ) : domain ) ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=" + username : constraint ) ) ; return sb.toString ( ) ; }
Source:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM model = new org.ovirt.engine.core.common.businessentities.VM ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }

Target:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.Vm model = new org.ovirt.engine.api.restapi.resource.Vm ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { return createIdParameterMapper ( lun.getId ( ) ) . addValue ( "physical_volume_id" , lun.getphysical_volume_id ( ) ) . addValue ( "volume_group_id" , lun.getvolume_group_id ( ) ) . addValue ( "serial" , lun.getSerial ( ) ) . addValue ( "lun_mapping" , lun.getLunMapping ( ) ) . addValue ( "vendor_id" , lun.getVendorId ( ) ) . addValue ( "product_id" , lun.getProductId ( ) ) . addValue ( "device_size" , lun.getDeviceSize ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { return createIdParameterMapper ( lun.getId ( ) ) . addValue ( "physical_volume_id" , lun.getphysical_volume_id ( ) ) . addValue ( "volume_group_id" , lun.getvolume_group_id ( ) ) . addValue ( "serial" , lun.getSerial ( ) ) . addValue ( "lun_mapping" , lun.getLunMapping ( ) ) . addValue ( "vendor_id" , lun.getVendorId ( ) ) . addValue ( "product_id" , lun.getProductId ( ) ) . addValue ( "device_size" , lun.getDeviceSize ( ) ) ; }
Source:
private java.util.Collection < org.apache.commons.lang.math.LongRange > macPoolToRanges ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { final org.ovirt.engine.core.utils.DisjointRanges disjointRanges = new org.ovirt.engine.core.utils.DisjointRanges ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacRange macRange : macPool.getRanges ( ) ) { disjointRanges.addRange ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( macRange.getMacFrom ( ) ) , org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( macRange.getMacTo ( ) ) ) ; } return org.ovirt.engine.core.utils.MacAddressRangeUtils.clipMultiCastsFromRanges ( disjointRanges.getRanges ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolById ( org.ovirt.engine.core.compat.Guid macPoolId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { return getMacPoolById ( macPoolId , java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator ( commandContext ) ) ) ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfileWithPermissions = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.getCpuProfileDao ( ) . getAllForCluster ( vmBase.getClusterId ( ) , userId , ( userId != null ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfileWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } vmBase.setCpuProfileId ( cpuProfileWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult assignFirstCpuProfile ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Guid userId ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfileWithPermissions = cpuProfileDao.getAllForCluster ( vmBase.getClusterId ( ) , userId , ( userId != null ) , ActionGroup.ASSIGN_CPU_PROFILE ) ; if ( cpuProfileWithPermissions.isEmpty ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_CPU_PROFILE_EMPTY ) ; } vmBase.setCpuProfileId ( cpuProfileWithPermissions.get ( 0 ) . getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
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:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc copyData ( java.util.Map src , java.util.Map dst , boolean collapse ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.copyData" ) . withParameter ( "srcImage" , src ) . withParameter ( "dstImage" , dst ) . withParameter ( "collapse" , collapse ) . 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 ) ; }
Source:
private java.util.List < org.ovirt.engine.api.restapi.resource.StorageDomain > setUpVgs ( ) { java.util.List < org.ovirt.engine.api.restapi.resource.StorageDomain > vgs = new java.util.ArrayList < org.ovirt.engine.api.restapi.resource.StorageDomain > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { vgs.add ( getVgEntity ( i ) ) ; } return vgs ; }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }
Source:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > createMigrationDone ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = createPair ( ) ; setPairStatuses ( pair , VMStatus.MigratingFrom , VMStatus.Down ) ; pair.getSecond ( ) . getVmDynamic ( ) . setExitStatus ( VmExitStatus.Normal ) ; setDstHost ( pair ) ; return pair ; }

Target:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > createMigrationDone ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = createPair ( ) ; setPairStatuses ( pair , VMStatus.MigratingFrom , VMStatus.Down ) ; pair.getSecond ( ) . getVmDynamic ( ) . setExitStatus ( VmExitStatus.Normal ) ; pair.getSecond ( ) . getVmDynamic ( ) . setExitReason ( VmExitReason.MigrationSucceeded ) ; setDstHost ( pair ) ; return pair ; }
Source:
public void testDate ( ) { org.ovirt.engine.api.types.V4Vm object = objectFromJson ( "{'creation_time':'2016-01-17T17:18:23.123+01:00'}" ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "UTC+1" ) ; java.util.Calendar calendar = java.util.Calendar.getInstance ( tz ) ; calendar.clear ( ) ; calendar.set ( 2015 , 12 , 17 , 16 , 18 , 23 ) ; calendar.set ( java.util.Calendar.MILLISECOND , 123 ) ; java.util.Date date = calendar.getTime ( ) ; org.junit.Assert.assertEquals ( date , object.getCreationTime ( ) ) ; }

Target:
public void testDate ( ) { org.ovirt.engine.api.types.V4Vm object = objectFromJson ( "{'creation_time':'2016-01-17T17:18:23.123+01:00'}" ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "UTC+1" ) ; java.util.Calendar calendar = java.util.Calendar.getInstance ( tz ) ; calendar.clear ( ) ; calendar.set ( 2015 , 12 , 17 , 16 , 18 , 23 ) ; calendar.set ( java.util.Calendar.MILLISECOND , 123 ) ; java.util.Date date = calendar.getTime ( ) ; org.junit.Assert.assertEquals ( date , object.creationTime ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksFromDB ( ) { if ( ( cachedDisksFromDb ) == null ) { cachedDisksFromDb = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmTemplateFromSnapshotCommand.getVm ( ) . getDiskMap ( ) . values ( ) , false , true , true ) ; } return cachedDisksFromDb ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksFromDB ( ) { if ( ( cachedDisksFromDb ) == null ) { cachedDisksFromDb = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmTemplateFromSnapshotCommand.getVm ( ) . getDiskMap ( ) . values ( ) , false , true , true ) ; cachedDisksFromDb.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.bll.AddVmTemplateFromSnapshotCommand.getVm ( ) . getDiskMap ( ) . values ( ) , true ) ) ; } return cachedDisksFromDb ; }
Source:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void getAllByLabelForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllByLabelForCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.NETWORK_LABEL , FixturesTool.CLUSTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.NetworkDaoTest.NETWORK_LABEL , network.getLabel ( ) ) ; } }

Target:
public void getAllByLabelForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllByLabelForCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.NETWORK_LABEL , FixturesTool.CLUSTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.network.NetworkDaoTest.NETWORK_LABEL , network.getLabel ( ) ) ; } }
Source:
public static void GetRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void GetHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getNumberOfVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected boolean checkRemoveEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = getParameters ( ) . getClusterPolicyId ( ) ; if ( clusterPolicyId == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getClusterPolicy ( clusterPolicyId ) ; if ( clusterPolicy == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } if ( clusterPolicy.isLocked ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } return true ; }

Target:
protected boolean checkRemoveEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = getParameters ( ) . getClusterPolicyId ( ) ; if ( clusterPolicyId == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = schedulingManager.getClusterPolicy ( clusterPolicyId ) ; if ( clusterPolicy == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } if ( clusterPolicy.isLocked ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } return true ; }
Source:
private void init ( ) { leftBound.setEntity ( ( ( macRange.getMacFrom ( ) ) == null ? "" : macRange.getMacFrom ( ) ) ) ; rightBound.setEntity ( ( ( macRange.getMacTo ( ) ) == null ? "" : macRange.getMacTo ( ) ) ) ; }

Target:
private void init ( ) { leftBound.setEntity ( ( ( macRange.getMacFrom ( ) ) == null ? "" : macRange.getMacFrom ( ) ) ) ; rightBound.setEntity ( ( ( macRange.getMacTo ( ) ) == null ? "" : macRange.getMacTo ( ) ) ) ; recalculateMacsCount ( ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( javax.servlet.http.HttpServletRequest request , org.ovirt.engine.core.sso.utils.SsoSession ssoSession , java.lang.String clientId , java.lang.String clientSecret ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > payload = buildResponse ( ssoSession ) ; if ( org.ovirt.engine.core.sso.utils.SsoUtils.scopeAsList ( ssoSession.getScope ( ) ) . contains ( SsoConstants.OPENID_SCOPE ) ) { payload.put ( "id_token" , org.ovirt.engine.core.sso.utils.SsoUtils.createJWT ( request , ssoSession , clientId , clientSecret ) ) ; } return payload ; }

Target:
protected java.lang.String getTokenForAuthCode ( java.lang.String authCode ) { return ssoContext.getTokenForAuthCode ( authCode ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createNetworkInterface ( boolean plugged , java.lang.String name , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vmNic.setId ( id ) ; vmNic.setName ( name ) ; interfaces.add ( vmNic ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createNetworkInterfaceDevice ( plugged , id ) ; device.setIsManaged ( true ) ; return device ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createNetworkInterface ( boolean plugged , java.lang.String name , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vmNic.setId ( id ) ; vmNic.setName ( name ) ; interfaces.add ( vmNic ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createNetworkInterfaceDevice ( plugged , id ) ; device.setManaged ( true ) ; return device ; }
Source:
private void setVmWatchdogToParams ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.action.VmManagementParametersBase updateVmParams ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType wdModel = model.getWatchdogModel ( ) . getSelectedItem ( ) ; updateVmParams.setUpdateWatchdog ( true ) ; if ( wdModel != null ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; vmWatchdog.setAction ( model.getWatchdogAction ( ) . getSelectedItem ( ) ) ; vmWatchdog.setModel ( wdModel ) ; updateVmParams.setWatchdog ( vmWatchdog ) ; } }

Target:
protected void setObjectName ( java.lang.Object object , java.lang.String name ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) . setName ( name ) ; }
Source:
protected void updateCdImage ( boolean forceRefresh ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getModel ( ) . getSelectedDataCenter ( ) ; if ( dataCenter == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < java.lang.String > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < java.lang.String > images ) { setImagesToModel ( getModel ( ) , images ) ; } } ) , dataCenter.getId ( ) , forceRefresh ) ; }

Target:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < java.lang.String > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < java.lang.String > images ) { setImagesToModel ( getModel ( ) , images ) ; } } ) , storagePoolId ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addMemoryBalloon ( org.ovirt.engine.core.compat.Guid vmId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.BALLOON , VmDeviceType.MEMBALLOON , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemoryBalloonSpecParams ( ) , true , true ) ; }

Target:
public void addUsbSlots ( org.ovirt.engine.core.compat.Guid vmId , int numberOfSlots ) { for ( int index = 1 ; index <= numberOfSlots ; index ++ ) { addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmId ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , true , false ) ; } }
Source:
public static void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }

Target:
public static void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.Tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }
Source:
private static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ID > & java.lang.Comparable < T > , ID extends java.io.Serializable & java.lang.Comparable < ? super ID > > void updateAllInTransaction ( final java.util.Collection < T > entities , final org.ovirt.engine.core.dao.MassOperationsDao < T , ID > dao ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.updateAllInTransaction ( null , entities , dao ) ; }

Target:
private boolean devicePluggable ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isDisk ( device ) ) || ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) ; }
Source:
public void testRemoveNotExisting ( ) { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNotExisting ( ) { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testGetWithInvalidNetworkId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondWithNoMatchingNetworks ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetWithInvalidNetworkId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondWithNoMatchingNetworks ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void diskImagesNotIllegalSecondtIllegal ( ) { disk2.setImageStatus ( ImageStatus.ILLEGAL ) ; org.junit.Assert.assertThat ( validator.diskImagesNotIllegal ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk2 ) ) ) ) ) ; }

Target:
public void diskImagesNotIllegalSecondtIllegal ( ) { disk2.setImageStatus ( ImageStatus.ILLEGAL ) ; org.junit.Assert.assertThat ( validator.diskImagesNotIllegal ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk2 ) ) ) ) ) ; }
Source:
public static void mockAsyncDataProvider ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp = org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.setup.getMocks ( ) . asyncDataProvider ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; }

Target:
public static void mockAsyncDataProvider ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp = org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.setup.getMocks ( ) . asyncDataProvider ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.osNameExists ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getMaxVmNameLengthWin ( ) ) . thenReturn ( 15 ) ; org.mockito.Mockito.when ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.adp.getOsDefaultIconId ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.OS_TYPE , false ) ) . thenReturn ( org.ovirt.engine.ui.uicommonweb.models.vms.BaseVmTest.LARGE_OS_DEFAULT_ICON_ID ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > interfaces = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskInterface > interfaceTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) ; for ( java.lang.String diskIfs : interfaces ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.DiskInterface.valueOf ( diskIfs ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > interfaces = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > interfaceTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ( ) ; for ( java.lang.String diskIfs : interfaces ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.valueOf ( diskIfs ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }
Source:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.ImportVmCommand.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }
Source:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( ActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.RestartVdsCommand.getSucceeded ( ) ) { return org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.SYSTEM_VDS_RESTART : org.ovirt.engine.core.common.AuditLogType.USER_VDS_RESTART ; } else { return org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.SYSTEM_FAILED_VDS_RESTART : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_VDS_RESTART ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.RestartVdsCommand.getSucceeded ( ) ) { if ( skippedDueToFencingPolicy ) { return org.ovirt.engine.core.common.AuditLogType.VDS_NOT_RESTARTED_DUE_TO_POLICY ; } else { return org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.SYSTEM_VDS_RESTART : org.ovirt.engine.core.common.AuditLogType.USER_VDS_RESTART ; } } else { return org.ovirt.engine.core.bll.RestartVdsCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.SYSTEM_FAILED_VDS_RESTART : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_VDS_RESTART ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getCpuName ( ) ) ) { return org.ovirt.engine.core.bll.CpuFlagsManagerHandler.getArchitectureByCpuName ( getVdsGroup ( ) . getCpuName ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getCpuName ( ) ) ) { return org.ovirt.engine.core.bll.VdsGroupOperationCommandBase.getCpuFlagsManagerHandler ( ) . getArchitectureByCpuName ( getVdsGroup ( ) . getCpuName ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }
Source:
private boolean isCreateSnapshotAvailable ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > list ) { if ( ( getSelectedItems ( ) . size ( ) ) == 1 ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = list.get ( 0 ) ; return ( volumeEntity.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; } else { return false ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue1 ) { clusterSnapshotConfigModel.getClusters ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue1 ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) , unitVmModel ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { networkCreatingManager.updateVnics ( ( ( idToUpdate ) == null ? ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) : idToUpdate ) , unitVmModel.getNicsWithLogicalNetworks ( ) . getItems ( ) , unitVmModel ) ; } else { networkCreatingManager.getCallback ( ) . queryFailed ( ) ; } }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setBootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenStaticBootProtocolNetmaskDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocolNetmask ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }