auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.sdk.decorators.VMDisk update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMDisk update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model ) { super . init ( model ) ; model.getMacPoolModel ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . updateMacPool ( model.getMacPoolModel ( ) ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . getMacPoolButton ( ) . getCommand ( ) . execute ( model ) ; }
Source:
public void getDataCenterMaxNameLength ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( 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.Integer ) ( source ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getMinimalVmMemSize ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForStorageAllocations ( ) ; return disksList ; }
Source:
public static void checkMessages ( org.ovirt.engine.core.bll.CommandBase < ? > cmd , org.ovirt.engine.core.dal.VdcBllMessages ... expected ) { java.util.List < java.lang.String > returned = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( expected.length , returned.size ( ) ) ; for ( int i = 0 ; i < ( expected.length ) ; i ++ ) { org.junit.Assert.assertEquals ( expected [ i ] . toString ( ) , returned.get ( i ) ) ; } }

Target:
public static void checkMessages ( org.ovirt.engine.core.bll.CommandBase < ? > cmd , org.ovirt.engine.core.dal.VdcBllMessages ... expected ) { java.util.List < java.lang.String > returned = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( "Wrong number of messages" , expected.length , returned.size ( ) ) ; for ( int i = 0 ; i < ( expected.length ) ; i ++ ) { org.junit.Assert.assertEquals ( "Wrong message" , expected [ i ] . toString ( ) , returned.get ( i ) ) ; } }
Source:
public void testGetAllNetworkFilters ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > allNetworkFilter = dao.getAllNetworkFilters ( ) ; org.junit.Assert.assertNotNull ( allNetworkFilter ) ; org.junit.Assert.assertEquals ( 3 , allNetworkFilter.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = expectedNetworkFilter ( ) ; org.junit.Assert.assertEquals ( networkFilter , allNetworkFilter.get ( 0 ) ) ; }

Target:
public void testGetAllNetworkFilters ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > allNetworkFilter = dao.getAllNetworkFilters ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( allNetworkFilter ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , allNetworkFilter.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = expectedNetworkFilter ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( networkFilter , allNetworkFilter.get ( 0 ) ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }

Target:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }
Source:
public void testGetAllForDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > result = dao.getAllForDataCenter ( datacenter ) ; org.ovirt.engine.core.dao.NetworkDAOTest.assertGetAllForClusterResult ( result ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : result ) { org.junit.Assert.assertEquals ( datacenter , net.getstorage_pool_id ( ) ) ; } }

Target:
private void verifyDataCenterNetworks ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > result ) { org.ovirt.engine.core.dao.NetworkDAOTest.assertGetAllForClusterResult ( result ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : result ) { org.junit.Assert.assertEquals ( datacenter , net.getstorage_pool_id ( ) ) ; } }
Source:
public void testGetAllForStorageDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithLunInterface ( ) { if ( ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) && ( ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VIRT_IO_SCSI_INTERFACE_FOR_LUN_DISKS_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( ( diskInterface == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ) || ( ( diskInterface == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void validateFailsOnSnapshotTypeRegularNotInPreview ( ) { mockSnapshotExists ( ) ; mockSnapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; mockSnapshotFromDb ( ) ; mockSnapshot.setType ( SnapshotType.REGULAR ) ; mockSnapshot.setStatus ( SnapshotStatus.OK ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( spyCommand , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_NOT_IN_PREVIEW ) ; }

Target:
public void validateFailsOnSnapshotTypeRegularNotInPreview ( ) { mockSnapshotExists ( ) ; mockSnapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.ArgumentMatchers.nullable ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.nullable ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; mockSnapshotFromDb ( ) ; mockSnapshot.setType ( SnapshotType.REGULAR ) ; mockSnapshot.setStatus ( SnapshotStatus.OK ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( spyCommand , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_NOT_IN_PREVIEW ) ; }
Source:
protected java.security.MessageDigest getMd5Digest ( javax.servlet.http.HttpServletRequest request ) throws java.security.NoSuchAlgorithmException { java.security.MessageDigest digest = super . getMd5Digest ( request ) ; digest.update ( request.getAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_APPLICATION_MODE ) . toString ( ) . getBytes ( ) ) ; digest.update ( request.getAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_PLUGIN_DEFS ) . toString ( ) . getBytes ( ) ) ; return digest ; }

Target:
protected java.security.MessageDigest getMd5Digest ( javax.servlet.http.HttpServletRequest request ) throws java.security.NoSuchAlgorithmException { java.security.MessageDigest digest = super . getMd5Digest ( request ) ; digest.update ( request.getAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_APPLICATION_MODE ) . toString ( ) . getBytes ( ) ) ; digest.update ( request.getAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_PLUGIN_DEFS ) . toString ( ) . getBytes ( ) ) ; digest.update ( request.getAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_ENGINE_SESSION_TIMEOUT ) . toString ( ) . getBytes ( ) ) ; return digest ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; params.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportInterfaceListModel vmImportInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel vmAppListModel ) { getClusterQuota ( ) . setIsAvailable ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( vmImportInterfaceListModel ) ; list.add ( importDiskListModel ) ; list.add ( vmAppListModel ) ; setDetailModels ( list ) ; }

Target:
public void importVms ( org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ImportVm , buildImportVmParameters ( ) , callback , this ) ; }
Source:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver ) { return performCreation ( task , taskParams , entityResolver , expectBlocking ( ) ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { return performCreate ( task , taskParams , entityResolver , expectBlocking ( ) , suggestedParentType ) ; }
Source:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; }

Target:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initHasSpiceSupport ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllVmsQuery.getDbFacade ( ) . getVmDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVMs ( ) { return vmDao.getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult existsAndUp ( ) { org.ovirt.engine.core.bll.ValidationResult existsResult = exists ( ) ; if ( ! ( existsResult.isValid ( ) ) ) { return existsResult ; } if ( ( storagePool.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult existsAndUp ( ) { org.ovirt.engine.core.bll.ValidationResult existsResult = exists ( ) ; if ( ! ( existsResult.isValid ( ) ) ) { return existsResult ; } return isInStatus ( StoragePoolStatus.Up ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel other = ( ( org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel ) ( obj ) ) ; return java.util.Objects.equals ( id , other.id ) ; }
Source:
private static java.lang.String getDomainIdTuple ( org.ovirt.engine.core.compat.Guid domainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage_domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( domainId ) ; if ( storage_domain != null ) { return ( domainId + ":" ) + ( storage_domain.getstorage_name ( ) ) ; } else { return domainId.toString ( ) ; } }

Target:
private static java.lang.String getDomainIdTuple ( org.ovirt.engine.core.compat.Guid domainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage_domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( domainId ) ; if ( storage_domain != null ) { return ( domainId + ":" ) + ( storage_domain.getStorageName ( ) ) ; } else { return domainId.toString ( ) ; } }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public void onLogout ( ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.instance ( ) . signOut ( ) ; performLogout ( ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setIp ( "111" ) ; existingVm2.setFqdn ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( FixturesTool.VM_RHEL5_POOL_51 ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setIp ( "111" ) ; existingVm2.setFqdn ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
protected void setUpGetPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , getPayloadModel ( ) ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , getPayloadModel ( ) ) ; } }
Source:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String url , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMList ( url , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }

Target:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . info ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . info ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugMemory ( java.util.Map info ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.hotplugMemory ( info ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static boolean isStatusOk ( java.util.Map < java.lang.String , java.lang.Object > response ) { if ( ( response.get ( "error" ) ) != null ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "%s: %s" , response.get ( "error_code" ) , response.get ( "error" ) ) ) ; } return true ; }

Target:
public static boolean isStatusOk ( java.util.Map < java.lang.String , java.lang.Object > response ) { if ( ( response.get ( "error" ) ) != null ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "%s: %s" , response.get ( "error" ) , response.get ( "error_description" ) ) ) ; } return true ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.network.VmNic oldNic ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , oldNic , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( result.getState ( ) ) ) ; vmSnapshotListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmSnapshotListModel.Cancel ( ) ; vmSnapshotListModel.UpdateActionAvailability ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( result.getState ( ) ) ) ; vmSnapshotListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmSnapshotListModel.Cancel ( ) ; vmSnapshotListModel.UpdateActionAvailability ( ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetTemplateQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetTemplateQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( collection.deprecatedRemove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
private void addPermission ( ) { if ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . isPublicUse ( ) ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( PredefinedRoles.TEMPLATE_USER.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }

Target:
private void addPermission ( ) { addPermissionForTempalte ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getCurrentUser ( ) . getUserId ( ) , PredefinedRoles.TEMPLATE_OWNER ) ; if ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . isPublicUse ( ) ) { addPermissionForTempalte ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID , PredefinedRoles.TEMPLATE_USER ) ; } }
Source:
public void validatePass ( ) { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setStorageName ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HOSTED_STORAGE_NAME ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validatePass ( ) { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { providerChanged ( ) ; }
Source:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.permissions perm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDAO ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDAO ( ) . remove ( perm.getId ( ) ) ; } } }

Target:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.permissions perm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . remove ( perm.getId ( ) ) ; } } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { super . executeCommand ( command , parameters ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { super . executeCommand ( command , parameters ) ; } else if ( command == ( getAddMacPoolCommand ( ) ) ) { super . executeCommand ( command , parameters ) ; addMacPool ( ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( parameters [ 0 ] ) ) ) ; } }
Source:
public void stop ( ) { if ( ( thread ) != null ) { thread.interrupt ( ) ; while ( true ) { try { thread.join ( ) ; break ; } catch ( java.lang.InterruptedException e ) { } } thread = null ; } }

Target:
public void stop ( ) { if ( ( thread ) != null ) { thread.interrupt ( ) ; while ( true ) { try { thread.join ( ) ; break ; } catch ( java.lang.InterruptedException ignore ) { } } thread = null ; } }
Source:
private int getAdditionalAvailableSize ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { int additionalAvailableSize = ( ( lun.getDeviceSize ( ) ) - ( lun.getPvSize ( ) ) ) - 1 ; if ( additionalAvailableSize < 0 ) { additionalAvailableSize = 0 ; } return additionalAvailableSize ; }

Target:
private int getAdditionalAvailableSize ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { int pvSize = lun.getPvSize ( ) ; if ( pvSize == 0 ) { return 0 ; } int additionalAvailableSize = ( ( lun.getDeviceSize ( ) ) - pvSize ) - 1 ; if ( additionalAvailableSize < 0 ) { additionalAvailableSize = 0 ; } return additionalAvailableSize ; }
Source:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; assertEquals ( "days1" , 0 , span.Days ) ; assertEquals ( "hours1" , 3 , span.Hours ) ; assertEquals ( "minutes1" , 50 , span.Minutes ) ; assertEquals ( "seconds1" , 10 , span.Seconds ) ; assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }

Target:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; org.junit.Assert.assertEquals ( "days1" , 0 , span.Days ) ; org.junit.Assert.assertEquals ( "hours1" , 3 , span.Hours ) ; org.junit.Assert.assertEquals ( "minutes1" , 50 , span.Minutes ) ; org.junit.Assert.assertEquals ( "seconds1" , 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }
Source:
protected void throwVdsErrorException ( java.lang.String message , org.ovirt.engine.core.common.errors.VdcBllErrors error ) { org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( message ) ; org.ovirt.engine.core.common.errors.VDSError vdsError = new org.ovirt.engine.core.common.errors.VDSError ( ) ; vdsError.setCode ( error ) ; vdsError.setMessage ( message ) ; outEx.setVdsError ( vdsError ) ; throw outEx ; }

Target:
protected void throwVdsErrorException ( java.lang.String message , org.ovirt.engine.core.common.errors.EngineError error ) { org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( message ) ; org.ovirt.engine.core.common.errors.VDSError vdsError = new org.ovirt.engine.core.common.errors.VDSError ( ) ; vdsError.setCode ( error ) ; vdsError.setMessage ( message ) ; outEx.setVdsError ( vdsError ) ; throw outEx ; }
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.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RepoImageToImageFileNameAsyncConverter ( ) { @ java.lang.Override protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ISO_PREFIX ) + ( super . transform ( fileNameList , repoImage ) ) ; } @ java.lang.Override protected boolean desiredImage ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( repoImage.getFileType ( ) ) ; } } ) ; }