auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > getNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }

Target:
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 ; }
Source:
private void removeVmSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.memory.MemoryImageRemover memoryImageRemover = new org.ovirt.engine.core.bll.memory.MemoryImageRemover ( vm , this ) ; java.util.Collection < java.lang.String > memoriesOfRemovedSnapshots = new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . removeSnapshots ( vm.getId ( ) ) ; for ( java.lang.String memoryVolumes : memoriesOfRemovedSnapshots ) { memoryImageRemover.removeMemoryVolume ( memoryVolumes ) ; } }

Target:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Collection < java.lang.String > memoriesOfRemovedSnapshots = new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . removeSnapshots ( vm.getId ( ) ) ; new org.ovirt.engine.core.bll.memory.MemoryImageRemover ( vm , this ) . removeMemoryVolumes ( memoriesOfRemovedSnapshots ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNetworkInterfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces != null ) ? vmNetworkInterfaces : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } return _vmInterfaces ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmNetworkInterfaces = org.ovirt.engine.core.bll.AddVmCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) : vmNetworkInterfaces ; } return _vmInterfaces ; }
Source:
private void setUpGetBallooningExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true ) ; }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( ( vmDevice.isManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }

Target:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( ( disk.isManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ) ; break ; } } }
Source:
private void verifyServiceOnServer2 ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID , service.getServiceId ( ) . toString ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_NAME , service.getServiceName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE , service.getServiceType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.PID_2 , service.getPid ( ) ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }

Target:
private void verifyServiceOnServer2 ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID , service.getServiceId ( ) . toString ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_NAME , service.getServiceName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE , service.getServiceType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.PID_2 , service.getPid ( ) ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME2 , service.getHostName ( ) ) ; }
Source:
public void execute ( ) { getEnclosingCommand ( ) . getReturnValue ( ) . setSucceeded ( false ) ; beforeTask ( ) ; addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getVDSCommandType ( ) , getVDSParameters ( ) ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void execute ( ) { if ( getEnclosingCommand ( ) . getParameters ( ) . getTaskGroupSuccess ( ) ) { getReturnValue ( ) . setSucceeded ( false ) ; beforeTask ( ) ; addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getVDSCommandType ( ) , getVDSParameters ( ) ) ) ; } getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > collection ) { org.junit.Assert.assertNotNull ( collection ) ; org.junit.Assert.assertEquals ( GUIDS.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( GUIDS.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , i ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > collection ) { org.junit.jupiter.api.Assertions.assertNotNull ( collection ) ; org.junit.jupiter.api.Assertions.assertEquals ( GUIDS.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( GUIDS.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , i ) ; } }
Source:
public void testVmDiskWithPassDiscardAndWadExistsFails ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.vmDiskWithPassDiscardAndWadExists ( storageDomainDisks , storageDomainVmDisks ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardSupport ( 0L ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }
Source:
public void testParameterMapDeserialization ( ) { java.lang.StringBuilder buf = new java.lang.StringBuilder ( "" ) ; buf.append ( "{" ) ; buf.append ( "\"NEXT_COMMAND_TYPE\" : [ \"org.ovirt.engine.core.common.action.VdcActionType\", \"DestroyImage\" ]" ) ; buf.append ( "}" ) ; java.util.Map < java.lang.String , java.io.Serializable > data = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( buf.toString ( ) , java.util.HashMap.class ) ; org.junit.Assert.assertNotNull ( data ) ; org.junit.Assert.assertEquals ( VdcActionType.DestroyImage , data.get ( "NEXT_COMMAND_TYPE" ) ) ; }

Target:
public void testParameterMapDeserialization ( ) { java.lang.StringBuilder buf = new java.lang.StringBuilder ( "" ) ; buf.append ( "{" ) ; buf.append ( "\"NEXT_COMMAND_TYPE\" : [ \"org.ovirt.engine.core.common.action.ActionType\", \"DestroyImage\" ]" ) ; buf.append ( "}" ) ; java.util.Map < java.lang.String , java.io.Serializable > data = new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( buf.toString ( ) , java.util.HashMap.class ) ; org.junit.Assert.assertNotNull ( data ) ; org.junit.Assert.assertEquals ( ActionType.DestroyImage , data.get ( "NEXT_COMMAND_TYPE" ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecord ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryDirectoryUsers ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecordsToDirectoryUsers ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) ; }
Source:
public void testGetAllForDataCenterWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > result = dao.getAllForDataCenter ( FixturesTool.DATA_CENTER , org.ovirt.engine.core.dao.network.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile : result ) { org.junit.Assert.assertEquals ( FixturesTool.DATA_CENTER_NAME , profile.getDataCenterName ( ) ) ; } }

Target:
public void testGetAllForDataCenterWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > result = dao.getAllForDataCenter ( FixturesTool.DATA_CENTER , org.ovirt.engine.core.dao.network.PRIVILEGED_USER_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.DATA_CENTER_NAME , profile.getDataCenterName ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VDS vds : getServersInCluster ( ) ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { setVdsName ( vds.getName ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "VdsName" , vds.getName ( ) ) ) ; return false ; } } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VDS vds : getServersInCluster ( ) ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { setVdsName ( vds.getName ( ) ) ; addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP ) ; addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "VdsName" , vds.getName ( ) ) ) ; return false ; } } return true ; }
Source:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.AddImageFromScratchCommand.getDestinationDiskImage ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( org.ovirt.engine.core.bll.AddImageFromScratchCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } super . endWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.AddImageFromScratchCommand.getDestinationDiskImage ( ) ) != null ) { if ( org.ovirt.engine.core.bll.AddImageFromScratchCommand.getParameters ( ) . isShouldRemainIllegalOnFailedExecution ( ) ) { setImageStatus ( ImageStatus.ILLEGAL ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( org.ovirt.engine.core.bll.AddImageFromScratchCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; super . endWithFailure ( ) ; } } }
Source:
public static void assertNoDuplicateKeys ( java.lang.String filePath ) throws java.io.FileNotFoundException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( filePath ) ) { props.load ( is ) ; } catch ( java.lang.Exception exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + filePath ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }

Target:
public static void assertNoDuplicateKeys ( java.lang.String filePath ) throws java.io.IOException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( filePath ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.DuplicatePropertyException exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + filePath ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }
Source:
public void loadAttachableDisks ( int os , org.ovirt.engine.core.compat.Version compatibilityVersion , final org.ovirt.engine.core.common.businessentities.Disk prevSelectedDisk ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.IMAGE , prevSelectedDisk ) ) , getVm ( ) . getStoragePoolId ( ) , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.LUN , prevSelectedDisk ) ) , null , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; }

Target:
public void loadAttachableDisks ( int os , org.ovirt.engine.core.compat.Version compatibilityVersion , final org.ovirt.engine.core.common.businessentities.storage.Disk prevSelectedDisk ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.IMAGE , prevSelectedDisk ) ) , getVm ( ) . getStoragePoolId ( ) , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.LUN , prevSelectedDisk ) ) , null , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isEnabled ( ) ) ) { if ( getValue ( ) ) { sb.append ( org.ovirt.engine.ui.common.widget.table.header.CheckboxHeader.INPUT_CHECKED_DISABLED ) ; sb.append ( title ) ; } else { sb.append ( org.ovirt.engine.ui.common.widget.table.header.CheckboxHeader.INPUT_UNCHECKED_DISABLED ) ; sb.append ( title ) ; } } else { super . render ( context , sb ) ; } }

Target:
public void render ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isEnabled ( ) ) ) { if ( getValue ( ) ) { sb.append ( org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader.INPUT_CHECKED_DISABLED ) ; } else { sb.append ( org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader.INPUT_UNCHECKED_DISABLED ) ; } } else { super . render ( context , sb ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.String AddInfo = getAdditionalInformation ( ) ; return java.lang.String.format ( "%s(%s %s)" , super . toString ( ) , ( ! ( AddInfo.isEmpty ( ) ) ? AddInfo + "," : "" ) , ( ( getParameters ( ) ) != null ? getParameters ( ) . toString ( ) : "null" ) ) ; }

Target:
public java.lang.String toString ( ) { java.lang.String addInfo = getAdditionalInformation ( ) ; return java.lang.String.format ( "%s(%s %s)" , super . toString ( ) , ( ! ( addInfo.isEmpty ( ) ) ? addInfo + "," : org.apache.commons.lang.StringUtils.EMPTY ) , ( ( getParameters ( ) ) != null ? getParameters ( ) . toString ( ) : "null" ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangeable ( ( ! entity ) ) ; }
Source:
public void correlationIdMaxSize ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , BusinessEntitiesDefinitions.CORRELATION_ID_SIZE , "A" ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.Assert.assertNull ( "Correlation id is size is at max permitted length" , result ) ; }

Target:
public void correlationIdMaxSize ( ) { org.ovirt.engine.core.common.action.ActionParametersBase parameters = new org.ovirt.engine.core.common.action.ActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , BusinessEntitiesDefinitions.CORRELATION_ID_SIZE , "A" ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.Assert.assertNull ( "Correlation id is size is at max permitted length" , result ) ; }
Source:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = filterNotBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate prevBaseTemplate = getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( baseTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( baseTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( ( prevBaseTemplate != null ? prevBaseTemplate.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { initTemplateWithVersion ( templates ) ; updateIsDisksAvailable ( ) ; }
Source:
private void networkNotUsedByHostsTest ( org.ovirt.engine.core.bll.ValidationResult expected , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDAO hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertEquals ( expected.getMessage ( ) , validator.networkNotUsedByHosts ( ) . getMessage ( ) ) ; }

Target:
private void networkNotUsedByHostsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDAO hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByHosts ( ) , matcher ) ; }
Source:
protected void extractBondIfModified ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( name , iface ) ; } } }

Target:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.DiskInterface GetDefaultDiskInterface ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { return osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ? org.ovirt.engine.core.common.businessentities.DiskInterface.IDE : ( disks != null ) && ( ( disks.size ( ) ) > 0 ) ? disks.get ( 0 ) . getDiskInterface ( ) : org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return filteredList ; }
Source:
private org.ovirt.engine.core.searchbackend.PagingType getPagingType ( ) { java.lang.String val = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DBPagingType ) ; org.ovirt.engine.core.searchbackend.PagingType type = null ; try { type = org.ovirt.engine.core.searchbackend.PagingType.valueOf ( val ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.searchbackend.SyntaxChecker.log.error ( org.ovirt.engine.core.compat.StringFormat.format ( "Unknown paging type %1$s" , val ) ) ; } return type ; }

Target:
private org.ovirt.engine.core.searchbackend.PagingType getPagingType ( ) { java.lang.String val = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DBPagingType ) ; org.ovirt.engine.core.searchbackend.PagingType type = null ; try { type = org.ovirt.engine.core.searchbackend.PagingType.valueOf ( val ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.searchbackend.SyntaxChecker.log.error ( ( "Unknown paging type " + val ) ) ; } return type ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > createActionTable ( ) { return new org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > ( modelProvider , getTableHeaderlessResources ( ) , getTableResources ( ) , org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getClientStorage ( ) ) { { if ( useTableWidgetForContent ( ) ) { enableHeaderContextMenu ( ) ; } } } ; }

Target:
public void resizeToFullHeight ( ) { table.updateGridSize ( ) ; }
Source:
protected void updateBricksWithTaskID ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickEntity : getParameters ( ) . getBricks ( ) ) { brickEntity.getAsyncTask ( ) . setTaskId ( asyncTask.getTaskId ( ) ) ; } getGlusterBrickDao ( ) . updateBrickTasksInBatch ( getParameters ( ) . getBricks ( ) ) ; glusterVolumeDao.updateVolumeTask ( getGlusterVolumeId ( ) , asyncTask.getTaskId ( ) ) ; }

Target:
protected void updateBricksWithTaskID ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickEntity : getParameters ( ) . getBricks ( ) ) { brickEntity.getAsyncTask ( ) . setTaskId ( asyncTask.getTaskId ( ) ) ; } glusterBrickDao.updateBrickTasksInBatch ( getParameters ( ) . getBricks ( ) ) ; glusterVolumeDao.updateVolumeTask ( getGlusterVolumeId ( ) , asyncTask.getTaskId ( ) ) ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ? java.lang.Math.round ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getActualDiskWithSnapshotsSize ( ) ) : ( ( long ) ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) || ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ? java.lang.Math.round ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getActualDiskWithSnapshotsSize ( ) ) : ( ( long ) ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) ) ; }
Source:
public void setup ( ) { tagsDirector = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) ) ; org.mockito.Mockito.when ( tagDao.getAllForParent ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Tags > emptyList ( ) ) ; org.mockito.Mockito.doReturn ( tagDao ) . when ( tagsDirector ) . getTagDAO ( ) ; org.mockito.Mockito.doNothing ( ) . when ( tagsDirector ) . updateTagInBackend ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.Tags.class ) ) ; tagsDirector.init ( ) ; }

Target:
public void setup ( ) { tagsDirector = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.TagsDirector.getInstance ( ) ) ; org.mockito.Mockito.when ( tagDao.getAllForParent ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Tags > emptyList ( ) ) ; org.mockito.Mockito.doReturn ( tagDao ) . when ( tagsDirector ) . getTagDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( tagsDirector ) . updateTagInBackend ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.Tags.class ) ) ; tagsDirector.init ( ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllVmsQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllVmsQuery.getDbFacade ( ) . getVmDAO ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllVmsQuery.getDbFacade ( ) . getVmDAO ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.UpdateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VDS object ) { return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VDS value ) { java.lang.String maintenanceReason = value.getMaintenanceReason ( ) ; if ( ( maintenanceReason != null ) && ( ! ( maintenanceReason.trim ( ) . isEmpty ( ) ) ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( maintenanceReason ) ; } return null ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) && ( ! ( validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.validator.ImportValidator importValidator = org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImportValidator ( ) ; if ( ! ( validate ( importValidator.validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImages ( ) ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setCanDoAction ( retValue ) ; return retValue ; }

Target:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setCanDoAction ( retValue ) ; return retValue ; }
Source:
private void addString ( org.snmp4j.PDU v2pdu , org.snmp4j.smi.OID prefix , int suffix , java.lang.String val , boolean allowEmpty ) { if ( allowEmpty || ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( val ) ) ) ) { v2pdu.add ( new org.snmp4j.smi.VariableBinding ( new org.snmp4j.smi.OID ( prefix ) . append ( suffix ) , new org.snmp4j.smi.OctetString ( ( val == null ? "" : val ) ) ) ) ; } }

Target:
private void addString ( org.snmp4j.PDU pdu , org.snmp4j.smi.OID prefix , int suffix , java.lang.String val , boolean allowEmpty ) { if ( allowEmpty || ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( val ) ) ) ) { pdu.add ( new org.snmp4j.smi.VariableBinding ( new org.snmp4j.smi.OID ( prefix ) . append ( suffix ) , new org.snmp4j.smi.OctetString ( ( val == null ? "" : val ) ) ) ) ; } }
Source:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( cluster.getCompatibilityVersion ( ) , osType ) ; } }

Target:
public void postUpdateNumOfSockets3 ( ) { java.lang.String version = getCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfThreadsPerCpu ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxThreadsPerCore = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } ) , version ) ; }
Source:
private void checkTemplateName ( boolean isImportAsNewEntity , java.lang.String name ) { command.getParameters ( ) . getVmTemplate ( ) . setName ( name ) ; command.getParameters ( ) . setImportAsNewEntity ( isImportAsNewEntity ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( command.getParameters ( ) , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertNotEquals ( validate.isEmpty ( ) , isImportAsNewEntity ) ; }

Target:
private void checkTemplateName ( boolean isImportAsNewEntity , java.lang.String name ) { command.getParameters ( ) . getVmTemplate ( ) . setName ( name ) ; command.getParameters ( ) . setImportAsNewEntity ( isImportAsNewEntity ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( command.getParameters ( ) , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( validate.isEmpty ( ) , isImportAsNewEntity ) ; }
Source:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.LabelNetwork , org.ovirt.engine.core.common.action.LabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.networkId , org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS [ 0 ] } , canDo , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.LabelNetwork , org.ovirt.engine.core.common.action.LabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID , org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS [ 0 ] } , canDo , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void createCluster ( org.ovirt.engine.core.compat.Version version ) { existingCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setname ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setcompatibility_version ( version ) ; }

Target:
private void createCluster ( org.ovirt.engine.core.compat.Version version ) { existingCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setName ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setcompatibility_version ( version ) ; createObjects ( version ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbGroup lookupGroupById ( org.ovirt.engine.core.compat.Guid id ) { return getEntity ( org.ovirt.engine.core.common.businessentities.DbGroup.class , VdcQueryType.GetDbGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , id.toString ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.LdapGroup findDirectoryGroup ( java.lang.String directoryName , org.ovirt.engine.api.model.Group groupModel ) { if ( groupModel.isSetId ( ) ) { java.lang.String groupId = groupModel.getId ( ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.LdapGroup.class , VdcQueryType.GetDirectoryGroupById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , org.ovirt.engine.core.common.utils.ExternalId.fromHex ( groupId ) ) , groupId , true ) ; } if ( groupModel.isSetName ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.LdapGroup.class , SearchType.AdGroup , getDirectoryGroupSearchPattern ( groupModel.getName ( ) , directoryName ) ) ; } return null ; }
Source:
protected void endWithFailure ( ) { if ( ( commandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } else { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Active , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ( commandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } else if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getParameters ( ) . isForceMaintenance ( ) ) { executeDeactivateCommand ( ) ; } else { auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_FAILED ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }