auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private void incrementDbGenerationForRelatedEntities ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateId ( ) ) ; } else { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsForDisk = getVmsWithVmDeviceInfoForDiskId ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : vmsForDisk ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( pair.getFirst ( ) . getId ( ) ) ; } } }

Target:
private void incrementDbGenerationForRelatedEntities ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmStaticDao ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmTemplateId ( ) ) ; } else { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsForDisk = getVmsWithVmDeviceInfoForDiskId ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : vmsForDisk ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmStaticDao ( ) . incrementDbGeneration ( pair.getFirst ( ) . getId ( ) ) ; } } }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( ActionType.CopyImageGroup , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.ActionReturnValue vdcRetValue = runInternalActionWithTasksContext ( ActionType.CopyImageGroup , buildModeOrCopyImageGroupParameters ( containerID , disk ) ) ; getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return null ; }
Source:
private static org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo nextAsyncTaskCreationInfo ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo info = new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) ; info.setStepId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setStoragePoolID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setTaskID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setTaskType ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.class ) ) ; return info ; }

Target:
private static org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo nextAsyncTaskCreationInfo ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo info = new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) ; info.setStepId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setStoragePoolID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setVdsmTaskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setTaskType ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.class ) ) ; return info ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { addCustomValue ( "SessionID" , ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ? org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.UNKNOWN : sessionId ) ) ; addCustomValue ( "SourceIP" , ( org.apache.commons.lang.StringUtils.isEmpty ( sourceIp ) ? org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.UNKNOWN : sourceIp ) ) ; return org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_VDC_LOGIN : org.ovirt.engine.core.common.AuditLogType.USER_VDC_LOGIN_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { addCustomValue ( "SessionID" , ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ? org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.UNKNOWN : sessionId ) ) ; addCustomValue ( "SourceIP" , ( org.apache.commons.lang.StringUtils.isEmpty ( sourceIp ) ? org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.UNKNOWN : sourceIp ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.addCustomValue ( "LoginErrMsg" , "" ) ; return org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_VDC_LOGIN : org.ovirt.engine.core.common.AuditLogType.USER_VDC_LOGIN_FAILED ; }
Source:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDaoTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDaoTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDaoTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDaoTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }

Target:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDaoTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDaoTest.AD_ELEMENT_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.PermissionDaoTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.PermissionDaoTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }
Source:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }

Target:
protected boolean isQuotaDependant ( ) { boolean result ; if ( ( getActionType ( ) . getQuotaDependency ( ) ) == ( VdcActionType.QuotaDependency.NONE ) ) result = false ; else if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) result = true ; else if ( getActionType ( ) . isQuotaDependentAsInternalCommand ( ) ) result = true ; else result = false ; return result ; }
Source:
public void runFailedAutoStartVM ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void runFailedAutoStartVM ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_RESTART_FAILED ) ; } }
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 getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , remoteUserName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( userName , remoteGroupName , remoteVolumeName , partial ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network mockExternalNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.Network.class ) ; org.ovirt.engine.core.common.businessentities.network.ProviderNetwork providerNetwork = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.ProviderNetwork.class ) ; org.mockito.Mockito.when ( network.getProvidedBy ( ) ) . thenReturn ( providerNetwork ) ; org.mockito.Mockito.when ( externalNetwork.getProvidedBy ( ) ) . thenReturn ( providerNetwork ) ; return externalNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createExternalNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; org.ovirt.engine.core.common.businessentities.network.ProviderNetwork providerNetwork = createProviderNetwork ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; network.setProvidedBy ( providerNetwork ) ; externalNetwork.setProvidedBy ( providerNetwork ) ; return externalNetwork ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testLongName ( ) { vmStatic.setName ( "this_should_be_very_long_vm_name_so_it will_fail_can_do_action_validation" ) ; org.junit.Assert.assertFalse ( "canDoAction should fail for too long vm name." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; }
Source:
public void getNetworkConnectivityCheckTimeoutInSeconds ( 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 ( ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getNetworkConnectivityCheckTimeoutInSeconds ( 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 ( ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; boolean isVirtIOScsiEnabled = ( clusterVersion != null ) ? ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , clusterVersion.getValue ( ) ) ) ) : true ; if ( isVirtIOScsiEnabled ) { diskInterfaces.add ( DiskInterface.VirtIO_SCSI ) ; } return diskInterfaces ; }

Target:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( model.getGlobalClusterQuota ( ) . getEntity ( ) ) || ( ( model.getSpecificClusterQuota ( ) . getEntity ( ) ) && ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) ) ) { return constants.editCellQuota ( ) ; } return null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( model.getGlobalClusterQuota ( ) . getEntity ( ) ) || ( ( model.getSpecificClusterQuota ( ) . getEntity ( ) ) && ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.constants.editCellQuota ( ) ; } return null ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }

Target:
public void testSubResourceLocatorBadGuid ( ) { verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.getCdromResource ( "foo" ) ) ) ; }
Source:
public void testVmDiskWithPassDiscardAndWadExistsFails ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.vmDiskWithPassDiscardAndWadExists ( storageDomainDisks , storageDomainVmDisks ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionAvailability ( ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getSuffixCauseToClonedNameCollisionMessage ( ( ( java.lang.String ) ( value ) ) ) ) ; } return result ; }
Source:
private void logMessage ( org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String logMessage ) { switch ( severity ) { case NORMAL : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( logMessage ) ; break ; case ERROR : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( logMessage ) ; break ; case ALERT : case WARNING : default : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( logMessage ) ; break ; } }

Target:
private void logMessage ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String logMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageToLog ( auditLog ) ; switch ( auditLog.getSeverity ( ) ) { case NORMAL : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( logMessage ) ; break ; case ERROR : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( logMessage ) ; break ; case ALERT : case WARNING : default : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( logMessage ) ; break ; } }
Source:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > getFullList ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map < java.lang.String , java.lang.Object > ... deviceInfos ) { java.util.Map < java.lang.String , java.lang.Object > vmInfo = new java.util.HashMap < > ( ) ; vmInfo.put ( "vmId" , vmId.toString ( ) ) ; vmInfo.put ( "devices" , deviceInfos ) ; return vmInfo ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > getDumpXmls ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map < java.lang.String , java.lang.Object > ... deviceInfos ) { java.util.Map < java.lang.String , java.lang.Object > vmInfo = new java.util.HashMap < > ( ) ; vmInfo.put ( "vmId" , vmId.toString ( ) ) ; vmInfo.put ( "devices" , deviceInfos ) ; return vmInfo ; }
Source:
public void validateIsoPrefixForOnlyIsoPrefixInKernelAndInitrd ( ) throws java.lang.Exception { java.lang.String initrd = org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ; java.lang.String kernelUrl = org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelUrl ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , "" ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , "" ) ; }

Target:
public void validateIsoPrefixForOnlyIsoPrefixInKernelAndInitrd ( ) throws java.lang.Exception { java.lang.String initrd = RunVmCommand.ISO_PREFIX ; java.lang.String kernelUrl = RunVmCommand.ISO_PREFIX ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelUrl ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , "" ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , "" ) ; }
Source:
protected R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; performAction ( update , updateProvider.getParameters ( incoming , entity ) ) ; return addLinks ( populate ( map ( getEntity ( entityResolver , false ) ) , entity ) ) ; }

Target:
protected < T > Q doUpdate ( R incoming , Q entity , org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { performAction ( update , updateProvider.getParameters ( incoming , entity ) ) ; entity = getEntity ( entityResolver , false ) ; return entity ; }
Source:
private void doTestBadAddBookmark ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.bookmark_name" , "Bookmark.bookmark_value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddBookmark ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void verifyIps ( org.ovirt.engine.api.model.ReportedDevice device ) { java.util.List < org.ovirt.engine.api.model.Ip > ips = device.getIps ( ) . getIps ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }

Target:
private void verifyIps ( org.ovirt.engine.api.model.ReportedDevice device ) { java.util.List < org.ovirt.engine.api.model.Ip > ips = device.getIps ( ) . getIps ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }
Source:
public boolean isTagDescestorOfTag ( org.ovirt.engine.core.compat.Guid sourceTagId , org.ovirt.engine.core.compat.Guid potentialDescestorId ) { if ( sourceTagId.equals ( potentialDescestorId ) ) { return true ; } org.ovirt.engine.core.common.businessentities.Tags tag = GetTagById ( sourceTagId ) ; if ( ( tag != null ) && ( ( tag.getChildren ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.Tags childTag : tag.getChildren ( ) ) { if ( isTagDescestorOfTag ( childTag.gettag_id ( ) , potentialDescestorId ) ) { return true ; } } } return false ; }

Target:
public boolean isTagDescestorOfTag ( org.ovirt.engine.core.compat.Guid sourceTagId , org.ovirt.engine.core.compat.Guid potentialDescestorId ) { if ( sourceTagId.equals ( potentialDescestorId ) ) { return true ; } org.ovirt.engine.core.common.businessentities.Tags tag = getTagById ( sourceTagId ) ; if ( ( tag != null ) && ( ( tag.getChildren ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.Tags childTag : tag.getChildren ( ) ) { if ( isTagDescestorOfTag ( childTag.gettag_id ( ) , potentialDescestorId ) ) { return true ; } } } return false ; }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( 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.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return CreateTask ( internalGetTaskType ( ) , p ) ; }

Target:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( 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.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }
Source:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > sdl ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains a : sdl ) { if ( ( ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getstatus ( ) ) != null ) ) && ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }

Target:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isData = ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }
Source:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VmInterfaceType getDefaultNicType ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > items ) { if ( ( items == null ) || ( items.isEmpty ( ) ) ) { return null ; } else if ( items.contains ( VmInterfaceType.pv ) ) { return org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.pv ; } else { return items.iterator ( ) . next ( ) ; } }
Source:
protected void perform ( ) { switch ( getFlow ( ) ) { case RESUME_PAUSE : resumeVm ( ) ; break ; case REMOVE_STATELESS_IMAGES : removeVmStatlessImages ( ) ; break ; case CREATE_STATELESS_IMAGES : createVmStatelessImages ( ) ; break ; case RESUME_HIBERNATE : case RUN : default : runVm ( ) ; } }

Target:
protected void perform ( ) { switch ( getFlow ( ) ) { case RESUME_PAUSE : resumeVm ( ) ; break ; case REMOVE_STATELESS_IMAGES : removeStatlessSnapshot ( ) ; break ; case CREATE_STATELESS_IMAGES : createStatelessSnapshot ( ) ; break ; case RESUME_HIBERNATE : case RUN : default : runVm ( ) ; } }
Source:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getBackend ( ) . runAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( ( ( getSourceVmFromDb ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( getSourceVmFromDb ( ) . isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( ( ( getSourceVmFromDb ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( getSourceVmFromDb ( ) . isDown ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return super . canDoAction ( ) ; }
Source:
private static java.lang.String AssignStringValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { if ( input.containsKey ( name ) ) { return ( ( java.lang.String ) ( ( input.get ( name ) ) instanceof java.lang.String ? input.get ( name ) : null ) ) ; } return null ; }

Target:
private static java.lang.String assignStringValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { if ( input.containsKey ( name ) ) { return ( ( java.lang.String ) ( ( input.get ( name ) ) instanceof java.lang.String ? input.get ( name ) : null ) ) ; } return null ; }
Source:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }

Target:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . teardown ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; assertEquals ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.api.restapi.resource.DOMAIN.getBytes ( ) , true ) . toString ( ) , model.getDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; assertEquals ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.api.restapi.resource.DOMAIN.getBytes ( ) , true ) . toString ( ) , model.getDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , getDeletedProvider ( ) ) ; return ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ) && ( validateRemoveProvider ( ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , getDeletedProvider ( ) ) ; return ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ) && ( validateRemoveProvider ( ) ) ; }
Source:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getit_guid ( ) ) ) ; } } }

Target:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getImageTemplateId ( ) ) ) ; } } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; super . testUpdate ( ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }
Source:
private void initInfoIcon ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { consoleAddressInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.enableConsoleAddressOverrideHelpMessage ( ) ) , resources ) ; providerSearchInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.providerSearchInfo ( ) ) , resources ) ; }

Target:
private void initInfoIcon ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { consoleAddressInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.enableConsoleAddressOverrideHelpMessage ( ) ) , resources ) ; providerSearchInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.providerSearchInfo ( ) ) , resources ) ; provisionedHostInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.provisionedHostInfo ( ) ) , resources ) ; discoveredHostInfoIcon = new org.ovirt.engine.ui.common.widget.dialog.InfoIcon ( applicationTemplates.italicText ( constants.discoveredHostInfoIcon ( ) ) , resources ) ; }
Source:
private void debugQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase parameters ) { if ( org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.isDebugEnabled ( ) ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "Query type: " ) ; builder.append ( queryType ) ; builder.append ( ", Parameters: " ) ; builder.append ( parameters ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( builder.toString ( ) ) ; } }

Target:
private void debugAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Action type '{}', Parameters '{}'" , actionType , params ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.RepoImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.RepoImage entity = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; entity.setRepoDomainId ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.ImageFileType.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.RepoImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.RepoImage entity = new org.ovirt.engine.core.common.businessentities.storage.RepoImage ( ) ; entity.setRepoDomainId ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }
Source:
public void testSubscribe ( ) { dao.subscribe ( newSubscription ) ; java.util.List < org.ovirt.engine.core.common.businessentities.event_subscriber > result = dao.getAllForSubscriber ( newSubscription.getsubscriber_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.event_subscriber subscription : result ) { org.junit.Assert.assertEquals ( newSubscriber , subscription.getsubscriber_id ( ) ) ; } }

Target:
public void testSubscribe ( ) { dao.subscribe ( newSubscription ) ; java.util.List < org.ovirt.engine.core.common.businessentities.EventSubscriber > result = dao.getAllForSubscriber ( newSubscription.getSubscriberId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscription : result ) { org.junit.Assert.assertEquals ( newSubscriber , subscription.getSubscriberId ( ) ) ; } }
Source:
private void handleNonResponsiveHosts ( java.util.List < java.lang.String > hostNotRespondingList ) { if ( ! ( hostNotRespondingList.isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_VDS_IS_NOT_RESPONDING_WITH_VMS ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostNotResponding %1$s" , org.apache.commons.lang.StringUtils.join ( hostNotRespondingList , "," ) ) ) ; } }

Target:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addValidationMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }