auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testFetchGlobalQuotaUsageForGlobalVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroup.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( new java.lang.Integer ( 100 ) , quotaVdsGroup.getVirtualCpu ( ) ) ; }

Target:
public void testFetchGlobalQuotaUsageForGlobalVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroup.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( 100 ) , quotaVdsGroup.getVirtualCpu ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( wae.getResponse ( ) . getStatus ( ) , 404 ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.LoginUserParameters > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to login: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; clearLoggedInUser ( ) ; if ( callback.isHandleFailure ( ) ) { setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.LoginUserParameters > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to login: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkQoS flush ( ) { super . flush ( ) ; networkQoS.setName ( ( ( java.lang.String ) ( getName ( ) . getEntity ( ) ) ) ) ; networkQoS.setStoragePoolId ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenters ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; return networkQoS ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkQoS flush ( ) { super . flush ( ) ; networkQoS.setName ( getName ( ) . getEntity ( ) ) ; networkQoS.setStoragePoolId ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) ) ; return networkQoS ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; hostSetupNetworksParametersData.getNetworkAttachments ( ) . addAll ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ) ; initNetworkIdToExistingAttachmentMap ( ) ; queryVfsConfig ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { hostSetupNetworksParametersData.getNetworkAttachments ( ) . addAll ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue.getReturnValue ( ) ) ) ) ; initNetworkIdToExistingAttachmentMap ( ) ; queryVfsConfig ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertTrue ( "The theme should load" , testTheme.load ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "The theme should load" , testTheme.load ( ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.network nwk ) { switch ( nwk.getStatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { switch ( nwk.getStatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VM lookupEntity ( org.ovirt.engine.core.compat.Guid id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM model = new org.ovirt.engine.core.common.businessentities.VM ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }

Target:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM model = new org.ovirt.engine.core.common.businessentities.VM ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }
Source:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; if ( o != null ) { return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } return null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }

Target:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , node , javax.xml.xpath.XPathConstants.NODE ) ; return o != null ? new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) : null ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommandBase.setSucceeded ( true ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
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.StorageDomain > ( ) : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Network.class , network ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
private org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , VdcQueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , VdcQueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getName ( ) , entity.getQualifiedName ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }

Target:
private org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , VdcQueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , VdcQueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getId ( ) , entity.getId ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }

Target:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; }
Source:
private void hostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( vds == null ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( vds , null , false , null ) ; getName ( ) . setIsChangable ( false ) ; getHost ( ) . setIsChangable ( false ) ; }

Target:
private void hostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( vds == null ) { vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( vds , null , false , null ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( java.lang.String alias ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( alias ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( storage.getSelectedItem ( ) ) ) ) ; } } return importData ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( java.lang.String alias ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( alias ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( storage.getSelectedItem ( ) ) ; } } return importData ; }
Source:
org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties getVmwareVmProviderProperties ( org.ovirt.engine.core.compat.Guid dataCenterId ) { return new org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties ( getvCenter ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel.mergeDcAndCluster ( getVmwareDatacenter ( ) . getEntity ( ) , getVmwareCluster ( ) . getEntity ( ) ) , getVerifySSL ( ) . getEntity ( ) , dataCenterId , ( ( getProxyHost ( ) . getSelectedItem ( ) ) != null ? getProxyHost ( ) . getSelectedItem ( ) . getId ( ) : null ) ) ; }

Target:
org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties getVmwareVmProviderProperties ( org.ovirt.engine.core.compat.Guid dataCenterId ) { return new org.ovirt.engine.core.common.businessentities.VmwareVmProviderProperties ( getvCenter ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel.mergeDcAndCluster ( getVmwareDatacenter ( ) . getEntity ( ) , getVmwareCluster ( ) . getEntity ( ) , false ) , getVerifySSL ( ) . getEntity ( ) , dataCenterId , ( ( getProxyHost ( ) . getSelectedItem ( ) ) != null ? getProxyHost ( ) . getSelectedItem ( ) . getId ( ) : null ) ) ; }
Source:
public void updateExistingVariable ( ) { java.lang.String name = "fence-kdump-listener" ; org.ovirt.engine.core.common.ExternalVariable existing = dbFacade.getExternalVariableDao ( ) . get ( name ) ; existing.setValue ( "123456" ) ; existing.setUpdateDate ( new java.util.Date ( ) ) ; dbFacade.getExternalVariableDao ( ) . update ( existing ) ; org.ovirt.engine.core.common.ExternalVariable found = dbFacade.getExternalVariableDao ( ) . get ( name ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( existing , found ) ; }

Target:
public void updateExistingVariable ( ) { java.lang.String name = "fence-kdump-listener" ; org.ovirt.engine.core.common.ExternalVariable existing = dao.get ( name ) ; existing.setValue ( "123456" ) ; existing.setUpdateDate ( new java.util.Date ( ) ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( name ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( existing , found ) ; }
Source:
public static boolean CanUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum status , java.lang.Object fieldContainer ) { java.lang.Class type = null ; if ( ( type = org.ovirt.engine.core.utils.ObjectIdentityChecker.mAliases.get ( objectType ) ) != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( java.lang.String.format ( "status type %1$s not exist" , type ) ) ; } }

Target:
public static boolean CanUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { java.lang.Class < ? > type = null ; if ( ( type = org.ovirt.engine.core.utils.ObjectIdentityChecker.mAliases.get ( objectType ) ) != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( java.lang.String.format ( "status type %1$s not exist" , type ) ) ; } }
Source:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.bll.interfaces.BackendInternal backend = org.ovirt.engine.core.utils.ejb.EjbUtils.findBean ( BeanType.BACKEND , BeanProxyType.LOCAL ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( VdcActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }

Target:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( VdcActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }
Source:
private void assertGetAllForStoragePoolCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( "Wrong storage pool for VDS" , existingVds.getstorage_pool_id ( ) , vds.getstorage_pool_id ( ) ) ; } }

Target:
private void assertGetAllForStoragePoolCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( "Wrong storage pool for VDS" , existingVds.getStoragePoolId ( ) , vds.getStoragePoolId ( ) ) ; } }
Source:
public void testListCrash ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; control.replay ( ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }
Source:
private java.lang.String getStorageType ( ) { switch ( sdConnection.getstorage_type ( ) ) { case NFS : if ( ( sdConnection.getNfsVersion ( ) ) == ( org.ovirt.engine.core.common.businessentities.NfsVersion.V4 ) ) { return "nfs4" ; } else { return "nfs3" ; } case ISCSI : return "iscsi" ; case GLUSTERFS : return "glusterfs" ; case FCP : return "fc" ; } throw new java.lang.IllegalArgumentException ( ( "There is no legal storage type for the connection " + ( sdConnection.toString ( ) ) ) ) ; }

Target:
private java.lang.String getStorageType ( ) { switch ( sdConnection.getStorageType ( ) ) { case NFS : if ( ( sdConnection.getNfsVersion ( ) ) == ( org.ovirt.engine.core.common.businessentities.NfsVersion.V4 ) ) { return "nfs4" ; } else { return "nfs3" ; } case ISCSI : return "iscsi" ; case GLUSTERFS : return "glusterfs" ; case FCP : return "fc" ; } throw new java.lang.IllegalArgumentException ( ( "There is no legal storage type for the connection " + ( sdConnection.toString ( ) ) ) ) ; }
Source:
protected void updateConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { super . updateConsoleModel ( item ) ; if ( ( item.getEntity ( ) ) != null ) { item.getDefaultConsole ( ) . setForceVmStatusUp ( true ) ; } }

Target:
protected void updateConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { super . updateConsoleModel ( item ) ; if ( ( ( item.getEntity ( ) ) != null ) && ( ( item.getDefaultConsole ( ) ) != null ) ) { item.getDefaultConsole ( ) . setForceVmStatusUp ( true ) ; } }
Source:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > getAutoConnectableConsoles ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > autoConnectableConsoles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel upItem : items ) { if ( ( ! ( upItem.isPool ( ) ) ) && ( upItem.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { autoConnectableConsoles.add ( upItem.getVmConsoles ( ) ) ; } } return autoConnectableConsoles ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > getAutoConnectableConsoles ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > autoConnectableConsoles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.VmConsoles > ( ) ; if ( ( items ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel upItem : items ) { if ( ( ! ( upItem.isPool ( ) ) ) && ( upItem.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { autoConnectableConsoles.add ( upItem.getVmConsoles ( ) ) ; } } } return autoConnectableConsoles ; }
Source:
public static synchronized org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo getInstance ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ) == null ) { org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance = new org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo ( ) ; } else { if ( ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.class ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ) == null ) { org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance = new org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo ( ) ; } } } } return org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ; }

Target:
public static synchronized org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo getInstance ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.class ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ) == null ) { org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance = new org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo ( ) ; } } } return org.ovirt.engine.core.bll.hostdeploy.OVirtNodeInfo.instance ; }
Source:
private java.nio.channels.ServerSocketChannel setupChannel ( java.net.InetSocketAddress address ) throws java.io.IOException { final java.nio.channels.ServerSocketChannel serverSocketChannel = java.nio.channels.ServerSocketChannel.open ( ) ; serverSocketChannel.configureBlocking ( false ) ; try { serverSocketChannel.register ( this . selector , java.nio.channels.SelectionKey.OP_ACCEPT , this ) ; serverSocketChannel.bind ( address ) ; } catch ( java.nio.channels.ClosedChannelException e ) { throw new java.lang.RuntimeException ( "Connection closed unexpectedly" ) ; } catch ( java.io.IOException e ) { try { serverSocketChannel.close ( ) ; } catch ( java.io.IOException e1 ) { } } return serverSocketChannel ; }

Target:
private java.nio.channels.ServerSocketChannel setupChannel ( java.net.InetSocketAddress address ) throws java.io.IOException { final java.nio.channels.ServerSocketChannel serverSocketChannel = java.nio.channels.ServerSocketChannel.open ( ) ; serverSocketChannel.configureBlocking ( false ) ; try { serverSocketChannel.register ( this . selector , java.nio.channels.SelectionKey.OP_ACCEPT , this ) ; serverSocketChannel.bind ( address ) ; } catch ( java.nio.channels.ClosedChannelException e ) { throw new java.lang.RuntimeException ( "Connection closed unexpectedly" ) ; } catch ( java.io.IOException e ) { try { serverSocketChannel.close ( ) ; } catch ( java.io.IOException e1 ) { } throw e ; } return serverSocketChannel ; }
Source:
public static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }

Target:
private static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getVmEntityType ( ) ) == null ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; } else { java.lang.String status = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( object.getVmEntityType ( ) ) ; return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( status ) ; } }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getVmEntityType ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ; } else { java.lang.String status = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( object.getVmEntityType ( ) ) ; return status ; } }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ! ( isHostNetworkUnreacable ( vds ) ) ) && ( ! ( vds.getId ( ) . equals ( _vds.getId ( ) ) ) ) ) && ( vds.getstorage_pool_id ( ) . equals ( _vds.getstorage_pool_id ( ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ! ( isHostNetworkUnreacable ( vds ) ) ) && ( ! ( vds.getId ( ) . equals ( _vds.getId ( ) ) ) ) ) && ( vds.getStoragePoolId ( ) . equals ( _vds.getStoragePoolId ( ) ) ) ; }
Source:
public void testSetValidatorWithOutValue ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getKey ( ) ) . thenReturn ( "keyToSet" ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( null ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }

Target:
public void testSetValidatorWithOutValue ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getKey ( ) ) . thenReturn ( "keyToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( ) ; addUserColumn ( ) ; addAuthzColumn ( ) ; addNameSpaceColumn ( ) ; addRoleColumn ( ) ; addCreationDateColum ( ) ; addAddPermissionsButton ( ) ; addRemovePermissionsButton ( ) ; }
Source:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; }

Target:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters , null ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; }
Source:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.core.common.businessentities.VmTemplate template , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( templates.vmNameCellItem ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , "name" , context ) , template.getname ( ) ) ) ; java.lang.String description = template.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( templates.vmDescriptionCellItem ( description ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.userportal.section.main.view.tab.extended.Context context , org.ovirt.engine.core.common.businessentities.VmTemplate template , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( templates.vmNameCellItem ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , "name" , context ) , template.getName ( ) ) ) ; java.lang.String description = template.getDescription ( ) ; if ( ( description != null ) && ( ! ( description.isEmpty ( ) ) ) ) { sb.append ( templates.vmDescriptionCellItem ( description ) ) ; } }
Source:
private void registerModelPropertyChangeListener ( ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isSelected = model.getIsSelected ( ) ; org.ovirt.engine.ui.common.widget.ModelBoundCheckBox.super . setValue ( isSelected , true ) ; } } ) ; }

Target:
private void registerModelPropertyChangeListener ( ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { boolean isSelected = model.getIsSelected ( ) ; org.ovirt.engine.ui.common.widget.ModelBoundCheckBox.super . setValue ( isSelected , true ) ; } } ) ; }
Source:
public static java.util.Set < java.lang.String > getExpectations ( javax.ws.rs.core.HttpHeaders headers ) { java.util.Set < java.lang.String > expectations = new java.util.HashSet < > ( ) ; for ( java.lang.String header : org.ovirt.engine.api.restapi.util.ExpectationHelper.HEADERS ) { java.util.List < java.lang.String > values = headers.getRequestHeader ( header ) ; if ( values != null ) { expectations.addAll ( values ) ; } } return expectations ; }

Target:
public static java.util.Set < java.lang.String > getExpectations ( javax.ws.rs.core.HttpHeaders headers ) { java.util.Set < java.lang.String > expectations = new java.util.HashSet < > ( ) ; if ( headers == null ) { return expectations ; } for ( java.lang.String header : org.ovirt.engine.api.restapi.util.ExpectationHelper.HEADERS ) { java.util.List < java.lang.String > values = headers.getRequestHeader ( header ) ; if ( values != null ) { expectations.addAll ( values ) ; } } return expectations ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { if ( ( mImage ) == null ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . get ( getImageId ( ) ) ; if ( image != null ) { mImage = image ; } else { image = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getSnapshotById ( getImageId ( ) ) ; if ( image != null ) { mImage = image ; } } } return mImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { if ( ( mImage ) == null ) { mImage = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . get ( getImageId ( ) ) ; if ( ( mImage ) == null ) { mImage = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getSnapshotById ( getImageId ( ) ) ; } } return mImage ; }
Source:
private void onCreateSnapshot ( ) { final org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel ) ( getWindow ( ) ) ) ; if ( ! ( snapshotModel.validate ( ) ) ) { return ; } if ( ( ! ( snapshotModel.isScheduleTabVisible ( ) ) ) || ( ( snapshotModel.getRecurrence ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN ) ) ) { createNewSnapshot ( snapshotModel ) ; } else { scheduleSnapshot ( snapshotModel , false ) ; } }

Target:
private void onCreateSnapshot ( ) { final org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel ) ( getWindow ( ) ) ) ; if ( ! ( snapshotModel.validate ( false ) ) ) { return ; } if ( ( ! ( snapshotModel.isScheduleTabVisible ( ) ) ) || ( ( snapshotModel.getRecurrence ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN ) ) ) { createNewSnapshot ( snapshotModel ) ; } else { scheduleSnapshot ( snapshotModel , false ) ; } }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) . append ( "clusterSwitchType" , getClusterSwitchType ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "networks" , getNetworks ( ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , getCreateOrUpdateBonds ( ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) . append ( "clusterSwitchType" , getClusterSwitchType ( ) ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failCanDoAction ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failCanDoAction ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }