auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static javax.ws.rs.core.Response.Status getStatus ( org.ovirt.engine.core.common.errors.ErrorType errorType ) { switch ( errorType ) { case BAD_PARAMETERS : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case CONFLICT : return javax.ws.rs.core.Response.Status.CONFLICT ; case CONSTRAINT_VIOLATION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case DATA_CORRUPTION : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case INTERNAL_ERROR : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case NO_AUTHENTICATION : return javax.ws.rs.core.Response.Status.UNAUTHORIZED ; case NO_PERMISSION : return javax.ws.rs.core.Response.Status.FORBIDDEN ; case NOT_SUPPORTED : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case INCOMPATIBLE_VERSION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; default : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; } }

Target:
private static javax.ws.rs.core.Response.Status getStatus ( org.ovirt.engine.core.common.errors.ErrorType errorType ) { switch ( errorType ) { case BAD_PARAMETERS : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case CONFLICT : return javax.ws.rs.core.Response.Status.CONFLICT ; case CONSTRAINT_VIOLATION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case DATA_CORRUPTION : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case INTERNAL_ERROR : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case NO_AUTHENTICATION : return javax.ws.rs.core.Response.Status.UNAUTHORIZED ; case NO_PERMISSION : return javax.ws.rs.core.Response.Status.FORBIDDEN ; case NOT_SUPPORTED : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case INCOMPATIBLE_VERSION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case ATTESTATION_SERVER_ERROR : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; default : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; } }
Source:
private boolean hasReportsModelRefreshEvent ( ) { for ( org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > listnr : getModel ( ) . getReportModelRefreshEvent ( ) . getListeners ( ) ) { if ( listnr instanceof org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ) { return true ; } } return false ; }

Target:
private boolean hasReportsModelRefreshEvent ( ) { for ( org.ovirt.engine.ui.uicompat.IEventListener < ? extends org.ovirt.engine.ui.uicompat.EventArgs > listnr : ( ( java.util.List < org.ovirt.engine.ui.uicompat.IEventListener < ? extends org.ovirt.engine.ui.uicompat.EventArgs > > ) ( getModel ( ) . getReportsAvailabilityEvent ( ) . getListeners ( ) ) ) ) { if ( listnr instanceof org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ) { return true ; } } return false ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsVirtioScsiEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult nameNotTakenInDc ( ) { java.util.List < T > allQosInDcByType = getAllQosInDcByType ( ) ; if ( allQosInDcByType != null ) { for ( T iterQos : allQosInDcByType ) { if ( org.apache.commons.lang.ObjectUtils.equals ( iterQos.getName ( ) , qos.getName ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_QOS_NAME_EXIST ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult nameNotTakenInDc ( ) { java.util.List < T > allQosInDcByType = getAllQosInDcByType ( ) ; if ( allQosInDcByType != null ) { for ( T iterQos : allQosInDcByType ) { if ( org.apache.commons.lang.ObjectUtils.equals ( iterQos.getName ( ) , qos.getName ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_QOS_NAME_EXIST ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { final org.ovirt.engine.core.dao.VdsGroupDAO v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setVdsGroupId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }

Target:
public org.ovirt.engine.core.dao.VdsGroupDao getVdsGroupDao ( ) { final org.ovirt.engine.core.dao.VdsGroupDao v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setVdsGroupId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; java.lang.String path = org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ; if ( new java.io.File ( path ) . exists ( ) ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.FileUtil.readAllText ( path ) ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; return ; } org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; java.io.File path = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKICACert ( ) ; if ( path.exists ( ) ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.FileUtil.readAllText ( path.getAbsolutePath ( ) ) ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; return ; } org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
protected void RemoveTaskFromDB ( ) { try { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDAO ( ) . remove ( getTaskID ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase" , getTaskID ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception." , getTaskID ( ) ) , e ) ; } }

Target:
protected void RemoveTaskFromDB ( ) { try { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . remove ( getTaskID ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase" , getTaskID ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception." , getTaskID ( ) ) , e ) ; } }
Source:
public void testParseSecureOptions ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( org.ovirt.engine.api.restapi.util.FenceOptionsParserTest.FENCE_OPTION , org.ovirt.engine.api.restapi.util.FenceOptionsParserTest.FENCE_OPTION_TYPES ) ; assertNotNull ( ret ) ; assertEquals ( 16 , ret.size ( ) ) ; verifyResult ( ret.get ( 1 ) , "apc_snmp" , "port" , "int" , "port" , "encrypt_options" , "bool" , "encrypt_options" ) ; }

Target:
public void testParseSecureOptions ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( org.ovirt.engine.api.restapi.util.FenceOptionsParserTest.FENCE_OPTION , org.ovirt.engine.api.restapi.util.FenceOptionsParserTest.FENCE_OPTION_TYPES ) ; assertNotNull ( ret ) ; assertEquals ( 16 , ret.size ( ) ) ; verifyResult ( ret.get ( 1 ) , "apc_snmp" , "port" , "int" , "port" , "encrypt_options" , "bool" , "encrypt_options" ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.api.model.GlusterBrick brick = new org.ovirt.engine.api.model.GlusterBrick ( ) ; brick.setId ( id ) ; org.ovirt.engine.api.model.GlusterBricks bricks = new org.ovirt.engine.api.model.GlusterBricks ( ) ; bricks.getGlusterBricks ( ) . add ( brick ) ; return parent.remove ( bricks ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.api.model.GlusterBrick brick = new org.ovirt.engine.api.model.GlusterBrick ( ) ; brick.setId ( id ) ; org.ovirt.engine.api.model.GlusterBricks bricks = new org.ovirt.engine.api.model.GlusterBricks ( ) ; bricks.getGlusterBricks ( ) . add ( brick ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setBricks ( bricks ) ; return parent.remove ( action ) ; }
Source:
public void testInitServletConfig_BaseSet ( ) throws javax.servlet.ServletException { org.mockito.Mockito.when ( mockConfig.getInitParameter ( "file" ) ) . thenReturn ( file.getParent ( ) ) ; testServlet.init ( mockConfig ) ; org.junit.Assert.assertNull ( "Type should be null" , testServlet.type ) ; org.junit.Assert.assertEquals ( ( "base should be " + ( file.getParent ( ) ) ) , file.getParentFile ( ) , testServlet.base ) ; }

Target:
public void testInitServletConfig_BaseSet ( ) throws javax.servlet.ServletException { org.mockito.Mockito.when ( mockConfig.getInitParameter ( "file" ) ) . thenReturn ( file.getParent ( ) ) ; testServlet.init ( mockConfig ) ; org.junit.jupiter.api.Assertions.assertNull ( testServlet.type , "Type should be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( file.getParentFile ( ) , testServlet.base , ( "base should be " + ( file.getParent ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface createVmGuestAgentInterface ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = new org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface ( ) ; guestAgentInterface.setVmId ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; guestAgentInterface.setMacAddress ( "AA:AA:AA:AA:AA:AA" ) ; guestAgentInterface.setInterfaceName ( "p2p3" ) ; guestAgentInterface.setIpv4Addresses ( java.util.Arrays.asList ( "1.1.1.1" , "2.2.2.2" , "3.3.3.3" ) ) ; guestAgentInterface.setIpv6Addresses ( java.util.Collections.emptyList ( ) ) ; return guestAgentInterface ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface createVmGuestAgentInterface ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = new org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface ( ) ; guestAgentInterface.setVmId ( FixturesTool.VM_RHEL5_POOL_50 ) ; guestAgentInterface.setMacAddress ( "AA:AA:AA:AA:AA:AA" ) ; guestAgentInterface.setInterfaceName ( "p2p3" ) ; guestAgentInterface.setIpv4Addresses ( java.util.Arrays.asList ( "1.1.1.1" , "2.2.2.2" , "3.3.3.3" ) ) ; guestAgentInterface.setIpv6Addresses ( java.util.Collections.emptyList ( ) ) ; return guestAgentInterface ; }
Source:
public void addLabel ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.lang.String label ) { getCallsHandler ( ) . executeModification ( "InsertvfsConfigLabel" , createLabelParametersMapper ( vfsConfigId , label ) ) ; }

Target:
private void massLabelsUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < java.lang.String > labels ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( labels.size ( ) ) ; for ( java.lang.String label : labels ) { executions.add ( createLabelParametersMapper ( vfsConfigId , label ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertVfsConfigLabel" , executions ) ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; getInstanceImages ( ) . updateActionsAvailability ( ) ; }
Source:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.errorFormat ( "Can't find image to update to active: {0}, snapshot type: {1}, original image id: {2}" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }

Target:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }
Source:
public void testAnotherInterfaceAlreadyLabeledWithThisLabelDoNotCompareWithSelf ( ) { java.lang.String sameName = "sameName" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( sameName ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface preexistingVdsNetworkInterface = createVdsNetworkInterfaceWithName ( sameName ) ; java.lang.String label = "label" ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; preexistingVdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > preexistingInterfaces = java.util.Collections.singletonList ( preexistingVdsNetworkInterface ) ; org.junit.Assert.assertThat ( validator.anotherInterfaceAlreadyLabeledWithThisLabel ( label , preexistingInterfaces ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testAnotherInterfaceAlreadyLabeledWithThisLabelDoNotCompareWithSelf ( ) { java.lang.String sameName = "sameName" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( sameName ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface preexistingVdsNetworkInterface = createVdsNetworkInterfaceWithName ( sameName ) ; java.lang.String label = "label" ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; preexistingVdsNetworkInterface.setLabels ( java.util.Collections.singleton ( label ) ) ; org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > preexistingInterfaces = java.util.Collections.singletonList ( preexistingVdsNetworkInterface ) ; org.hamcrest.MatcherAssert.assertThat ( validator.anotherInterfaceAlreadyLabeledWithThisLabel ( label , preexistingInterfaces ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.util.List < org.ovirt.api.metamodel.concepts.Locator > getLocators ( ) { return locators ; }

Target:
public java.util.List < org.ovirt.api.metamodel.concepts.Locator > getLocators ( ) { java.util.List < org.ovirt.api.metamodel.concepts.Locator > result = new java.util.ArrayList ( locators ) ; if ( ( base ) != null ) { result.addAll ( base.getLocators ( ) ) ; } result.sort ( java.util.Comparator.comparing ( Locator :: getName ) ) ; return result ; }
Source:
public void testSetEmulatedMachine ( ) { java.lang.String preUpdate = existingVdsGroup.getEmulatedMachine ( ) ; java.lang.String updatedValue = "pc-version-1.2.3" ; org.junit.Assert.assertNotSame ( preUpdate , updatedValue ) ; existingVdsGroup.setEmulatedMachine ( updatedValue ) ; dao.setEmulatedMachine ( existingVdsGroup.getId ( ) , updatedValue , false ) ; org.junit.Assert.assertEquals ( updatedValue , dao.get ( existingVdsGroup.getId ( ) ) . getEmulatedMachine ( ) ) ; }

Target:
public void testSetEmulatedMachine ( ) { java.lang.String preUpdate = existingCluster.getEmulatedMachine ( ) ; java.lang.String updatedValue = "pc-version-1.2.3" ; org.junit.Assert.assertNotSame ( preUpdate , updatedValue ) ; existingCluster.setEmulatedMachine ( updatedValue ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , updatedValue , false ) ; org.junit.Assert.assertEquals ( updatedValue , dao.get ( existingCluster.getId ( ) ) . getEmulatedMachine ( ) ) ; }
Source:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; cloudInitEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types , org.ovirt.engine.core.compat.Guid groupId , org.ovirt.engine.core.common.businessentities.VDSStatus status , int minNrOfCpus ) { return null ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfTypes ( org.ovirt.engine.core.common.businessentities.VDSType [ ] types ) { java.lang.Integer [ ] intTypes = new java.lang.Integer [ types.length ] ; for ( int index = 0 ; index < ( types.length ) ; index ++ ) { intTypes [ index ] = types [ index ] . getValue ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > found = vdsStaticDAO.findByCriteria ( org.hibernate.criterion.Restrictions.in ( "vdsType" , intTypes ) ) ; return convertToVdsList ( found ) ; }
Source:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockEntities ( storageId ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void validateSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockEntities ( storageId ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
public static boolean isLinuxOsType ( int osId ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsIds.contains ( osId ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private static java.lang.String singular ( java.lang.String s ) { return s.endsWith ( "s" ) ? s.substring ( 0 , ( ( s.length ( ) ) - 1 ) ) : s ; }

Target:
private static java.lang.String singular ( java.lang.String s ) { return org.ovirt.engine.api.restapi.types.MappingTestHelper.isSingularSpecialCase ( s ) ? org.ovirt.engine.api.restapi.types.MappingTestHelper.handleSingularSpecialCase ( s ) : s.endsWith ( "s" ) ? s.substring ( 0 , ( ( s.length ( ) ) - 1 ) ) : s ; }
Source:
private void addCreationDateColum ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > creationDateColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractRenderedTextColumn < org.ovirt.engine.core.common.businessentities.Permission , java.util.Date > ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) ) { @ java.lang.Override public java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return new java.util.Date ( ( ( object.getCreationDate ( ) ) * 1000 ) ) ; } } ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( creationDateColumn , constants.permissionsCreationDate ( ) , "300px" ) ; creationDateColumn.makeSortable ( ) ; }

Target:
private void addCreationDateColum ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > creationDateColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractRenderedTextColumn < org.ovirt.engine.core.common.businessentities.Permission , java.util.Date > ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) ) { @ java.lang.Override public java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return new java.util.Date ( ( ( object.getCreationDate ( ) ) * 1000 ) ) ; } } ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( creationDateColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.permissionsCreationDate ( ) , "300px" ) ; creationDateColumn.makeSortable ( ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void init ( java.lang.String configFilePath ) throws org.ovirt.engine.core.utils.kerberos.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.core.utils.kerberos.ManageDomainsConfiguration ( configFilePath ) ; } catch ( org.apache.commons.configuration.ConfigurationException e ) { throw new org.ovirt.engine.core.utils.kerberos.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.core.utils.kerberos.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.core.utils.kerberos.ManageDomainsResult ( ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }

Target:
public void init ( java.lang.String configFilePath ) throws org.ovirt.engine.core.utils.kerberos.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.core.utils.kerberos.ManageDomainsConfiguration ( configFilePath ) ; } catch ( org.apache.commons.configuration.ConfigurationException e ) { throw new org.ovirt.engine.core.utils.kerberos.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.core.utils.kerberos.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.core.utils.kerberos.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }
Source:
private int getBootableDiskIndex ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { int index = org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory.getStrategy ( vm.getClusterArch ( ) ) . run ( new org.ovirt.engine.core.vdsbroker.architecture.GetBootableDiskIndex ( numOfReservedScsiIndexes ) ) . returnValue ( ) ; log.info ( "Bootable disk '{}' set to index '{}'" , disk.getId ( ) , index ) ; return index ; }

Target:
private int getBootableDiskIndex ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { int index = org.ovirt.engine.core.utils.archstrategy.ArchStrategyFactory.getStrategy ( vm.getClusterArch ( ) ) . run ( new org.ovirt.engine.core.vdsbroker.architecture.GetBootableDiskIndex ( numOfReservedScsiIndexes ) ) . returnValue ( ) ; org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuilderImpl.log.info ( "Bootable disk '{}' set to index '{}'" , disk.getId ( ) , index ) ; return index ; }
Source:
public void testFingerprintStrings ( ) throws java.lang.Exception { for ( java.lang.String [ ] key : org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.KEYS ) { org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testFingerprintString ( key [ 0 ] , key [ 1 ] ) ; } }

Target:
public void testFingerprintStrings ( ) throws java.lang.Exception { for ( java.lang.String [ ] key : org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.KEYS ) { org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testFingerprintString ( key [ 0 ] , key [ 1 ] , "MD5" ) ; org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.testFingerprintString ( key [ 0 ] , key [ 2 ] , "SHA-256" ) ; } }
Source:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }

Target:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptySet ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetRelevantVdsGroupQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( FixturesTool.VDS_GROUP_RHEL6_NFS , org.ovirt.engine.core.dao.UNPRIVILEGED_USER_SESSION_ID , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }

Target:
public void testGetRelevantStorageQuotaForUserWithoutPrivileges ( ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( unprivilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForStorage ( FixturesTool.STORAGE_DOAMIN_NFS_MASTER , unprivilegedUserSession.getId ( ) , true ) ; org.junit.Assert.assertEquals ( "Unprivileged user is not allowed to fetch for quota" , 0 , quotas.size ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMapId other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMapId ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( actionGroup , other.actionGroup ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( roleId , other.roleId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMapId other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMapId ) ( obj ) ) ; return ( java.util.Objects.equals ( actionGroup , other.actionGroup ) ) && ( java.util.Objects.equals ( roleId , other.roleId ) ) ; }