auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( HasEntity.entityChangedEventDefinition ) ) { if ( ( ( sender == ( getImageSourceLocalEnabled ( ) ) ) || ( sender == ( getImagePath ( ) ) ) ) || ( sender == ( getImageUri ( ) ) ) ) { recalculateImageDerivedFields ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) { if ( ( sender == ( getDiskModel ( ) . getStorageDomain ( ) ) ) || ( sender == ( getDiskModel ( ) . getVolumeType ( ) ) ) ) { updateVolumeType ( ) ; } } }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageServerConnectionRefIdAlreadyInUse : case StorageServerConnectionRefIdDoesNotExist : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( java.lang.String.format ( "Failed in vdscommand %1$s, error = %2$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getCommandName ( ) , getReturnStatus ( ) . mMessage ) ) ; initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageServerConnectionRefIdAlreadyInUse : case StorageServerConnectionRefIdDoesNotExist : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( java.lang.String.format ( "Failed in vdscommand %1$s, error = %2$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getCommandName ( ) , getReturnStatus ( ) . message ) ) ; initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; break ; } }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.appendHtmlConstant ( "<div style='display:block'>" ) ; sb.append ( value ) ; sb.appendHtmlConstant ( "</div>" ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.appendHtmlConstant ( ( ( "<div id=\"" + id ) + "\" style=\'display:block\'>" ) ) ; sb.append ( value ) ; sb.appendHtmlConstant ( "</div>" ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult requiredValuesPresent ( ) { if ( ( missingCategoryValues ( getQos ( ) . getMaxThroughput ( ) , getQos ( ) . getMaxReadThroughput ( ) , getQos ( ) . getMaxWriteThroughput ( ) ) ) || ( missingCategoryValues ( getQos ( ) . getMaxIops ( ) , getQos ( ) . getMaxReadIops ( ) , getQos ( ) . getMaxWriteIops ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_QOS_ILLEGAL_VALUES ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult requiredValuesPresent ( ) { if ( ( missingCategoryValues ( getQos ( ) . getMaxThroughput ( ) , getQos ( ) . getMaxReadThroughput ( ) , getQos ( ) . getMaxWriteThroughput ( ) ) ) || ( missingCategoryValues ( getQos ( ) . getMaxIops ( ) , getQos ( ) . getMaxReadIops ( ) , getQos ( ) . getMaxWriteIops ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_QOS_ILLEGAL_VALUES ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }

Target:
public java.lang.String generateJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , org.apache.commons.lang.StringUtils.defaultString ( disk.getDiskDescription ( ) ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( generateJsonDiskDescription ( description , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DESCRIPTION_FIELDS_PRIORITY ) , false ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getSelectionModel ( topTableIsEdited ) . clear ( ) ; }

Target:
private void edit ( org.ovirt.engine.ui.uicommonweb.models.ListModel model , final boolean topTableIsEdited ) { org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > table = getTable ( topTableIsEdited ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel oldModel = table.asEditor ( ) . flush ( ) ; org.ovirt.engine.ui.uicompat.IEventListener listener = ( topTableIsEdited ) ? topItemsChangedListener : bottomItemsChangedListener ; if ( oldModel != null ) { oldModel.getItemsChangedEvent ( ) . removeListener ( listener ) ; } model.getItemsChangedEvent ( ) . addListener ( listener ) ; table.asEditor ( ) . edit ( model ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; }
Source:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { setGraphicsAndVideoDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }

Target:
protected void loadTemplateData ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( template ) ; if ( ( ( template.getInterfaces ( ) ) == null ) || ( template.getInterfaces ( ) . isEmpty ( ) ) ) { template.setInterfaces ( getVmNetworkInterfaceDao ( ) . getAllForTemplate ( template.getId ( ) ) ) ; } }
Source:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; if ( org.ovirt.engine.api.common.util.QueryHelper.hasConstraint ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.getUriInfo ( ) , QueryHelper.CONSTRAINT_PARAMETER ) ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return ( ( java.util.List < Q > ) ( org.apache.commons.collections.CollectionUtils.intersection ( filteredList , searchList ) ) ) ; } else { return filteredList ; } }

Target:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return ( ( java.util.List < Q > ) ( org.apache.commons.collections.CollectionUtils.intersection ( filteredList , searchList ) ) ) ; } else { return filteredList ; } }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetGlusterHookById , org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters.class , new java.lang.String [ ] { "HookId" , "IncludeServerHooks" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId , true } , ( notFound ? null : getEntity ( 0 ) ) ) ; if ( ! notFound ) { setUpEntityQueryExpectations ( VdcQueryType.GetGlusterHookContent , org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters.class , new java.lang.String [ ] { "GlusterHookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT ) ; } } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetGlusterHookById , org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters.class , new java.lang.String [ ] { "HookId" , "IncludeServerHooks" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId , true } , ( notFound ? null : getEntity ( 0 ) ) ) ; if ( ! notFound ) { setUpEntityQueryExpectations ( QueryType.GetGlusterHookContent , org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters.class , new java.lang.String [ ] { "GlusterHookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT ) ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.InstanceType getInstanceType ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VmTemplate result = get ( id ) ; if ( ( result != null ) && ( ( result.getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { result = null ; } return result ; }

Target:
public org.ovirt.engine.core.common.businessentities.InstanceType getInstanceType ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.ovirt.engine.core.common.businessentities.VmTemplate result = get ( id , userID , isFiltered ) ; if ( ( result != null ) && ( ( result.getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { result = null ; } return result ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; iface.setQos ( ifaceQos ) ; iface.setReportedSwitchType ( SwitchType.LEGACY ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; testedNetworkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; testedNetworkAttachment.setIpConfiguration ( new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setRequiredSwitchTypeForCluster ( SwitchType.LEGACY ) ; }
Source:
protected void executeCommand ( ) { getQuotaDao ( ) . remove ( getParameters ( ) . getId ( ) ) ; getQuotaManager ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { quotaDao.remove ( getParameters ( ) . getId ( ) ) ; getQuotaManager ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
private void initCommandExecutor ( ) { if ( ! ( cmdExecutorInitialized ) ) { synchronized ( LOCK ) { if ( ! ( cmdExecutorInitialized ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : coco.getCommandsWithCallBackEnabled ( ) ) { if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; cmdCallBackMap.put ( cmdEntity.getId ( ) , cmd.getCallBack ( ) ) ; } } cmdExecutorInitialized = true ; } } } }

Target:
public void addToCallBackMap ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( cmdCallBackMap.containsKey ( cmdEntity.getId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandBase < ? > cmd = coco.retrieveCommand ( cmdEntity.getId ( ) ) ; if ( ( cmd != null ) && ( ( cmd.getCallBack ( ) ) != null ) ) { cmdCallBackMap.put ( cmdEntity.getId ( ) , cmd.getCallBack ( ) ) ; } } }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) ) . addV2VJobForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { if ( ( cachedCallback ) == null ) { cachedCallback = new org.ovirt.engine.core.bll.ConvertVmCallback ( org.ovirt.engine.core.bll.ConvertVmCommand.getCommandId ( ) ) ; if ( ( getCommandExecutionStatus ( ) ) == ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.UNKNOWN ) ; } } return cachedCallback ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( array [ 0 ] ) ) ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.UpdataMaxVmsInPool ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( array [ 0 ] ) ) ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; }
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommand.getVmStaticDAO ( ) . get ( getVm ( ) . getId ( ) ) ; if ( duplicateVm != null ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; } return true ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.Matchers.any ( ) ) ; }

Target:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.CreationStatus getAsynchronousStatus ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType pollingType ) { org.ovirt.engine.api.model.CreationStatus asyncStatus = null ; if ( pollingType == ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType.JOB ) ) { asyncStatus = getJobIdStatus ( result ) ; } else if ( pollingType == ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType.VDSM_TASKS ) ) { asyncStatus = getVdsmTasksStatus ( result ) ; } else { throw new java.lang.IllegalStateException ( "Unexpected Polling Status" ) ; } return asyncStatus ; }

Target:
protected org.ovirt.engine.api.model.CreationStatus getAsynchronousStatus ( org.ovirt.engine.core.common.action.ActionReturnValue result , org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType pollingType ) { org.ovirt.engine.api.model.CreationStatus asyncStatus = null ; if ( pollingType == ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType.JOB ) ) { asyncStatus = getJobIdStatus ( result ) ; } else if ( pollingType == ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.PollingType.VDSM_TASKS ) ) { asyncStatus = getVdsmTasksStatus ( result ) ; } else { throw new java.lang.IllegalStateException ( "Unexpected Polling Status" ) ; } return asyncStatus ; }
Source:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < org.ovirt.engine.api.model.StorageDomain > ( ) ; org.ovirt.engine.api.model.StorageDomain sd = new org.ovirt.engine.api.model.StorageDomain ( ) ; sd.setstorage_name ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }

Target:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < org.ovirt.engine.api.model.StorageDomain > ( ) ; org.ovirt.engine.api.model.StorageDomain sd = new org.ovirt.engine.api.model.StorageDomain ( ) ; sd.setStorageName ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }
Source:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.entityChangedEventDefinition ) ) { onEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.Definition ) ) { entityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.entityChangedEventDefinition ) ) { onEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.definition ) ) { entityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }
Source:
public static org.ovirt.engine.core.bll.context.CommandContext createInternalJobContext ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; executionContext.setJobRequired ( true ) ; executionContext.setMonitored ( true ) ; return new org.ovirt.engine.core.bll.context.CommandContext ( new org.ovirt.engine.core.bll.context.EngineContext ( ) ) . withExecutionContext ( executionContext ) . withLock ( lock ) . withoutCompensationContext ( ) ; }

Target:
public static org.ovirt.engine.core.bll.context.CommandContext createInternalJobContext ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { return org.ovirt.engine.core.bll.job.ExecutionHandler.modifyContextForIntenralJob ( new org.ovirt.engine.core.bll.context.CommandContext ( new org.ovirt.engine.core.bll.context.EngineContext ( ) ) , lock ) ; }
Source:
public static void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveBookmark , org.ovirt.engine.core.common.action.BookmarksParametersBase.class , new java.lang.String [ ] { "BookmarkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveBookmark , org.ovirt.engine.core.common.action.BookmarksParametersBase.class , new java.lang.String [ ] { "BookmarkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private java.lang.String getBaseDNForDomain ( java.lang.String domainName ) { if ( domainName == null ) { return null ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.Domain domain = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.UsersDomainsCacheManagerService.getInstance ( ) . getDomain ( domainName ) ; if ( domain == null ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LDAPTemplateWrapper.log.errorFormat ( "The domain {0} does not exist in the configuration. A base DN cannot be configured for it" , domainName ) ; return null ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.RootDSE rootDSE = domain.getRootDSE ( ) ; if ( rootDSE != null ) { return rootDSE.getDefaultNamingContext ( ) ; } return null ; }

Target:
private java.lang.String getBaseDNForDomain ( ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.RootDSE rootDSE = ( ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.RootDSE ) ( configuration.get ( "config.rootDSE" ) ) ) ; if ( rootDSE != null ) { return rootDSE.getDefaultNamingContext ( ) ; } return null ; }
Source:
public void testGetHostDevicesByHostIdAndIommuGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > hostDevices = dao.getHostDevicesByHostIdAndIommuGroup ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.TOTAL_DEVICES_IN_GROUP , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , hostDevice.getHostId ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) , hostDevice.getIommuGroup ( ) ) ; } }

Target:
public void saveNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice netDevice = generateNewEntity ( ) ; netDevice.setCapability ( "net" ) ; netDevice.setNetworkInterfaceName ( "eth1" ) ; dao.save ( netDevice ) ; org.ovirt.engine.core.common.businessentities.HostDevice result = dao.get ( netDevice.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( netDevice , result ) ; }
Source:
public 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 getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.lang.Iterable value , java.lang.Object selectedItem ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( selectedItem ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > createHANotRunningAndUknown ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm > pair = pairOf ( createDbVm ( ) , null ) ; pair.getFirst ( ) . setAutoStartup ( true ) ; pair.getFirst ( ) . setStatus ( VMStatus.Unknown ) ; return pair ; }

Target:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > createHANotRunningAndUknown ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = pairOf ( createDbVm ( ) , null ) ; pair.getFirst ( ) . setAutoStartup ( true ) ; pair.getFirst ( ) . setStatus ( VMStatus.Unknown ) ; return pair ; }
Source:
private boolean registerLibvirtSecrets ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getDbFacade ( ) . getLibvirtSecretDao ( ) . getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } return true ; }

Target:
private boolean registerLibvirtSecrets ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.cinderProviderSupported ( getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getDbFacade ( ) . getLibvirtSecretDao ( ) . getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } } return true ; }
Source:
public void testGetLocaleFromStringString_withDefault ( ) { org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be jp" , java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" , true ) ) ; }

Target:
public void testGetLocaleFromStringStringWithDefault ( ) { org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be jp" , java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" , true ) ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void versionDecreaseWithHost ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; VdsExist ( ) ; canDoActionFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION ) ; }
Source:
public void validateSucceedsInitFormatDataDomain ( ) { sd.setStorageFormat ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.junit.Assert.assertEquals ( "Format not initialized correctly" , StorageFormatType.V3 , sd.getStorageFormat ( ) ) ; }

Target:
public void validateSucceedsInitFormatDataDomain ( ) { sd.setStorageFormat ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.ovirt.engine.core.common.businessentities.StorageFormatType targetStorageFormatType = org.ovirt.engine.core.common.businessentities.StorageFormatType.values ( ) [ ( ( org.ovirt.engine.core.common.businessentities.StorageFormatType.values ( ) . length ) - 1 ) ] ; org.junit.Assert.assertEquals ( "Format not initialized correctly" , targetStorageFormatType , sd.getStorageFormat ( ) ) ; }
Source:
public void canDoActionFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void hostProviderExists ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ) ; org.junit.Assert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostProviderExists ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ) ; org.junit.Assert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void createTables ( org.ovirt.engine.ui.uicommonweb.models.storage.RegisterEntityModel < E > model ) { createEntityTable ( model ) ; createInfoPanel ( model ) ; entityTable.asEditor ( ) . edit ( model.getEntities ( ) ) ; model.getEntities ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( model.getEntities ( ) . getItems ( ) ) ) ; }

Target:
private void createTables ( M model ) { createEntityTable ( model ) ; createInfoPanel ( model ) ; entityTable.asEditor ( ) . edit ( model.getEntities ( ) ) ; model.getEntities ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( model.getEntities ( ) . getItems ( ) ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { if ( ( object.getLastAlignmentScan ( ) ) != null ) { java.lang.String lastScanDate = com.google.gwt.i18n.client.DateTimeFormat.getFormat ( "yyyy-MM-dd, HH:mm" ) . format ( object.getLastAlignmentScan ( ) ) ; setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.messages.lastDiskAlignment ( lastScanDate ) ) ; } else { setTitle ( null ) ; } return object.getAlignment ( ) . toString ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getLastAlignmentScan ( ) ) != null ) { java.lang.String lastScanDate = com.google.gwt.i18n.client.DateTimeFormat.getFormat ( "yyyy-MM-dd, HH:mm" ) . format ( object.getLastAlignmentScan ( ) ) ; setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.messages.lastDiskAlignment ( lastScanDate ) ) ; } else { setTitle ( null ) ; } return object.getAlignment ( ) . toString ( ) ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.image_storage_domain_map entry = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.image_storage_domain_map > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( ( ( entries.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.image_storage_domain_map entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.image_storage_domain_map entry = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.image_storage_domain_map > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( ( ( entries.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.image_storage_domain_map entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }