auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this , getEntity ( ) ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getUpdatedStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getstorage_ids ( ) . get ( 0 ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getSizeInGigabytes ( ) ) ) ; return list ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getUpdatedStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( getQuotaId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getstorage_ids ( ) . get ( 0 ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getSizeInGigabytes ( ) ) ) ; return list ; }
Source:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.NGuid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid.getValue ( ) ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }

Target:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.Guid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid.getValue ( ) ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NIC incoming , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , nic , ( incoming.isSetNetwork ( ) ? incoming.getNetwork ( ) . isSetName ( ) ? nic.getNetworkName ( ) : "" : null ) , ( incoming.isSetPortMirroring ( ) ? nic.isPortMirroring ( ) : false ) ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NIC incoming , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , nic ) ; }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImageList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3SerialNumber adapt ( org.ovirt.engine.api.model.SerialNumber from ) { org.ovirt.engine.api.v3.types.V3SerialNumber to = new org.ovirt.engine.api.v3.types.V3SerialNumber ( ) ; if ( from.isSetPolicy ( ) ) { to.setPolicy ( from.getPolicy ( ) ) ; } if ( from.isSetValue ( ) ) { to.setValue ( from.getValue ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3SerialNumber adapt ( org.ovirt.engine.api.model.SerialNumber from ) { org.ovirt.engine.api.v3.types.V3SerialNumber to = new org.ovirt.engine.api.v3.types.V3SerialNumber ( ) ; if ( from.isSetPolicy ( ) ) { to.setPolicy ( from.getPolicy ( ) . value ( ) ) ; } if ( from.isSetValue ( ) ) { to.setValue ( from.getValue ( ) ) ; } return to ; }
Source:
private void lockEntities ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getSnapshot ( ) ) ; getSnapshotDao ( ) . updateStatus ( sourceSnapshotId , SnapshotStatus.LOCKED ) ; lockVmWithCompensationIfNeeded ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.freeLock ( ) ; }

Target:
protected void lockEntities ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getSnapshot ( ) ) ; getSnapshotDao ( ) . updateStatus ( sourceSnapshotId , SnapshotStatus.LOCKED ) ; lockVmWithCompensationIfNeeded ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.freeLock ( ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnMove" ) ) || ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnCopy" ) ) ) { OnExecute ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; OnExecute ( ) ; }
Source:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void updateNonExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getClientStorage ( ) ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setimage_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.BaseDisk generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk d = new org.ovirt.engine.core.common.businessentities.storage.BaseDisk ( ) ; d.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; d.setDiskInterface ( DiskInterface.IDE ) ; d.setWipeAfterDelete ( true ) ; d.setPropagateErrors ( PropagateErrors.Off ) ; d.setDiskAlias ( "DiskName" ) ; d.setSgio ( ScsiGenericIO.FILTERED ) ; return d ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.BaseDisk generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk d = new org.ovirt.engine.core.common.businessentities.storage.BaseDisk ( ) ; d.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; d.setWipeAfterDelete ( true ) ; d.setPropagateErrors ( PropagateErrors.Off ) ; d.setDiskAlias ( "DiskName" ) ; d.setSgio ( ScsiGenericIO.FILTERED ) ; return d ; }
Source:
public static void init ( ) { java.lang.String QUARTZ_DB_TEST_PROPERTIES = "ovirt-db-scheduler-test.properties" ; java.util.Properties props = null ; try { props = org.ovirt.engine.core.utils.ResourceUtils.loadProperties ( org.ovirt.engine.core.utils.timer.SchedulerUtil.class , QUARTZ_DB_TEST_PROPERTIES ) ; } catch ( java.io.IOException exception ) { throw new java.lang.IllegalStateException ( ( ( "Can\'t load properties from resource \"" + QUARTZ_DB_TEST_PROPERTIES ) + "\"." ) , exception ) ; } org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler = new org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImpl ( ) ; org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.setup ( props ) ; }

Target:
public static void init ( ) throws java.io.IOException { java.lang.String QUARTZ_DB_TEST_PROPERTIES = "ovirt-db-scheduler-test.properties" ; java.util.Properties props = org.ovirt.engine.core.utils.ResourceUtils.loadProperties ( org.ovirt.engine.core.utils.timer.SchedulerUtil.class , QUARTZ_DB_TEST_PROPERTIES ) ; org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler = new org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImpl ( ) ; org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.setup ( props ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpVnicProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpVnicProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) { return true ; } return ( ( vmDevice.getSnapshotId ( ) ) == null ) && ( getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) . isAllowSnapshot ( ) ) ; }

Target:
private boolean deviceCanBeRemoved ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { if ( ! ( vmDevice.getDevice ( ) . equals ( VmDeviceType.DISK.getName ( ) ) ) ) { return true ; } if ( ( vmDevice.getSnapshotId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.Disk disk = getDiskDao ( ) . get ( vmDevice.getDeviceId ( ) ) ; return ( disk != null ) && ( disk.isAllowSnapshot ( ) ) ; } return false ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRefreshCommand ( ) ) ) { refreshModel ( ) ; updatePagingAvailability ( ) ; } else if ( command == ( getDetailsCommand ( ) ) ) { details ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRefreshCommand ( ) ) ) { refreshModel ( ) ; updatePagingAvailability ( ) ; } else if ( command == ( getDetailsCommand ( ) ) ) { details ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
public void flush ( ) { if ( validate ( false ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; } }

Target:
public boolean flush ( ) { if ( validate ( ) ) { diskModel.flush ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getDiskModel ( ) . getDisk ( ) ) ) . setVolumeFormat ( getVolumeFormat ( ) . getSelectedItem ( ) ) ; return true ; } return false ; }
Source:
private static java.util.List < java.lang.String > assertCanDoActionMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}canDoAction messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.CanDoActionTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }

Target:
public static java.util.List < java.lang.String > assertCanDoActionMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}canDoAction messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.CanDoActionTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }
Source:
public int compare ( org.ovirt.engine.api.model.Network n1 , org.ovirt.engine.api.model.Network n2 ) { if ( n1.getId ( ) . equals ( n2.getId ( ) ) ) { return 0 ; } else { return n1.getId ( ) . toString ( ) . compareTo ( n2.getId ( ) . toString ( ) ) ; } }

Target:
public int compare ( org.ovirt.engine.api.model.Network n1 , org.ovirt.engine.api.model.Network n2 ) { if ( n1.getId ( ) . equals ( n2.getId ( ) ) ) { return 0 ; } else { return n1.getId ( ) . compareTo ( n2.getId ( ) ) ; } }
Source:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) ) ; } }

Target:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) , true ) ; } }
Source:
void handleAutoLogin ( ) { org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { final org.ovirt.engine.core.common.users.VdcUser vdcUser = autoLoginData.getVdcUser ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { lockInteractionManager.showLoadingIndicator ( ) ; getLoginModel ( ) . AutoLogin ( vdcUser ) ; } } ) ; user.setAutoLogin ( true ) ; } }

Target:
protected void handleAutoLogin ( org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData ) { final org.ovirt.engine.core.common.users.VdcUser vdcUser = autoLoginData.getVdcUser ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { lockInteractionManager.showLoadingIndicator ( ) ; getLoginModel ( ) . AutoLogin ( vdcUser ) ; } } ) ; user.setAutoLogin ( true ) ; }
Source:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { messages.add ( EngineMessage.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; return true ; } return false ; }

Target:
private static boolean vmAssignedToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < java.lang.String > messages ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) . size ( ) ) > 0 ) { messages.add ( EngineMessage.VM_POOL_CANNOT_ADD_VM_WITH_USERS_ATTACHED_TO_POOL.toString ( ) ) ; return true ; } return false ; }
Source:
public void onSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( null ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }

Target:
public void onSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }
Source:
static org.ovirt.engine.api.model.Event getModel ( int index ) { org.ovirt.engine.api.model.Event model = new org.ovirt.engine.api.model.Event ( ) ; model.setId ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; model.setSeverity ( LogSeverity.ALERT.value ( ) ) ; model.setDescription ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; model.setOrigin ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; model.setCustomId ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; model.setFloodRate ( 30 ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Event getModel ( int index ) { org.ovirt.engine.api.model.Event model = new org.ovirt.engine.api.model.Event ( ) ; model.setId ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; model.setSeverity ( LogSeverity.ALERT ) ; model.setDescription ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; model.setOrigin ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; model.setCustomId ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; model.setFloodRate ( 30 ) ; return model ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String version = org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getParameters ( ) . getVersion ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( version ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFenceOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String version = org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getParameters ( ) . getVersion ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( version ) ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.String > > map = options.getFenceOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }
Source:
private java.util.ArrayList < java.lang.String > trimElements ( java.lang.String ... elements ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( elements.length ) ; for ( java.lang.String e : elements ) { list.add ( e.trim ( ) ) ; } return list ; }

Target:
private java.util.ArrayList < java.lang.String > trimElements ( java.lang.String ... elements ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( elements.length ) ; for ( java.lang.String e : elements ) { e = e.trim ( ) ; if ( ( e.length ( ) ) > 0 ) { list.add ( e ) ; } } return list ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setowner ( org.ovirt.engine.core.common.businessentities.StorageDomainOwnerType.forValue ( rs.getInt ( "owner" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
public void executeCommand ( ) { 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 ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doNothing ( ) . when ( hookSyncJob ) . refreshHooksInCluster ( getVdsGroup ( ) , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REFRESH ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doNothing ( ) . when ( hookSyncJob ) . refreshHooksInCluster ( getVdsGroup ( ) , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REFRESH ) ; }
Source:
public static void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }

Target:
public static void isStorageDomainNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; return storageDomains.isEmpty ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Storage: name=" + name ) , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByNameComparer ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByNameComparer ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }
Source:
public void refreshLightWeightData ( ) { log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster lightweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }

Target:
public void refreshLightWeightData ( ) { log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster lightweight data of cluster {0}!" , cluster.getName ( ) , e ) ; } } } }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { initializeCommand ( ) ; 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 ( ) ; 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 static org.ovirt.engine.core.common.businessentities.GraphicsDevice map ( org.ovirt.engine.api.model.GraphicsConsole graphicsConsole , org.ovirt.engine.core.common.businessentities.GraphicsDevice template ) { org.ovirt.engine.api.model.GraphicsType type = org.ovirt.engine.api.model.GraphicsType.valueOf ( graphicsConsole.getProtocol ( ) ) ; if ( template != null ) { return template ; } switch ( type ) { case SPICE : return new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; case VNC : return new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.VNC ) ; default : return template ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.GraphicsDevice map ( org.ovirt.engine.api.model.GraphicsConsole graphicsConsole , org.ovirt.engine.core.common.businessentities.GraphicsDevice template ) { if ( template != null ) { return template ; } switch ( graphicsConsole.getProtocol ( ) ) { case SPICE : return new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; case VNC : return new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.VNC ) ; default : return template ; } }
Source:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getVmName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel clusterPolicyListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPolicyComparator ( ) ) ; clusterPolicyListModel.setItems ( list ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPolicyComparator ( ) ) ; setItems ( list ) ; }
Source:
protected void selectDataCenterWithCluster ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { if ( selectedCluster == null ) { getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) ) ; } else { model.getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( ( ( org.ovirt.engine.core.compat.Guid ) ( selectedCluster ) ) ) ) ) ; } }

Target:
protected void selectDataCenterWithCluster ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { if ( selectedCluster == null ) { getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) ) ; } else { model.getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , org.ovirt.engine.core.compat.Guid vnicProfileId ) { java.util.Map < java.lang.String , java.lang.String > customProperties = null ; if ( vnicProfileId != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile profile = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) . get ( vnicProfileId ) ; customProperties = ( profile == null ) ? null : profile.getCustomProperties ( ) ; } return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , VmDeviceType.BRIDGE , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , customProperties ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , VmDeviceType.BRIDGE , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }
Source:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }

Target:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }
Source:
private static void shuffle ( java.lang.reflect.Method method , java.lang.Object model ) { java.lang.Class < ? extends java.lang.Enum > enumType = ( ( java.lang.Class < ? extends java.lang.Enum > ) ( method.getParameterTypes ( ) [ 0 ] ) ) ; try { method.invoke ( model , org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( enumType ) ) ; } catch ( java.lang.Exception e ) { } }

Target:
private static void shuffle ( java.lang.reflect.Method method , java.lang.Object model ) throws java.lang.Exception { java.lang.Class < ? extends java.lang.Enum > enumType = ( ( java.lang.Class < ? extends java.lang.Enum > ) ( method.getParameterTypes ( ) [ 0 ] ) ) ; method.invoke ( model , org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( enumType ) ) ; }
Source:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.StoragePool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.stopTask ( ) ; } }

Target:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.StoragePool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getName ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.stopTask ( ) ; } }