auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addIpv6BootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { final org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol ipv6BootProtocol = attachment.getIpv6BootProtocol ( ) ; opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCPV6_BOOT_PROTOCOL , ( ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.DHCP ) == ipv6BootProtocol ) ) ; if ( ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) == ipv6BootProtocol ) { org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipv6addr" , getIpv6Address ( attachment ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipv6gateway" , attachment.getIpv6Gateway ( ) ) ; } }

Target:
private void addIpv6BootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { final org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv6BootProtocol = attachment.getIpv6BootProtocol ( ) ; opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCPV6_BOOT_PROTOCOL , ( ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.DHCP ) == ipv6BootProtocol ) ) ; if ( ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.STATIC_IP ) == ipv6BootProtocol ) { org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipv6addr" , getIpv6Address ( attachment ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipv6gateway" , attachment.getIpv6Gateway ( ) ) ; } }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveVmParameters params = new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( VdcActionType.ExportVmTemplate , params , action ) ; }

Target:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveVmParameters params = new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( VdcActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getBaseTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getBaseTemplate ( ) . setSelectedItem ( template ) ; model.getBaseTemplate ( ) . setIsChangable ( false ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templatesChain = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ) ; initTemplateWithVersion ( templatesChain , templateId , useLatest ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot getSnapshot ( ) { if ( ( snapshot ) == null ) { snapshot = getSnapshotDao ( ) . get ( sourceSnapshotId ) ; if ( ( snapshot ) != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } return snapshot ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot getSnapshot ( ) { if ( ( snapshot ) == null ) { snapshot = org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getSnapshotDao ( ) . get ( sourceSnapshotId ) ; if ( ( snapshot ) != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } return snapshot ; }
Source:
public boolean isMacInUse ( java.lang.String mac ) { lockObj.readLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; return macsStorage.isMacInUse ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public boolean isMacInUse ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.readLock ( ) ) ) { checkIfInitialized ( ) ; return macsStorage.isMacInUse ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getClustersHavingHosts ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( ) { return networkNotUsed ( getVms ( ) , EngineMessage.VAR__ENTITIES__VMS , EngineMessage.VAR__ENTITIES__VM ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult getNetworkInUsePlural ( java.util.Collection < java.lang.String > names ) { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_NETWORK_IN_MANY_USES ; java.util.List < java.lang.String > replacements = java.util.stream.Stream.concat ( org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , names ) . stream ( ) , java.util.stream.Stream.of ( entitiesReplacementPlural.name ( ) ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacements ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
private org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction getRequiredAction ( ) { if ( ( requiredAction ) == null ) { if ( ( ! ( oldIface.isActive ( ) ) ) && ( getInterface ( ) . isActive ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.PLUG ; } else if ( ( oldIface.isActive ( ) ) && ( ! ( getInterface ( ) . isActive ( ) ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UNPLUG ; } else if ( ( liveActionRequired ( ) ) && ( properiesRequiringVmUpdateDeviceWereUpdated ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ; } } return requiredAction ; }

Target:
private org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction getRequiredAction ( ) { if ( ( requiredAction ) == null ) { if ( ( ! ( oldIface.isPlugged ( ) ) ) && ( getInterface ( ) . isPlugged ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.PLUG ; } else if ( ( oldIface.isPlugged ( ) ) && ( ! ( getInterface ( ) . isPlugged ( ) ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UNPLUG ; } else if ( ( liveActionRequired ( ) ) && ( properiesRequiringVmUpdateDeviceWereUpdated ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ; } } return requiredAction ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . unless ( ( ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) || ( ( ( ipConfiguration.getAddress ( ) ) != null ) && ( ( ipConfiguration.getNetmask ( ) ) != null ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }
Source:
private void passthroughIsLinkedCommon ( boolean isPassthrough , boolean isLinked , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( nic.isPassthrough ( ) ) . thenReturn ( isPassthrough ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( isLinked ) ; org.junit.Assert.assertThat ( validator.passthroughIsLinked ( ) , matcher ) ; }

Target:
private void passthroughIsLinkedCommon ( boolean isPassthrough , boolean isLinked , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( nic.isPassthrough ( ) ) . thenReturn ( isPassthrough ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( isLinked ) ; org.hamcrest.MatcherAssert.assertThat ( validator.passthroughIsLinked ( ) , matcher ) ; }
Source:
protected void initGeneralSubTabView ( ) { com.google.gwt.user.client.ui.ScrollPanel generalPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ) ( object.getDetailModels ( ) . get ( 0 ) ) ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider , constants ) ; generalPanel.add ( generalView ) ; subTabLayoutPanel.add ( generalPanel , constants.generalImpTempTab ( ) ) ; }

Target:
protected void initGeneralSubTabView ( ) { com.google.gwt.user.client.ui.ScrollPanel generalPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ) ( importModel.getDetailModels ( ) . get ( 0 ) ) ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider , constants ) ; generalPanel.add ( generalView ) ; subTabLayoutPanel.add ( generalPanel , constants.generalImpTempTab ( ) ) ; }
Source:
private java.util.Date getDateFromDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map ) { try { return new java.text.SimpleDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.formatStrFromDiskDescription ) . parse ( map.get ( OvfInfoFileConstants.LastUpdated ) . toString ( ) ) ; } catch ( java.text.ParseException e ) { log.errorFormat ( "LastUpdate Date could not be parsed from disk desscription. Exception: {0}" , e ) ; return null ; } }

Target:
private java.util.Date getDateFromDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map ) { try { java.lang.Object lastUpdate = map.get ( OvfInfoFileConstants.LastUpdated ) ; if ( lastUpdate != null ) { return new java.text.SimpleDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.formatStrFromDiskDescription ) . parse ( lastUpdate.toString ( ) ) ; } else { log.info ( "LastUpdate Date is not initialized in the OVF_STORE disk." ) ; } } catch ( java.text.ParseException e ) { log.error ( "LastUpdate Date could not be parsed from disk description: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } return null ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' balance is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; return null ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( @ javax.validation.constraints.NotNull org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' balance is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; return null ; }
Source:
public void testNotEnoughSpaceToMergeSnapshotsWithOneDisk ( ) { spySdValidatorForOneDomain ( ) ; org.mockito.Mockito.when ( diskImageDAO.get ( mockSourceImage ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; mockStorageDomainDAOGetForStoragePool ( 3 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertFalse ( "Validation should fail. Free space minus threshold should be smaller then disk size" , cmd.validateStorageDomains ( ) ) ; }

Target:
public void testCanDoActionEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; }
Source:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getvmt_guid ( ) . toString ( ) ) ; } return pool ; }

Target:
public org.ovirt.engine.api.model.VmPool populate ( org.ovirt.engine.api.model.VmPool pool , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( pool.isSetSize ( ) ) && ( ( pool.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( pool.getName ( ) ) ) ) ; pool.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; pool.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return pool ; }
Source:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( templateDiskImage.getId ( ) , templateId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , java.lang.Boolean.FALSE , null , false ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getSlave ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBondName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getSlave ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBondName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private void handleTransactivity ( ) { scope = ( ( getParameters ( ) ) != null ) ? getParameters ( ) . getTransactionScopeOption ( ) : org.ovirt.engine.core.compat.TransactionScopeOption.Required ; endActionScope = scope ; boolean forceCompensation = getForceCompensation ( ) ; if ( ! ( getTransactive ( ) ) ) { scope = org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ; endActionScope = ( forceCompensation ) ? endActionScope : scope ; } if ( ( getCompensationContext ( ) ) == null ) { context.setCompensationContext ( createCompensationContext ( scope , forceCompensation ) ) ; } }

Target:
private void handleTransactivity ( ) { scope = ( ( getParameters ( ) ) != null ) ? getParameters ( ) . getTransactionScopeOption ( ) : org.ovirt.engine.core.compat.TransactionScopeOption.Required ; endActionScope = scope ; boolean forceCompensation = getForceCompensation ( ) ; if ( ! ( getTransactive ( ) ) ) { scope = org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ; endActionScope = ( forceCompensation ) ? endActionScope : scope ; } if ( ( getCompensationContext ( ) ) == null ) { context.withCompensationContext ( createCompensationContext ( scope , forceCompensation ) ) ; } }
Source:
protected void expectGetIsAttached ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId ) { org.ovirt.engine.core.dao.StoragePoolIsoMapDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolIsoMapDAO.class ) ; org.mockito.Mockito.when ( db.getStoragePoolIsoMapDAO ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( id , poolId ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ) ; }

Target:
protected void expectGetIsAttached ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId ) { org.ovirt.engine.core.dao.StoragePoolIsoMapDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolIsoMapDAO.class ) ; org.mockito.Mockito.when ( db.getStoragePoolIsoMapDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( id , poolId ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ) ; }
Source:
public void Execute ( ) { java.util.concurrent.CountDownLatch latch = new java.util.concurrent.CountDownLatch ( _numberOfOperations ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread ( latch , i ) ) ; } try { latch.await ( ) ; } catch ( java.lang.InterruptedException e ) { } }

Target:
public void Execute ( ) { java.util.List < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > operations = new java.util.ArrayList < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > ( ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { operations.add ( new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread ( i ) ) ; } if ( ( _numberOfOperations ) > 0 ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.invokeAll ( operations ) ; } }
Source:
public void testGetEngineSessionTimeoutObject ( ) { org.codehaus.jackson.node.ObjectNode result = testServlet.getEngineSessionTimeoutObject ( java.lang.Integer.valueOf ( 30 ) ) ; org.junit.Assert.assertEquals ( result.get ( "value" ) . asText ( ) , "30" ) ; }

Target:
public void testGetEngineSessionTimeoutObject ( ) { org.codehaus.jackson.node.ObjectNode result = testServlet.getEngineSessionTimeoutObject ( 30 , 60 ) ; org.junit.Assert.assertEquals ( result.get ( "sessionTimeout" ) . asInt ( ) , 30 ) ; org.junit.Assert.assertEquals ( result.get ( "sessionHardLimit" ) . asInt ( ) , 60 ) ; }
Source:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.StorageType expectedStorageType , java.lang.String mockDevtype ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun = org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct.class ) ; org.mockito.Mockito.when ( xlun.contains ( GetDeviceListVDSCommand.DEVTYPE_FIELD ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( xlun.getItem ( GetDeviceListVDSCommand.DEVTYPE_FIELD ) ) . thenReturn ( mockDevtype ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }

Target:
public void parseLunFromXmlRpcReturnsUnknownForNoField ( ) throws java.lang.Exception { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( StorageType.UNKNOWN , lun.getLunType ( ) ) ; }
Source:
public static void GetDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
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 , 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.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notRemovingManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDao ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notRemovingManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
private java.lang.String generateInfoFileData ( ) { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( OvfInfoFileConstants.LastUpdated , updateDate.toString ( ) ) ; data.put ( OvfInfoFileConstants.Domains , java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; return buildJson ( data , true ) ; }

Target:
private java.lang.String generateInfoFileData ( ) { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( OvfInfoFileConstants.LastUpdated , updateDate.toString ( ) ) ; data.put ( OvfInfoFileConstants.Domains , java.util.Collections.singletonList ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; return buildJson ( data , true ) ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = getBackendCollection ( VdcQueryType.GetNetworksByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.DataCenter dataCenter = new org.ovirt.engine.api.model.DataCenter ( ) ; dataCenter.setId ( dataCenterId.toString ( ) ) ; network.setDataCenter ( dataCenter ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }

Target:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
protected void mockStorageDomainDaoGetAllForStoragePool ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( createStorageDomain ( ) ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getUpdate ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdateWrongPortMirroringNetwork ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = getNic ( false ) ; nic.getPortMirroring ( ) . getNetworks ( ) . getNetworks ( ) . get ( 0 ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; nic = resource.update ( nic ) ; assertNotNull ( nic ) ; }
Source:
public boolean isFileDomain ( ) { return ( ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.NFS ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLANCE ) ) ; }

Target:
public boolean isFileDomain ( ) { return ( subtype ) == ( org.ovirt.engine.core.common.businessentities.StorageType.Subtype.FILE ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newStaticDomain.setWipeAfterDelete ( true ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setAvailableDiskSize ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { if ( node.InnerText.equals ( java.lang.String.valueOf ( OsRepository.OLD_OTHER_ID ) ) ) { node.InnerText = java.lang.String.valueOf ( OsRepository.DEFAULT_OS ) ; } _vmTemplate.setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED , java.util.Collections.singletonMap ( GlusterConstants.COMMAND , "gluster peer probe" ) ) ; nonOpParams.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED , java.util.Collections.singletonMap ( GlusterConstants.COMMAND , "gluster peer status" ) ) ; nonOpParams.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool createDefaultStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createBasicPool ( ) ; pool.setIsLocal ( true ) ; pool.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; return pool ; }