auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks ) , true , null ) ; }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks , null ) , true , null ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails getVolumeAdvancedDetails ( org.ovirt.engine.core.common.businessentities.VDS upServer , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = runVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( upServer.getId ( ) , clusterId , volumeName , null , false , true ) ) ; return result.getSucceeded ( ) ? ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result.getReturnValue ( ) ) ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails getVolumeAdvancedDetails ( org.ovirt.engine.core.common.businessentities.VDS upServer , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = runVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( upServer.getId ( ) , clusterId , volumeName , null , false , true ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result.getReturnValue ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryVfMap ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryVfMap ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.Object > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( vds.getId ( ) , vds.getUsageCpuPercent ( ) ) ) ; } return scores ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( vds.getId ( ) , vds.getUsageCpuPercent ( ) ) ) ; } return scores ; }
Source:
private void mockDaoForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDao ( ) ) . thenReturn ( vmTemplateDao ) ; returnedVmTemplates = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllTemplatesRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVmTemplates ) ; }

Target:
private void mockDaoForQuery ( ) { returnedVmTemplates = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllTemplatesRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVmTemplates ) ; }
Source:
public void testProcessingHardwareVirt ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( virtStrategy ) . processHardwareCapabilities ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; exception.expect ( java.lang.RuntimeException.class ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; strategy.processHardwareCapabilities ( vds ) ; }

Target:
public void testProcessingHardwareVirt ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( virtStrategy ) . processHardwareCapabilities ( org.mockito.ArgumentMatchers.any ( ) ) ; exception.expect ( java.lang.RuntimeException.class ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; strategy.processHardwareCapabilities ( vds ) ; }
Source:
public void encodeWhenNonAsciiDiskDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "áéíñáé" ) ; java.lang.String nonAsciiDiskDescription = "ñññññññññññññññññññññññññññññññññññññññññññññññññññññññ" ; disk.setDiskDescription ( nonAsciiDiskDescription ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñáé" ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( nonAsciiDiskDescription.substring ( 0 , 34 ) ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateEncodingJsonEntry ( 3 ) ) ; }

Target:
public void encodeWhenNonAsciiDiskDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "áéíñáé" ) ; java.lang.String nonAsciiDiskDescription = "ñññññññññññññññññññññññññññññññññññññññññññññññññññññññ" ; disk.setDiskDescription ( nonAsciiDiskDescription ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñáé" ) ) , generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( nonAsciiDiskDescription.substring ( 0 , 34 ) ) ) , generateEncodingJsonEntry ( 3 ) ) ; }
Source:
private java.util.List < java.lang.String > getAllHostNames ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allHosts ) { java.util.List < java.lang.String > allHostNames = new java.util.ArrayList < java.lang.String > ( allHosts.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : allHosts ) { allHostNames.add ( vds.getName ( ) ) ; } return allHostNames ; }

Target:
private java.util.List < java.lang.String > getAllHostNames ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allHosts ) { java.util.List < java.lang.String > allHostNames = new java.util.ArrayList ( allHosts.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : allHosts ) { allHostNames.add ( vds.getName ( ) ) ; } return allHostNames ; }
Source:
void mockGetCaCertificate ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue caCertificateReturnValue = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; caCertificateReturnValue.setSucceeded ( true ) ; caCertificateReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) ; org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetCACertificate ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; }

Target:
void mockGetCaCertificate ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue caCertificateReturnValue = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; caCertificateReturnValue.setSucceeded ( true ) ; caCertificateReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) ; org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetCACertificate ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : ifaces ) { iface.setNetworkImplementationDetails ( org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( getExistingClusterNetworks ( ) , iface ) ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getExistingIfaces ( ) { if ( ( existingIfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( params.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : ifaces ) { iface.setNetworkImplementationDetails ( org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( getExistingClusterNetworks ( ) , iface ) ) ; } existingIfaces = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( ifaces ) ; } return existingIfaces ; }
Source:
private java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > getFetchedServersList ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > servers = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ( ) ; servers.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_NAME_1 , org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.CONNECTED ) ) ; servers.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_ID_2 , org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_NAME_2 , org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.CONNECTED ) ) ; return servers ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > getFetchedServersList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > servers = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ( ) ; servers.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_NAME_1 , org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.CONNECTED ) ) ; servers.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ( org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_ID_2 , org.ovirt.engine.core.bll.gluster.GlusterManagerTest.SERVER_NAME_2 , org.ovirt.engine.core.common.businessentities.gluster.PeerStatus.CONNECTED ) ) ; return servers ; }
Source:
private void lockImageInDb ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; final org.ovirt.engine.core.common.businessentities.ImageStatus imgStatus = diskImage.getImageStatus ( ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( diskImage.getImage ( ) , imgStatus ) ; getCompensationContext ( ) . stateChanged ( ) ; diskImage.setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImageId ( ) , ImageStatus.LOCKED ) ; return null ; } } ) ; }

Target:
private void lockImageInDb ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( diskImage.getImage ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; diskImage.setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImageId ( ) , ImageStatus.LOCKED ) ; return null ; } } ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED , java.util.Collections.singletonMap ( GlusterConstants.COMMAND , "gluster peer status" ) ) ; nonOpParams.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED , java.util.Collections.singletonMap ( GlusterConstants.COMMAND , "gluster peer status" ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getDiskId ( ) ) ) ) ; } return listVms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getDiskId ( ) ) ) , true ) ; } return listVms ; }
Source:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setSessionHelper ( sessionHelper ) ; if ( resource instanceof org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) { ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } else if ( resource instanceof org.ovirt.engine.api.resource.CapabilitiesResource ) { ( ( org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource ) ( resource ) ) . setMappingLocator ( mappingLocator ) ; } resource.setValidatorLocator ( validatorLocator ) ; singletons.add ( resource ) ; }

Target:
private void addResource ( final org.ovirt.engine.api.restapi.resource.BackendResource resource ) { resource.setMessageBundle ( messageBundle ) ; resource.setBackend ( backend ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMappingLocator ( mappingLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; singletons.add ( resource ) ; }
Source:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) { setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; } }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) == null ) { return ; } super . init ( ) ; setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setVmName ( "testVm" ) ; final org.ovirt.engine.core.common.action.ImportVmParameters p = new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; return p ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setVmName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; allDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.getCinderLeafImages ( disks , true ) ) ; return allDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; allDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.getCinderLeafImages ( disks , false ) ) ; return allDisks ; }
Source:
public void testAddForceFalse ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , false , "false" , uriInfo , false ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }

Target:
public void testAddForceFalse ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , false , "false" , uriInfo ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( asyncTaskDaoMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }

Target:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > cinderVolumeTypes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( returnValue ) ) ; java.util.List < java.lang.String > volumeTypesNames = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType cinderVolumeType : cinderVolumeTypes ) { volumeTypesNames.add ( cinderVolumeType.getName ( ) ) ; } volumeTypesNames.add ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.noCinderVolumeType ( ) ) ; diskModel.getCinderVolumeType ( ) . setItems ( volumeTypesNames ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > cinderVolumeTypes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( returnValue ) ) ; java.util.List < java.lang.String > volumeTypesNames = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType cinderVolumeType : cinderVolumeTypes ) { volumeTypesNames.add ( cinderVolumeType.getName ( ) ) ; } diskModel.getCinderVolumeType ( ) . setItems ( volumeTypesNames ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; setItems ( glusterVolumeEntity.getBricks ( ) ) ; } else { setItems ( null ) ; } updateRemoveBrickActionsAvailability ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ) ; }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; setItems ( glusterVolumeEntity.getBricks ( ) ) ; } else { setItems ( null ) ; } }
Source:
protected void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . ibuff ) == null ) { this . ibuff = java.nio.ByteBuffer.allocate ( 16384 ) ; readBytes ( this . ibuff ) ; } else { readBytes ( this . ibuff ) ; } }

Target:
protected abstract void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ;
Source:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void setColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column , boolean visible ) { if ( isColumnPresent ( column ) ) { columnVisibleMapOverride.put ( column , visible ) ; java.lang.String persistedWidth = getHiddenPersistedColumnWidth ( column ) ; java.lang.String columnWidth = ( persistedWidth != null ) ? persistedWidth : columnWidthMap.get ( column ) ; persistColumnVisibility ( column , visible ) ; ensureColumnVisible ( column , null , visible , columnWidth , false ) ; } }

Target:
public void setColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column , boolean visible ) { if ( isColumnPresent ( column ) ) { columnVisibleMapOverride.put ( column , visible ) ; java.lang.String columnWidth = ( ( getHiddenPersistedColumnWidth ( column ) ) != null ) ? getHiddenPersistedColumnWidth ( column ) : columnWidthMap.get ( column ) ; persistColumnVisibility ( column , visible ) ; ensureColumnVisible ( column , null , visible , columnWidth , false ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getFetchSshFingerprint ( ) . setEntity ( fingerprint ) ; getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . successLoadingFingerprint ( ) ) ; } else { getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; } }

Target:
public void onSuccess ( java.lang.String fingerprint ) { if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getFetchSshFingerprint ( ) . setEntity ( fingerprint ) ; getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . successLoadingFingerprint ( ) ) ; } else { getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.getParameters ( ) . getId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND ) ; } if ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.OVIRT.equalsIgnoreCase ( event.getOrigin ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } if ( ( event.getseverity ( ) ) == ( org.ovirt.engine.core.common.AuditLogSeverity.ALERT ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_OPERATION ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.bll.RemoveExternalEventCommand.getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.getParameters ( ) . getId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND ) ; } if ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.OVIRT.equalsIgnoreCase ( event.getOrigin ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } return true ; }
Source:
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.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; if ( ( this . failedConnections ) < ( org.ovirt.vdsm.jsonrpc.client.internal.ResponseTracker.MAX_FAILED_CONNECTIONS ) ) { ( this . failedConnections ) ++ ; } else { this . failedConnections = 0 ; tracking.getClient ( ) . disconnect ( ) ; } }

Target:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; }
Source:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }

Target:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.log.error ( java.lang.String.format ( "Trying to revert unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; } super . ProceedProxyReturnValue ( ) ; }

Target:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to revert unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; } super . ProceedProxyReturnValue ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetDomainExpectations ( StorageType.NFS , false ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > getItem ( java.lang.String clusterName ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > items = ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > item : items ) { if ( item.getFirst ( ) . getname ( ) . equals ( clusterName ) ) { return item ; } } return null ; }

Target:
private org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > getItem ( java.lang.String clusterName ) { java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > items = ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > > ) ( getItems ( ) ) ) ; for ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > item : items ) { if ( item.getFirst ( ) . getName ( ) . equals ( clusterName ) ) { return item ; } } return null ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.mockito.Mockito.when ( qosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createQos ( ) ) ; qos ( network , iface , null , Version.v3_3 ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.mockito.Mockito.when ( qosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createQos ( ) ) ; qos ( network , iface , null , false ) ; }
Source:
private boolean namedDataCenter ( org.ovirt.engine.api.model.Network network ) { return ( ( ( network != null ) && ( network.isSetDataCenter ( ) ) ) && ( network.getDataCenter ( ) . isSetName ( ) ) ) && ( ! ( network.getDataCenter ( ) . isSetId ( ) ) ) ; }

Target:
protected boolean namedDataCenter ( org.ovirt.engine.api.model.Network network ) { return ( ( ( network != null ) && ( network.isSetDataCenter ( ) ) ) && ( network.getDataCenter ( ) . isSetName ( ) ) ) && ( ! ( network.getDataCenter ( ) . isSetId ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } upServer = getUpServer ( ) ; if ( ( upServer ) == null ) { addCanDoActionMessage ( java.lang.String.format ( "$clusterName %1$s" , org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroup ( ) . getname ( ) ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } upServer = getUpServer ( ) ; if ( ( upServer ) == null ) { addCanDoActionMessage ( java.lang.String.format ( "$clusterName %1$s" , org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroup ( ) . getName ( ) ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }
Source:
void initListBoxEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { org.ovirt.engine.core.compat.RpmVersion version = ( ( org.ovirt.engine.core.compat.RpmVersion ) ( object ) ) ; return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelTextAreaLabelEditor ( true , true ) ; }

Target:
void initListBoxEditors ( ) { isoEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { org.ovirt.engine.core.compat.RpmVersion version = ( ( org.ovirt.engine.core.compat.RpmVersion ) ( object ) ) ; return version.getRpmName ( ) ; } } ) ; rbPassword = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; rbPublicKey = new com.google.gwt.user.client.ui.RadioButton ( "1" ) ; publicKeyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelTextAreaLabelEditor ( ) ; }
Source:
public void testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( snapshots ) ; org.junit.Assert.assertTrue ( ( ( snapshots.size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( snapshots.contains ( existingSnapshot ) ) ; }

Target:
public void testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( snapshots ) ; org.junit.Assert.assertEquals ( 2 , snapshots.size ( ) ) ; org.junit.Assert.assertTrue ( snapshots.contains ( existingSnapshot ) ) ; }
Source:
protected void initStoragePoolId ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) == null ) || ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) ) ) { setStoragePoolId ( ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ? org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }

Target:
protected void initStoragePoolId ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) == null ) || ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveImageCommand.getStoragePoolId ( ) ) ) ) { setStoragePoolId ( ( ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ? org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImage ( ) . getStoragePoolId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }