auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.queries.VdcQueryReturnValue generateQueryReturnValueForGetDiskImages ( boolean succeeded , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksFromStorage , java.lang.String exceptionString ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue vdcQueryReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; vdcQueryReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdcQueryReturnValue.setReturnValue ( disksFromStorage ) ; } else { vdcQueryReturnValue.setExceptionString ( exceptionString ) ; } return vdcQueryReturnValue ; }

Target:
private org.ovirt.engine.core.common.queries.VdcQueryReturnValue generateQueryReturnValueForGetDiskImages ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue vdcQueryReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; vdcQueryReturnValue.setSucceeded ( true ) ; return vdcQueryReturnValue ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getManageCommand ( ) ) ) { manage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnManage" ) ) { onManage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getManageCommand ( ) ) ) { manage ( ) ; } }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public org.ovirt.engine.core.compat.Guid getQuotaId ( ) { return getParameters ( ) . getQuotaId ( ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel.getIsQueryFirstTime ( ) ) ; tempVar.setAllUsersWithPermission ( getAllUsersWithPermission ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( false ) ; tempVar.setRefresh ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel.getIsQueryFirstTime ( ) ) ; tempVar.setAllUsersWithPermission ( getAllUsersWithPermission ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.unLockImage ( ) ; if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.Object > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }
Source:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }
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:
protected 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:
static org.ovirt.engine.api.model.MacPool setUpEntityExpectations ( org.ovirt.engine.api.model.MacPool entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.api.model.MacPool setUpEntityExpectations ( org.ovirt.engine.api.model.MacPool entity , int index ) { org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }
Source:
public void setupNetworks ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupNetworksWindowModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ( this ) ; setupNetworksWindowModel.setEntity ( ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > ) ( getSelectedItem ( ) ) ) . getSecond ( ) ) ; setWindow ( setupNetworksWindowModel ) ; }

Target:
public void setupNetworks ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupNetworksWindowModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ( this , ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > ) ( getSelectedItem ( ) ) ) . getSecond ( ) ) ; setWindow ( setupNetworksWindowModel ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) . getValue ( ) , updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , updated ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } control.replay ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.frontend.FrontendFailureEventArgs failureArgs = ( ( org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ) ( args ) ) ; if ( ( failureArgs.getMessage ( ) ) != null ) { errorPopupManager.show ( messages.uiCommonRunActionFailed ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessage ( failureArgs.getMessage ( ) ) ) ) ; } else if ( ( failureArgs.getMessages ( ) ) != null ) { errorPopupManager.show ( messages.uiCommonRunActionFailed ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessages ( failureArgs.getMessages ( ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.frontend.FrontendFailureEventArgs failureArgs = ( ( org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ) ( args ) ) ; errorPopupManager.show ( messages.uiCommonRunActionFailed ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessages ( failureArgs.getMessages ( ) ) ) ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }
Source:
public java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > getDiskHotpluggableInterfaces ( java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = getDiskHotpluggableInterfacesMap ( ) . get ( new org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > ( osId , version ) ) ; if ( diskHotpluggableInterfaces == null ) { return java.util.Collections.emptySet ( ) ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > diskInterfaces = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ( ) ; for ( java.lang.String diskHotpluggableInterface : diskHotpluggableInterfaces ) { diskInterfaces.add ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.valueOf ( diskHotpluggableInterface ) ) ; } return diskInterfaces ; }

Target:
public java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > getDiskHotpluggableInterfaces ( java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = getDiskHotpluggableInterfacesMap ( ) . get ( new org.ovirt.engine.core.common.utils.Pair ( osId , version ) ) ; if ( diskHotpluggableInterfaces == null ) { return java.util.Collections.emptySet ( ) ; } java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskInterface > diskInterfaces = new java.util.HashSet < > ( ) ; for ( java.lang.String diskHotpluggableInterface : diskHotpluggableInterfaces ) { diskInterfaces.add ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.valueOf ( diskHotpluggableInterface ) ) ; } return diskInterfaces ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( result ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } }
Source:
private void isToSyncChanged ( ) { initValues ( ) ; java.lang.Boolean isEditingEnabled = ( ! ( getIsToSync ( ) . getIsChangable ( ) ) ) || ( getIsToSync ( ) . getEntity ( ) ) ; setBootProtocolsAvailable ( isEditingEnabled ) ; getQosOverridden ( ) . setIsChangeable ( isEditingEnabled ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangeable ( isEditingEnabled ) ; }

Target:
private void isToSyncChanged ( ) { setBootProtocolsAvailable ( true ) ; initValues ( ) ; java.lang.Boolean isEditingEnabled = ( ! ( getIsToSync ( ) . getIsChangable ( ) ) ) || ( getIsToSync ( ) . getEntity ( ) ) ; setBootProtocolsAvailable ( isEditingEnabled ) ; getQosOverridden ( ) . setIsChangeable ( isEditingEnabled ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangeable ( isEditingEnabled ) ; }
Source:
public void testSave ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( false , result.isPortMirroring ( ) ) ; org.junit.Assert.assertFalse ( result.isPassthrough ( ) ) ; }

Target:
public void testSave ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertFalse ( result.isPortMirroring ( ) ) ; org.junit.Assert.assertFalse ( result.isPassthrough ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.job.StepSubjectEntity > getCommandStepSubjectEntities ( ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getJobWeight ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.common.job.StepSubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Disk , ( ( org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getJobWeight ( ) ) ) ; } return null ; }

Target:
public java.util.List < org.ovirt.engine.core.common.job.StepSubjectEntity > getCommandStepSubjectEntities ( ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getJobWeight ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.common.job.StepSubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Disk , ( ( org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo ) ( org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getDstInfo ( ) ) ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.storage.disk.image.CopyDataCommand.getParameters ( ) . getJobWeight ( ) ) ) ; } return super . getCommandStepSubjectEntities ( ) ; }
Source:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
private void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
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 ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }
Source:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType value , org.ovirt.engine.ui.common.widget.profile.ProfileInstanceTypeEditor item , boolean becomingGhost ) { item.profileEditor.setEnabled ( ( ! becomingGhost ) ) ; item.profileEditor.asWidget ( ) . setEnabled ( true ) ; if ( ! becomingGhost ) { vnics.add ( value.getNetworkInterface ( ) ) ; } realEntryCount += ( becomingGhost ) ? - 1 : 1 ; updateHeaderLabel ( ) ; }

Target:
protected void toggleGhost ( org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType value , org.ovirt.engine.ui.common.widget.profile.ProfileInstanceTypeEditor item , boolean becomingGhost ) { item.profileEditor.setEnabled ( ( ! becomingGhost ) ) ; item.profileEditor.asWidget ( ) . setEnabled ( true ) ; realEntryCount += ( becomingGhost ) ? - 1 : 1 ; updateHeaderLabel ( ) ; }
Source:
private void verifyVersionEqual ( java.lang.Object returnValue , int major , int minor , int build ) { org.ovirt.engine.core.compat.Version version = ( ( org.ovirt.engine.core.compat.Version ) ( returnValue ) ) ; org.junit.Assert.assertEquals ( version.getMajor ( ) , major ) ; org.junit.Assert.assertEquals ( version.getMinor ( ) , minor ) ; org.junit.Assert.assertEquals ( version.getBuild ( ) , build ) ; org.junit.Assert.assertEquals ( version.getRevision ( ) , 0 ) ; }

Target:
private void verifyVersionEqual ( java.lang.Object returnValue , int major , int minor , int build ) { org.ovirt.engine.core.compat.Version version = ( ( org.ovirt.engine.core.compat.Version ) ( returnValue ) ) ; org.junit.Assert.assertEquals ( version.getMajor ( ) , major ) ; org.junit.Assert.assertEquals ( version.getMinor ( ) , minor ) ; org.junit.Assert.assertEquals ( version.getBuild ( ) , build ) ; org.junit.Assert.assertEquals ( 0 , version.getRevision ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel providerModel = ( ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel ) ( model ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; dataCenters.add ( noneStoragePool ) ; providerModel.getDataCenter ( ) . setItems ( dataCenters ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; dataCenters.add ( noneStoragePool ) ; getDataCenter ( ) . setItems ( dataCenters ) ; }
Source:
private org.ovirt.sdk.python.PythonClassName buildClassName ( org.ovirt.api.metamodel.concepts.Name base , org.ovirt.api.metamodel.concepts.Name suffix , java.lang.String module ) { java.util.List < java.lang.String > words = base.getWords ( ) ; if ( suffix != null ) { words.addAll ( suffix.getWords ( ) ) ; } org.ovirt.api.metamodel.concepts.Name name = new org.ovirt.api.metamodel.concepts.Name ( words ) ; org.ovirt.sdk.python.PythonClassName result = new org.ovirt.sdk.python.PythonClassName ( ) ; result.setClassName ( getClassStyleName ( name ) ) ; result.setModuleName ( getModuleName ( module , getModuleStyleName ( base ) ) ) ; return result ; }

Target:
private org.ovirt.sdk.python.PythonClassName buildClassName ( org.ovirt.api.metamodel.concepts.Name base , org.ovirt.api.metamodel.concepts.Name suffix , java.lang.String module ) { java.util.List < java.lang.String > words = base.getWords ( ) ; if ( suffix != null ) { words.addAll ( suffix.getWords ( ) ) ; } org.ovirt.api.metamodel.concepts.Name name = new org.ovirt.api.metamodel.concepts.Name ( words ) ; org.ovirt.sdk.python.PythonClassName result = new org.ovirt.sdk.python.PythonClassName ( ) ; result.setClassName ( getClassStyleName ( name ) ) ; result.setModuleName ( getModuleName ( module ) ) ; return result ; }
Source:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( vmInterfaceManager ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; }

Target:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( vmInterfaceManager ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.ArgumentMatchers.any ( ) ) ; injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; }
Source:
private void initSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; initSpmPriorities1 ( ) ; } } ) ) ; }

Target:
private void initSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; initSpmPriorities1 ( ) ; } } ) ) ; }
Source:
public void EnsureAsyncSearchStopped ( ) { getTimer ( ) . stop ( ) ; if ( ( ( getAsyncResult ( ) ) != null ) && ( ! ( getAsyncResult ( ) . getId ( ) . equals ( NGuid.Empty ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.UnregisterQuery ( getAsyncResult ( ) . getId ( ) ) ; setAsyncResult ( null ) ; } }

Target:
public void EnsureAsyncSearchStopped ( ) { getTimer ( ) . stop ( ) ; if ( ( ( getAsyncResult ( ) ) != null ) && ( ! ( getAsyncResult ( ) . getId ( ) . equals ( NGuid.Empty ) ) ) ) { setAsyncResult ( null ) ; } }
Source:
public java.lang.String getButtonToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }

Target:
public java.lang.String getButtonToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }
Source:
public void testMaximumLatency ( ) { java.lang.String doubleValue = "999999999000000000" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) , new java.lang.Double ( "999999999" ) ) ; }

Target:
public void testMaximumLatency ( ) { java.lang.String doubleValue = "999999999000000000" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "999999999" ) , vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) ) ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , null ) ; assertNotNull ( map.getGuestInfo ( ) . getFqdn ( ) ) ; assertEquals ( map.getGuestInfo ( ) . getFqdn ( ) , "localhost.localdomain" ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , null ) ; assertNotNull ( map.getGuestInfo ( ) . getFqdn ( ) ) ; assertEquals ( map.getGuestInfo ( ) . getFqdn ( ) , "localhost.localdomain" ) ; }
Source:
public void execute ( ) { if ( getEnclosingCommand ( ) . getParameters ( ) . getTaskGroupSuccess ( ) ) { getReturnValue ( ) . setSucceeded ( false ) ; beforeTask ( ) ; addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getVDSCommandType ( ) , getVDSParameters ( ) ) ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( getEnclosingCommand ( ) . getExecutionContext ( ) , true ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void execute ( ) { if ( getEnclosingCommand ( ) . getParameters ( ) . getTaskGroupSuccess ( ) ) { getReturnValue ( ) . setSucceeded ( false ) ; beforeTask ( ) ; addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getVDSCommandType ( ) , getVDSParameters ( ) ) , false ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( getEnclosingCommand ( ) . getExecutionContext ( ) , true ) ; getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void hostProviderTypeDoesNotMatch ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.OPENSTACK_IMAGE ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( provider ) ; org.junit.Assert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH ) ) ; }

Target:
public void hostProviderTypeDoesNotMatch ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.OPENSTACK_IMAGE ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( provider ) ; org.junit.Assert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void proposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }

Target:
protected void proposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }
Source:
public boolean getIsDiskHotPlugSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; boolean isVmStatusApplicableForHotPlug = ( vm != null ) && ( ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; return ( privateIsDiskHotPlugSupported ) && isVmStatusApplicableForHotPlug ; }

Target:
public boolean getIsDiskHotPlugSupported ( ) { return privateIsDiskHotPlugSupported ; }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }