auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }
Source:
private void plug ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotPlugDiskToVm , createHotPlugDiskToVmParameters ( true ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }

Target:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : getSelectedItems ( ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { setEnumTitle ( dc.getStatus ( ) ) ; switch ( dc.getStatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case NonResponsive : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.StoragePool dc ) { java.lang.String tooltipContent = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( dc.getStatus ( ) ) ; return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltipContent ) ; }
Source:
protected void executeCommand ( ) { boolean removedStatelessSnapshot = detachUsers ( ) ; if ( ! removedStatelessSnapshot ) { removeVmStatelessImages ( ) ; } org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuotaByVmId ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; removeStatelessVmUnmanagedDevices ( ) ; applyNextRunConfiguration ( ) ; }

Target:
protected void executeCommand ( ) { applyNextRunConfiguration ( ) ; boolean removedStatelessSnapshot = detachUsers ( ) ; if ( ( ! removedStatelessSnapshot ) && ( ! ( templateVersionChanged ) ) ) { removeVmStatelessImages ( ) ; } org.ovirt.engine.core.bll.ProcessDownVmCommand.getQuotaManager ( ) . rollbackQuotaByVmId ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; removeStatelessVmUnmanagedDevices ( ) ; boolean vmHasDirectPassthroughDevices = releaseUsedHostDevices ( ) ; org.ovirt.engine.core.compat.Guid hostId = cleanupVfs ( ) ; refreshHostIfNeeded ( ( hostId == null ? vmHasDirectPassthroughDevices ? org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) : null : hostId ) ) ; }
Source:
public void customPropertiesNetworkRemoved ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createManagementNetworkNic ( "eth0" ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; mockExistingIfaces ( iface ) ; iface.setNetworkName ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNetworkRemoved ( helper , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void customPropertiesNoNetwork ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
private static void convertAAAProfilesResult ( 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 ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } return results ; } } ; }

Target:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { 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 ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult snapshotTypeSupported ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , java.util.Collection < org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType > supportedtypes ) { if ( ! ( supportedtypes.contains ( snapshot.getType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_TYPE_NOT_ALLOWED , java.lang.String.format ( "$supportedSnapshotTypes %s" , org.apache.commons.lang.StringUtils.join ( supportedtypes , ", " ) ) , java.lang.String.format ( "$snapshotType %s" , snapshot.getType ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isRegularSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { if ( ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) != ( snapshot.getType ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_TYPE_NOT_REGULAR ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getLunDao ( ) ; existingLUN = dao.get ( "1IET_00180001" ) ; newLUN = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; newLUN.setLUN_id ( "oicu812" ) ; newLUN.setvolume_group_id ( "" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getLunDao ( ) ; existingLUN = dao.get ( "1IET_00180001" ) ; newLUN = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; newLUN.setLUNId ( "oicu812" ) ; newLUN.setVolumeGroupId ( "" ) ; }
Source:
public boolean Validate ( boolean isOVirt ) { getOVirtISO ( ) . setIsValid ( true ) ; getRootPassword ( ) . setIsValid ( true ) ; if ( isOVirt ) { getOVirtISO ( ) . ValidateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } else { getRootPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return ( getRootPassword ( ) . getIsValid ( ) ) && ( getOVirtISO ( ) . getIsValid ( ) ) ; }

Target:
public boolean Validate ( boolean isOVirt ) { getOVirtISO ( ) . setIsValid ( true ) ; getRootPassword ( ) . setIsValid ( true ) ; if ( isOVirt ) { getOVirtISO ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } else { getRootPassword ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return ( getRootPassword ( ) . getIsValid ( ) ) && ( getOVirtISO ( ) . getIsValid ( ) ) ; }
Source:
public void onSelection ( com.google.gwt.event.logical.shared.SelectionEvent < java.lang.Integer > event ) { if ( event == null ) { return ; } if ( ( event.getSelectedItem ( ) ) == ( org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.BOOKMARK_INDEX ) ) { bookmarkModelProvider.getModel ( ) . executeBookmarksSearch ( ) ; } else { bookmarkModelProvider.getModel ( ) . EnsureAsyncSearchStopped ( ) ; } }

Target:
public void onSelection ( com.google.gwt.event.logical.shared.SelectionEvent < java.lang.Integer > event ) { if ( event == null ) { return ; } if ( ( event.getSelectedItem ( ) ) == ( org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.BOOKMARK_INDEX ) ) { bookmarkModelProvider.getModel ( ) . executeBookmarksSearch ( ) ; } else { bookmarkModelProvider.getModel ( ) . ensureAsyncSearchStopped ( ) ; } }
Source:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsList ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageServerConnectionLunMapDAO ( ) ) ; storageServerConnectionDao = prepareDAO ( dbFacade.getStorageServerConnectionDAO ( ) ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.storage_server_connections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map_id ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageServerConnectionLunMapDao ( ) ) ; storageServerConnectionDao = prepareDAO ( dbFacade.getStorageServerConnectionDao ( ) ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.storage_server_connections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map_id ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.LUN_storage_server_connection_map ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAOTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { if ( ( getStoragePool ( ) ) != null ) { return validateAttachStorageDomain ( ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateAddProvider ( ) { org.ovirt.engine.core.bll.ValidationResult cinderValidation = isCinderAlreadyExists ( ) ; if ( ! ( cinderValidation.isValid ( ) ) ) { return cinderValidation ; } if ( ( getStoragePool ( ) ) != null ) { return validateAttachStorageDomain ( ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void setUpGetBallooningExpectations ( java.lang.Integer ... idxs ) throws java.lang.Exception { for ( int i : idxs ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }

Target:
protected void setUpGetBallooningExpectations ( java.lang.Integer ... idxs ) throws java.lang.Exception { for ( int i : idxs ) { setUpGetEntityExpectations ( QueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
public void canDoActionWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }

Target:
public void canDoActionWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.core.bll.GetHostArchitectureQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetHostArchitectureQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = org.ovirt.engine.core.bll.GetHostArchitectureQuery.getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( host.getCpuFlags ( ) , host.getVdsGroupCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.GetHostArchitectureQuery.getQueryReturnValue ( ) . setReturnValue ( ( sc == null ? org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined : sc.getArchitecture ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.core.bll.GetHostArchitectureQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetHostArchitectureQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = cpuFlagsManagerHandler.findMaxServerCpuByFlags ( host.getCpuFlags ( ) , host.getVdsGroupCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.GetHostArchitectureQuery.getQueryReturnValue ( ) . setReturnValue ( ( sc == null ? org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined : sc.getArchitecture ( ) ) ) ; }
Source:
public void testFindSingleDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.test ( mockNetwork ) ) . thenReturn ( true ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }

Target:
public void testFindSingleDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.test ( mockNetwork ) ) . thenReturn ( true ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.jupiter.api.Assertions.assertSame ( actual , mockNetwork ) ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void setId ( org.ovirt.engine.core.compat.Guid value ) { if ( ( ( ( id ) == null ) && ( value != null ) ) || ( ( ( id ) != null ) && ( ! ( id.equals ( value ) ) ) ) ) { id = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Id" ) ) ; } }

Target:
public void setId ( org.ovirt.engine.core.compat.Guid value ) { if ( ( ( ( id ) == null ) && ( value != null ) ) || ( ( ( id ) != null ) && ( ! ( id.equals ( value ) ) ) ) ) { id = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Id" ) ) ; } }
Source:
public static void getAttachedTagsToVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickStatus backendStatus , org.ovirt.engine.api.model.GlusterState restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterBrick restVolume = org.ovirt.engine.api.restapi.types.GlusterBrickMapper.map ( brick , null ) ; assertEquals ( restVolume.getState ( ) , restStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterState restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterBrick restVolume = org.ovirt.engine.api.restapi.types.GlusterBrickMapper.map ( brick , null ) ; assertEquals ( restVolume.getState ( ) , restStatus.value ( ) ) ; }
Source:
public void getDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
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 ( ) ) . update ( templateVersionNameEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( detachableWidgets ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . detachable ( ) . visibleInAdvancedModeOnly ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap widgetConfiguration = super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( templateVersionNameEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , detachableWidgets ( ) , UpdateToDetachable.INSTANCE ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , adminOnlyWidgets ( ) , UpdateToAdminOnly.INSTANCE ) ; return widgetConfiguration ; }
Source:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertFalse ( "validate should fail with can't use host CPU." , validInput ) ; assertValidateMessage ( EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }

Target:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }
Source:
public void testGetAllVMTemplatesSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Template" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VmTemplate ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmTemplateResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllVMTemplatesSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Template" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VmTemplate ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( vmTemplateResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLUNList ( _result.lunList ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } if ( ( ( snapshots ) == null ) || ( snapshots.isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST , getGlusterVolumeName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } if ( ( ( snapshots ) == null ) || ( snapshots.isEmpty ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST , getGlusterVolumeName ( ) ) ; } return true ; }
Source:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( imageFromDb ) ; org.junit.Assert.assertEquals ( "Image snapshot id wasn't updated properly" , guid , imageFromDb.getSnapshotId ( ) ) ; }

Target:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( imageFromDb ) ; org.junit.Assert.assertEquals ( "Image snapshot id wasn't updated properly" , guid , imageFromDb.getSnapshotId ( ) ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testWarnOnActiveVmPositive ( ) { testWarnOnActiveVmInner ( true ) ; org.mockito.Mockito.verify ( mockAuditLogDirector ) . log ( auditLogableBaseCaptor.capture ( ) , org.mockito.ArgumentMatchers.same ( AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM ) ) ; final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase actualLoggable = auditLogableBaseCaptor.getValue ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID , actualLoggable.getClusterId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , actualLoggable.getCustomValue ( "networkname" ) ) ; }

Target:
public void setUp ( ) { underTest = new org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelper ( mockNetworkClusterDao , mockVmDao , mockClusterDao , mockNetworkCluster , org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , mockAuditLogDirector ) ; org.mockito.Mockito.when ( mockNetworkCluster.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkClusterBeforeUpdate ) ; org.mockito.Mockito.when ( mockClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID ) ) . thenReturn ( createCluster ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_NAME ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { BackendHostNicLabelsResourceTest.nicId } , java.util.Arrays.asList ( getEntity ( 0 ) ) ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; storagePool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; storagePool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
public boolean IsDisplayTypeSupported ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { switch ( displayType ) { case vnc : return true ; case qxl : return ( ( clientOsType ( ) . equalsIgnoreCase ( "Windows" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Explorer" ) ) ) || ( ( clientOsType ( ) . equalsIgnoreCase ( "Linux" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Firefox" ) ) ) ; } return false ; }

Target:
public boolean isClientLinuxFirefox ( ) { return ( clientOsType ( ) . equalsIgnoreCase ( "Linux" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Firefox" ) ) ; }
Source:
private void initializeObjectState ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getSnapshotName ( ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . getSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } }

Target:
private void initializeObjectState ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getSnapshotName ( ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . getSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH , cmd.getAuditLogTypeValue ( ) ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) ) ; }

Target:
public void validateSucceedsOnUpVolume ( ) { cmd.setGlusterVolumeId ( volumeId1 ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.io.UnsupportedEncodingException , java.security.GeneralSecurityException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; return org.apache.commons.codec.binary.Base64.encodeBase64String ( rsa.doFinal ( source.trim ( ) . getBytes ( "UTF-8" ) ) ) ; }

Target:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.io.UnsupportedEncodingException , java.security.GeneralSecurityException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; return new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( rsa.doFinal ( source.trim ( ) . getBytes ( "UTF-8" ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MAX_MEMORY_SIZE ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( ActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; params.setUpdateNuma ( true ) ; return params ; }

Target:
private static org.ovirt.engine.core.common.action.VmManagementParametersBase initParams ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( org.ovirt.engine.core.bll.UpdateVmCommandTest.clusterId ) ; vmStatic.setName ( "my_vm" ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MAX_MEMORY_SIZE ) ; vmStatic.setMemSizeMb ( org.ovirt.engine.core.bll.UpdateVmCommandTest.MEMORY_SIZE ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( ActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; params.setUpdateNuma ( true ) ; return params ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( 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 ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }