auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( disk.getVm ( ) ) == null ) { return ; } boolean isVirtioScsiEnabled = java.lang.Boolean.TRUE.equals ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ; org.ovirt.engine.core.compat.Version clusterVersion = disk.getVm ( ) . getCompatibilityVersion ( ) ; interfaceInfoIcon.setVisible ( ( ( ( clusterVersion.compareTo ( Version.v3_3 ) ) >= 0 ) && ( ! isVirtioScsiEnabled ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( disk.getVm ( ) ) == null ) { return ; } boolean isVirtioScsiEnabled = java.lang.Boolean.TRUE.equals ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ; interfaceInfoIcon.setVisible ( ( ! isVirtioScsiEnabled ) ) ; }
Source:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; showBricksListEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getHostName ( ) ; } } ) ; }

Target:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; showBricksListEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getHostName ( ) ; } } ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS getUpServer ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getVdsDao ( ) . getAllForVdsGroupWithStatus ( clusterId , VDSStatus.Up ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NO_UP_SERVER_FOUND ) ; } return org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( servers ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDS getUpServer ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getVdsDao ( ) . getAllForVdsGroupWithStatus ( clusterId , VDSStatus.Up ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { return null ; } return org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( servers ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getDbUserDao ( ) ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setname ( "Bob" ) ; newUser.setsurname ( "Milqtoste" ) ; newUser.setusername ( "newuser" ) ; newUser.setemail ( "newuser@redhat.com" ) ; newUser.setdomain ( "domain" ) ; newUser.setgroups ( "groups" ) ; newSession = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( ) ; newSession.setsession_id ( org.ovirt.engine.core.dao.DbUserDAOTest.SESSION_ID ) ; newSession.setuser_id ( existingUser.getuser_id ( ) ) ; java.util.Date now = new java.util.Date ( ) ; now.setTime ( java.lang.System.currentTimeMillis ( ) ) ; newSession.setlogin_time ( now ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setname ( "Bob" ) ; newUser.setsurname ( "Milqtoste" ) ; newUser.setusername ( "newuser" ) ; newUser.setemail ( "newuser@redhat.com" ) ; newUser.setdomain ( "domain" ) ; newUser.setgroups ( "groups" ) ; newSession = new org.ovirt.engine.core.dal.dbbroker.user_sessions ( ) ; newSession.setsession_id ( org.ovirt.engine.core.dao.DbUserDAOTest.SESSION_ID ) ; newSession.setuser_id ( existingUser.getuser_id ( ) ) ; java.util.Date now = new java.util.Date ( ) ; now.setTime ( java.lang.System.currentTimeMillis ( ) ) ; newSession.setlogin_time ( now ) ; }
Source:
public void testDoGetExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.ArgumentMatchers.eq ( "ETag" ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }

Target:
public void testDoGetExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.ArgumentMatchers.eq ( "ETag" ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setClusterCompatibilityVersion ( Version.v3_1 ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }
Source:
public void setup ( ) { setUpVds ( ) ; executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.FenceAgentExecutor ( vds , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( resourceManager ) . when ( executor ) . getResourceManager ( ) ; org.mockito.Mockito.doReturn ( proxyLocator ) . when ( executor ) . getProxyLocator ( ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( executor ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doReturn ( realAgent ) . when ( executor ) . createRealAgent ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void setup ( ) { setUpVds ( ) ; org.mockito.Mockito.doReturn ( proxyLocator ) . when ( executor ) . getProxyLocator ( ) ; org.mockito.Mockito.doReturn ( realAgent ) . when ( executor ) . createRealAgent ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.config.ConfigValues defaultTimeZoneConfigKey ; switch ( org.ovirt.engine.core.bll.GetDefaultTimeZoneQuery.getParameters ( ) . getTimeZoneType ( ) ) { default : case GENERAL_TIMEZONE : defaultTimeZoneConfigKey = org.ovirt.engine.core.common.config.ConfigValues.DefaultGeneralTimeZone ; break ; case WINDOWS_TIMEZONE : defaultTimeZoneConfigKey = org.ovirt.engine.core.common.config.ConfigValues.DefaultWindowsTimeZone ; break ; } java.lang.String timeZone = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( defaultTimeZoneConfigKey ) ; org.ovirt.engine.core.bll.GetDefaultTimeZoneQuery.getQueryReturnValue ( ) . setReturnValue ( timeZone ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.config.ConfigValues defaultTimeZoneConfigKey ; switch ( org.ovirt.engine.core.bll.GetDefaultTimeZoneQuery.getParameters ( ) . getTimeZoneType ( ) ) { default : case GENERAL_TIMEZONE : defaultTimeZoneConfigKey = org.ovirt.engine.core.common.config.ConfigValues.DefaultGeneralTimeZone ; break ; case WINDOWS_TIMEZONE : defaultTimeZoneConfigKey = org.ovirt.engine.core.common.config.ConfigValues.DefaultWindowsTimeZone ; break ; } java.lang.String timeZone = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( defaultTimeZoneConfigKey ) ; org.ovirt.engine.core.bll.GetDefaultTimeZoneQuery.getQueryReturnValue ( ) . setReturnValue ( timeZone ) ; }
Source:
public void testParameterMapDeserialization ( ) { java.lang.StringBuilder buf = new java.lang.StringBuilder ( "" ) ; buf.append ( "{" ) ; buf.append ( "\"NEXT_COMMAND_TYPE\" : [ \"org.ovirt.engine.core.common.action.VdcActionType\", \"DestroyImage\" ]" ) ; buf.append ( "}" ) ; java.util.Map < java.lang.String , java.io.Serializable > data = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( buf.toString ( ) , java.util.HashMap.class ) ; org.junit.Assert.assertNotNull ( data ) ; org.junit.Assert.assertEquals ( data.get ( "NEXT_COMMAND_TYPE" ) , VdcActionType.DestroyImage ) ; }

Target:
public void testParameterMapDeserialization ( ) { java.lang.StringBuilder buf = new java.lang.StringBuilder ( "" ) ; buf.append ( "{" ) ; buf.append ( "\"NEXT_COMMAND_TYPE\" : [ \"org.ovirt.engine.core.common.action.VdcActionType\", \"DestroyImage\" ]" ) ; buf.append ( "}" ) ; java.util.Map < java.lang.String , java.io.Serializable > data = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( buf.toString ( ) , java.util.HashMap.class ) ; org.junit.Assert.assertNotNull ( data ) ; org.junit.Assert.assertEquals ( VdcActionType.DestroyImage , data.get ( "NEXT_COMMAND_TYPE" ) ) ; }
Source:
public void storagePool ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.common.businessentities.StoragePool sp = b.getStoragePool ( ) ; org.junit.Assert.assertEquals ( p , sp ) ; }

Target:
public void storagePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.common.businessentities.StoragePool sp = b.getStoragePool ( ) ; org.junit.Assert.assertEquals ( p , sp ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.io.InputStream fixturesStream = org.ovirt.engine.core.FixturesTest.class . getResourceAsStream ( "/fixtures.xml" ) ; javax.xml.parsers.DocumentBuilder documentBuilder = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) . newDocumentBuilder ( ) ; fixturesDocument = documentBuilder.parse ( fixturesStream ) ; javax.xml.xpath.XPath xPath = javax.xml.xpath.XPathFactory.newInstance ( ) . newXPath ( ) ; tablesOfDatasetExpression = xPath.compile ( "/dataset/table" ) ; columnsExpression = xPath.compile ( "column" ) ; rowExpression = xPath.compile ( "row" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { try ( java.io.InputStream fixturesStream = org.ovirt.engine.core.FixturesTest.class . getResourceAsStream ( "/fixtures.xml" ) ) { javax.xml.parsers.DocumentBuilder documentBuilder = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) . newDocumentBuilder ( ) ; fixturesDocument = documentBuilder.parse ( fixturesStream ) ; javax.xml.xpath.XPath xPath = javax.xml.xpath.XPathFactory.newInstance ( ) . newXPath ( ) ; tablesOfDatasetExpression = xPath.compile ( "/dataset/table" ) ; columnsExpression = xPath.compile ( "column" ) ; rowExpression = xPath.compile ( "row" ) ; } }
Source:
private static void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { java.lang.String s = new java.lang.Integer ( vmDevice.getBootOrder ( ) ) . toString ( ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.add ( VdsProperties.BootOrder , s ) ; } }

Target:
private static void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.lang.String s = new java.lang.Integer ( vmDevice.getBootOrder ( ) ) . toString ( ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.put ( VdsProperties.BootOrder , s ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.GetVmdataByPoolIdParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }
Source:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , false , null ) ; }

Target:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , false ) ; }
Source:
public java.util.List < org.ovirt.api.metamodel.concepts.Method > getMethods ( ) { java.util.List < org.ovirt.api.metamodel.concepts.Method > result = new java.util.ArrayList ( methods ) ; if ( ( base ) != null ) { result.addAll ( base.getMethods ( ) ) ; } result.sort ( java.util.Comparator.comparing ( Method :: getName ) ) ; return result ; }

Target:
public java.util.List < org.ovirt.api.metamodel.concepts.Method > getMethods ( ) { java.util.List < org.ovirt.api.metamodel.concepts.Method > result = new java.util.ArrayList ( methods ) ; if ( ( base ) != null ) { result.addAll ( base.getMethods ( ) ) ; } return result ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "STATUS" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSStatus.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "TYPE" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSNiceType.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "STATUS" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSNiceType.class ) ; } else { } return retval ; }
Source:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
public void addStatistics ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
public void init ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > externalVms , final org.ovirt.engine.core.compat.Guid dataCenterId ) { setCloseCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( null , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . close ( ) ) . setIsDefault ( true ) . setIsCancel ( true ) ) ; setTargetArchitecture ( externalVms.iterator ( ) . next ( ) . getClusterArch ( ) ) ; super . setItems ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { doInit ( dataCenterId ) ; } } , externalVms ) ; }

Target:
protected void setTargetArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > externalVms ) { setTargetArchitecture ( externalVms.iterator ( ) . next ( ) . getClusterArch ( ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.HostStorage model , int index ) { assertEquals ( StorageType.ISCSI.value ( ) , model.getType ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( 1 , model.getLogicalUnits ( ) . getLogicalUnits ( ) . size ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.HostStorage model , int index ) { assertEquals ( StorageType.ISCSI , model.getType ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( 1 , model.getLogicalUnits ( ) . getLogicalUnits ( ) . size ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }
Source:
public void addSubnet ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet subnet ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = getExternalNetwork ( subnet.getExternalNetwork ( ) ) ; com.woorea.openstack.quantum.model.Subnet subnetForCreate = createNewSubnetEntity ( subnet , externalNetwork ) ; try { getClient ( ) . subnets ( ) . create ( subnetForCreate ) . execute ( ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
public void addSubnet ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet subnet ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = getExternalNetwork ( subnet.getExternalNetwork ( ) ) ; com.woorea.openstack.quantum.model.Subnet subnetForCreate = createNewSubnetEntity ( subnet , externalNetwork ) ; execute ( getClient ( ) . subnets ( ) . create ( subnetForCreate ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { validateEnums ( org.ovirt.engine.api.model.Disk.class , disk ) ; if ( disk.isSetId ( ) ) { return attachDiskToVm ( disk ) ; } else { validateDiskForCreation ( disk ) ; updateStorageTypeForDisk ( disk ) ; return performCreate ( VdcActionType.AddDisk , getAddParameters ( map ( disk ) , disk ) , new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource.AddDiskResolver ( ) ) ; } }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { if ( disk.isSetId ( ) ) { return attachDiskToVm ( disk ) ; } else { validateDiskForCreation ( disk ) ; updateStorageTypeForDisk ( disk ) ; return performCreate ( VdcActionType.AddDisk , getAddParameters ( map ( disk ) , disk ) , new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource.AddDiskResolver ( ) ) ; } }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < > ( ) ; }
Source:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VmBase value , javax.validation.ConstraintValidatorContext context ) { if ( ( ( value.getTimeZone ( ) ) == null ) || ( "" . equals ( value.getTimeZone ( ) . trim ( ) ) ) ) { return true ; } org.ovirt.engine.core.common.TimeZoneType timeZoneType = ( osRepository.isWindows ( value.getOsId ( ) ) ) ? org.ovirt.engine.core.common.TimeZoneType.WINDOWS_TIMEZONE : org.ovirt.engine.core.common.TimeZoneType.GENERAL_TIMEZONE ; return timeZoneType.getTimeZoneList ( ) . containsKey ( value.getTimeZone ( ) ) ; }

Target:
public boolean isValid ( org.ovirt.engine.core.common.businessentities.VmBase value , javax.validation.ConstraintValidatorContext context ) { if ( ( value.getTimeZone ( ) ) == null ) { return true ; } org.ovirt.engine.core.common.TimeZoneType timeZoneType = ( osRepository.isWindows ( value.getOsId ( ) ) ) ? org.ovirt.engine.core.common.TimeZoneType.WINDOWS_TIMEZONE : org.ovirt.engine.core.common.TimeZoneType.GENERAL_TIMEZONE ; return timeZoneType.getTimeZoneList ( ) . containsKey ( value.getTimeZone ( ) ) ; }
Source:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }
Source:
public static void getDiskList ( 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getDiskList ( 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { boolean hasIscsiStorage = false ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }
Source:
protected boolean validateIsImagesOnDomains ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getImagesToCheckDestinationStorageDomains ( ) ) { if ( ! ( image.getStorageIds ( ) . containsAll ( diskInfoDestinationMap.get ( image.getId ( ) ) . getStorageIds ( ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; return false ; } } return true ; }

Target:
protected boolean validateIsImagesOnDomains ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getImagesToCheckDestinationStorageDomains ( ) ) { if ( ! ( image.getStorageIds ( ) . containsAll ( diskInfoDestinationMap.get ( image.getId ( ) ) . getStorageIds ( ) ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; return false ; } } return true ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.provider.GetProviderByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.dao.provider.ProviderDao dao = org.ovirt.engine.core.bll.provider.GetProviderByIdQuery.getDbFacade ( ) . getProviderDao ( ) ; org.ovirt.engine.core.common.businessentities.Provider < ? > provider = dao.get ( id ) ; org.ovirt.engine.core.bll.provider.GetProviderByIdQuery.getQueryReturnValue ( ) . setReturnValue ( provider ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.provider.GetProviderByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.common.businessentities.Provider < ? > provider = dao.get ( id ) ; org.ovirt.engine.core.bll.provider.GetProviderByIdQuery.getQueryReturnValue ( ) . setReturnValue ( provider ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.core.common.businessentities.VmDynamic dynamicVm ) { org.easymock.EasyMock.expect ( entity.getQueryableId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.VM_ID ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDynamicData ( ) ) . andReturn ( dynamicVm ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getAppList ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.getAppList ( ) ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.core.common.businessentities.VmDynamic dynamicVm ) { org.mockito.Mockito.when ( entity.getQueryableId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.VM_ID ) ; org.mockito.Mockito.when ( entity.getDynamicData ( ) ) . thenReturn ( dynamicVm ) ; org.mockito.Mockito.when ( entity.getAppList ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.getAppList ( ) ) ; return entity ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.DEACTIVATED ) ) { failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotStatus.DEACTIVATED ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_ALREADY_DEACTIVATED , getSnapshot ( ) . getSnapshotName ( ) ) ; } return true ; }
Source:
public synchronized void updateStorageDomain ( org.ovirt.vdsmfake.domain.StorageDomain storageDomain ) { org.ovirt.vdsmfake.domain.VdsmManager.log.info ( "Updating storage domain: {}" , storageDomain.getId ( ) ) ; if ( ! ( storageDomainMap.containsKey ( storageDomain.getId ( ) ) ) ) { storageDomainMap.put ( storageDomain.getId ( ) , storageDomain ) ; } storeObject ( storageDomain ) ; }

Target:
public void updateStorageDomain ( org.ovirt.vdsmfake.domain.StorageDomain storageDomain ) { org.ovirt.vdsmfake.domain.VdsmManager.log.info ( "Updating storage domain: {}" , storageDomain.getId ( ) ) ; if ( ! ( storageDomainMap.containsKey ( storageDomain.getId ( ) ) ) ) { storageDomainMap.put ( storageDomain.getId ( ) , storageDomain ) ; } storeObject ( storageDomain ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( ( ( rs.getString ( "config_possible_values" ) ) != null ? java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) : null ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = super . mapRow ( rs , rowNum ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; return entity ; }
Source:
public void validateFailedDiscardNotSupported ( ) { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) . when ( diskVmElementValidator ) . isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }

Target:
public void validateFailedDiscardNotSupported ( ) { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) . when ( diskVmElementValidator ) . isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }
Source:
public java.util.HashMap < java.lang.String , java.lang.Object > getSpecParams ( ) { java.util.HashMap < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmWatchdog.WATCHDOG_MODEL_PARAM_NAME , model.name ( ) ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmWatchdog.WATCHDOG_ACTION_PARAM_NAME , action.name ( ) . toLowerCase ( ) ) ; return specParams ; }

Target:
public java.util.Map < java.lang.String , java.lang.Object > getSpecParams ( ) { java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmWatchdog.WATCHDOG_MODEL_PARAM_NAME , model.name ( ) ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmWatchdog.WATCHDOG_ACTION_PARAM_NAME , action.name ( ) . toLowerCase ( ) ) ; return specParams ; }
Source:
public static org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( result.getExceptionString ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( ( ( result.getVdsError ( ) ) != null ? result.getVdsError ( ) . getCode ( ) : org.ovirt.engine.core.common.errors.EngineError.ENGINE ) , result.getExceptionString ( ) ) ; } return result ; }

Target:
public static org.ovirt.engine.core.common.vdscommands.VDSReturnValue handleVdsResult ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue result ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( result.getExceptionString ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( ( ( result.getVdsError ( ) ) != null ? result.getVdsError ( ) . getCode ( ) : org.ovirt.engine.core.common.errors.EngineError.ENGINE ) , result.getExceptionString ( ) , result ) ; } return result ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup = getEntity ( ) ; affinityGroup.getEntityIds ( ) . add ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( vm.getId ( ) ) ) ; return performAction ( VdcActionType.EditAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( affinityGroup.getId ( ) , affinityGroup ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.VM vm ) { org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup = getEntity ( ) ; affinityGroup.getEntityIds ( ) . add ( asGuid ( vm.getId ( ) ) ) ; return performAction ( VdcActionType.EditAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( affinityGroup.getId ( ) , affinityGroup ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel storageDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel ) ( model ) ) ; storageDiskListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel storageDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel ) ( model ) ) ; storageDiskListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }