auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.vdscommands.VDSParametersBase createVDSParameters ( ) { return org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DestroyImageVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getImageList ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . isPostZero ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . isForce ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSParametersBase createVDSParameters ( ) { return postDeleteActionHandler.fixParameters ( new org.ovirt.engine.core.common.vdscommands.DestroyImageVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . getImageList ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . isPostZero ( ) , org.ovirt.engine.core.bll.storage.disk.image.DestroyImageCommand.getParameters ( ) . isForce ( ) ) ) ; }
Source:
protected boolean getIsNodeEnabled ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return disk.getstorage_ids ( ) . get ( 0 ) . equals ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntity ) ( listModel.getEntity ( ) ) ) . getId ( ) ) ; }

Target:
protected boolean getIsNodeEnabled ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getstorage_ids ( ) . get ( 0 ) . equals ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntity ) ( listModel.getEntity ( ) ) ) . getId ( ) ) ; } else { return true ; } }
Source:
public void testActionWithState ( ) throws java.lang.Exception { java.lang.String response = "<action><status><state>mystate</state></status></action>" ; try ( java.io.InputStream stream = new java.io.ByteArrayInputStream ( response.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = new org.ovirt.api.metamodel.runtime.xml.XmlReader ( stream ) ) { org.ovirt.engine.sdk4.types.Action action = org.ovirt.engine.sdk4.internal.xml.XmlActionReader.readOne ( reader ) ; org.junit.Assert.assertTrue ( action.statusPresent ( ) ) ; org.junit.Assert.assertTrue ( action.status ( ) . statePresent ( ) ) ; org.junit.Assert.assertEquals ( "mystate" , action.status ( ) . state ( ) ) ; } }

Target:
public void testActionWithState ( ) throws java.lang.Exception { java.lang.String response = "<action><status>mystatus</status></action>" ; try ( java.io.InputStream stream = new java.io.ByteArrayInputStream ( response.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = new org.ovirt.api.metamodel.runtime.xml.XmlReader ( stream ) ) { org.ovirt.engine.sdk4.types.Action action = org.ovirt.engine.sdk4.internal.xml.XmlActionReader.readOne ( reader ) ; org.junit.Assert.assertTrue ( action.statusPresent ( ) ) ; org.junit.Assert.assertEquals ( "mystatus" , action.status ( ) ) ; } }
Source:
public void deactivate ( ) { leftElement.replaceClassName ( style.activeLeft ( ) , style.inactiveLeft ( ) ) ; rightElement.replaceClassName ( style.activeRight ( ) , style.inactiveRight ( ) ) ; middleElement.replaceClassName ( style.activeMiddle ( ) , style.inactiveMiddle ( ) ) ; hyperlink.getElement ( ) . replaceClassName ( style.activeMiddleLink ( ) , style.inactiveMiddleLink ( ) ) ; arrowElement.replaceClassName ( style.activeArrow ( ) , style.inactiveArrow ( ) ) ; }

Target:
public void deactivate ( ) { leftElement.replaceClassName ( style.activeLeft ( ) , style.inactiveLeft ( ) ) ; rightElement.replaceClassName ( style.activeRight ( ) , style.inactiveRight ( ) ) ; middleElement.replaceClassName ( style.activeMiddle ( ) , style.inactiveMiddle ( ) ) ; hyperlinkLabel.getElement ( ) . replaceClassName ( style.activeMiddleLink ( ) , style.inactiveMiddleLink ( ) ) ; arrowElement.replaceClassName ( style.activeArrow ( ) , style.inactiveArrow ( ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenBondIsUnnamed ( ) throws java.lang.Exception { doTestValidModifiedBonds ( new org.ovirt.engine.core.common.businessentities.network.Bond ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( bond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) . mput ( Schema.UserKeys.UNLOCK_TIME , java.lang.System.currentTimeMillis ( ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }

Target:
private void internalEndSuccessfully ( ) { log.info ( "Ending command '{}' successfully." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; java.lang.String path = org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( path ) ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.FileUtil.readAllText ( path ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; java.lang.String path = org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ; if ( new java.io.File ( path ) . exists ( ) ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.FileUtil.readAllText ( path ) ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; return ; } org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ISpice extractSpice ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = model.getModel ( ) . getDefaultConsoleModel ( ) ; if ( ! ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) . getspice ( ) ; return spice ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel extractSpiceModel ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = model.getModel ( ) . getDefaultConsoleModel ( ) ; if ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) ; } return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.vm_pool_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vm_pool_map entity = new org.ovirt.engine.core.common.businessentities.vm_pool_map ( ) ; entity.setvm_guid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_guid" ) ) ) ; entity.setvm_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_pool_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmPoolMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmPoolMap entity = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( ) ; entity.setvm_guid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_guid" ) ) ) ; entity.setvm_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_pool_id" ) ) ) ; return entity ; }
Source:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { PARENT_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID ) } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }

Target:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { PARENT_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID ) } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS checkForActiveVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVdsDao ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( hosts.isEmpty ( ) ) ) { return hosts.get ( new java.util.Random ( ) . nextInt ( hosts.size ( ) ) ) ; } addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS checkForActiveVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getVdsDao ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( hosts.isEmpty ( ) ) ) { return hosts.get ( new java.util.Random ( ) . nextInt ( hosts.size ( ) ) ) ; } addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; return null ; }
Source:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return pool ; }

Target:
public org.ovirt.engine.api.model.VmPool doPopulate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { return pool ; }
Source:
private boolean selectionContextChanged ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext newContext = new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vm.getDefaultDisplayType ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsole = resolveSelectedConsoleModel ( vm.getId ( ) ) ; if ( selectedConsole == null ) { return true ; } return ! ( newContext.equals ( selectedConsole.getSelectionContext ( ) ) ) ; }

Target:
private boolean selectionContextChanged ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext newContext = new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vmDisplay ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsole = resolveUserSelectedConsoleModel ( vm.getId ( ) ) ; if ( selectedConsole == null ) { return true ; } return ! ( newContext.equals ( selectedConsole.getSelectionContext ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VolumeInfoReturnForXmlRpc getVolumeInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.getInfo" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgUUID ) . withParameter ( "volumeID" , volUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VolumeInfoReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VolumeInfoReturn getVolumeInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.getInfo" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgUUID ) . withParameter ( "volumeID" , volUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VolumeInfoReturn ( response ) ; }
Source:
public void saveListWithValidValues ( ) { java.util.List < java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > > validLists = new java.util.ArrayList < > ( ) ; validLists.add ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.CLUSTER ) ) ; validLists.add ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.DC ) ) ; validLists.add ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.OTHER_DC ) ) ; validLists.add ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.CLUSTER , org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.DC , org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.OTHER_DC ) ) ; for ( java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > validList : validLists ) { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.saveAsString ( validList ) ; } }

Target:
public void saveListWithValidValues ( ) { java.util.List < java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > > validLists = new java.util.ArrayList < > ( ) ; validLists.add ( java.util.Collections.singletonList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.CLUSTER ) ) ; validLists.add ( java.util.Collections.singletonList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.DC ) ) ; validLists.add ( java.util.Collections.singletonList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.OTHER_DC ) ) ; validLists.add ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.CLUSTER , org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.DC , org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType.OTHER_DC ) ) ; for ( java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > validList : validLists ) { org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.saveAsString ( validList ) ; } }
Source:
protected org.ovirt.engine.api.model.ExternalDiscoveredHost getEntity ( int index ) { org.ovirt.engine.api.model.ExternalDiscoveredHost provider = control.createMock ( org.ovirt.engine.api.model.ExternalDiscoveredHost.class ) ; org.easymock.EasyMock.expect ( provider.getIp ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( provider.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return provider ; }

Target:
protected org.ovirt.engine.api.model.ExternalDiscoveredHost getEntity ( int index ) { org.ovirt.engine.api.model.ExternalDiscoveredHost provider = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.ExternalDiscoveredHost.class ) ; org.mockito.Mockito.when ( provider.getIp ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( provider.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; return provider ; }
Source:
public static void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( 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.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setCompatibilityVersion ( Version.v3_5 ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setEmulatedMachine ( "pc-1.0" ) ; vdsGroup.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsGroup ) ; return mock ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainFormatCorrectForDC ( ) { if ( isStorageDomainOfTypeIsoOrExport ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } if ( ( storagePool ) != null ) { if ( ( org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getPreferredForVersion ( storagePool.getcompatibility_version ( ) , storageDomainStatic.getStorageType ( ) ) . compareTo ( storageDomainStatic.getStorageFormat ( ) ) ) < 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL , java.lang.String.format ( "$storageFormat %1$s" , storageDomainStatic.getStorageFormat ( ) . toString ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainFormatCorrectForDC ( ) { if ( isStorageDomainOfTypeIsoOrExport ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } if ( ( storagePool ) != null ) { if ( ( org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getPreferredForVersion ( storagePool.getCompatibilityVersion ( ) , storageDomainStatic.getStorageType ( ) ) . compareTo ( storageDomainStatic.getStorageFormat ( ) ) ) < 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL , java.lang.String.format ( "$storageFormat %1$s" , storageDomainStatic.getStorageFormat ( ) . toString ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfTypes ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSType type : types ) { list.addAll ( getAllOfType ( type ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types , org.ovirt.engine.core.compat.Guid groupId , org.ovirt.engine.core.common.businessentities.VDSStatus status , int minNrOfCpus ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( final org.ovirt.engine.core.common.businessentities.VDSType type : types ) { result.addAll ( getVdsToRun ( type , groupId , status , minNrOfCpus ) ) ; } return result ; }
Source:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }

Target:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.propertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } }
Source:
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 ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVm ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } 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 ( ( ( getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( getVm ( ) . getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } return permissionList ; }
Source:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }
Source:
private com.google.gwt.resources.client.ImageResource getNicIcon ( ) { return item.isSriovEnabled ( ) ? org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicSriov ( ) : org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicIcon ( ) ; }

Target:
private com.google.gwt.resources.client.ImageResource getNicIcon ( ) { if ( item.isSriovEnabled ( ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicSriov ( ) ; } else if ( item.isVf ( ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicVF ( ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicIcon ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { boolean value = getIsChangable ( ) ; getOutAverageLinkshare ( ) . setIsChangable ( value ) ; getOutAverageUpperlimit ( ) . setIsChangable ( value ) ; getOutAverageRealtime ( ) . setIsChangable ( value ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { boolean value = getIsChangable ( ) ; getOutAverageLinkshare ( ) . setIsChangeable ( value ) ; getOutAverageUpperlimit ( ) . setIsChangeable ( value ) ; getOutAverageRealtime ( ) . setIsChangeable ( value ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.MacPool macPool = getMacPool ( ) ; macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( macPool ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.getInstance ( ) . createPool ( macPool ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( macPool.getId ( ) ) ; }

Target:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
protected void extractBondSlave ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > value = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; value.add ( iface ) ; if ( bondSlaves.containsKey ( bondName ) ) { value.addAll ( bondSlaves.get ( bondName ) ) ; } bondSlaves.put ( bondName , value ) ; }

Target:
private void extractBondSlave ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = bonds.get ( iface.getBondName ( ) ) ; if ( slaves == null ) { slaves = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; bonds.put ( iface.getBondName ( ) , slaves ) ; } slaves.add ( iface ) ; }
Source:
public void testUpdateGlusterServerUuid ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entityToUpdate = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( org.ovirt.engine.core.dao.gluster.GlusterServerDaoTest.SERVER_ID1 , org.ovirt.engine.core.dao.FixturesTool.GLUSTER_SERVER_UUID_NEW ) ; dao.update ( entityToUpdate ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( org.ovirt.engine.core.dao.gluster.GlusterServerDaoTest.SERVER_ID1 ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_SERVER_UUID_NEW , entity.getGlusterServerUuid ( ) ) ; }

Target:
public void testUpdateGlusterServerUuid ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entityToUpdate = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( org.ovirt.engine.core.dao.FixturesTool.GLUSTER_BRICK_SERVER1 , org.ovirt.engine.core.dao.FixturesTool.GLUSTER_SERVER_UUID_NEW ) ; dao.update ( entityToUpdate ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = dao.getByServerId ( FixturesTool.GLUSTER_BRICK_SERVER1 ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_SERVER_UUID_NEW , entity.getGlusterServerUuid ( ) ) ; }
Source:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }

Target:
protected final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.UserSessionTimeOutInterval ) ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
private void CleanUp ( ) { if ( ( ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions ) != null ) && ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping ) != null ) ) && ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes ) != null ) ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingSpecialParams.clear ( ) ; } Init ( ) ; }

Target:
private void CleanUp ( ) { if ( ( ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions ) != null ) && ( ( fencingOptionMapping ) != null ) ) && ( ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes ) != null ) ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingAgentInstanceOptions.clear ( ) ; fencingOptionMapping.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.clear ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingSpecialParams.clear ( ) ; } Init ( ) ; }
Source:
private javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( guid ) ; if ( action.isSetHost ( ) ) { validateParameters ( action.getHost ( ) , "id|name" ) ; org.ovirt.engine.core.compat.Guid hostId = getHostId ( action ) ; params.setSourceServerId ( hostId ) ; } return doAction ( VdcActionType.UpdateGlusterHook , params , action ) ; }

Target:
private javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( guid ) ; if ( action.isSetHost ( ) ) { validateParameters ( action.getHost ( ) , "id|name" ) ; org.ovirt.engine.core.compat.Guid hostId = getHostId ( action ) ; params.setSourceServerId ( hostId ) ; } return doAction ( ActionType.UpdateGlusterHook , params , action ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > newList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : list ) { if ( ! ( permission.getrole_id ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > newList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : list ) { if ( ! ( permission.getRoleId ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected boolean validate ( ) { if ( ( ( getEvent ( ) ) == null ) || ( AuditLog.OVIRT_ORIGIN.equalsIgnoreCase ( getEvent ( ) . getOrigin ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( ( getEvent ( ) ) == null ) || ( AuditLog.OVIRT_ORIGIN.equalsIgnoreCase ( getEvent ( ) . getOrigin ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } org.ovirt.engine.core.common.businessentities.AuditLog auditLog = auditLogDao.getByOriginAndCustomEventId ( getEvent ( ) . getOrigin ( ) , getEvent ( ) . getCustomEventId ( ) ) ; if ( auditLog != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_DUPLICATE_CUSTOM_ID ) ; } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remotVolumeName , java.lang.String userName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remotVolumeName ) . withParameter ( "force" , force ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remotVolumeName , java.lang.String userName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remotVolumeName ) . withParameter ( "force" , force ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void getVMProperties ( org.ovirt.engine.core.compat.Version version , java.util.Map < java.lang.String , java.lang.String > propertiesMap , java.lang.String vmPropertiesFieldValue ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vmPropertiesFieldValue ) ) { return ; } populateVMProperties ( version , vmPropertiesFieldValue , propertiesMap ) ; }

Target:
private void getVMProperties ( org.ovirt.engine.core.compat.Version version , java.util.Map < java.lang.String , java.lang.String > propertiesMap , java.lang.String vmPropertiesFieldValue ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vmPropertiesFieldValue ) ) { return ; } propertiesMap.putAll ( convertProperties ( vmPropertiesFieldValue , allVmProperties.get ( version ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskVmElement getDiskVmElement ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid diskId ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( disk.getId ( ) . equals ( diskId ) ) { return disk.getDiskVmElementForVm ( vm.getId ( ) ) ; } } return null ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.VmDeviceId , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement > extractDiskVmElements ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < org.ovirt.engine.core.common.businessentities.VmDeviceId , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement > result = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement element = disk.getDiskVmElementForVm ( vm.getId ( ) ) ; if ( element != null ) { result.put ( element.getId ( ) , element ) ; } } return result ; }
Source:
public void clusterChanged ( ) { org.mockito.Mockito.when ( oldHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( host.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_CANNOT_UPDATE_CLUSTER ) ) ; }

Target:
public void clusterNotChanged ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( oldHost.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( clusterId ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }