auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { java.lang.String terminatedSessionId = sessionDataContainer.getSessionIdBySeqId ( org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getParameters ( ) . getTerminatedSessionDbId ( ) ) ; if ( terminatedSessionId == null ) { log.info ( "Cannot terminate session with database id '{}', it doesn't exist anymore." , org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getParameters ( ) . getTerminatedSessionDbId ( ) ) ; org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.setSucceeded ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.aaa.DbUser terminatedUser = sessionDataContainer.getUser ( terminatedSessionId , false ) ; if ( terminatedUser != null ) { addCustomValue ( "TerminatedSessionUsername" , java.lang.String.format ( "%s@%s" , terminatedUser.getLoginName ( ) , terminatedUser.getDomain ( ) ) ) ; } setReturnValue ( org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getBackend ( ) . logoff ( new org.ovirt.engine.core.common.action.ActionParametersBase ( terminatedSessionId ) ) ) ; }

Target:
protected void executeCommand ( ) { sessionId = sessionDataContainer.getSessionIdBySeqId ( org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getParameters ( ) . getTerminatedSessionDbId ( ) ) ; if ( ( sessionId ) == null ) { log.info ( "Cannot terminate session with database id '{}', it doesn't exist anymore." , org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getParameters ( ) . getTerminatedSessionDbId ( ) ) ; org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.setSucceeded ( false ) ; return ; } sourceIp = sessionDataContainer.getSourceIp ( sessionId ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser terminatedUser = sessionDataContainer.getUser ( sessionId , false ) ; if ( terminatedUser != null ) { addCustomValue ( "TerminatedSessionUsername" , java.lang.String.format ( "%s@%s" , terminatedUser.getLoginName ( ) , terminatedUser.getDomain ( ) ) ) ; } setReturnValue ( org.ovirt.engine.core.bll.aaa.TerminateSessionCommand.getBackend ( ) . logoff ( new org.ovirt.engine.core.common.action.ActionParametersBase ( sessionId ) ) ) ; }
Source:
private void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( template.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( template.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
private void initCdImage ( ) { updateSelectedCdImage ( template ) ; updateCdImage ( ) ; }
Source:
public org.ovirt.engine.api.model.Network get ( ) { return performGet ( VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
public void setNbLine ( int nbLine ) { this . nbLine = nbLine ; }

Target:
public synchronized boolean isNextBreakpoint ( ) { if ( ! ( openSocket ) ) { return false ; } try { askForStatus ( ) ; ois = new routines.system.NoHeaderObjectInputStream ( s.getInputStream ( ) ) ; routines.system.TraceBean traceBean = ( ( routines.system.TraceBean ) ( ois.readObject ( ) ) ) ; return traceBean.equals ( TraceStatusBean.NEXT_BREAKPOINT ) ; } catch ( java.io.IOException e ) { e.printStackTrace ( ) ; return false ; } catch ( java.lang.ClassNotFoundException e ) { e.printStackTrace ( ) ; return false ; } }
Source:
public void testComplexCommand ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . privateKey ( java.nio.file.Paths.get ( "/mykey" ) ) . inventoryFile ( java.nio.file.Paths.get ( "/myinventory" ) ) . limit ( "mylimit" ) . verboseLevel ( AnsibleVerbosity.LEVEL3 ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , "-vvv" , "--private-key=/mykey" , "--inventory=/myinventory" , "--limit=mylimit" , "--extra-vars=a=1" , "--extra-vars=b=2" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testComplexCommand ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . privateKey ( java.nio.file.Paths.get ( "/mykey" ) ) . inventoryFile ( java.nio.file.Paths.get ( "/myinventory" ) ) . limit ( "mylimit" ) . verboseLevel ( AnsibleVerbosity.LEVEL3 ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , "-vvv" , "--private-key=/mykey" , "--inventory=/myinventory" , "--limit=mylimit" , "--extra-vars=a=1" , "--extra-vars=b=2" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
protected void update ( boolean canDo , boolean executeCommandResult , int getConnectionExecTimes ) throws java.lang.Exception { for ( int i = 0 ; i < getConnectionExecTimes ; i ++ ) { setUpGetEntityExpectations ( ) ; } setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStorageServerConnection , org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , executeCommandResult ) ) ; verifyModel ( resource.update ( getModel ( 3 ) ) , 3 ) ; }

Target:
protected void update ( boolean valid , boolean executeCommandResult , int getConnectionExecTimes ) throws java.lang.Exception { for ( int i = 0 ; i < getConnectionExecTimes ; i ++ ) { setUpGetEntityExpectations ( ) ; } setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStorageServerConnection , org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , executeCommandResult ) ) ; verifyModel ( resource.update ( getModel ( 3 ) ) , 3 ) ; }
Source:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( storageServerConnectionLunMapDao ) ; expectGetConnections ( storageServerConnectionDao ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }

Target:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( storageServerConnectionLunMapDao ) ; expectGetConnections ( storageServerConnectionDao ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }
Source:
protected boolean executeUpdateVmInSpmCommand ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.UpdateVMVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.UpdateVMVDSCommandParameters ( storagePoolId , metaDictionary ) ; tempVar.setStorageDomainId ( storageDomainId ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVM , tempVar ) . getSucceeded ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase performOvfUpdateForStoragePool ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( storagePoolId ) ) ; }
Source:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; if ( snapshot.isSetPersistMemorystate ( ) ) { snapshotParams.setSaveMemory ( snapshot.isPersistMemorystate ( ) ) ; } if ( snapshot.isSetDisks ( ) ) { snapshotParams.setDisks ( mapDisks ( snapshot.getDisks ( ) ) ) ; } return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }

Target:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; if ( snapshot.isSetPersistMemorystate ( ) ) { snapshotParams.setSaveMemory ( snapshot.isPersistMemorystate ( ) ) ; } if ( snapshot.isSetDiskAttachments ( ) ) { snapshotParams.setDisks ( mapDisks ( snapshot.getDiskAttachments ( ) ) ) ; } return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }
Source:
private static java.lang.String getRelativePath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.restapi.util.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.api.restapi.util.LinkHelper.PathKey ) { org.ovirt.engine.api.restapi.util.LinkHelper.PathKey key = ( ( org.ovirt.engine.api.restapi.util.LinkHelper.PathKey ) ( obj ) ) ; return ( equals ( service , key.service ) ) && ( equals ( parentService , key.parentService ) ) ; } else { return false ; } }
Source:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getName ( ) ) ) ; }

Target:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . syncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getName ( ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_pool get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.storage_pool > mapper = new org.ovirt.engine.core.dao.StoragePoolDAODbFacadeImpl.StoragePoolRawMapper ( ) ; return getCallsHandler ( ) . executeRead ( "Getstorage_poolByid" , mapper , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage_pool get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "Getstorage_poolByid" , org.ovirt.engine.core.dao.StoragePoolDAODbFacadeImpl.mapper , parameterSource ) ; }
Source:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getKeyCode ( ) ) ) { handleEnterKey ( ) ; } else if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) == ( event.getKeyCode ( ) ) ) { handleEscapeKey ( ) ; } }

Target:
protected void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getKeyCode ( ) ) ) { handleEnterKey ( ) ; } else if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) == ( event.getKeyCode ( ) ) ) { handleEscapeKey ( ) ; event.preventDefault ( ) ; } }
Source:
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.INSERT ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.put ( 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.INSERT ) ; 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.put ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
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 getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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 ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void testCommandExternalNetwork ( ) { setUpPhysicalNetwork ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.HAS_SHORT_NAME , org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.IS_VM_NETWORK ) ; physicalNetwork.setProvidedBy ( new org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK.name ( ) ) ) ; }

Target:
public void testCommandExternalNetwork ( ) { setUpPhysicalNetwork ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.HAS_SHORT_NAME , org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.IS_VM_NETWORK ) ; physicalNetwork.setProvidedBy ( new org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED ) ; return false ; } if ( ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getGlusterHooksDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED ) ; return false ; } if ( ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getGlusterHooksDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST ) ; return false ; } return true ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.DbUser user = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; user.setuser_id ( GUIDS [ i ] ) ; user.setname ( NAMES [ i ] ) ; user.setusername ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.DbUser user = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; user.setId ( GUIDS [ i ] ) ; user.setFirstName ( NAMES [ i ] ) ; user.setLoginName ( NAMES [ i ] ) ; users.add ( user ) ; } return users ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startSpice ( java.lang.String vdsIp , int port , java.lang.String ticket ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startSpice ( vdsIp , port , ticket ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.remove_image_ticket ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , resolvedMessage ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLog create ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , resolvedMessage ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( succeeded ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; networkQoS.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) ) ; } postSaveAction ( succeeded ) ; }
Source:
public void testValidateFailReadOnlyOnInterface ( ) { org.mockito.Mockito.when ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; org.mockito.Mockito.verify ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ; }

Target:
public void testValidateFailReadOnlyOnInterface ( ) { org.mockito.Mockito.when ( diskVmElementValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; org.mockito.Mockito.verify ( diskVmElementValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void IsShareableDiskEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ShareableDiskEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }
Source:
public void rollback ( ) { super . rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . AddMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( getMacAddress ( ) ) ; } } }

Target:
public void rollback ( ) { super . rollback ( ) ; if ( macAddressChanged ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . addMac ( oldIface.getMacAddress ( ) ) ; if ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.AllowDuplicateMacAddresses ) ) ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( getMacAddress ( ) ) ; } } }
Source:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm ; if ( isNextRunRequested ( ) ) { vm = performGet ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } else { vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } return removeRestrictedInfo ( vm ) ; }

Target:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm ; if ( isNextRunRequested ( ) ) { org.ovirt.engine.api.model.VM entity = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id , true ) ; vm = addLinks ( populate ( org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null , false ) , entity ) ) ; } else { vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } return removeRestrictedInfo ( vm ) ; }
Source:
void attachAlert ( org.ovirt.engine.ui.common.widget.panel.AlertPanel alertPanel ) { com.google.gwt.user.client.ui.RootPanel.get ( ) . add ( alertPanel ) ; com.google.gwt.dom.client.Element messageDivElement = alertPanel.getMessageAt ( 0 ) . getElement ( ) ; if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectOverflowUsingScrollWidth ( messageDivElement ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipContent = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( messageDivElement.getInnerText ( ) ) ; org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( tooltipContent , alertPanel.getElement ( ) , Placement.BOTTOM ) ; } }

Target:
void attachAlert ( org.ovirt.engine.ui.common.widget.panel.AlertPanel alertPanel ) { com.google.gwt.user.client.ui.RootPanel.get ( ) . add ( alertPanel ) ; com.google.gwt.dom.client.Element messageDivElement = alertPanel.getMessageAt ( 0 ) . getElement ( ) ; if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectOverflowUsingScrollWidth ( messageDivElement ) ) { java.lang.String tooltipContent = messageDivElement.getInnerText ( ) ; org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.setTooltipOnElement ( tooltipContent , alertPanel.getElement ( ) ) ; } }
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.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; 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.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 > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }
Source:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; cretaeVirtIODisk ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.< java.lang.String > emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
private void failureEventHandler ( final java.lang.String description , final java.util.ArrayList < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }

Target:
private void failureEventHandler ( final java.lang.String description , final java.util.List < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { handleNotLoggedInEvent ( errorMessage ) ; messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; updateVmInit ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; updateVmInit ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }
Source:
public void addActionVersionMap ( org.ovirt.engine.core.common.businessentities.ActionVersionMap actionVersionMap ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_type" , actionVersionMap.getaction_type ( ) ) . addValue ( "cluster_minimal_version" , actionVersionMap.getcluster_minimal_version ( ) ) . addValue ( "storage_pool_minimal_version" , actionVersionMap.getstorage_pool_minimal_version ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertaction_version_map" , parameterSource ) ; }

Target:
public void addActionVersionMap ( org.ovirt.engine.core.common.businessentities.ActionVersionMap actionVersionMap ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_type" , actionVersionMap.getActionType ( ) ) . addValue ( "cluster_minimal_version" , actionVersionMap.getClusterMinimalVersion ( ) ) . addValue ( "storage_pool_minimal_version" , actionVersionMap.getStoragePoolMinimalVersion ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertaction_version_map" , parameterSource ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.roles role ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , role.getdescription ( ) ) . addValue ( "id" , role.getId ( ) ) . addValue ( "name" , role.getname ( ) ) . addValue ( "is_readonly" , role.getis_readonly ( ) ) . addValue ( "role_type" , role.getType ( ) . getId ( ) ) . addValue ( "allows_viewing_children" , role.allowsViewingChildren ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertRole" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.Role role ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , role.getdescription ( ) ) . addValue ( "id" , role.getId ( ) ) . addValue ( "name" , role.getname ( ) ) . addValue ( "is_readonly" , role.getis_readonly ( ) ) . addValue ( "role_type" , role.getType ( ) . getId ( ) ) . addValue ( "allows_viewing_children" , role.allowsViewingChildren ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertRole" , parameterSource ) ; }
Source:
protected void updateScsiPassthroguhChangeability ( ) { getIsScsiPassthrough ( ) . setIsChangable ( ( ( ! ( getIsReadOnly ( ) . getEntity ( ) ) ) && ( isEditEnabled ( ) ) ) ) ; getIsScsiPassthrough ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.cannotEnableScsiPassthroughForLunReadOnlyDisk ( ) ) ; updateSgIoUnfilteredChangeability ( ) ; }

Target:
private void DiskInterface_SelectedItemChanged ( ) { boolean isLunDisk = ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ; org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = getDiskInterface ( ) . getSelectedItem ( ) ; getIsSgIoUnfiltered ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; getIsScsiPassthrough ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; updateScsiPassthroguhChangeability ( ) ; updateReadOnlyChangeability ( ) ; updatePlugChangeability ( ) ; }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
private org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParametersForTask ( parentCommand , getParameters ( ) ) ; if ( ( ( parentParameters.getParametersCurrentUser ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) != null ) ) { parentParameters.setParametersCurrentUser ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) ; } return parentParameters ; }
Source:
private void addVmToDb ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmInterfaces ( ) ; addVmStatistics ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }

Target:
protected org.ovirt.engine.core.bll.validator.ImportValidator getImportValidator ( ) { if ( ( importValidator ) == null ) { importValidator = new org.ovirt.engine.core.bll.validator.ImportValidator ( getParameters ( ) ) ; } return importValidator ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . setnet_config_dirty ( false ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . getDynamicData ( ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . setnet_config_dirty ( false ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . update ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . getDynamicData ( ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDiskForVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_MEMORY_DISK_DESCRIPTION ) ; image.setSize ( vm.getTotalMemorySizeInBytes ( ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vm.getTotalMemorySizeInBytes ( ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType type , boolean value , boolean inSync ) { reportedConfigurationList.add ( new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( type , java.lang.Boolean.toString ( value ) , inSync ) ) ; return this ; }

Target:
public < T > org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType type , T actual , T expected , boolean inSync ) { java.lang.String actualValue = ( actual == null ) ? null : actual.toString ( ) ; java.lang.String expectedValue = ( expected == null ) ? null : expected.toString ( ) ; reportedConfigurationList.add ( new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( type , actualValue , expectedValue , inSync ) ) ; return this ; }