auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storages ) ; } else { saveNewNfsStorage ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { nfsModel.getPath ( ) . setIsValid ( false ) ; handleDomainAlreadyExists ( storages ) ; } else { saveNewNfsStorage ( ) ; } }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; }

Target:
public T convert ( java.lang.Object source ) { java.lang.Iterable < T > iterable = ( ( java.lang.Iterable < T > ) ( source ) ) ; java.util.Iterator < T > iterator = iterable.iterator ( ) ; while ( iterator.hasNext ( ) ) { return iterator.next ( ) ; } return null ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getAAAProfilesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testCheckGroupsCanBeAttachedSuccess ( ) { getRole ( ) . setType ( RoleType.ADMIN ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.Assert.assertFalse ( "validate should succeed" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertTrue ( "no messages sould have been added" , messages.isEmpty ( ) ) ; }

Target:
public void testCheckGroupsCanBeAttachedSuccess ( ) { getRole ( ) . setType ( RoleType.ADMIN ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) , "validate should succeed" ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.isEmpty ( ) , "no messages sould have been added" ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.Host > hosts = getCollection ( ) ; assertTrue ( hosts.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( hosts ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetCertificateInfo ( NAMES.length ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.Host > hosts = getCollection ( ) ; assertTrue ( hosts.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( hosts ) ; } finally { accepts.clear ( ) ; } }
Source:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de" ) ; keys.add ( "en_US" ) ; keys.add ( "es" ) ; keys.add ( "fr" ) ; keys.add ( "ja" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }

Target:
private java.util.List < java.lang.String > createLocaleKeys ( ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < java.lang.String > ( ) ; keys.add ( "de_DE" ) ; keys.add ( "en_US" ) ; keys.add ( "es_ES" ) ; keys.add ( "fr_FR" ) ; keys.add ( "ja_JP" ) ; keys.add ( "pt_BR" ) ; keys.add ( "zh_CN" ) ; return keys ; }
Source:
protected void verify ( org.ovirt.engine.api.model.OpenStackNetwork model , org.ovirt.engine.api.model.OpenStackNetwork transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.OpenStackNetwork model , org.ovirt.engine.api.model.OpenStackNetwork transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; }
Source:
private static boolean canPlugInterfaceInDc ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( dataCenterId == null ) { return false ; } else { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . poolForDataCenter ( dataCenterId ) ; return ! ( pool.isMacInUse ( iface.getMacAddress ( ) ) ) ; } }

Target:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid vdsGroupId ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVdsGroupDao ( ) . get ( vdsGroupId ) ; org.ovirt.engine.core.compat.Guid dataCenterId = ( vdsGroup == null ) ? null : vdsGroup.getStoragePoolId ( ) ; java.lang.String macAddress = iface.getMacAddress ( ) ; boolean canPlugInterface = org.ovirt.engine.core.bll.utils.VmDeviceUtils.canPlugInterfaceInDc ( macAddress , dataCenterId ) ; if ( ! canPlugInterface ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . auditLogMacInUseUnplug ( iface ) ; } return canPlugInterface ; }
Source:
protected boolean isPortMirroringSupported ( ) { org.ovirt.engine.core.compat.Version v31 = new org.ovirt.engine.core.compat.Version ( 3 , 1 ) ; boolean isLessThan31 = ( getDcCompatibilityVersion ( ) . compareTo ( v31 ) ) < 0 ; return ! isLessThan31 ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkQoS getEmptyQos ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos ) == null ) { org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos.setName ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unlimitedQoSTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos.setId ( Guid.Empty ) ; } return org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.emptyQos ; }
Source:
public void setHeader ( java.lang.String name , java.lang.String value ) { if ( ( ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.EXPIRES_HEADER.equalsIgnoreCase ( name ) ) || ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.CACHE_CONTROL_HEADER.equalsIgnoreCase ( name ) ) ) || ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.PRAGMA_HEADER.equalsIgnoreCase ( name ) ) ) { return ; } if ( preventConditionalDownloadHeaders && ( ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.ETAG_HEADER.equalsIgnoreCase ( name ) ) || ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.LAST_MODIFIED_HEADER.equalsIgnoreCase ( name ) ) ) ) { return ; } httpResponse.setHeader ( name , value ) ; }

Target:
public void setHeader ( java.lang.String name , java.lang.String value ) { if ( ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.EXPIRES_HEADER.equalsIgnoreCase ( name ) ) || ( org.ovirt.engine.core.utils.servlet.CachingFilter.CACHE_CONTROL_HEADER.equalsIgnoreCase ( name ) ) ) || ( org.ovirt.engine.core.utils.servlet.CachingFilter.PRAGMA_HEADER.equalsIgnoreCase ( name ) ) ) { return ; } if ( preventConditionalDownloadHeaders && ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.ETAG_HEADER.equalsIgnoreCase ( name ) ) || ( org.ovirt.engine.core.utils.servlet.CachingFilter.LAST_MODIFIED_HEADER.equalsIgnoreCase ( name ) ) ) ) { return ; } httpResponse.setHeader ( name , value ) ; }
Source:
protected void onExportChanged ( ) { if ( ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; } }

Target:
protected void onExportChanged ( ) { if ( ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; getNetworkLabel ( ) . setIsChangable ( false ) ; } super . onExportChanged ( ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void updateAll ( java.lang.String procedureName , java.util.Collection < T > entities ) { if ( procedureName == null ) { procedureName = org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) ; } for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( procedureName , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }

Target:
public void removeAll ( java.util.Collection < ID > ids ) { for ( ID id : ids ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.remove ( id ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookAdd ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName , java.lang.String content , java.lang.String checksum , java.lang.Boolean enabled ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookAdd ( glusterCommand , stage , hookName , content , checksum , enabled ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
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.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public void getHostListByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . gettag_id ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getvm_id ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getTagId ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getVmId ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }
Source:
public void canUpdateNumaPinning ( ) { updatedNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massUpdateNumaNode ( org.mockito.Matchers.eq ( updatedNumaNodes ) ) ; }

Target:
public void canUpdateNumaPinning ( ) { updatedNumaNodes = java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massUpdateNumaNode ( org.mockito.Matchers.eq ( updatedNumaNodes ) ) ; }
Source:
public static boolean isPrestartedVmForAssignment ( org.ovirt.engine.core.compat.Guid vm_guid ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . get ( vm_guid ) ; if ( ( ( vmDynamic != null ) && ( ( vmDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm_guid ) ) ) { return true ; } else { return false ; } }

Target:
protected static boolean canAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId ) { return ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , new java.util.ArrayList < java.lang.String > ( ) ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ; }
Source:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( resource.move ( setUpMoveParams ( false ) ) ) ; }

Target:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( resource.move ( setUpMoveParams ( false ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setVdsmName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }
Source:
private java.util.Set < java.lang.String > filterPackages ( java.util.Collection < java.lang.String > queriedPackages , java.util.Collection < java.lang.String > reportedPackages ) { java.util.Set < java.lang.String > filtered = new java.util.HashSet < > ( ) ; for ( java.lang.String reportedPackage : reportedPackages ) { for ( java.lang.String queriedPackage : queriedPackages ) { if ( org.apache.commons.lang.StringUtils.startsWith ( reportedPackage , queriedPackage ) ) { filtered.add ( queriedPackage ) ; } } } return filtered ; }

Target:
private java.util.Set < java.lang.String > filterPackages ( java.util.Collection < java.lang.String > queriedPackages , java.util.Collection < java.lang.String > reportedPackages ) { java.util.Set < java.lang.String > filtered = new java.util.TreeSet < > ( ) ; for ( java.lang.String reportedPackage : reportedPackages ) { for ( java.lang.String queriedPackage : queriedPackages ) { if ( org.apache.commons.lang.StringUtils.startsWith ( reportedPackage , queriedPackage ) ) { filtered.add ( queriedPackage ) ; } } } return filtered ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) == ( event.getNativeEvent ( ) . getKeyCode ( ) ) ) { if ( ctx.canSetInModel ( ) ) { ctx.setInModel ( editor.getValue ( ) ) ; } } }

Target:
private < T > void setInModel ( final com.google.gwt.editor.client.EditorContext < T > ctx , java.lang.Object editor , T value ) { if ( ctx.canSetInModel ( ) ) { boolean editorValid = true ; if ( editor instanceof org.ovirt.engine.ui.common.widget.editor.HasEditorValidityState ) { editorValid = ( ( org.ovirt.engine.ui.common.widget.editor.HasEditorValidityState ) ( editor ) ) . isStateValid ( ) ; } if ( editorValid ) { ctx.setInModel ( value ) ; } } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > FindAllVDSByPmEnabled ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS i : items ) { if ( i.getpm_enabled ( ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > findAllVDSByPmEnabled ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS i : items ) { if ( i.getpm_enabled ( ) ) { ret.add ( i ) ; } } return ret ; }
Source:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
private int setUpGetStorageDomainsQueryExpectations ( int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByVmTemplateId , org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , getStorageDomains ( ) , null ) ; } return times ; }

Target:
private int setUpGetStorageDomainsQueryExpectations ( int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByVmTemplateId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , getStorageDomains ( ) , null ) ; } return times ; }
Source:
public void validateCantLiveMigrateToBackupDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( srcStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }

Target:
public void validateCantLiveMigrateToBackupDomain ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_POLICY_PARAMETERS_INVALID ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( checkRemoveEditValidations ( ) ) ) { return false ; } if ( ( getVdsGroupDao ( ) . getClustersByClusterPolicyId ( getParameters ( ) . getClusterPolicyId ( ) ) . size ( ) ) > 0 ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_INUSE , java.lang.String.format ( "$clusters %1$s" , clustersListIntoTokenizedString ( ) ) ) ; } return true ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( forceMigrationForNonMigratableVm ? 1231 : 1237 ) ; result = ( prime * result ) + ( ( targetVdsGroupId ) == null ? 0 : targetVdsGroupId.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( getVmId ( ) , forceMigrationForNonMigratableVm , targetVdsGroupId ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVmId ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }
Source:
public void validateVmMemoryCanRunOnVdsHighMem ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setPhysicalMemMb ( 15000 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanRunOnVds ( ) { boolean vmPassedMemoryRequirement = slaValidator.hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImageBase > mapDisks ( org.ovirt.engine.api.model.Disks disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImageBase > diskImages = null ; if ( ( disks != null ) && ( disks.isSetDisks ( ) ) ) { diskImages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.Disk disk : disks.getDisks ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ) ) ; diskImages.add ( diskImage ) ; } } return diskImages ; }

Target:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }
Source:
public static java.lang.String GetDefaultImportPath ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ImportDefaultPath ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ; } return "" ; }

Target:
public static java.lang.String GetDefaultImportPath ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ImportDefaultPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ; } return "" ; }
Source:
protected boolean checkIfNeedToBeOverride ( ) { if ( ( ( ( isTemplate ( ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ) ) && ( ! ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getForceOverride ( ) ) ) ) && ( getImage ( ) . getStorageIds ( ) . contains ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getStorageDomain ( ) . getId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean checkIfNeedToBeOverride ( ) { if ( ( ( ( isTemplate ( ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ) ) && ( ! ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getForceOverride ( ) ) ) ) && ( getImage ( ) . getStorageIds ( ) . contains ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getStorageDomain ( ) . getId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_ALREADY_EXISTS ) ; } return true ; }
Source:
public void getDiskList ( 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.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
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 ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createBondSlaves ( java.lang.String bondName , int slaveCount ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( slaveCount ) ; for ( int i = 0 ; i < slaveCount ; i ++ ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( ( "eth" + i ) , null ) ; if ( bondName != null ) { nic = enslaveOrReleaseNIC ( nic , bondName ) ; } ifaces.add ( nic ) ; } return ifaces ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createNics ( java.lang.String bondName , int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( ( "eth" + i ) , null ) ; if ( bondName != null ) { nic = enslaveOrReleaseNIC ( nic , bondName ) ; } ifaces.add ( nic ) ; } return ifaces ; }
Source:
public void testMissingSuperField ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }

Target:
public void testMissingSuperField ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }
Source:
public void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = runInternalQuery ( QueryType.GetUnregisteredCinderDiskByIdAndStorageDomainId , new org.ovirt.engine.core.common.action.GetCinderEntityByStorageDomainIdParameters ( getCinderDisk ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = returnValue.getReturnValue ( ) ; if ( cinderDisk != null ) { addCinderDiskToDB ( cinderDisk ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getReturnValue ( ) . setActionReturnValue ( cinderDisk.getId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.setSucceeded ( true ) ; } }

Target:
public void executeCommand ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue returnValue = runInternalQuery ( QueryType.GetUnregisteredCinderDiskByIdAndStorageDomainId , new org.ovirt.engine.core.common.action.GetCinderEntityByStorageDomainIdParameters ( getCinderDisk ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = returnValue.getReturnValue ( ) ; if ( cinderDisk != null ) { addCinderDiskToDB ( cinderDisk ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getReturnValue ( ) . setActionReturnValue ( cinderDisk.getId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.setSucceeded ( true ) ; } }
Source:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > destStorages , boolean notCheckSize ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getAllForStoragePool ( template.getstorage_pool_id ( ) . getValue ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages , notCheckSize ) ; }

Target:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > destStorages , boolean notCheckSize ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getstorage_pool_id ( ) . getValue ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages , notCheckSize ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( buildCommandEntity ( getParentParameters ( parentCommand ) . getCommandId ( ) , enableCallBack ) , cmdContext ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addBonds ( org.ovirt.engine.core.common.businessentities.network.Bond ... bonds ) { if ( nullParameters ( bonds ) ) { return this ; } if ( ( parameters.getBonds ( ) ) == null ) { parameters.setBonds ( new java.util.ArrayList < > ( ) ) ; } parameters.getBonds ( ) . addAll ( java.util.Arrays.asList ( bonds ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addBonds ( org.ovirt.engine.core.common.action.CreateOrUpdateBond ... createOrUpdateBonds ) { if ( nullParameters ( createOrUpdateBonds ) ) { return this ; } if ( ( parameters.getCreateOrUpdateBonds ( ) ) == null ) { parameters.setCreateOrUpdateBonds ( new java.util.ArrayList < > ( ) ) ; } parameters.getCreateOrUpdateBonds ( ) . addAll ( java.util.Arrays.asList ( createOrUpdateBonds ) ) ; return this ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.OperatingSystem os ) { if ( os != null ) { if ( os.isSetType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.OsType.class , os.getType ( ) , true ) ; } if ( os.isSetBoot ( ) ) { for ( org.ovirt.engine.api.model.Boot boot : os.getBoot ( ) ) { bootValidator.validateEnums ( boot ) ; } } } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.OperatingSystem os ) { if ( os != null ) { if ( os.isSetType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.OsType.class , org.ovirt.engine.api.model.OsTypeUtils.getAllValues ( ) , os.getType ( ) , true ) ; } if ( os.isSetBoot ( ) ) { for ( org.ovirt.engine.api.model.Boot boot : os.getBoot ( ) ) { bootValidator.validateEnums ( boot ) ; } } } }
Source:
public void perform ( ) { try { refreshExistingVmJobList ( ) ; refreshVmStats ( ) ; afterVMsRefreshTreatment ( ) ; vdsManager.vmsMonitoringInitFinished ( ) ; } finally { unlockVmsManager ( ) ; } }

Target:
public void perform ( ) { try { refreshExistingVmJobList ( ) ; refreshVmStats ( ) ; afterVMsRefreshTreatment ( ) ; vdsManager.vmsMonitoringInitFinished ( ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.error ( "Failed during vms monitoring on host error is: {}" , vdsManager.getVdsName ( ) , ex ) ; org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( "Exception:" , ex ) ; } finally { unlockVmsManager ( ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( array [ 1 ] ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.SetClusters ( model , clusters , null ) ; behavior.InitTemplate ( ) ; behavior.InitCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.PoolModelBehaviorBase ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( array [ 1 ] ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setClusters ( model , clusters , null ) ; behavior.initTemplate ( ) ; behavior.initCdImage ( ) ; }
Source:
public boolean pollVds ( ) { try { org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( host.getId ( ) ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = task.get ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) , java.util.concurrent.TimeUnit.SECONDS ) ; if ( returnValue.getSucceeded ( ) ) { return true ; } } catch ( java.lang.Exception e ) { } return false ; }

Target:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller poller = new org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller ( ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( poller.poll ( host.getId ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.info ( "Engine managed to communicate with VDSM agent on host '{}' ('{}')" , host.getName ( ) , host.getId ( ) ) ; return true ; } } return false ; }