auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response CancelVm ( org.ovirt.optimizer.service.facts.RunningVm request , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Origin" , "*" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Methods" , "POST" ) ; response.getOutputHeaders ( ) . putSingle ( "Access-Control-Allow-Headers" , "Content-Type" ) ; optimizer.cancelVmStart ( cluster , request.getId ( ) ) ; return javax.ws.rs.core.Response.ok ( ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response CancelVm ( org.ovirt.optimizer.service.facts.RunningVm request , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { optimizer.cancelVmStart ( cluster , request.getId ( ) ) ; return javax.ws.rs.core.Response.ok ( ) . header ( "Access-Control-Allow-Origin" , "*" ) . header ( "Access-Control-Allow-Methods" , "POST" ) . header ( "Access-Control-Allow-Headers" , "Content-Type" ) . build ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; model.SetDataCenter ( model , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { dataCenter } ) ) ) ; model.getDataCenter ( ) . setIsChangable ( false ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenter ( model , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StoragePool [ ] { dataCenter } ) ) ) ; model.getDataCenter ( ) . setIsChangable ( false ) ; }
Source:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }

Target:
protected boolean validateStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = getSnapshotsDummiesForStorageAllocations ( ) ; org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( disksList ) ) ) ; }
Source:
public void testFetchVmDisks ( ) throws java.io.IOException { try { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > disks = org.ovirt.engine.core.utils.OvfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } }

Target:
public void testFetchVmDisks ( ) throws java.io.IOException { try { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = org.ovirt.engine.core.utils.OvfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( profile.getCustomProperties ( ) ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return createIdParameterMapper ( profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "description" , profile.getDescription ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( profile.getCustomProperties ( ) ) ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = getModel ( ) . getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = getModel ( ) . CloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = getModel ( ) . getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = getModel ( ) . cloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.ColdMerge , new org.ovirt.engine.core.common.vdscommands.ColdMergeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getSubchainInfo ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { completeGenerationInfo ( ) ; org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithFailover ( VDSCommandType.ColdMerge , new org.ovirt.engine.core.common.vdscommands.ColdMergeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getSubchainInfo ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.setSucceeded ( true ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAAAProfilesListViaPublic ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void shouldAllowUnpinnedNumaNodes ( ) { validVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isVmReadyForUpgrade ( validVM ) , org.hamcrest.core.Is.is ( org.hamcrest.Matchers.empty ( ) ) ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_NUMA_PINNED ) ) ; }
Source:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond1" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
private boolean stopVms ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ! ( vm.isDown ( ) ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.StopVm , withRootCommandInfo ( new org.ovirt.engine.core.common.action.StopVmParameters ( vm.getId ( ) , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.getActionType ( ) ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { return false ; } } } return true ; }

Target:
private boolean removeAllVmsInPool ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ( ! ( vmsRemoved.contains ( vm.getId ( ) ) ) ) && ( ! ( removeVm ( vm ) ) ) ) { return false ; } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage getDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setread_rate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_RATE ) ; disk.setwrite_rate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_RATE ) ; disk.setReadLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_LATENCY ) ; disk.setWriteLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_LATENCY ) ; disk.setFlushLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.FLUSH_LATENCY ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage getDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setReadRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_RATE ) ; disk.setWriteRate ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_RATE ) ; disk.setReadLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.READ_LATENCY ) ; disk.setWriteLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.WRITE_LATENCY ) ; disk.setFlushLatency ( org.ovirt.engine.api.restapi.resource.DiskStatisticalQueryTest.FLUSH_LATENCY ) ; return disk ; }
Source:
private void handleOperationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable throwable , org.ovirt.engine.core.bll.adbroker.LdapCredentials credentials ) { response.setServerScore ( Score.HIGH ) . setTranslatedException ( new org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ( org.ovirt.engine.core.utils.kerberos.AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED , throwable ) ) . setTryNextServer ( false ) ; org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.logEventForUser ( credentials.getUserName ( ) , AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED.getAuditLogType ( ) ) ; }

Target:
private void handleOperationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable throwable , org.ovirt.engine.core.bll.adbroker.LdapCredentials credentials ) { response.setOrderingAlgorithm ( OrderingAlgorithmType.NO_OP ) . setTranslatedException ( new org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ( org.ovirt.engine.core.utils.kerberos.AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED , throwable ) ) . setTryNextServer ( false ) ; org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.logEventForUser ( credentials.getUserName ( ) , AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED.getAuditLogType ( ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "OpenstackNetworkProviderProperties [pluginType=" ) . append ( getPluginType ( ) ) . append ( ", tenantName=" ) . append ( getTenantName ( ) ) . append ( "]" ) ; return builder.toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "pluginType" , getPluginType ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.onSuccess ( asyncQuery.Model , ifacesOptions ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.onSuccess ( asyncQuery.model , ifacesOptions ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRebalance ( glusterVolume ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setit_guid ( itGuid ) ; return expectedDisk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setImageTemplateId ( itGuid ) ; return expectedDisk ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getNetworkCluster ( ) { if ( ( networkCluster ) == null ) { org.ovirt.engine.core.common.businessentities.network.NetworkClusterId networkClusterId = new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( host.getVdsGroupId ( ) , getNetwork ( ) . getId ( ) ) ; networkCluster = getDbFacade ( ) . getNetworkClusterDao ( ) . get ( networkClusterId ) ; } return networkCluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getNetworkCluster ( ) { if ( ( networkCluster ) == null ) { org.ovirt.engine.core.common.businessentities.network.NetworkClusterId networkClusterId = new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( host.getVdsGroupId ( ) , attachment.getNetworkId ( ) ) ; networkCluster = networkClusterDao.get ( networkClusterId ) ; } return networkCluster ; }
Source:
private void mockHasVolumeOnServer ( boolean isBricksRequired ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; if ( isBricksRequired ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; brick.setServerId ( command.getVdsId ( ) ) ; bricks.add ( brick ) ; } org.mockito.Mockito.when ( glusterBrickDao.getGlusterVolumeBricksByServerId ( command.getVdsId ( ) ) ) . thenReturn ( bricks ) ; }

Target:
private void mockHasVolumeOnServer ( boolean isBricksRequired ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; if ( isBricksRequired ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; brick.setServerId ( command.getVdsId ( ) ) ; bricks.add ( brick ) ; } org.mockito.Mockito.when ( glusterBrickDao.getGlusterVolumeBricksByServerId ( command.getVdsId ( ) ) ) . thenReturn ( bricks ) ; }
Source:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid , new java.util.ArrayList < > ( ) ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; return runVmAsStateless ( vmToPrestart ) ; } return false ; }

Target:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid , java.util.List < java.lang.String > messages ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid , messages ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; return runVmAsStateless ( vmToPrestart ) ; } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc importImage ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String dstImgGUID , java.lang.String dstVolUUID , java.lang.String importLocation ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.importImage ( spUUID , sdUUID , dstImgGUID , dstVolUUID , importLocation ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc downloadImage ( java.util.Map methodInfo , java.lang.String spUUID , java.lang.String sdUUID , java.lang.String dstImgGUID , java.lang.String dstVolUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = irsServer.downloadImage ( methodInfo , spUUID , sdUUID , dstImgGUID , dstVolUUID ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertFalse ( model.isSetVm ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; assertEquals ( model.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertFalse ( model.isSetVm ( ) ) ; org.junit.Assert.assertTrue ( model.isSparse ( ) ) ; org.junit.Assert.assertTrue ( model.isPropagateErrors ( ) ) ; org.junit.Assert.assertEquals ( model.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }
Source:
private static java.lang.String getKvmNested ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean kvmNested ) { if ( ! kvmNested ) { return "" ; } switch ( cpuVendor ) { case AMD : return "kvm-amd.nested=on " ; case INTEL : return "kvm-intel.nested=on " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }

Target:
private static java.lang.String getKvmNested ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean kvmNested ) { if ( ! kvmNested ) { return "" ; } switch ( cpuVendor ) { case AMD : return "kvm-amd.nested=1 " ; case INTEL : return "kvm-intel.nested=1 " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel object ) { org.ovirt.engine.ui.common.view.popup.DefaultConfirmationPopupView.Driver.driver.edit ( object ) ; object.getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < java.lang.String > items = ( ( java.util.ArrayList < java.lang.String > ) ( object.getItems ( ) ) ) ; for ( java.lang.String item : items ) { descriptionPanel.add ( new com.google.gwt.user.client.ui.Label ( item ) ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel object ) { driver.edit ( object ) ; object.getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.ArrayList < java.lang.String > items = ( ( java.util.ArrayList < java.lang.String > ) ( object.getItems ( ) ) ) ; for ( java.lang.String item : items ) { descriptionPanel.add ( new com.google.gwt.user.client.ui.Label ( item ) ) ; } } } ) ; }
Source:
public void testIsFileDomain ( ) { junit.framework.Assert.assertFalse ( StorageType.FCP.isFileDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.ISCSI.isFileDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.NFS.isFileDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.LOCALFS.isFileDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.POSIXFS.isFileDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.GLUSTERFS.isFileDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.GLANCE.isFileDomain ( ) ) ; }

Target:
public void testIsFileDomain ( ) { org.junit.Assert.assertFalse ( StorageType.FCP.isFileDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.ISCSI.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.NFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.LOCALFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.POSIXFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLUSTERFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLANCE.isFileDomain ( ) ) ; }
Source:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { initTemplate ( ) ; super . initialize ( systemTreeSelectedItem ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( pool.getVmPoolSpiceProxy ( ) ) ) ) { getModel ( ) . getSpiceProxyEnabled ( ) . setEntity ( true ) ; getModel ( ) . getSpiceProxy ( ) . setEntity ( pool.getVmPoolSpiceProxy ( ) ) ; getModel ( ) . getSpiceProxy ( ) . setIsChangable ( true ) ; } instanceTypeManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingPoolInstanceTypeManager ( getModel ( ) , pool ) ; }

Target:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { initTemplate ( ) ; super . initialize ( systemTreeSelectedItem ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( pool.getVmPoolSpiceProxy ( ) ) ) ) { getModel ( ) . getSpiceProxyEnabled ( ) . setEntity ( true ) ; getModel ( ) . getSpiceProxy ( ) . setEntity ( pool.getVmPoolSpiceProxy ( ) ) ; getModel ( ) . getSpiceProxy ( ) . setIsChangable ( true ) ; } instanceTypeManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingPoolInstanceTypeManager ( getModel ( ) , pool ) ; instanceTypeManager.setAlwaysEnabledFieldUpdate ( true ) ; }
Source:
public java.util.List < java.lang.String > getList ( org.ovirt.engine.sdk.entities.DetailedLink link , java.lang.String key ) { java.lang.String value = get ( link , key ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptyList ( ) ; } return java.util.Arrays.asList ( value.split ( "\\s" ) ) ; }

Target:
public void putList ( java.lang.String key , java.util.List < java.lang.String > values ) { if ( values == null ) { values = java.util.Collections.emptyList ( ) ; } java.lang.String value = java.lang.String.join ( " " , values ) ; put ( key , value ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index , org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( v ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( int index , org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( v ) ; return cluster ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { sanStorageLunToTargetList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageLunToTargetList ( object , true , multiSelection ) ; sanStorageLunToTargetList.activateItemsUpdate ( ) ; sanStorageLunToTargetList.setTreeContainerStyleName ( style.treePanel ( ) ) ; listPanel.add ( sanStorageLunToTargetList ) ; }

Target:
protected void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { sanStorageLunToTargetList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageLunToTargetList ( object , true , multiSelection ) ; sanStorageLunToTargetList.activateItemsUpdate ( ) ; sanStorageLunToTargetList.setTreeContainerHeight ( listHeight ) ; contentPanel.getElement ( ) . getStyle ( ) . setHeight ( panelHeight , Unit.PX ) ; listPanel.add ( sanStorageLunToTargetList ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeGeoRepStatusForMasterVolume ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ) ( returnValue ) ) ; java.util.Collections.sort ( geoRepSessions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) ; setItems ( geoRepSessions ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeGeoRepStatusForMasterVolume ( new org.ovirt.engine.ui.uicommonweb.models.gluster.SetSortedRawItemsAsyncQuery ( new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public void testHostTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; tag.getHost ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testHostTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; tag.getHost ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_TAG_HREF , tag.getHref ( ) ) ; }
Source:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.Guid guid1 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.Guid guid2 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.Assert.assertEquals ( 0 , guid1.compareTo ( guid1 ) ) ; org.junit.Assert.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }

Target:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.Guid guid1 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.Guid guid2 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , guid1.compareTo ( guid1 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }
Source:
private void massLabelsUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < java.lang.String > labels ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { executions.add ( createLabelParametersMapper ( vfsConfigId , label ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertvfsConfigLabel" , executions ) ; }

Target:
public void removeLabel ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.lang.String label ) { getCallsHandler ( ) . executeModification ( "DeleteVfsConfigLabel" , createLabelParametersMapper ( vfsConfigId , label ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getQuotaId ( ) { return org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getvds_group_id ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getcpu_per_socket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getnum_of_sockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getmem_size_mb ( ) ) ) ; return list ; }
Source:
protected org.ovirt.engine.core.dao.VdsStaticDAO getVdsStaticDAO ( ) { return org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getDbFacade ( ) . getVdsStaticDao ( ) ; }

Target:
private boolean areAllVdssInMaintenance ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss ) { boolean allInMaintenance = true ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdss ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) { allInMaintenance = false ; break ; } } return allInMaintenance ; }
Source:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { if ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) { return false ; } } return true ; }

Target:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { if ( ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) || ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { return false ; } } return true ; }