auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { boolean numOfSocketsChangable = getModel ( ) . getNumOfSockets ( ) . getIsChangable ( ) ; boolean coresPerSocket = getModel ( ) . getCoresPerSocket ( ) . getIsChangable ( ) ; super . doUpdateManagedFieldsFrom ( vmBase ) ; deactivate ( ) ; getModel ( ) . getNumOfSockets ( ) . setIsChangable ( numOfSocketsChangable ) ; getModel ( ) . getCoresPerSocket ( ) . setIsChangable ( coresPerSocket ) ; activate ( ) ; }

Target:
protected void doUpdateManagedFieldsFrom ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { boolean numOfSocketsChangable = getModel ( ) . getNumOfSockets ( ) . getIsChangable ( ) ; boolean coresPerSocket = getModel ( ) . getCoresPerSocket ( ) . getIsChangable ( ) ; super . doUpdateManagedFieldsFrom ( vmBase ) ; deactivate ( ) ; getModel ( ) . getNumOfSockets ( ) . setIsChangeable ( numOfSocketsChangable ) ; getModel ( ) . getCoresPerSocket ( ) . setIsChangeable ( coresPerSocket ) ; activate ( ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void setSelectedNetworkQoSId ( org.ovirt.engine.core.compat.Guid networkQoSId ) { if ( networkQoSId != null ) { for ( java.lang.Object item : getNetworkQoS ( ) . getItems ( ) ) { if ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( item ) ) . getId ( ) . equals ( networkQoSId ) ) { getNetworkQoS ( ) . setSelectedItem ( item ) ; break ; } } } else { setSelectedNetworkQoSId ( Guid.Empty ) ; } }

Target:
private void setSelectedNetworkQoSId ( org.ovirt.engine.core.compat.Guid networkQoSId ) { for ( java.lang.Object item : getNetworkQoS ( ) . getItems ( ) ) { if ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( item ) ) . getId ( ) . equals ( networkQoSId ) ) { getNetworkQoS ( ) . setSelectedItem ( item ) ; return ; } } getNetworkQoS ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.getEmptyQos ( ) ) ; }
Source:
public void portsNotChanged ( ) { int port = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; org.mockito.Mockito.when ( oldHost.getPort ( ) ) . thenReturn ( port ) ; org.mockito.Mockito.when ( host.getPort ( ) ) . thenReturn ( port ) ; org.junit.Assert.assertThat ( validator.updatePortAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void portsNotChanged ( ) { int port = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; org.mockito.Mockito.when ( oldHost.getPort ( ) ) . thenReturn ( port ) ; org.mockito.Mockito.when ( host.getPort ( ) ) . thenReturn ( port ) ; org.hamcrest.MatcherAssert.assertThat ( validator.updatePortAllowed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize64 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; }

Target:
private void handleQxlChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > checkbox , java.lang.String version , boolean isQxl ) { if ( isQxl ) { checkbox.setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionNotSupportedClusterVersionTooOld ( version ) ) ; } else { checkbox.setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionRequiresSpiceEnabled ( ) ) ; } }
Source:
public org.ovirt.engine.core.config.entity.helper.ValidationResult validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { java.util.List < java.lang.String > validValues = key.getValidValues ( ) ; boolean isValid = false ; if ( validValues.isEmpty ( ) ) { isValid = true ; } else { isValid = validValues.contains ( value ) ; } return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( isValid ) ; }

Target:
public org.ovirt.engine.core.config.entity.helper.ValidationResult validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { java.util.List < java.lang.String > validValues = key.getValidValues ( ) ; boolean isValid = false ; java.lang.String details = "" ; if ( validValues.isEmpty ( ) ) { isValid = true ; } else { isValid = validValues.contains ( value ) ; if ( ! isValid ) { details = "Valid values are " + ( key.getValidValues ( ) ) ; } } return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( isValid , details ) ; }
Source:
public org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return super . createTask ( taskId , asyncTaskCreationInfo , parentCommand , entityType , entityIds ) ; }

Target:
protected void endWithFailure ( ) { if ( isConsiderSuccessful ( ) ) { auditLog ( this , AuditLogType.USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_SRC_IMAGE ) ; this . endSuccessfully ( ) ; return ; } super . endWithFailure ( ) ; handleDestDisk ( ) ; unlockDisk ( ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.setSucceeded ( true ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAdGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public org.ovirt.engine.sdk.entities.Response delete ( java.lang.Boolean async , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . add ( "async" , async , UrlParameterType.MATRIX ) . build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
public java.lang.String getValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = "Empty" ; if ( ( value != null ) && ( ! ( value.equals ( "" ) ) ) ) { try { decrypt ( value ) ; returnedValue = "Set" ; } catch ( java.lang.Exception e ) { java.lang.String msg = "Failed to decrypt the current value" ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } } return returnedValue ; }

Target:
public java.lang.String getValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = "Empty" ; if ( ( value != null ) && ( ! ( value.equals ( "" ) ) ) ) { try { decrypt ( value ) ; returnedValue = "Set" ; } catch ( java.lang.Exception exception ) { java.lang.String msg = "Failed to decrypt the current value." ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.console.writeLine ( msg ) ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( exception ) ; throw new java.security.GeneralSecurityException ( msg ) ; } } return returnedValue ; }
Source:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ) . when ( storagePoolValidator ) . existsAndUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND.name ( ) ) ) ; }

Target:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ) . when ( storagePoolValidator ) . existsAndUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ; }
Source:
private void initIsoImages ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIso ( ) . setItems ( images ) ; getIso ( ) . setSelectedItem ( tryToFindVirtioTools ( images ) ) ; } } ) , getStoragePool ( ) . getId ( ) , false ) ; }

Target:
private void initIsoImages ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < java.lang.String > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < java.lang.String > images ) { getIso ( ) . setItems ( images ) ; getIso ( ) . setSelectedItem ( tryToFindVirtioTools ( images ) ) ; } } ) , getStoragePool ( ) . getId ( ) , false ) ; }
Source:
public void PostOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.all ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { Cancel ( ) ; } }

Target:
public void postOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.all ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { cancel ( ) ; } }
Source:
public static final < T extends org.ovirt.engine.core.common.businessentities.Disk > java.lang.Iterable < T > filterDisksByStorageType ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Disk > source , final org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType diskStorageType ) { return ( ( java.lang.Iterable < T > ) ( org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Disk source ) { return ( source.getDiskStorageType ( ) ) == diskStorageType ; } } ) ) ) ; }

Target:
public static final < T extends org.ovirt.engine.core.common.businessentities.Disk > java.util.Collection < T > filterDisksByStorageType ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > source , final org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType diskStorageType ) { return ( ( java.util.Collection < T > ) ( org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Disk source ) { return ( source.getDiskStorageType ( ) ) == diskStorageType ; } } ) ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( disk ) ; diskModels.add ( diskModel ) ; } return diskModels ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( disk ) ; diskModels.add ( diskModel ) ; } return diskModels ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , java.lang.String template ) { switch ( storageDomainType ) { case Master : return StorageDomainType.DATA.value ( ) ; case Data : return StorageDomainType.DATA.value ( ) ; case ISO : return StorageDomainType.ISO.value ( ) ; case ImportExport : return StorageDomainType.EXPORT.value ( ) ; case Image : return StorageDomainType.IMAGE.value ( ) ; case Volume : return StorageDomainType.VOLUME.value ( ) ; case Unknown : default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainType map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , org.ovirt.engine.api.model.StorageDomainType template ) { switch ( storageDomainType ) { case Master : return org.ovirt.engine.api.model.StorageDomainType.DATA ; case Data : return org.ovirt.engine.api.model.StorageDomainType.DATA ; case ISO : return org.ovirt.engine.api.model.StorageDomainType.ISO ; case ImportExport : return org.ovirt.engine.api.model.StorageDomainType.EXPORT ; case Image : return org.ovirt.engine.api.model.StorageDomainType.IMAGE ; case Volume : return org.ovirt.engine.api.model.StorageDomainType.VOLUME ; case Unknown : default : return null ; } }
Source:
public 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getAuditLogType ( ) ) != null ) { addCustomValue ( "DiskId" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getDiskId ( ) . toString ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getAuditLogType ( ) ; } else { return super . getAuditLogTypeValue ( ) ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getAuditLogType ( ) ) != null ) { addCustomValue ( "DiskId" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getDiskId ( ) . toString ( ) ) ; addCustomValue ( "EngineUrl" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getProxyLocation ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.TransferImageStatusCommand.getParameters ( ) . getAuditLogType ( ) ; } else { return super . getAuditLogTypeValue ( ) ; } }
Source:
public java.util.Set < java.lang.String > getSupportedVersions ( ) { java.lang.String value = config.getProperty ( org.ovirt.engine.api.restapi.LocalConfig.SUPPORTED_VERSIONS ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptySet ( ) ; } java.lang.String [ ] chunks = value.split ( "\\s*,\\s*" ) ; java.util.Set < java.lang.String > versions = new java.util.HashSet < > ( ) ; java.util.Collections.addAll ( versions , chunks ) ; return versions ; }

Target:
private java.util.Set < java.lang.String > getVersions ( java.lang.String key ) { java.lang.String value = config.getProperty ( key ) ; if ( ( value == null ) || ( value.isEmpty ( ) ) ) { return java.util.Collections.emptySet ( ) ; } java.lang.String [ ] chunks = value.split ( "\\s*,\\s*" ) ; java.util.Set < java.lang.String > versions = new java.util.HashSet < > ( ) ; java.util.Collections.addAll ( versions , chunks ) ; return versions ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public 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 < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.vm_pools pool = ( ( org.ovirt.engine.core.common.businessentities.vm_pools ) ( returnValue ) ) ; boolean isManualPool = ( pool.getvm_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ; behavior.UpdateCommandsAccordingToPoolType ( isManualPool ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getvm_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ; behavior.UpdateCommandsAccordingToPoolType ( isManualPool ) ; }
Source:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getWatchdogModel ( ) . getEntity ( ) ) == null ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( null ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }

Target:
private void watchdogModelSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getWatchdogModel ( ) . getSelectedItem ( ) ) == null ) { getWatchdogAction ( ) . setIsChangeable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( null ) ; } else { getWatchdogAction ( ) . setIsChangeable ( true ) ; } }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public void testImportVMFromConfigurationXMLCouldNotGetParsed ( ) { org.ovirt.engine.core.common.businessentities.OvfEntityData ovfEntity = getOvfEntityData ( ) ; ovfEntity.setOvfData ( "This is not a valid XML" ) ; initCommand ( ovfEntity ) ; org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , storageDomainId ) ) . thenReturn ( ovfEntity ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_OVF_CONFIGURATION_NOT_SUPPORTED ) ; }

Target:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = new java.util.ArrayList < > ( ) ; if ( resultOvfEntityData != null ) { ovfEntityDataList.add ( resultOvfEntityData ) ; } org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , storageDomainId ) ) . thenReturn ( ovfEntityDataList ) ; }
Source:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }

Target:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }
Source:
private void fillDiskMap ( org.ovirt.engine.core.common.businessentities.storage.LunDisk disk , org.ovirt.engine.core.common.businessentities.VM vm , int expectedMapSize ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.Disk > diskMap = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < expectedMapSize ; i ++ ) { diskMap.put ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , disk ) ; } vm.setDiskMap ( diskMap ) ; }

Target:
private void mockOtherVmDisks ( org.ovirt.engine.core.common.businessentities.VM vm , int numOfDisks , org.ovirt.engine.core.common.businessentities.storage.DiskInterface iface ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskVmElement > otherDisks = new java.util.ArrayList < > ( numOfDisks ) ; for ( int i = 0 ; i < numOfDisks ; i ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) ; dve.setDiskInterface ( iface ) ; otherDisks.add ( dve ) ; } org.mockito.Mockito.doReturn ( otherDisks ) . when ( diskVmElementDao ) . getAllForVm ( org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.vmId ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3SPM adapt ( org.ovirt.engine.api.model.Spm from ) { org.ovirt.engine.api.v3.types.V3SPM to = new org.ovirt.engine.api.v3.types.V3SPM ( ) ; if ( from.isSetPriority ( ) ) { to.setPriority ( from.getPriority ( ) ) ; } if ( from.isSetStatus ( ) ) { to.setStatus ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getStatus ( ) ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3SPM adapt ( org.ovirt.engine.api.model.Spm from ) { org.ovirt.engine.api.v3.types.V3SPM to = new org.ovirt.engine.api.v3.types.V3SPM ( ) ; if ( from.isSetPriority ( ) ) { to.setPriority ( from.getPriority ( ) ) ; } if ( from.isSetStatus ( ) ) { org.ovirt.engine.api.v3.types.V3Status status = new org.ovirt.engine.api.v3.types.V3Status ( ) ; status.setState ( from.getStatus ( ) . value ( ) ) ; to.setStatus ( status ) ; } return to ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }
Source:
public void onMouseDown ( com.google.gwt.event.dom.client.MouseDownEvent event ) { if ( ( event.getNativeButton ( ) ) == ( com.google.gwt.dom.client.NativeEvent.BUTTON_RIGHT ) ) { setFocus ( true ) ; selectAll ( ) ; } }

Target:
protected void addHandlers ( ) { super . addHandlers ( ) ; addFocusHandler ( new com.google.gwt.event.dom.client.FocusHandler ( ) { @ java.lang.Override public void onFocus ( com.google.gwt.event.dom.client.FocusEvent event ) { hasFocus = true ; } } ) ; addBlurHandler ( new com.google.gwt.event.dom.client.BlurHandler ( ) { @ java.lang.Override public void onBlur ( com.google.gwt.event.dom.client.BlurEvent event ) { hasFocus = false ; } } ) ; }
Source:
public void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void calculateNetworkImplementationDetailsUnmamagedNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.Network > emptyMap ( ) , iface ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNoNetworkName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setNetworkName ( null ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.Network > emptyMap ( ) , iface ) ) ; }
Source:
protected void executeQueryCommand ( ) { final java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getDomain ( ) ; final java.lang.String id = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.aaa.Directory directory = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getDirectory ( directoryName ) ; if ( directory == null ) { org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { final org.ovirt.engine.core.aaa.DirectoryGroup group = directory.findGroupById ( id ) ; org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; } }

Target:
protected void executeQueryCommand ( ) { final java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getDomain ( ) ; final java.lang.String id = org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.extensions.mgr.ExtensionProxy authz = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getAuthz ( directoryName ) ; if ( authz == null ) { org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; } else { final org.ovirt.engine.core.aaa.DirectoryGroup group = org.ovirt.engine.core.aaa.AuthzUtils.findGroupById ( authz , id ) ; org.ovirt.engine.core.bll.GetDirectoryGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; } }
Source:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority , org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy macPool ) { boolean returnValue = true ; if ( ( macPool.getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean verifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority , org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy macPool ) { boolean returnValue = true ; if ( ( macPool.getAvailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public void validateVmMemoryCanStartOnVdsHostTooSmallButLowOverhead ( ) { vds.setMemFree ( 8835L ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }

Target:
public void validateVmMemoryCanStartOnVdsHostTooSmallButLowOverhead ( ) { vds.setMemFree ( 8835L ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( VdcQueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }

Target:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.config.ConfigValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( VdcQueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; initVmDiskImage ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void setupExpectedVolume ( ) { expected = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; expected.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickEntity.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setServerId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setBrickDirectory ( "/tmp/b1" ) ; brickEntity.setStatus ( GlusterBrickStatus.DOWN ) ; bricks.add ( brickEntity ) ; expected.setBricks ( bricks ) ; }

Target:
private void setupExpectedVolume ( ) { expected = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; expected.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickEntity.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setServerId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setBrickDirectory ( "/tmp/b1" ) ; brickEntity.setStatus ( GlusterStatus.DOWN ) ; bricks.add ( brickEntity ) ; expected.setBricks ( bricks ) ; }
Source:
public boolean getLegal ( ) { boolean returnValue = true ; if ( getUseTimout ( ) ) { synchronized ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mLock ) { java.lang.String keyForCheck = getkeyForCheck ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase timeoutBase = org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.get ( keyForCheck ) ; if ( timeoutBase != null ) { if ( ( java.lang.System.currentTimeMillis ( ) ) < ( timeoutBase.getEndTime ( ) ) ) { returnValue = false ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.remove ( keyForCheck ) ; } } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBase.mHandler.put ( keyForCheck , this ) ; } } } return returnValue ; }

Target:
public boolean getLegal ( ) { if ( getUseTimout ( ) ) { java.lang.String keyForCheck = getkeyForCheck ( ) ; if ( ( org.ovirt.engine.core.utils.cache.CacheManager.getTimeoutBaseCache ( ) . putIfAbsent ( keyForCheck , this , this . getEndTime ( ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ) == null ) { return true ; } return false ; } return true ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmPoolType.class ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmPoolType.class ) ; } else if ( "ARCHITECTURE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }
Source:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( vdsDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ; }

Target:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( vdsDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) || ( ( ( vdsDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ) ; }
Source:
public void testSaveServerConnection ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > before = dao.getAll ( ) ; dao.save ( newServerConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > after = dao.getAll ( ) ; org.junit.Assert.assertEquals ( ( ( before.size ( ) ) + 1 ) , after.size ( ) ) ; }

Target:
public void testSaveServerConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = dao.get ( newServerConnection.getid ( ) ) ; org.junit.Assert.assertNull ( conn ) ; dao.save ( newServerConnection ) ; conn = dao.get ( newServerConnection.getid ( ) ) ; org.junit.Assert.assertEquals ( newServerConnection , conn ) ; }