auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canDoActionFailsOnCompat ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.StartRebalanceGlusterVolumeCommandTest.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void validateFailsOnCompat ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.StartRebalanceGlusterVolumeCommandTest.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.NGuid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getvds_group_id ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.NGuid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getVdsGroupId ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
public java.util.Map shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { final org.ovirt.vdsmfake.domain.VM vm = getActiveHost ( ) . getRunningVMs ( ) . get ( vmId ) ; if ( vm != null ) { vm.setStatus ( VM.VMStatus.PoweringDown ) ; } org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( org.ovirt.vdsmfake.task.TaskType.SHUTDOWN_VM , 5000L , vm ) ) ; return ResultCodes.MACHINE_SHUTDOWN.map ( ) ; }

Target:
public java.util.Map shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { final java.util.Map resultMap = getStatusMap ( "Machine shut down" , 0 ) ; final org.ovirt.vdsmfake.domain.VM vm = getActiveHost ( ) . getRunningVMs ( ) . get ( vmId ) ; if ( vm != null ) { vm.setStatus ( VM.VMStatus.PoweringDown ) ; } org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( org.ovirt.vdsmfake.task.TaskType.SHUTDOWN_VM , 5000L , vm ) ) ; return resultMap ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.ProviderType type1 , org.ovirt.engine.core.common.businessentities.ProviderType type2 ) { return org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.comp ( org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( type1 ) , org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( type2 ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getBroker ( ) . getOvaInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getParameters ( ) . getPath ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = vmListReturn.vmList [ 0 ] ; map.put ( VdsProperties.vm_guid , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; map.put ( VdsProperties.vm_arch , ArchitectureType.x86_64.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( map ) ; setReturnValue ( vm ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { vmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getBroker ( ) . getExternalVmFromOva ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.getParameters ( ) . getPath ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetOvaInfoVDSCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = vmListReturn.vmList [ 0 ] ; map.put ( VdsProperties.vm_guid , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; map.put ( VdsProperties.vm_arch , ArchitectureType.x86_64.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmsDataFromExternalProvider ( map ) ; setReturnValue ( vm ) ; }
Source:
public void equalPctThreshold ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 5 ; settings.diskSpaceUsed = 5 ; settings.spaceThresholdGB = 1 ; settings.spaceThresholdPct = 50 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isBelowThresholds ( domain ) ) ; }

Target:
public void equalPctThreshold ( ) { org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings = new org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings ( ) ; settings.diskSpaceFree = 5 ; settings.diskSpaceUsed = 5 ; settings.spaceThresholdGB = 1 ; settings.spaceThresholdPct = 50 ; org.ovirt.engine.core.common.businessentities.storage_domains domain = setupForSpaceTest ( settings ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.isWithinThresholds ( domain ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id|name" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( VdcActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id|name" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( ActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private void _validateDigest ( java.security.MessageDigest digest , java.lang.String actual ) throws java.io.IOException { try { if ( ! ( java.util.Arrays.equals ( digest.digest ( ) , org.apache.commons.codec.binary.Hex.decodeHex ( actual.toCharArray ( ) ) ) ) ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } } catch ( org.apache.commons.codec.DecoderException e ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } }

Target:
private void validateDigest ( java.security.MessageDigest digest , java.lang.String actual ) throws java.io.IOException { try { if ( ! ( java.util.Arrays.equals ( digest.digest ( ) , org.apache.commons.codec.binary.Hex.decodeHex ( actual.toCharArray ( ) ) ) ) ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } } catch ( org.apache.commons.codec.DecoderException e ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } }
Source:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getContext ( ) . withCompensationContext ( null ) ) ; } }

Target:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.info ( "Deleting snapshots for stateless vm '{}'" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getContext ( ) . withCompensationContext ( null ) ) ; } }
Source:
public javax.ws.rs.core.Response move ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( getDisk ( ) . getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveDisksParameters params = new org.ovirt.engine.core.common.action.MoveDisksParameters ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.action.MoveDiskParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId ) ) ) ; return doAction ( VdcActionType.MoveDisks , params , action ) ; }

Target:
public javax.ws.rs.core.Response move ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = getDisk ( ) ; org.ovirt.engine.core.compat.Guid sourceStorageDomainId = getSourceStorageDomainId ( disk ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveDisksParameters params = new org.ovirt.engine.core.common.action.MoveDisksParameters ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.action.MoveDiskParameters ( imageId , sourceStorageDomainId , storageDomainId ) ) ) ; return doAction ( VdcActionType.MoveDisks , params , action ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } oldMacPool = macPoolDao.get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }
Source:
private void refreshAllVdssInPool ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vdsIdsToSetNonOperational = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; runSynchronizeOperation ( new org.ovirt.engine.core.bll.storage.RefreshPoolSingleAsyncOperationFactory ( ) , vdsIdsToSetNonOperational ) ; for ( org.ovirt.engine.core.compat.Guid vdsId : vdsIdsToSetNonOperational ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE ) ; tempVar.setStorageDomainId ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; tempVar.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }

Target:
private boolean storageDomainStatusIsValid ( ) { boolean returnValue ; if ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.isInternalExecution ( ) ) { returnValue = checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , StorageDomainStatus.Maintenance , StorageDomainStatus.PreparingForMaintenance ) ; } else { returnValue = checkStorageDomainStatus ( StorageDomainStatus.Inactive , StorageDomainStatus.Unknown , StorageDomainStatus.Maintenance , StorageDomainStatus.PreparingForMaintenance ) ; } return returnValue ; }
Source:
protected void handleAutoLogin ( org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData ) { final org.ovirt.engine.core.common.businessentities.DbUser loggedUser = autoLoginData.getDbUser ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { lockInteractionManager.showLoadingIndicator ( ) ; getLoginModel ( ) . autoLogin ( loggedUser ) ; } } ) ; user.setAutoLogin ( true ) ; }

Target:
protected void handleAutoLogin ( org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData ) { final org.ovirt.engine.core.common.businessentities.DbUser loggedUser = autoLoginData.getDbUser ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { lockInteractionManager.showLoadingIndicator ( ) ; getLoginModel ( ) . autoLogin ( loggedUser ) ; } } ) ; org.ovirt.engine.ui.frontend.communication.SSOTokenChangeEvent.fire ( eventBus , org.ovirt.engine.ui.common.auth.SSOTokenData.instance ( ) . getToken ( ) ) ; user.setAutoLogin ( true ) ; }
Source:
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.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "provisionedSize|size" , "format" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "provisionedSize|size" , "format" ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > Get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }
Source:
private static void assertVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VM newVm , long expectedDbGeneration ) { org.junit.Assert.assertEquals ( "imported vm is different than expected" , vm , newVm ) ; org.junit.Assert.assertEquals ( "imported db generation is different than expected" , expectedDbGeneration , newVm.getDbGeneration ( ) ) ; org.junit.Assert.assertEquals ( vm.getStaticData ( ) , newVm.getStaticData ( ) ) ; }

Target:
private static void assertVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VM newVm , long expectedDbGeneration ) { org.junit.Assert.assertEquals ( "imported vm is different than expected" , vm , newVm ) ; org.junit.Assert.assertEquals ( "imported db generation is different than expected" , expectedDbGeneration , newVm.getDbGeneration ( ) ) ; newVm.getStaticData ( ) . setSmallIconId ( vm.getStaticData ( ) . getSmallIconId ( ) ) ; newVm.getStaticData ( ) . setLargeIconId ( vm.getStaticData ( ) . getLargeIconId ( ) ) ; org.junit.Assert.assertEquals ( vm.getStaticData ( ) , newVm.getStaticData ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.StorageType getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return null ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; return disk.getStorageTypes ( ) . isEmpty ( ) ? null : disk.getStorageTypes ( ) . get ( 0 ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.StorageType getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( ( object.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) && ( ( object.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ) { return null ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; return disk.getStorageTypes ( ) . isEmpty ( ) ? null : disk.getStorageTypes ( ) . get ( 0 ) ; }
Source:
protected void executeQueryCommand ( ) { setReturnValue ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { setReturnValue ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getDbFacade ( ) . getDiskDao ( ) . getAllAttachableDisksByPoolId ( org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetAllAttachableDisksForVmQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { newModel.getName ( ) . setEntity ( getName ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( defaultProfile.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; defaultProfile.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }
Source:
private void massNetworksUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < org.ovirt.engine.core.compat.Guid > networks ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( networks.size ( ) ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networks ) { executions.add ( createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertvfsConfigNetwork" , executions ) ; }

Target:
private void massNetworksUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < org.ovirt.engine.core.compat.Guid > networks ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( networks.size ( ) ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networks ) { executions.add ( createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertVfsConfigNetwork" , executions ) ; }
Source:
private void setUpGetVirtioScsiExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVirtioScsiControllers , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
private void setUpGetCertuficateExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }
Source:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( vmNetwork1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Collections.singletonList ( networkAttachment ) ; expectedException.expect ( java.lang.IllegalArgumentException.class ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap ) . validateNetworkExclusiveOnNics ( ) ; }

Target:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Collections.singletonList ( networkAttachment ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap , networkExclusivenessValidator ) . validateNetworkExclusiveOnNics ( ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.AddVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getTaskIdList ( ) . size ( ) ) > 0 ? org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_STARTED : org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_ADD_VM ; case END_SUCCESS : return org.ovirt.engine.core.bll.AddVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_SUCCESS : org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_FAILURE ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.AddVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . size ( ) ) > 0 ? org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_STARTED : org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_ADD_VM ; case END_SUCCESS : return org.ovirt.engine.core.bll.AddVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_SUCCESS : org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_FAILURE ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_VM_FINISHED_FAILURE ; } }
Source:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.UpdateProviderCommand.getProviderDao ( ) . update ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onModification ( ) ; } org.ovirt.engine.core.bll.provider.UpdateProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { providerDao.update ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onModification ( ) ; } org.ovirt.engine.core.bll.provider.UpdateProviderCommand.setSucceeded ( true ) ; }
Source:
public void newNetwork ( ) { }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ( network , this ) ; setWindow ( networkModel ) ; initDcList ( networkModel ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getView ( ) . getCloseButton ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . hide ( ) ; } } ) ) ; }

Target:
public void onKeyPress ( com.google.gwt.dom.client.NativeEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) == ( event.getKeyCode ( ) ) ) { getView ( ) . hide ( ) ; unbind ( ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; if ( ( ( result.getReturnValue ( ) ) != null ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancelConfirm ( ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster != null ) { maintenance ( cluster.isMaintenanceReasonRequired ( ) , cluster.supportsGlusterService ( ) ) ; } }
Source:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED , java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { return failCanDoAction ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } } return true ; }

Target:
protected boolean isImageNotLocked ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getImage ( ) ; if ( ( diskImage.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { if ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Move ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED , java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; } else { return failValidation ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } } return true ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHashName ( "create_snapshot" ) ; model.setCancelCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , cancelCommandTarget ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; return model ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHelpTag ( HelpTag.create_snapshot ) ; model.setHashName ( "create_snapshot" ) ; model.setCancelCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , cancelCommandTarget ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; return model ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc glusterServicesList ( java.lang.String [ ] serviceNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesGet ( serviceNames ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc ( 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.gluster.GlusterServicesReturnForXmlRpc glusterServicesList ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String [ ] serviceNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesGet ( serviceNames ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc ( serverId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testNoIsoDomain ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_CD_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO ) ; }

Target:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.compat.Guid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static < E extends org.ovirt.engine.core.common.businessentities.network.NetworkInterface < ? > > java.util.Map < java.lang.String , E > interfacesByNetworkName ( java.util.List < E > entityList ) { if ( entityList != null ) { java.util.Map < java.lang.String , E > map = new java.util.HashMap < java.lang.String , E > ( ) ; for ( E e : entityList ) { map.put ( e.getNetworkName ( ) , e ) ; } return map ; } else { return java.util.Collections.emptyMap ( ) ; } }

Target:
public static < E extends org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > java.util.Map < java.lang.String , E > vmInterfacesByNetworkName ( java.util.List < E > entityList ) { if ( entityList != null ) { java.util.Map < java.lang.String , E > map = new java.util.HashMap < java.lang.String , E > ( ) ; for ( E e : entityList ) { map.put ( e.getNetworkName ( ) , e ) ; } return map ; } else { return java.util.Collections.emptyMap ( ) ; } }
Source:
private void configureLocalStorage2 ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model ) { java.lang.String prefix = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.RhevhLocalFSPath ) ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }

Target:
private void configureLocalStorage2 ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model ) { java.lang.String prefix = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.RhevhLocalFSPath ) ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangeable ( false ) ; } configureLocalStorage3 ( model ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStatus ( StorageDomainStatus.InActive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s2.setStatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setStatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStatus ( StorageDomainStatus.Inactive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s2.setStatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setStatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }
Source:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.QueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParameters ( ) ; if ( parentHasCallback ( ) ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } } else { parentParameters = getParameters ( ) . getParentParameters ( ) ; } return parentParameters ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParameters ( ) ; if ( parentHasCallback ( ) ) { if ( ( ! ( getParameters ( ) . getShouldBeEndedByParent ( ) ) ) || ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } } else if ( getParameters ( ) . getShouldBeEndedByParent ( ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } return parentParameters ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.events.EventModel eventModel ) { driver.edit ( eventModel ) ; org.ovirt.engine.core.common.businessentities.AuditLog event = eventModel.getEvent ( ) ; eventIdLabel.asValueBox ( ) . setValue ( java.lang.String.valueOf ( event.getlog_typeValue ( ) ) ) ; eventTimeLabel.asValueBox ( ) . setValue ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) . render ( event.getlog_time ( ) ) ) ; eventMessageTextArea.asValueBox ( ) . setValue ( event.getmessage ( ) ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.events.EventModel eventModel ) { driver.edit ( eventModel ) ; org.ovirt.engine.core.common.businessentities.AuditLog event = eventModel.getEvent ( ) ; eventIdLabel.asValueBox ( ) . setValue ( java.lang.String.valueOf ( event.getLogTypeValue ( ) ) ) ; eventTimeLabel.asValueBox ( ) . setValue ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) . render ( event.getLogTime ( ) ) ) ; eventMessageTextArea.asValueBox ( ) . setValue ( event.getMessage ( ) ) ; }
Source:
public void init ( org.ovirt.engine.core.common.businessentities.VDS vds ) { mCurrentVdsId = vds.getId ( ) ; setmIrsPort ( vds.getPort ( ) ) ; privatemCurrentIrsHost = vds.getHostName ( ) ; setProtocol ( vds.getProtocol ( ) ) ; }

Target:
public void init ( org.ovirt.engine.core.common.businessentities.VDS vds ) { mCurrentVdsId = vds.getId ( ) ; setmIrsPort ( vds.getPort ( ) ) ; privatemCurrentIrsHost = vds.getHostName ( ) ; setProtocol ( vds.getProtocol ( ) ) ; setVersion ( vds.getVdsGroupCompatibilityVersion ( ) ) ; }