auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public java.lang.StringBuilder GetTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , gettag_id ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( org.ovirt.engine.core.compat.StringFormat.format ( ",%1$s" , tag.GetTagIdAndChildrenIds ( ) ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder GetTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( "," ) . append ( tag.GetTagIdAndChildrenIds ( ) ) ; } return builder ; }
Source:
private void initClustersTable ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { clusterTable = new org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.core.common.businessentities.VDSGroup > ( clusterPolicyClusterModelProvider , getTableHeaderlessResources ( ) , getTableResources ( ) , eventBus , clientStorage ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VDSGroup object ) { return object.getName ( ) ; } } ; clusterTable.addColumn ( clusterColumn , constants.clusterPolicyAttachedCluster ( ) ) ; }

Target:
private void initClustersTable ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { clusterTable = new org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.core.common.businessentities.VDSGroup > ( clusterPolicyClusterModelProvider , getTableHeaderlessResources ( ) , getTableResources ( ) , eventBus , clientStorage ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VDSGroup object ) { return object.getName ( ) ; } } ; clusterTable.addColumn ( clusterColumn , constants.clusterPolicyAttachedCluster ( ) ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
private void initStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setcompatibility_version ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private void initStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setCompatibilityVersion ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private void mockDiskImageDAO ( ) { org.mockito.Mockito.when ( dbFacada.getDiskImageDAO ( ) ) . thenReturn ( diskImageDAO ) ; org.mockito.Mockito.when ( diskImageDAO.getSnapshotById ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getDiskImageList ( ) . get ( 0 ) ) ; }

Target:
private void mockStorageDomainDAO ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains ) { org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( command ) . getStorageDomainDAO ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : storageDomains ) { org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomain.getId ( ) , storagePoolId ) ) . thenReturn ( storageDomain ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( FixturesTool.DATA_CENTER ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = FixturesTool.VDS_RHEL6_NFS_SPM ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( FixturesTool.DATA_CENTER ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = FixturesTool.VDS_RHEL6_NFS_SPM ; cluster = FixturesTool.CLUSTER ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }
Source:
private boolean isDataCenterValidForAttachedStorageDomains ( ) { if ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsWithAttachedStoragePoolGuidQuery.getParameters ( ) . isCheckStoragePoolStatus ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsWithAttachedStoragePoolGuidQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsWithAttachedStoragePoolGuidQuery.getParameters ( ) . getId ( ) ) ; if ( ( storagePool == null ) || ( ( storagePool.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) ) { log.info ( "The Data Center is not in UP status." ) ; return false ; } } return true ; }

Target:
private boolean isDataCenterValidForAttachedStorageDomains ( ) { if ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsWithAttachedStoragePoolGuidQuery.getParameters ( ) . isCheckStoragePoolStatus ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = storagePoolDao.get ( org.ovirt.engine.core.bll.storage.domain.GetStorageDomainsWithAttachedStoragePoolGuidQuery.getParameters ( ) . getId ( ) ) ; if ( ( storagePool == null ) || ( ( storagePool.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) ) { log.info ( "The Data Center is not in UP status." ) ; return false ; } } return true ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( foremanTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
private void addServerHook ( org.ovirt.engine.core.compat.Guid serverId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook newServerHook = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; newServerHook.setHookId ( getGlusterHook ( ) . getId ( ) ) ; newServerHook.setStatus ( getNewStatus ( ) ) ; newServerHook.setServerId ( serverId ) ; addServerHookInDb ( newServerHook ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; if ( ( getGlusterHook ( ) ) != null ) { jobProperties.put ( GlusterConstants.HOOK_NAME , getGlusterHook ( ) . getName ( ) ) ; } } return jobProperties ; }
Source:
public void testUpdateSnapshotStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.STOPPED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertFalse ( snapshot.equals ( existingSnapshot ) ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.STOPPED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }

Target:
public void testUpdateSnapshotStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertFalse ( snapshot.equals ( existingSnapshot ) ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = filterClusters ( clusters ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , null ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }
Source:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size" , cmd.validateStorageDomains ( ) ) ; }

Target:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { spySdValidatorForOneDomain ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size" , cmd.validateStorageDomains ( ) ) ; }
Source:
public void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.DeleteGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotActionVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . getSnapshotName ( ) ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; if ( ! ( getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED , retVal.getVdsError ( ) . getMessage ( ) ) ; } else { getGlusterVolumeSnapshotDao ( ) . remove ( getSnapshot ( ) . getId ( ) ) ; } }

Target:
private boolean deleteGlusterVolumeSnapshot ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String volumeName , java.lang.String snapshotName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.DeleteGlusterVolumeSnapshot , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeSnapshotActionVDSParameters ( serverId , volumeName , snapshotName ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; if ( ! ( getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED , retVal.getVdsError ( ) . getMessage ( ) ) ; return false ; } else { getGlusterVolumeSnapshotDao ( ) . remove ( getSnapshot ( ) . getId ( ) ) ; } return true ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult , org.ovirt.engine.core.bll.job.ExecutionContext executionContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = org.ovirt.engine.core.bll.MultipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal ) ; runner.setExecutionContext ( executionContext ) ; runner.setIsRunOnlyIfAllCanDoPass ( isRunOnlyIfAllCanDoPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllCanDoPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = org.ovirt.engine.core.bll.MultipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllCanDoPass ( isRunOnlyIfAllCanDoPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( ( ( getVmPoolId ( ) ) == null ? null : getVmPoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.VmPool , org.ovirt.engine.core.bll.VmPoolCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getVmPoolId ( ) ) == null ? null : getVmPoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.VmPool , org.ovirt.engine.core.bll.VmPoolCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
private java.util.Set < java.lang.String > createDiskAliasesList ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > diskAliases = new java.util.HashSet ( vm.getDiskMap ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { diskAliases.add ( disk.getDiskAlias ( ) ) ; } return diskAliases ; }

Target:
private java.util.Set < java.lang.String > createDiskAliasesList ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > diskAliases = new java.util.HashSet ( vm.getDiskMap ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : vm.getDiskMap ( ) . values ( ) ) { diskAliases.add ( disk.getDiskAlias ( ) ) ; } return diskAliases ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostExternalNetworkProviderConfigurationResourceTest.PROVIDER_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostExternalNetworkProviderConfigurationResourceTest.PROVIDER_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static boolean isMemorySizeLegal ( org.ovirt.engine.core.common.businessentities.VmOsType osType , int memSizeInMB , java.util.List < java.lang.String > reasons , java.lang.String clusterVersion ) { boolean result = org.ovirt.engine.core.common.utils.VmValidationUtils.isMemorySizeLegal ( osType , memSizeInMB , clusterVersion ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_MEMORY_SIZE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$minMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMinMemorySizeInMb ( ) ) ) ; reasons.add ( java.lang.String.format ( "$maxMemorySize %s" , org.ovirt.engine.core.common.utils.VmValidationUtils.getMaxMemorySizeInMb ( osType , clusterVersion ) ) ) ; } return result ; }

Target:
public static boolean isMemorySizeLegal ( org.ovirt.engine.core.common.businessentities.VmOsType osType , int memSizeInMB , java.util.List < java.lang.String > reasons , java.lang.String clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isMemorySizeLegal ( osType , memSizeInMB , clusterVersion ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_MEMORY_SIZE.toString ( ) ) ; reasons.add ( java.lang.String.format ( "$minMemorySize %s" , org.ovirt.engine.core.bll.validator.VmValidationUtils.getMinMemorySizeInMb ( ) ) ) ; reasons.add ( java.lang.String.format ( "$maxMemorySize %s" , org.ovirt.engine.core.bll.validator.VmValidationUtils.getMaxMemorySizeInMb ( osType , clusterVersion ) ) ) ; } return result ; }
Source:
public boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ) { java.lang.String networkName = iface.getNetworkName ( ) ; return ( networkName == null ) || ( ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ) ; }

Target:
public boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networksByName ) { java.lang.String networkName = iface.getNetworkName ( ) ; return ( networkName == null ) || ( ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ) ; }
Source:
public void onForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; cancel ( ) ; }

Target:
public void onForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; cancel ( ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > FindAllInterfaceBondNameIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceBondNameIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getBondName ( ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
private void Cluster_SelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetHostList ( 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.MoveHost moveHost = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; moveHost.PostGetHostList ( hosts ) ; } } ) ) ; } }

Target:
private void cluster_SelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getHostList ( 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.MoveHost moveHost = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; moveHost.postGetHostList ( hosts ) ; } } ) ) ; } }
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.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.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( networkLinkingSupported ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( nic.isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.bll.validator.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( nic.isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
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.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( PropertyChangedEventArgs.Args.PROGRESS.toString ( ) . equals ( pcArgs.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }

Target:
public void execute ( ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } }
Source:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { java.lang.String capsParam = filterConfig.getInitParameter ( org.ovirt.engine.core.aaa.filters.NegotiationFilter.CAPABILITIES_PARAMETER ) ; if ( capsParam != null ) { for ( java.lang.String nego : capsParam.trim ( ) . split ( " *\\| *" ) ) { try { caps |= Authn.Capabilities.class . getField ( nego ) . getLong ( null ) ; } catch ( java.lang.IllegalArgumentException | java.lang.IllegalAccessException | java.lang.NoSuchFieldException ex ) { org.ovirt.engine.core.aaa.filters.NegotiationFilter.log.error ( java.lang.String.format ( "Error calculating authn capabilities while accessing constant %1$s" , nego ) ) ; } } } }

Target:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { java.lang.String capsParam = filterConfig.getInitParameter ( org.ovirt.engine.core.aaa.filters.NegotiationFilter.CAPABILITIES_PARAMETER ) ; if ( capsParam != null ) { for ( java.lang.String nego : capsParam.trim ( ) . split ( " *\\| *" ) ) { try { caps |= Authn.Capabilities.class . getField ( nego ) . getLong ( null ) ; } catch ( java.lang.IllegalArgumentException | java.lang.IllegalAccessException | java.lang.NoSuchFieldException ex ) { org.ovirt.engine.core.aaa.filters.NegotiationFilter.log.error ( "Error calculating authn capabilities while accessing constant {}" , nego ) ; } } } }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
public org.ovirt.engine.core.common.asynctasks.AsyncTaskType getAsyncTaskType ( ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { throw new java.lang.UnsupportedOperationException ( ) ; } return getTaskType ( ) ; }
Source:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.UpdateMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; macPoolDao.update ( getMacPoolEntity ( ) ) ; macPoolPerCluster.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( ( ( org.ovirt.engine.core.utils.transaction.TransactionRollbackListener ) ( ( ) -> org.ovirt.engine.core.bll.macPoolPerCluster.modifyPool ( oldMacPool ) ) ) ) ; macPoolDao.update ( getMacPoolEntity ( ) ) ; macPoolPerCluster.modifyPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setname ( "Bob" ) ; newUser.setsurname ( "Milqtoste" ) ; newUser.setusername ( "newuser" ) ; newUser.setemail ( "newuser@redhat.com" ) ; newUser.setdomain ( "domain" ) ; newUser.setgroups ( "groups" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( "groups" ) ; }
Source:
public java.lang.String getValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = "Empty" ; if ( ( value != null ) && ( ! ( value.equals ( "" ) ) ) ) { try { decrypt ( value ) ; returnedValue = "Set" ; } catch ( java.lang.Exception e ) { java.lang.String msg = "Failed to decrypt the current value" ; org.apache.log4j.Logger.getLogger ( org.ovirt.engine.core.config.EngineConfig.class ) . debug ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } } return returnedValue ; }

Target:
public java.lang.String getValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = "Empty" ; if ( ( value != null ) && ( ! ( value.equals ( "" ) ) ) ) { try { decrypt ( value ) ; returnedValue = "Set" ; } catch ( java.lang.Exception e ) { java.lang.String msg = "Failed to decrypt the current value" ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } } return returnedValue ; }
Source:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }

Target:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; } return true ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { ( ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue ) ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getReturnValue ( ) ) ) . setFailedVds ( vds ) ; throw e ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { getResult ( ) . setFailedVds ( vds ) ; throw e ; } }
Source:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand command = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; command.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; command.setIsDefault ( true ) ; getCommands ( ) . add ( command ) ; command = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; command.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; command.setIsCancel ( true ) ; getCommands ( ) . add ( command ) ; }

Target:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand command = org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ; getCommands ( ) . add ( command ) ; getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public void runFailedAutoStartVMs ( java.util.List < org.ovirt.engine.core.compat.Guid > vmIds ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "Highly Available VM went down. Attempting to restart. VM Name: {0}, VM Id: {1}" , event.getVmName ( ) , vmId ) ; } org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmsToRun ( vmIds ) ; }

Target:
public void runFailedAutoStartVMs ( java.util.List < org.ovirt.engine.core.compat.Guid > vmIds ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; auditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.info ( "Highly Available VM went down. Attempting to restart. VM Name '{}', VM Id '{}'" , event.getVmName ( ) , vmId ) ; } org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmsToRun ( vmIds ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Nic > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Nic > nics = getCollection ( ) ; org.junit.Assert.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }