auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.DATA_CENTER_ID } , org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.setUpIscsiBonds ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.DATA_CENTER_ID } , org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.setUpIscsiBonds ( ) , failure ) ; }
Source:
public void HandleVdsFinishedInit ( org.ovirt.engine.core.compat.Guid vdsId ) { java.util.HashSet < org.ovirt.engine.core.compat.Guid > vms = null ; if ( ( vms = _vdsAndVmsList.get ( vdsId ) ) != null ) { for ( org.ovirt.engine.core.compat.Guid vmId : vms ) { getEventListener ( ) . processOnVmStop ( vmId ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.log.info ( ( "Procceed on vm stop entered: " + ( vmId.toString ( ) ) ) ) ; } _vdsAndVmsList.remove ( vdsId ) ; } }

Target:
public void HandleVdsFinishedInit ( org.ovirt.engine.core.compat.Guid vdsId ) { java.util.HashSet < org.ovirt.engine.core.compat.Guid > vms = _vdsAndVmsList.get ( vdsId ) ; if ( vms != null ) { getEventListener ( ) . processOnVmStop ( vms ) ; _vdsAndVmsList.remove ( vdsId ) ; } }
Source:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( 0 ) ; } }

Target:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( null ) ; } }
Source:
private void refreshServerData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { if ( cluster.supportsVirtService ( ) ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debugFormat ( "As cluster {0} supports virt service as well, it's servers will not be synced with glusterfs" , cluster.getname ( ) ) ; return ; } java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = fetchServers ( cluster , upServer , existingServers ) ; if ( fetchedServers != null ) { removeDetachedServers ( existingServers , fetchedServers ) ; } }

Target:
private void refreshServerData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { if ( cluster.supportsVirtService ( ) ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debugFormat ( "As cluster {0} supports virt service as well, it's servers will not be synced with glusterfs" , cluster.getname ( ) ) ; return ; } java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = fetchServers ( cluster , upServer , existingServers ) ; if ( fetchedServers != null ) { removeDetachedServers ( existingServers , fetchedServers ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.UpdateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.UpdateOptionsLocalFS ( ) ; }
Source:
public java.lang.String getUserName ( ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( mUserName ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserName = java.lang.String.format ( "%s[%s]" , getCurrentUser ( ) . getLoginName ( ) , getCurrentUser ( ) . getDomain ( ) ) ; } return mUserName ; }

Target:
public java.lang.String getUserName ( ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( mUserName ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserName = java.lang.String.format ( "%s@%s" , getCurrentUser ( ) . getLoginName ( ) , getCurrentUser ( ) . getDomain ( ) ) ; } return mUserName ; }
Source:
private void removeTemplateBackup ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > prms = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object selectedItem : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( selectedItem ) ) ; prms.add ( new org.ovirt.engine.core.common.action.VmTemplateImportExportParameters ( template.getId ( ) , getEntity ( ) . getId ( ) , pool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveVmTemplateFromImportExport , prms ) ; cancel ( ) ; }

Target:
private void removeTemplateBackup ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > prms = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : getSelectedItems ( ) ) { prms.add ( new org.ovirt.engine.core.common.action.VmTemplateImportExportParameters ( template.getId ( ) , getEntity ( ) . getId ( ) , pool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveVmTemplateFromImportExport , prms ) ; cancel ( ) ; }
Source:
private static java.lang.String AssignStringValue ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct input , java.lang.String name ) { if ( input.containsKey ( name ) ) { return ( ( java.lang.String ) ( ( input.getItem ( name ) ) instanceof java.lang.String ? input.getItem ( name ) : null ) ) ; } return null ; }

Target:
private static java.lang.String AssignStringValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { if ( input.containsKey ( name ) ) { return ( ( java.lang.String ) ( ( input.get ( name ) ) instanceof java.lang.String ? input.get ( name ) : null ) ) ; } return null ; }
Source:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 1 ) { removeMemoryVolumes ( memory , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }

Target:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { removeMemoryVolumes ( memory , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( getStorageDevice ( "sda" ) ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( getStorageDevice ( "sda" ) ) ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }

Target:
public void activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : getSelectedItems ( ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ActivateStorageDomain , pb ) ; }
Source:
private void commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.SnapshotActionEnum.COMMIT ) , null , null ) ; } }

Target:
private void commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.SnapshotActionEnum.COMMIT ) , null , null ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosList = ( returnValue == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; qosList.add ( 0 , NetworkQoSModel.EMPTY_QOS ) ; return qosList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > convert ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosList = super . convert ( returnValue ) ; qosList.add ( 0 , NetworkQoSModel.EMPTY_QOS ) ; return qosList ; }
Source:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( ( "/" + ( getServletContext ( ) . getContextPath ( ) ) ) ) ; response.addCookie ( cookie ) ; }

Target:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; response.addCookie ( cookie ) ; }
Source:
private boolean isPathEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( storage.getStorageType ( ) . isFileDomain ( ) ) && ( ! ( storage.getStorageType ( ) . equals ( StorageType.GLUSTERFS ) ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = storage.getStorageDomainType ( ) ; return ( storageDomainType.isInternalDomain ( ) ) && ( isStorageStatusValidForPathEditing ( storage ) ) ; } return false ; }

Target:
private boolean isPathEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( storage.getStorageType ( ) . isFileDomain ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = storage.getStorageDomainType ( ) ; return ( storageDomainType.isInternalDomain ( ) ) && ( isStorageStatusValidForPathEditing ( storage ) ) ; } return false ; }
Source:
public void setUp ( ) { vmId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; snapshot.setType ( Snapshot.SnapshotType.REGULAR ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( validator ) . getSnapshotDao ( ) ; }

Target:
public void setUp ( ) { vmId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; snapshot.setType ( Snapshot.SnapshotType.REGULAR ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.setSubTabPanelVisible ( false ) ; } org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.setSubTabPanelVisible ( false ) ; } getTable ( ) . resetScrollPosition ( ) ; getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }
Source:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage_pool ( "foo" , org.ovirt.engine.core.compat.Guid.Empty , "foo" , StorageType.NFS.getValue ( ) , StoragePoolStatus.Up.getValue ( ) ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; }

Target:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( "foo" , org.ovirt.engine.core.compat.Guid.Empty , "foo" , StorageType.NFS.getValue ( ) , StoragePoolStatus.Up.getValue ( ) ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; }
Source:
private java.lang.String getMemoryFromSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( cachedMemoryVolumeFromSnapshot ) == null ) { boolean archSupportSnapshot = org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; cachedMemoryVolumeFromSnapshot = ( archSupportSnapshot && ( org.ovirt.engine.core.common.FeatureSupported.memorySnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) ? getActiveSnapshot ( ) . getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; } return cachedMemoryVolumeFromSnapshot ; }

Target:
private java.lang.String getMemoryFromSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( cachedMemoryVolumeFromSnapshot ) == null ) { boolean archSupportSnapshot = org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; cachedMemoryVolumeFromSnapshot = ( archSupportSnapshot && ( org.ovirt.engine.core.common.FeatureSupported.memorySnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) ? org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; } return cachedMemoryVolumeFromSnapshot ; }
Source:
public void executeCommandTest ( ) { addClusterCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( clusterDao ) . save ( cluster ) ; org.mockito.Mockito.verify ( backend ) . runAction ( org.mockito.ArgumentMatchers.eq ( ActionType.AddCpuProfile ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ; org.junit.Assert.assertTrue ( addClusterCommand.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void executeCommandTest ( ) { addClusterCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( clusterDao ) . save ( cluster ) ; org.mockito.Mockito.verify ( backend ) . runAction ( org.mockito.ArgumentMatchers.eq ( ActionType.AddCpuProfile ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertTrue ( addClusterCommand.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; 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 ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
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.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }

Target:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( loadedDataCenter , loadedCluster ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }
Source:
public void testNicLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , nic ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }

Target:
public void testNicLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( nic ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }

Target:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpNetworkAttachmentsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpNetworkAttachmentsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }
Source:
public static void initOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }

Target:
public static void initOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( ( cluster != null ) && ( isFeatureSupported ( cluster.getCompatibilityVersion ( ) ) ) ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult canAddRngDevice ( org.ovirt.engine.core.common.businessentities.Cluster cluster , org.ovirt.engine.core.common.businessentities.VmRngDevice rngDevice ) { org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source = rngDevice.getSource ( ) ; boolean supported = ( cluster != null ) && ( cluster.getRequiredRngSources ( ) . contains ( source ) ) ; if ( ! supported ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getConnection ( ) . geIid ( ) ; org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getConnection ( ) . getId ( ) ; org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
public static void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { resourceManager.getVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }

Target:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( "Refresh host capabilities" ) ) { resourceManager.getVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } }
Source:
public org.ovirt.engine.core.common.action.RunVmOnceParams createRunVmOnceParams ( ) { org.ovirt.engine.core.common.action.RunVmOnceParams params = super . createRunVmOnceParams ( ) ; if ( ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) != null ) { params.setSysPrepDomainName ( ( ( java.lang.String ) ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) ) ) ; } return params ; }

Target:
protected org.ovirt.engine.core.common.action.RunVmOnceParams createRunVmOnceParams ( ) { org.ovirt.engine.core.common.action.RunVmOnceParams params = super . createRunVmOnceParams ( ) ; if ( ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) != null ) { params.setSysPrepDomainName ( ( ( java.lang.String ) ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) ) ) ; } return params ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , true , true , false ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID ) } , true , true , false ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public org.ovirt.engine.core.authentication.AuthenticationResult < ? > authenticate ( java.lang.String name , java.lang.String password ) { org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.AuthenticateUser , new org.ovirt.engine.core.bll.adbroker.LdapUserPasswordBaseParameters ( domain , name , password ) ) ; org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult authResult = ( ( org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult ) ( ldapResult.getReturnValue ( ) ) ) ; return new org.ovirt.engine.core.authentication.provisional.ProvisionalAuthenticationResult ( authResult ) ; }

Target:
public org.ovirt.engine.core.authentication.AuthenticationResult authenticate ( java.lang.String name , java.lang.String password ) { org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.AuthenticateUser , new org.ovirt.engine.core.bll.adbroker.LdapUserPasswordBaseParameters ( domain , name , password ) ) ; org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult authResult = ( ( org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult ) ( ldapResult.getReturnValue ( ) ) ) ; return new org.ovirt.engine.core.authentication.provisional.ProvisionalAuthenticationResult ( domain , authResult ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
private boolean networkExists ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > networks = org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster network_cluster : networks ) { if ( network_cluster.getnetwork_id ( ) . equals ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetworkCluster ( ) . getnetwork_id ( ) ) ) { return true ; } } return false ; }

Target:
private boolean networkExists ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > networks = org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster network_cluster : networks ) { if ( network_cluster.getnetwork_id ( ) . equals ( getNetworkCluster ( ) . getnetwork_id ( ) ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult verifyDisks ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imageList , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > imageToDestinationDomainMap ) { if ( ( ! ( params.isImportAsNewEntity ( ) ) ) && ( ! ( params.isImagesExistOnTargetStorageDomain ( ) ) ) ) { return new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( imageList ) . diskImagesOnStorage ( imageToDestinationDomainMap ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult verifyDisks ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imageList , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.Guid > imageToDestinationDomainMap ) { if ( ( ! ( params.isImportAsNewEntity ( ) ) ) && ( ! ( params.isImagesExistOnTargetStorageDomain ( ) ) ) ) { return new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( imageList ) . diskImagesOnStorage ( imageToDestinationDomainMap , params.getStoragePoolId ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testParseActionNotFirst ( ) throws java.lang.Exception { java.lang.System.out.println ( "Testing parse args with action not first..." ) ; try { parser.parse ( new java.lang.String [ ] { "-b" , "-a" , "filename" } ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.Exception e ) { java.lang.System.out.println ( e.getMessage ( ) ) ; } }

Target:
public void testParseActionNotFirst ( ) throws java.lang.Exception { parser.parse ( new java.lang.String [ ] { "-b" , "-a" , "filename" } ) ; }
Source:
private void nfsStorageModel_PathChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel senderModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( sender ) ) ; for ( java.lang.Object item : getStorageModels ( ) ) { if ( ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) && ( item != sender ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; model.getPath ( ) . setEntity ( senderModel.getPath ( ) . getEntity ( ) ) ; } } }

Target:
private void nfsStorageModel_PathChanged ( java.lang.Object sender ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel senderModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( sender ) ) ; for ( java.lang.Object item : getStorageModels ( ) ) { if ( ( item instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) && ( item != sender ) ) { org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) ( item ) ) ; model.getPath ( ) . setEntity ( senderModel.getPath ( ) . getEntity ( ) ) ; } } }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; } default : { return org.ovirt.engine.core.bll.Backend.NotAutorizedError ( ) ; } } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; } default : { return NotAutorizedError ( ) ; } } }