auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o.getClass ( ) ) ) ) return false ; org.ovirt.engine.core.common.businessentities.VmIcon vmIcon = ( ( org.ovirt.engine.core.common.businessentities.VmIcon ) ( o ) ) ; return ( java.util.Objects.equals ( id , vmIcon.id ) ) && ( java.util.Objects.equals ( dataUrl , vmIcon.dataUrl ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.VmIcon ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmIcon vmIcon = ( ( org.ovirt.engine.core.common.businessentities.VmIcon ) ( o ) ) ; return ( java.util.Objects.equals ( id , vmIcon.id ) ) && ( java.util.Objects.equals ( dataUrl , vmIcon.dataUrl ) ) ; }
Source:
protected void failedToRunVm ( ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { processVmPoolOnStopVm ( ) ; } } ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }

Target:
protected void failedToRunVm ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.quota.QuotaClusterListModel quotaClusterListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaClusterListModel ) ( model ) ) ; quotaClusterListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }

Target:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }
Source:
private boolean isCopyCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { if ( ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) || ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { return false ; } } return true ; }

Target:
private boolean isCopyCommandAvailable ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { if ( ( ( disk.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) || ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { return false ; } } return true ; }
Source:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDao storageDomainDao = dbFacade.getStorageDomainDao ( ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOMAIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue createGetStorageDomainInfoReturnValue ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , java.lang.Object > pair = new org.ovirt.engine.core.common.utils.Pair ( storageDomain.getStorageStaticData ( ) , null ) ; returnValue.setReturnValue ( pair ) ; return returnValue ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue createGetStorageDomainInfoReturnValue ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , java.lang.Object > pair = new org.ovirt.engine.core.common.utils.Pair ( storageDomain.getStorageStaticData ( ) , null ) ; returnValue.setReturnValue ( pair ) ; return returnValue ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VM o1 , org.ovirt.engine.core.common.businessentities.VM o2 ) { java.lang.String name1 = ( ( o1.getVmName ( ) ) == null ) ? "" : o1.getVmName ( ) ; java.lang.String name2 = ( ( o2.getVmName ( ) ) == null ) ? "" : o2.getVmName ( ) ; return name1.compareTo ( name2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VM o1 , org.ovirt.engine.core.common.businessentities.VM o2 ) { java.lang.String name1 = ( ( o1.getName ( ) ) == null ) ? "" : o1.getName ( ) ; java.lang.String name2 = ( ( o2.getName ( ) ) == null ) ? "" : o2.getName ( ) ; return name1.compareTo ( name2 ) ; }
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 ( null ) ; } }

Target:
private void UpdateTotalDiskSize ( ) { java.lang.Integer available = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getAvailableDiskSize ( ) ; java.lang.Integer used = ( ( getStorageDynamicData ( ) ) == null ) ? null : getStorageDynamicData ( ) . getUsedDiskSize ( ) ; if ( ( available != null ) && ( used != null ) ) { setTotalDiskSize ( ( available + used ) ) ; } else { setTotalDiskSize ( null ) ; } }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getStorageIds ( ) . get ( 0 ) . getValue ( ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }

Target:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getStorageIds ( ) . get ( 0 ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }
Source:
public void testGetThemeStyleSheet ( ) { org.junit.Assert.assertEquals ( "User portal style sheet: 'user_portal.css'" , "user_portal.css" , testTheme.getThemeStylesheets ( "userportal" ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( "User portal style sheet: 'abc.css'" , "abc.css" , testTheme.getThemeStylesheets ( "userportal" ) . get ( 1 ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: 'web_admin.css'" , "web_admin.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: '123.css'" , "123.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 1 ) ) ; }

Target:
public void testGetThemeStyleSheet ( ) { org.junit.Assert.assertEquals ( "Wedadmin style sheet: 'web_admin.css'" , "web_admin.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: '123.css'" , "123.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 1 ) ) ; }
Source:
private void prepareMocksForTasksFromCLI ( ) { org.mockito.Mockito.doReturn ( getVolume ( 0 ) ) . when ( volumeDao ) . getVolumeByGlusterTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 0 ] ) ; org.mockito.Mockito.doReturn ( getVolume ( 1 ) ) . when ( volumeDao ) . getVolumeByGlusterTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 1 ] ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.job.Step > ( ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 0 ] ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.job.Step > ( ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 1 ] ) ; }

Target:
private void prepareMocksForTasksFromCLI ( ) { org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.job.Step > ( ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 0 ] ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.job.Step > ( ) ) . when ( stepDao ) . getStepsByExternalId ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.TASK_GUIDS [ 1 ] ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "OS" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmOsType.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "CREATIONDATE" ) ) { retval = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "STATUS" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "OS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmOsType.class ) ; } else if ( "CREATIONDATE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.DateEnumForSearch.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.class ) ; } return null ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; control.replay ( ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; 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 ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( java.lang.String name , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.EasyMock.expect ( vdsGroup.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( vdsGroup.getname ( ) ) . andReturn ( name ) . anyTimes ( ) ; return vdsGroup ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( java.lang.String name , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.EasyMock.expect ( vdsGroup.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( vdsGroup.getName ( ) ) . andReturn ( name ) . anyTimes ( ) ; return vdsGroup ; }
Source:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > volumeOptionsEnabled = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( volume.getOptions ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = volumeOptionsEnabled ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } return ! ( filteredOptions.isEmpty ( ) ) ; }

Target:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = new java.util.ArrayList ( volume.getOptions ( ) ) ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } return ! ( filteredOptions.isEmpty ( ) ) ; }
Source:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , getSelectedItem ( ) , this ) ; setWindow ( model ) ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ret ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IscsiBond > items = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ret ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel dataCenterIscsiBondListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; dataCenterIscsiBondListModel.setItems ( items ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ret ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IscsiBond > items = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ret ) ) . getReturnValue ( ) ; setItems ( items ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > mapErrata ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ExternalErratum > externalErrata ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > errata = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( externalErrata.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ExternalErratum externalErratum : externalErrata ) { org.ovirt.engine.core.common.businessentities.Erratum erratum = mapErratum ( externalErratum ) ; errata.add ( erratum ) ; } return errata ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.Erratum > mapErrata ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ExternalErratum > externalErrata ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > errata = new java.util.ArrayList ( externalErrata.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ExternalErratum externalErratum : externalErrata ) { org.ovirt.engine.core.common.businessentities.Erratum erratum = mapErratum ( externalErratum ) ; errata.add ( erratum ) ; } return errata ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel innerGeneralModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ) ( model ) ) ; java.util.Map < java.lang.String , java.lang.String > serverMap = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( result ) ) ; if ( ! ( serverMap.isEmpty ( ) ) ) { innerGeneralModel.setHasNewGlusterHostsAlert ( true ) ; innerGeneralModel.setHasAnyAlert ( true ) ; } else { setHasNewGlusterHostsAlert ( false ) ; setHasAnyAlert ( false ) ; } }

Target:
public void onSuccess ( java.util.Map < java.lang.String , java.lang.String > serverMap ) { if ( ! ( serverMap.isEmpty ( ) ) ) { setHasNewGlusterHostsAlert ( true ) ; setHasAnyAlert ( true ) ; } else { setHasNewGlusterHostsAlert ( false ) ; setHasAnyAlert ( false ) ; } }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Watchdog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters parameters = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; parameters.setAction ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( org.ovirt.engine.api.model.WatchdogAction.fromValue ( model.getAction ( ) ) ) ) ; parameters.setModel ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( org.ovirt.engine.api.model.WatchdogModel.fromValue ( model.getModel ( ) ) ) ) ; parameters.setId ( vmId ) ; parameters.setVm ( true ) ; return parameters ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Watchdog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters parameters = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; parameters.setAction ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model.getAction ( ) ) ) ; parameters.setModel ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model.getModel ( ) ) ) ; parameters.setId ( vmId ) ; parameters.setVm ( true ) ; return parameters ; }
Source:
protected void setUpGetClusterExpectations ( int times , java.lang.Object failure ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }

Target:
protected void setUpGetClusterExpectations ( int times ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }
Source:
protected < T extends org.ovirt.engine.core.bll.gluster.CreateBrickCommand > void prepareMocks ( T command , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.mockito.Mockito.when ( command.getCluster ( ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getVds ( ) ; org.mockito.Mockito.doReturn ( status ) . when ( vds ) . getStatus ( ) ; mockIsGlusterEnabled ( true ) ; org.mockito.Mockito.doReturn ( glusterUtil ) . when ( command ) . getGlusterUtil ( ) ; }

Target:
protected void prepareMocks ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.mockito.Mockito.when ( cmd.getCluster ( ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.doReturn ( vds ) . when ( cmd ) . getVds ( ) ; org.mockito.Mockito.doReturn ( status ) . when ( vds ) . getStatus ( ) ; mockIsGlusterEnabled ( true ) ; org.mockito.Mockito.doReturn ( glusterUtil ) . when ( cmd ) . getGlusterUtil ( ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.info ( "MacPoolManager::freeMacs - entered" ) ; lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to free MAC addresses." ) ; } for ( java.lang.String mac : macs ) { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMacs ( java.util.List < java.lang.String > macs ) { lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to free MAC addresses." ) ; } for ( java.lang.String mac : macs ) { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }
Source:
private static < T > java.lang.reflect.Constructor < T > findCommandConstructor ( java.lang.Class < T > type , java.lang.Class < ? > ... expectedParams ) { java.lang.reflect.Constructor < T > constructor = org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( type , expectedParams ) ; if ( constructor == null ) { org.ovirt.engine.core.bll.CommandsFactory.log.errorFormat ( org.ovirt.engine.core.bll.CommandsFactory.CTOR_NOT_FOUND_FOR_PARAMETERS , type.getName ( ) , java.util.Arrays.toString ( expectedParams ) ) ; throw new java.lang.RuntimeException ( java.text.MessageFormat.format ( org.ovirt.engine.core.bll.CommandsFactory.CTOR_MISMATCH , type ) ) ; } return constructor ; }

Target:
private static < T > java.lang.reflect.Constructor < T > findCommandConstructor ( java.lang.Class < T > type , java.lang.Class < ? > ... expectedParams ) { java.lang.reflect.Constructor < T > constructor = org.ovirt.engine.core.utils.ReflectionUtils.findConstructor ( type , expectedParams ) ; if ( constructor == null ) { org.ovirt.engine.core.bll.CommandsFactory.log.error ( org.ovirt.engine.core.bll.CommandsFactory.CTOR_NOT_FOUND_FOR_PARAMETERS , type.getName ( ) , java.util.Arrays.toString ( expectedParams ) ) ; throw new java.lang.RuntimeException ( java.text.MessageFormat.format ( org.ovirt.engine.core.bll.CommandsFactory.CTOR_MISMATCH , type ) ) ; } return constructor ; }
Source:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( spyCommand ) . performImagesChecks ( ) ; org.mockito.Mockito.doReturn ( storageValidator ) . when ( spyCommand ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( spyCommand ) . createVmValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( spyCommand ) . performImagesChecks ( ) ; org.mockito.Mockito.doReturn ( storageValidator ) . when ( spyCommand ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( spyCommand ) . createVmValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getKernelImage ( ) . setItems ( images ) ; getInitrdImage ( ) . setItems ( images ) ; getKernelImage ( ) . setSelectedItem ( null ) ; getInitrdImage ( ) . setSelectedItem ( null ) ; }

Target:
public void onSuccess ( java.util.List < java.lang.String > images ) { getKernelImage ( ) . setItems ( images ) ; getInitrdImage ( ) . setItems ( images ) ; getKernelImage ( ) . setSelectedItem ( null ) ; getInitrdImage ( ) . setSelectedItem ( null ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( isVnicProfilePermitted ( userId , profile , profile.isPortMirroring ( ) ) ) { return profile ; } } return null ; }
Source:
public static void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; }
Source:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( VdcActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId ) ) ; }

Target:
private void connectStorageToHost ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.api.model.LogicalUnit unit ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx = org.ovirt.engine.api.restapi.util.StorageDomainHelper.getConnection ( storageType , unit.getAddress ( ) , unit.getTarget ( ) , unit.getUsername ( ) , unit.getPassword ( ) , unit.getPort ( ) ) ; performAction ( VdcActionType.ConnectStorageToVds , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( cnx , hostId , false ) ) ; }
Source:
private boolean isStoragePoolMatching ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( getStorageDomainId ( ) . getValue ( ) , vm.getStoragePoolId ( ) ) ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_OF_VM_NOT_MATCH ) ; } return true ; }

Target:
private boolean isStoragePoolMatching ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( getStorageDomainId ( ) , vm.getStoragePoolId ( ) ) ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_OF_VM_NOT_MATCH ) ; } return true ; }
Source:
public org.ovirt.engine.core.compat.NGuid getStoragePoolId ( ) { if ( ( _storagePoolId ) == null ) { if ( ( _storagePool ) != null ) { _storagePoolId = _storagePool.getId ( ) ; } else if ( ( getStorageDomain ( ) ) != null ) { _storagePoolId = getStorageDomain ( ) . getstorage_pool_id ( ) ; } } return _storagePoolId ; }

Target:
public org.ovirt.engine.core.compat.NGuid getStoragePoolId ( ) { if ( ( _storagePoolId ) == null ) { if ( ( _storagePool ) != null ) { _storagePoolId = _storagePool.getId ( ) ; } else if ( ( getStorageDomain ( ) ) != null ) { _storagePoolId = getStorageDomain ( ) . getStoragePoolId ( ) ; } } return _storagePoolId ; }
Source:
public void canDoActionFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand < org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) ) ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) ) ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }
Source:
protected boolean ExecuteWithoutTransaction ( ) { boolean succeeded = false ; try { org.ovirt.engine.core.bll.RegisterVdsQuery.log.info ( "Running Command: RegisterVds" ) ; ExecuteRegisterVdsCommand ( ) ; succeeded = org.ovirt.engine.core.bll.RegisterVdsQuery.getQueryReturnValue ( ) . getSucceeded ( ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.RegisterVdsQuery.log.error ( "RegisterVdsQuery::ExecuteWithoutTransaction: An exception has been thrown." , ex ) ; } finally { WriteToAuditLog ( ) ; } return succeeded ; }

Target:
protected boolean ExecuteWithoutTransaction ( ) { boolean succeeded = false ; try { log.info ( "Running Command: RegisterVds" ) ; ExecuteRegisterVdsCommand ( ) ; succeeded = org.ovirt.engine.core.bll.RegisterVdsQuery.getQueryReturnValue ( ) . getSucceeded ( ) ; } catch ( java.lang.RuntimeException ex ) { log.error ( "RegisterVdsQuery::ExecuteWithoutTransaction: An exception has been thrown." , ex ) ; } finally { WriteToAuditLog ( ) ; } return succeeded ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( lastExecutedCommand.getName ( ) , "OnEditManagementNetworkConfirmation" ) ) { return hostManagementConfirmationdetachConfirmPopupProvider.get ( ) ; } return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( "OnEditManagementNetworkConfirmation" . equals ( lastExecutedCommand.getName ( ) ) ) { return hostManagementConfirmationdetachConfirmPopupProvider.get ( ) ; } return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }
Source:
public void testGetAllStaticByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByName ( "rhel5-pool-50" ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( "rhel5-pool-50" , vm.getVmName ( ) ) ; } }

Target:
public void testGetAllStaticByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByName ( "rhel5-pool-50" ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( "rhel5-pool-50" , vm.getName ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.allHosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; clusterGuideModel.allHosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getBookmarkDao ( ) ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDAOTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setbookmark_value ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getBookmarkDao ( ) ; new_bookmark = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; new_bookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDAOTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; new_bookmark.setbookmark_value ( "newbookmarkvalue" ) ; existing_bookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }
Source:
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 ) { 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:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < > ( ( ( java.util.HashSet < java.lang.String > ) ( returnValue ) ) ) ; java.lang.String oldVal = getEmulatedMachine ( ) . getSelectedItem ( ) ; getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; convertEmulatedMachineField ( ) ; } }

Target:
public void onSuccess ( java.util.Set < java.lang.String > emulatedSet ) { if ( emulatedSet != null ) { java.lang.String oldVal = getEmulatedMachine ( ) . getSelectedItem ( ) ; getEmulatedMachine ( ) . setItems ( new java.util.TreeSet < > ( emulatedSet ) ) ; getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; convertEmulatedMachineField ( ) ; } }