auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void runAndAssertCanDoActionSuccess ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { boolean canDoAction = command.canDoAction ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Command''s canDoAction expected to succeed, but failed, messages are: {0}" , command.getReturnValue ( ) . getCanDoActionMessages ( ) ) , canDoAction ) ; }

Target:
public static void runAndAssertCanDoActionSuccess ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { boolean canDoAction = command.canDoAction ( ) ; java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Command''s canDoAction expected to succeed, but failed, messages are: {0}" , canDoActionMessages ) , canDoAction ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Command''s canDoAction succeeded, but added the following messages: {0}" , canDoActionMessages ) , canDoActionMessages.isEmpty ( ) ) ; }
Source:
public void testUpdateGlusterHookChecksum ( ) { dao.updateGlusterServerHookChecksum ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhook = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertNotNull ( serverhook ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhook.getStatus ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM , serverhook.getChecksum ( ) ) ; }

Target:
public void testUpdateGlusterHookChecksum ( ) { dao.updateGlusterServerHookChecksum ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhook = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( serverhook ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterHookStatus.ENABLED , serverhook.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterHooksDaoTest.CHECKSUM , serverhook.getChecksum ( ) ) ; }
Source:
private void buildSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; } }

Target:
private void buildSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { sharedLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) ; } }
Source:
private static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
private static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( "AuditLogType: '{}' not exist in string table" , value ) ; } } } }
Source:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; targetUrl = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( config.getInitParameter ( org.ovirt.engine.core.utils.servlet.RedirectServlet.TARGET_URL ) . replaceAll ( "%\\{" , "\\${" ) ) ; java.lang.String url404ConfigValue = config.getInitParameter ( org.ovirt.engine.core.utils.servlet.RedirectServlet.URL404 ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( url404ConfigValue ) ) { url404 = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( url404ConfigValue.replaceAll ( "%\\{" , "\\${" ) ) ; } else { url404 = org.ovirt.engine.core.utils.servlet.RedirectServlet.url404Default ; } }

Target:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; targetUrl = injectLocalHost ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( config.getInitParameter ( org.ovirt.engine.core.utils.servlet.RedirectServlet.TARGET_URL ) . replaceAll ( "%\\{" , "\\${" ) ) ) ; url404 = org.ovirt.engine.core.utils.servlet.RedirectServlet.url404Default ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( config.getInitParameter ( org.ovirt.engine.core.utils.servlet.RedirectServlet.URL404 ) ) ) { url404 = config.getInitParameter ( org.ovirt.engine.core.utils.servlet.RedirectServlet.URL404 ) ; } url404 = injectLocalHost ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( url404.replaceAll ( "%\\{" , "\\${" ) ) ) ; }
Source:
public void AppendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }

Target:
public void appendCustomValue ( final java.lang.String name , final java.lang.String value , final java.lang.String separator ) { final java.lang.String key = name.toLowerCase ( ) ; java.lang.String newValue = value ; allocateCustomValues ( ) ; if ( customValues.containsKey ( key ) ) { newValue = java.lang.String.format ( "%1$s%2$s%3$s" , customValues.get ( key ) , separator , value ) ; } customValues.put ( name.toLowerCase ( ) , newValue ) ; }
Source:
public void qosBondAndSlaveSpeedsZero ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( 0 , 0 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INVALID_INTERFACE_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface anotherBond = createBond ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) + "1" ) , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( anotherBond , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , anotherBond.getName ( ) ) ; }
Source:
public static void getStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void endVmRelatedOps ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation , java.lang.Throwable throwable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; alert.updateCallStackFromThrowable ( throwable ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType , auditLogDirector ) ; }

Target:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation , java.lang.Throwable throwable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; alert.updateCallStackFromThrowable ( throwable ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }
Source:
private void validateUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
private void validateUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.VmDiskOperationParameterBase parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected boolean isEditEnabled ( ) { return ( ( ( getIsFloating ( ) ) || ( getIsNew ( ) ) ) || ( getVm ( ) . isDown ( ) ) ) || ( ! ( getDisk ( ) . getPlugged ( ) ) ) ; }

Target:
protected boolean isEditEnabled ( ) { return ( ( ( ( getIsFloating ( ) ) || ( getIsNew ( ) ) ) || ( getVm ( ) . isDown ( ) ) ) || ( ! ( getDisk ( ) . getPlugged ( ) ) ) ) && ( getIsChangable ( ) ) ; }
Source:
protected void executeCommand ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( ) ) ) ; handleTaskReturn ( executeAndReturnTask ( ) ) ; }

Target:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME ) ; addCanDoActionMessage ( java.lang.String.format ( "$volumeName %1$s" , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ) ; addCanDoActionMessage ( java.lang.String.format ( "$vdsGroup %1$s" , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ) ; }
Source:
public void testGetAllMultiDiskImageSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( diskImageResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiDiskImageSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Disks" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( diskImageResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public void getPlaceHolderListTest1 ( ) { java.lang.String testMessage = "This is a test if {0} can actually work out {1}" ; java.util.List < java.lang.Integer > result = testMessages.getPlaceHolderList ( testMessage ) ; org.junit.Assert.assertEquals ( "Result should have 2 items" , 2 , result.size ( ) ) ; org.junit.Assert.assertEquals ( "index 0 should be 0" , ( ( java.lang.Integer ) ( 0 ) ) , result.get ( 0 ) ) ; }

Target:
public void getPlaceHolderListTest1 ( ) { java.lang.String testMessage = "This is a test if {0} can actually work out {1}" ; java.util.List < java.lang.Integer > result = testMessages.getPlaceHolderList ( testMessage ) ; org.ovirt.engine.ui.common.utils.BaseDynamicMessagesTest.assertIndexes ( result , 2 ) ; }
Source:
public void attachISO ( ) { attachInternal ( StorageDomainType.ISO , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . attachISOLibraryTitle ( ) , "attach_iso_library" ) ; }

Target:
public void attachISO ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel listModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; listModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . attachISOLibraryTitle ( ) ) ; listModel.setHelpTag ( HelpTag.attach_iso_library ) ; listModel.setHashName ( "attach_iso_library" ) ; attachInternal ( listModel , StorageDomainType.ISO ) ; }
Source:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , 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.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets3 ( ) ; } } ) , version ) ; }

Target:
public void postUpdateNumOfSockets3 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfThreadsPerCpu ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { maxThreadsPerCore = returnValue ; totalCpuCoresChanged ( ) ; } } ) , version ) ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel adElementListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel ) ( model ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) ; if ( handleQueryError ( queryReturnValue , adElementListModel ) ) { return ; } setusers ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > ( ) ) ; addUsersToModel ( queryReturnValue , getExcludeUsers ( ) ) ; onUserAndAdGroupsLoaded ( adElementListModel ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel adElementListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel ) ( model ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) ; if ( handleQueryError ( queryReturnValue , adElementListModel ) ) { return ; } setusers ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.aaa.DbUser > > ( ) ) ; addUsersToModel ( queryReturnValue , getExcludeUsers ( ) ) ; onAdUsersLoaded ( adElementListModel ) ; }
Source:
private javax.ws.rs.core.Response fence ( org.ovirt.engine.api.model.Action action , org.ovirt.engine.core.common.action.VdcActionType vdcAction , org.ovirt.engine.core.common.businessentities.FenceActionType fenceType ) { return doAction ( vdcAction , new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( guid , fenceType ) , action ) ; }

Target:
private org.ovirt.engine.api.model.Action mapToStorageDomains ( org.ovirt.engine.api.model.Action action , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { if ( storageDomains != null ) { action.setStorageDomains ( new org.ovirt.engine.api.model.StorageDomains ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { action.getStorageDomains ( ) . getStorageDomains ( ) . add ( map ( storageDomain ) ) ; } } return action ; }
Source:
private void mockStorageDomainDao ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
protected org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator createMultipleStorageDomainsValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { return new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( disksList ) ) ; }

Target:
private boolean validateStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > memoryDisksList = getMemoryImageBuilder ( ) . getDisksToBeCreated ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getAllDisks ( vmDisksList , memoryDisksList ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( sdValidator.allDomainsHaveSpaceForAllDisks ( vmDisksList , memoryDisksList ) ) ) ; }
Source:
protected boolean containsDefaultCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getVdsGroupDao ( ) . getAllForStoragePool ( storagePool.getId ( ) ) ; boolean hasDefaultCluster = false ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getId ( ) . equals ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ) { hasDefaultCluster = true ; break ; } } return hasDefaultCluster ; }

Target:
protected boolean containsDefaultCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getVdsGroupDao ( ) . getAllForStoragePool ( storagePool.getId ( ) ) ; boolean hasDefaultCluster = false ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getId ( ) . equals ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID ) ) ) { hasDefaultCluster = true ; break ; } } return hasDefaultCluster ; }
Source:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( args instanceof org.ovirt.engine.core.compat.PropertyChangedEventArgs ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Disks" . equals ( changedArgs.PropertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( changedArgs.PropertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } } } ) ; }

Target:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { model.getPropertyChangedEvent ( ) . 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 ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Disks" . equals ( changedArgs.PropertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( changedArgs.PropertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } } } ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPortMirroring ( ) ) ) { permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.common.businessentities.ActionGroup.PORT_MIRRORING ) ) ; } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPortMirroring ( ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.common.businessentities.ActionGroup.PORT_MIRRORING ) ) ; } return permissionList ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionResume ( parameters.getVolumeName ( ) , parameters.getSlaveHost ( ) , parameters.getSlaveVolume ( ) , parameters.getForce ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters parameters = org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.getParameters ( ) ; status = org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionResume ( parameters.getVolumeName ( ) , parameters.getSlaveHost ( ) , parameters.getSlaveVolume ( ) , parameters.getUserName ( ) , parameters.getForce ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResumeGeoRepSessionVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; cleanConnection ( storageListModel.fileConnection , storageListModel.hostId ) ; storageListModel.fileConnection = null ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > checkedLuns = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) ; postGetLunsMessages ( sanStorageModel.getUsedLunsMessages ( checkedLuns ) ) ; } else { sanStorageModel.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( model.getVmInitEnabled ( ) . getEntity ( ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) , model.getDomain ( ) . getEntity ( ) ) ; } else { return null ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( ( model.getVmInitEnabled ( ) . getEntity ( ) ) || ( model.getSysprepEnabled ( ) . getEntity ( ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) , model.getDomain ( ) . getEntity ( ) ) ; } else { return null ; } }
Source:
public void canDoActionSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void validateSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
public synchronized void CancelTask ( org.ovirt.engine.core.compat.Guid taskID ) { if ( _tasks.containsKey ( taskID ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to cancel task '{0}'." , taskID ) ; _tasks.get ( taskID ) . stopTask ( ) ; _tasks.get ( taskID ) . ConcreteStartPollingTask ( ) ; } }

Target:
public synchronized boolean EntityHasTasks ( org.ovirt.engine.core.compat.Guid id ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( isCurrentTaskLookedFor ( id , task ) ) { return true ; } } return false ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }
Source:
private boolean shouldOverrideSoundDevice ( ) { return ( ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) ) && ( isSoundDeviceEnabled ( ) ) ) && ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
private void initRadioButtonEditors ( ) { optimizationNoneEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForServerEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForDesktopEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationCustomEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; migrateOnErrorOption_YESEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_HA_ONLYEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_NOEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; optimizationCustomExplanationLabel = new com.google.gwt.user.client.ui.Label ( ) ; optimizationCustomExplanationLabel.setVisible ( false ) ; }

Target:
private void initRadioButtonEditors ( ) { enableOvirtServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "service" ) ; enableGlusterServiceOptionEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "service" ) ; optimizationNoneEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForServerEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationForDesktopEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; optimizationCustomEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "1" ) ; migrateOnErrorOption_YESEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_HA_ONLYEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; migrateOnErrorOption_NOEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelRadioButtonEditor ( "2" ) ; optimizationCustomExplanationLabel = new com.google.gwt.user.client.ui.Label ( ) ; optimizationCustomExplanationLabel.setVisible ( false ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; postInitTemplate ( ) ; }

Target:
public void afterUpdates ( ) { getInstanceTypeManager ( ) . activate ( ) ; }
Source:
private boolean isCreateFromSnapshot ( org.ovirt.engine.api.model.VM vm ) { return ( ( vm.isSetSnapshots ( ) ) && ( ( vm.getSnapshots ( ) . getSnapshots ( ) ) != null ) ) && ( ! ( vm.getSnapshots ( ) . getSnapshots ( ) . isEmpty ( ) ) ) ; }

Target:
private boolean isCreateFromSnapshot ( org.ovirt.engine.api.model.Vm vm ) { return ( ( vm.isSetSnapshots ( ) ) && ( ( vm.getSnapshots ( ) . getSnapshots ( ) ) != null ) ) && ( ! ( vm.getSnapshots ( ) . getSnapshots ( ) . isEmpty ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getFilteredDisksForSnapshot ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisksForSnapshot = getDiskImagesForVm ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; filteredDisksForSnapshot.addAll ( cinderDisks ) ; return filteredDisksForSnapshot ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( disks , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { allDisks.add ( org.ovirt.engine.core.bll.ImagesHandler.getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return allDisks ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { response.sendRedirect ( url ) ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String redirectUrl = url ; java.lang.String queryString = request.getQueryString ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( queryString ) ) { if ( ( redirectUrl.indexOf ( "?" ) ) == ( - 1 ) ) { redirectUrl += "?" ; } else { redirectUrl += "&" ; } redirectUrl += queryString ; } response.sendRedirect ( redirectUrl ) ; }
Source:
public static void getHostPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS doPersist ( ) { vdsStaticDao.save ( object.getStaticData ( ) ) ; vdsDynamicDao.save ( object.getDynamicData ( ) ) ; vdsStatisticsDao.save ( object.getStatisticsData ( ) ) ; return object ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS doPersist ( ) { vdsStaticDao.save ( object.getStaticData ( ) ) ; vdsDynamicDao.save ( object.getDynamicData ( ) ) ; vdsStatisticsDao.save ( object.getStatisticsData ( ) ) ; return vdsDao.get ( object.getId ( ) ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( QueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }

Target:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( QueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }