auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityId ( destImageId ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalTaskIdList ( ) ) ; } }

Target:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityId ( destImageId ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
protected boolean Validate ( ) { getUserName ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getPassword ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getDomain ( ) . ValidateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( ( getUserName ( ) . getIsValid ( ) ) && ( getPassword ( ) . getIsValid ( ) ) ) && ( getDomain ( ) . getIsValid ( ) ) ; }

Target:
protected boolean Validate ( ) { getUserName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getDomain ( ) . ValidateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( ( getUserName ( ) . getIsValid ( ) ) && ( getPassword ( ) . getIsValid ( ) ) ) && ( getDomain ( ) . getIsValid ( ) ) ; }
Source:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; }

Target:
public void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }
Source:
public java.lang.String getSearchString ( ) { if ( ( searchString ) == null ) { return null ; } return ( searchString ) + ( ( pagingSearchString ) == null ? "" : pagingSearchString ) ; }

Target:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { boolean shouldRefresh = ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { searchString = stripPageKeyword ( searchString ) ; setSearchStringPage ( 1 ) ; refresh ( ) ; } }
Source:
public boolean increase ( T key , boolean allowDuplicate ) { org.ovirt.engine.core.bll.network.macpoolmanager.ObjectCounter.Counter counter = map.get ( key ) ; if ( counter == null ) { map.put ( key , new org.ovirt.engine.core.bll.network.macpoolmanager.ObjectCounter.Counter ( ) ) ; return true ; } else if ( allowDuplicate ) { counter.increase ( ) ; return true ; } else { return false ; } }

Target:
public boolean increase ( T key , boolean allowDuplicate ) { org.ovirt.engine.core.bll.network.macpool.ObjectCounter.Counter counter = map.get ( key ) ; if ( counter == null ) { map.put ( key , new org.ovirt.engine.core.bll.network.macpool.ObjectCounter.Counter ( ) ) ; return true ; } else if ( allowDuplicate ) { counter.increase ( ) ; return true ; } else { return false ; } }
Source:
public javax.ws.rs.core.Response fence ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "fenceType" ) ; org.ovirt.engine.api.model.FenceType fenceType = validateEnum ( org.ovirt.engine.api.model.FenceType.class , action.getFenceType ( ) . toUpperCase ( ) ) ; switch ( fenceType ) { case MANUAL : return fenceManually ( action ) ; case RESTART : return fence ( action , VdcActionType.RestartVds ) ; case START : return fence ( action , VdcActionType.StartVds ) ; case STOP : return fence ( action , VdcActionType.StopVds ) ; case STATUS : return getFenceStatus ( action ) ; default : return null ; } }

Target:
public javax.ws.rs.core.Response fence ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "fenceType" ) ; org.ovirt.engine.api.model.FenceType fenceType = validateEnum ( org.ovirt.engine.api.model.FenceType.class , action.getFenceType ( ) . toUpperCase ( ) ) ; switch ( fenceType ) { case MANUAL : return fenceManually ( action ) ; case RESTART : return fence ( action , ActionType.RestartVds ) ; case START : return fence ( action , ActionType.StartVds ) ; case STOP : return fence ( action , ActionType.StopVds ) ; case STATUS : return getFenceStatus ( action ) ; default : return null ; } }
Source:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
protected boolean removeVmLeaseIfNeeded ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } org.ovirt.engine.core.common.vdscommands.VmLeaseVDSParameters parameters = new org.ovirt.engine.core.common.vdscommands.VmLeaseVDSParameters ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStoragePoolId ( ) ) ; parameters.setLeaseId ( vmId ) ; parameters.setStorageDomainId ( leaseStorageDomainId ) ; return runVdsCommand ( VDSCommandType.RemoveVmLease , parameters ) . getSucceeded ( ) ; }

Target:
protected boolean removeVmLease ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } return runVdsCommand ( VDSCommandType.RemoveVmLease , new org.ovirt.engine.core.common.vdscommands.VmLeaseVDSParameters ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStoragePoolId ( ) , leaseStorageDomainId , vmId ) ) . getSucceeded ( ) ; }
Source:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }

Target:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmDevice addInterface ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , boolean plugged , boolean hostDev , java.lang.String address ) { return addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , plugged , false , address , null , false ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addInterface ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , boolean plugged , boolean hostDev , java.lang.String address ) { return addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.emptyMap ( ) , plugged , false , address , null , false ) ; }
Source:
public void updateActionsAvailability ( ) { boolean clusterSelected = ( unitVmModel.getSelectedCluster ( ) ) != null ; boolean osSelected = ( unitVmModel.getOSType ( ) . getSelectedItem ( ) ) != null ; if ( ( getItems ( ) ) == null ) { return ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel model : getItems ( ) ) { if ( model.isGhost ( ) ) { continue ; } model.setEnabled ( ( clusterSelected && osSelected ) ) ; } setIsChangable ( ( clusterSelected && osSelected ) ) ; }

Target:
public void updateActionsAvailability ( ) { boolean clusterSelected = ( unitVmModel.getSelectedCluster ( ) ) != null ; boolean osSelected = ( unitVmModel.getOSType ( ) . getSelectedItem ( ) ) != null ; if ( ( getItems ( ) ) == null ) { return ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel model : getItems ( ) ) { if ( model.isGhost ( ) ) { continue ; } model.setEnabled ( ( clusterSelected && osSelected ) ) ; } setIsChangeable ( ( clusterSelected && osSelected ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; parameters.setRunInUnknownStatus ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isRunInUnknownStatus ( ) ) ; return parameters ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.CreateVDSCommandParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; parameters.setRunInUnknownStatus ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isRunInUnknownStatus ( ) ) ; parameters.setInitializationType ( initializationType ) ; return parameters ; }
Source:
private void initSorting ( ) { nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; ipColumn.makeSortable ( ) ; fqdnColumn.makeSortable ( ) ; vnicNameColumn.makeSortable ( ) ; descriptionColumn.makeSortable ( ) ; }

Target:
private void initSorting ( ) { vmStatusColumn.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; ipColumn.makeSortable ( ) ; fqdnColumn.makeSortable ( ) ; nicActivateStatusColumn.makeSortable ( ) ; vnicNameColumn.makeSortable ( ) ; descriptionColumn.makeSortable ( ) ; }
Source:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.dupContext ( ) . withoutCompensationContext ( ) . withLock ( new org.ovirt.engine.core.utils.lock.EngineLock ( getExclusiveLocks ( ) , null ) ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; fenceVdsManuallyParams.setSessionId ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getParameters ( ) . getSessionId ( ) ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.cloneContext ( ) . withoutCompensationContext ( ) . withLock ( new org.ovirt.engine.core.utils.lock.EngineLock ( getExclusiveLocks ( ) , null ) ) ) ; }
Source:
private void initParetResource ( org.ovirt.engine.api.restapi.resource.AbstractBackendUsersResource resource , javax.ws.rs.core.UriInfo uriInfo ) { initResource ( resource ) ; resource.setUriInfo ( uriInfo ) ; }

Target:
private void setUpParentExpectations ( ) { org.ovirt.engine.api.restapi.resource.BackendDomainUsersResource parent = control.createMock ( org.ovirt.engine.api.restapi.resource.BackendDomainUsersResource.class ) ; org.ovirt.engine.api.model.Domain domain = new org.ovirt.engine.api.model.Domain ( ) ; domain.setName ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; org.easymock.EasyMock.expect ( parent.getDirectory ( ) ) . andReturn ( domain ) . anyTimes ( ) ; resource.setParent ( parent ) ; }
Source:
protected java.lang.String getHeaderBuilderCode ( java.util.List < org.ovirt.engine.sdk.entities.Header > headers ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.entities.Header header : headers ) { java.lang.String headerName = header.getName ( ) ; org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate template = new org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( headerName , org.ovirt.engine.sdk.generator.java.utils.FormatUtils.toJava ( headerName ) ) ) ; } return buffer.toString ( ) ; }

Target:
protected java.lang.String getHeaderBuilderCode ( java.util.List < org.ovirt.engine.sdk.generator.java.ParameterData > parameters ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.generator.java.ParameterData parameter : parameters ) { if ( ( parameter.getType ( ) ) == ( org.ovirt.engine.sdk.generator.java.ParameterType.HEADER ) ) { org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate template = new org.ovirt.engine.sdk.generator.java.templates.HeaderBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( parameter ) ) ; } } return buffer.toString ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails fetchAdvancedDetails ( java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getBackendResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getClusterId ( ) ) , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getClusterId ( ) , volumeName , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getBrickName ( ) , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . isDetailRequired ( ) ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( returnValue.getReturnValue ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails fetchAdvancedDetails ( java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getClusterId ( ) ) , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getClusterId ( ) , volumeName , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . getBrickName ( ) , org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getParameters ( ) . isDetailRequired ( ) ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( returnValue.getReturnValue ( ) ) ) ; }
Source:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ( ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage = new org.ovirt.engine.core.common.businessentities.storage.RepoImage ( ) ; repoImage.setStoragePoolId ( storagePoolId ) ; repoImage.setRepoDomainId ( storageDomainId ) ; repoImage.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoImage ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }

Target:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > tempProblematicRepoFileList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage = org.ovirt.engine.core.bll.IsoDomainListSyncronizer.createMockRepositoryFileMetaData ( storageDomainId , imageType , storagePoolId ) ; tempProblematicRepoFileList.add ( repoImage ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }
Source:
public void testUpdate ( ) { existingDynamic.setactual_size ( ( ( existingDynamic.getactual_size ( ) ) * 10 ) ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }

Target:
public void testUpdate ( ) { existingDynamic.setActualSize ( ( ( existingDynamic.getActualSize ( ) ) * 10 ) ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.HostJobInfo pollStorageJob ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( jobId == null ) { return null ; } org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters p = new org.ovirt.engine.core.common.vdscommands.GetHostJobsVDSCommandParameters ( vdsId , java.util.Collections.singletonList ( jobId ) , org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobType.storage ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.GetHostJobs , p ) ; return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.HostJobInfo > ) ( returnValue.getReturnValue ( ) ) ) . get ( jobId ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobType getHostJobType ( ) { return org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobType.storage ; }
Source:
public void onSuccess ( java.lang.String currentOsDefaultIcon ) { java.lang.String iconToShow = getIconToShow ( currentOsDefaultIcon ) ; org.ovirt.engine.core.compat.Guid smallIconId = getSmallIconId ( iconToShow , oldIcon , currentOsDefaultIcon , osDefaultIconId ) ; org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault newIconPair = new org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault ( iconToShow , currentOsDefaultIcon , smallIconId ) ; getIcon ( ) . setEntity ( newIconPair ) ; }

Target:
public void onCreated ( org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault instance ) { getIcon ( ) . setEntity ( instance ) ; }
Source:
private void setUpGetUserExpectations ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; user.setId ( GUIDS [ 0 ] ) ; org.easymock.EasyMock.expect ( sessionHelper.getCurrent ( ) . get ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ) . andReturn ( user ) . anyTimes ( ) ; }

Target:
private void setUpGetUserExpectations ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; user.setId ( GUIDS [ 0 ] ) ; org.easymock.EasyMock.expect ( sessionHelper.getCurrent ( ) . get ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ) . andReturn ( user ) . anyTimes ( ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.lang.Iterable ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < > ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.core.common.businessentities.network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { try { if ( ! ( model.isPool ( ) ) ) { model.getVmConsoles ( ) . connect ( ) ; } } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { getView ( ) . showErrorDialog ( e.getLocalizedErrorMessage ( ) ) ; } }

Target:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { try { if ( model.getVmConsoles ( ) . canConnectToConsole ( ) ) { model.getVmConsoles ( ) . connect ( ) ; } } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { getView ( ) . showErrorDialog ( e.getLocalizedErrorMessage ( ) ) ; } }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveUser , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void testStripeCount ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; int replicaCount = volume.getReplicaCount ( ) ; org.junit.Assert.assertTrue ( ( replicaCount != 0 ) ) ; org.junit.Assert.assertEquals ( 2 , replicaCount ) ; dao.updateReplicaCount ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID , 4 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeAfter = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; org.junit.Assert.assertNotNull ( volumeAfter ) ; replicaCount = volumeAfter.getReplicaCount ( ) ; org.junit.Assert.assertTrue ( ( replicaCount != 0 ) ) ; org.junit.Assert.assertEquals ( 4 , replicaCount ) ; }

Target:
public void testStripeCount ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; int replicaCount = volume.getReplicaCount ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( replicaCount != 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , replicaCount ) ; dao.updateReplicaCount ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID , 4 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeAfter = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volumeAfter ) ; replicaCount = volumeAfter.getReplicaCount ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( replicaCount != 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 4 , replicaCount ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { revealStorageView ( disk ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( disk.getVm ( ) ) == null ) { return ; } boolean isVirtioScsiEnabled = java.lang.Boolean.TRUE.equals ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ; org.ovirt.engine.core.compat.Version clusterVersion = disk.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ; interfaceInfoIcon.setVisible ( ( ( ( clusterVersion.compareTo ( Version.v3_3 ) ) >= 0 ) && ( ! isVirtioScsiEnabled ) ) ) ; }
Source:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertEquals ( 0 , device1.compareTo ( device1 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertEquals ( 0 , device1.compareTo ( device2 ) ) ; }

Target:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , device1.compareTo ( device1 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , device1.compareTo ( device2 ) ) ; }
Source:
public static void GetDiskMaxSize ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
private void removeMemory ( final org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { boolean success = removeMemoryVolumes ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) , false ) ; if ( ! success ) { log.errorFormat ( "Cannot remove memory volumes for snapshot {0}" , snapshot.getId ( ) ) ; } }

Target:
private void removeMemory ( final org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean useTaskManager ) { org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters parameters = new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ; if ( useTaskManager ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveMemoryVolumes , parameters , org.ovirt.engine.core.bll.RemoveSnapshotCommand.cloneContextAndDetachFromParent ( ) ) ; } else { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = runInternalAction ( VdcActionType.RemoveMemoryVolumes , parameters ) ; if ( ! ( ret.getSucceeded ( ) ) ) { log.error ( "Cannot remove memory volumes for snapshot '{}'" , snapshot.getId ( ) ) ; } } }
Source:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }

Target:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }
Source:
protected boolean Validate ( ) { getUserName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getDomain ( ) . ValidateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( ( getUserName ( ) . getIsValid ( ) ) && ( getPassword ( ) . getIsValid ( ) ) ) && ( getDomain ( ) . getIsValid ( ) ) ; }

Target:
protected boolean Validate ( ) { getUserName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getDomain ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( ( getUserName ( ) . getIsValid ( ) ) && ( getPassword ( ) . getIsValid ( ) ) ) && ( getDomain ( ) . getIsValid ( ) ) ; }
Source:
private void assertCorrectSlaveCountInValidBonds ( int numberOfSlaves , java.lang.String reason , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.lang.String bondName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( bondName , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createGivenCountOfSlavesForBond ( bondName , numberOfSlaves ) ; org.junit.Assert.assertThat ( reason , new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . validBond ( slaves ) , matcher ) ; }

Target:
private void assertCorrectSlaveCountInValidBonds ( int numberOfSlaves , java.lang.String reason , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.lang.String bondName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( bondName , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createGivenCountOfSlavesForBond ( bondName , numberOfSlaves ) ; org.hamcrest.MatcherAssert.assertThat ( reason , new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . validBond ( slaves ) , matcher ) ; }
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( poolId , VMStatus.Up ) ; int prestartedVmsInPool = 0 ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.CanAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { prestartedVmsInPool ++ ; } } } return prestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( poolId , VMStatus.Up ) ; int prestartedVmsInPool = 0 ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { prestartedVmsInPool ++ ; } } } return prestartedVmsInPool ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public boolean isUpdateAvailable ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backendInternal.runInternalQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( host.getId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.RpmVersion > isos = returnValue.getReturnValue ( ) ; boolean updateAvailable = org.ovirt.engine.core.common.utils.RpmVersionUtils.isUpdateAvailable ( isos , host.getHostOs ( ) ) ; if ( updateAvailable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLog = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLog.setVds ( host ) ; auditLogDirector.log ( auditLog , AuditLogType.OVIRT_NODE_UPDATES_ARE_AVAILABLE ) ; } return updateAvailable ; }

Target:
public boolean isUpdateAvailable ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backendInternal.runInternalQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( host.getId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.RpmVersion > isos = returnValue.getReturnValue ( ) ; boolean updateAvailable = org.ovirt.engine.core.common.utils.RpmVersionUtils.isUpdateAvailable ( isos , host.getHostOs ( ) ) ; if ( updateAvailable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLog = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; auditLog.setVds ( host ) ; auditLogDirector.log ( auditLog , AuditLogType.OVIRT_NODE_UPDATES_ARE_AVAILABLE ) ; } return updateAvailable ; }