auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void Manage ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel manageModel = createManageList ( ) ; setWindow ( manageModel ) ; manageModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworkTitle ( ) ) ; manageModel.setHashName ( "assign_network" ) ; }

Target:
public void manage ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel manageModel = createManageList ( ) ; setWindow ( manageModel ) ; manageModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworkTitle ( ) ) ; manageModel.setHashName ( "assign_network" ) ; }
Source:
private java.lang.String getMemoryFromSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( cachedMemoryVolumeFromSnapshot ) == null ) { cachedMemoryVolumeFromSnapshot = ( org.ovirt.engine.core.common.FeatureSupported.memorySnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ? getActiveSnapshot ( ) . getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; } return cachedMemoryVolumeFromSnapshot ; }

Target:
private java.lang.String getMemoryFromSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( cachedMemoryVolumeFromSnapshot ) == null ) { boolean archSupportSnapshot = org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; cachedMemoryVolumeFromSnapshot = ( archSupportSnapshot && ( org.ovirt.engine.core.common.FeatureSupported.memorySnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) ? getActiveSnapshot ( ) . getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; } return cachedMemoryVolumeFromSnapshot ; }
Source:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { int subTabHeight = ( splitPanel.getOffsetHeight ( ) ) / 2 ; if ( subTabHeight > ( org.ovirt.engine.ui.webadmin.section.main.view.MainContentView.subTabPanelMaxHeight ) ) { subTabHeight = org.ovirt.engine.ui.webadmin.section.main.view.MainContentView.subTabPanelMaxHeight ; } splitPanel.addSouth ( subTabPanelContainer , subTabHeight ) ; splitPanel.add ( mainTabPanelContainer ) ; } else { splitPanel.add ( mainTabPanelContainer ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }

Target:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.common.view.SubTabHelper.getSubTabHeight ( clientStorage , splitPanel ) ) ; splitPanel.add ( mainTabPanelContainer ) ; } else { splitPanel.add ( mainTabPanelContainer ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }
Source:
private org.ovirt.engine.core.aaa.DirectoryUser getUserById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String userId ) { org.ovirt.engine.core.aaa.DirectoryUser result ; try { userId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( userId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } result = getEntity ( org.ovirt.engine.core.aaa.DirectoryUser.class , VdcQueryType.GetDirectoryUserById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , userId ) , userId , true ) ; return result ; }

Target:
private org.ovirt.engine.core.aaa.DirectoryUser getUserById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String userId ) { org.ovirt.engine.core.aaa.DirectoryUser result ; try { userId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( userId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } result = getEntity ( org.ovirt.engine.core.aaa.DirectoryUser.class , QueryType.GetDirectoryUserById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , userId ) , userId , true ) ; return result ; }
Source:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }

Target:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; 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 int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getVmId ( ) ) == null ? 0 : getVmId ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , vmId ) ; }
Source:
public void testDetachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testDetachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyBadRequest ( wae ) ; } }
Source:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmMaxPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }

Target:
private void retrieveMaxSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmMaxPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; retrieveDefaultSpmPriority ( ) ; } } ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.Nic nic ) { return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , entity ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , nic ) ; validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmTemplateInterface , new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( instanceTypeId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( int index ) { org.ovirt.engine.api.restapi.resource.Cluster entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.DATA_CENTER_ID ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; org.mockito.Mockito.when ( group.getStoragePoolId ( ) ) . thenReturn ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
protected java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VM > asIterableReturnValue ( java.lang.Object returnValue ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ? resources.vmsImage ( ) : ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ? resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; return ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ? resources.vmsImage ( ) : ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ? resources.templatesImage ( ) : null ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyVmCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyVmCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; setvmBasicDiskListModel ( new org.ovirt.engine.ui.uicommonweb.models.userportal.VmBasicDiskListModel ( ) ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( getvmBasicDiskListModel ( ) ) ; setDetailModels ( list ) ; setActiveDetailModel ( getvmBasicDiskListModel ( ) ) ; }

Target:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; setVmBasicDiskListModel ( new org.ovirt.engine.ui.uicommonweb.models.userportal.VmBasicDiskListModel ( ) ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( getVmBasicDiskListModel ( ) ) ; setDetailModels ( list ) ; setActiveDetailModel ( getVmBasicDiskListModel ( ) ) ; }
Source:
public void testSave ( ) { dao.save ( newAuditLog ) ; org.ovirt.engine.core.common.businessentities.AuditLog result = dao.get ( newAuditLog.getaudit_log_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newAuditLog , result ) ; }

Target:
public void testSave ( ) { java.util.Date newAuditLogDateCuttoff = newAuditLog.getlog_time ( ) ; newAuditLogDateCuttoff.setTime ( ( ( newAuditLogDateCuttoff.getTime ( ) ) - 1 ) ) ; int countBefore = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; dao.save ( newAuditLog ) ; int countAfter = dao.getAllAfterDate ( newAuditLogDateCuttoff ) . size ( ) ; org.junit.Assert.assertEquals ( ( countBefore + 1 ) , countAfter ) ; }
Source:
public void iscsiBondWithTheSameNameDoesNotExistInDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; iscsiBonds.add ( createIscsiBond ( "First" , dataCenterId ) ) ; iscsiBonds.add ( createIscsiBond ( "Second" , dataCenterId ) ) ; org.mockito.Mockito.doReturn ( iscsiBonds ) . when ( iscsiBondDao ) . getAllByStoragePoolId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , validator.iscsiBondWithTheSameNameExistInDataCenter ( createIscsiBond ( "Third" , dataCenterId ) ) ) ; }

Target:
public void iscsiBondWithTheSameNameDoesNotExistInDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; iscsiBonds.add ( createIscsiBond ( "First" , dataCenterId ) ) ; iscsiBonds.add ( createIscsiBond ( "Second" , dataCenterId ) ) ; org.mockito.Mockito.doReturn ( iscsiBonds ) . when ( iscsiBondDao ) . getAllByStoragePoolId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( ValidationResult.VALID , validator.iscsiBondWithTheSameNameExistInDataCenter ( createIscsiBond ( "Third" , dataCenterId ) ) ) ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.gettime_zone ( ) ) ) { vm.settime_zone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getos ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.gettime_zone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.gettime_zone ( ) ; break ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.gettime_zone ( ) ) ) { vm.settime_zone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getos ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.gettime_zone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.gettime_zone ( ) ; break ; } return timeZone ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , host.getName ( ) , host.getStatus ( ) . name ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostValidator.VAR_HOST_STATUS , host.getStatus ( ) . name ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
private static void assertIndexes ( java.util.List < java.lang.Integer > result , int expectedSize ) { org.junit.Assert.assertEquals ( java.lang.String.format ( "Result should have %d items" , expectedSize ) , expectedSize , result.size ( ) ) ; for ( int i = 0 ; i < expectedSize ; ++ i ) { org.junit.Assert.assertEquals ( java.lang.String.format ( "index %d should be %d" , i , i ) , java.lang.Integer.valueOf ( i ) , result.get ( i ) ) ; } }

Target:
private static void assertIndexes ( java.util.List < java.lang.Integer > result , int expectedSize ) { org.junit.jupiter.api.Assertions.assertEquals ( expectedSize , result.size ( ) , java.lang.String.format ( "Result should have %d items" , expectedSize ) ) ; for ( int i = 0 ; i < expectedSize ; ++ i ) { org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Integer.valueOf ( i ) , result.get ( i ) , java.lang.String.format ( "index %d should be %d" , i , i ) ) ; } }
Source:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassCanDoAction ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testCanEditARunningVM ( ) { prepareVmToPassValidate ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc reset ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.reset ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( 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.AlignmentScanReturnForXmlRpc getDiskAlignment ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > driveSpecs ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDiskAlignment ( vmId , driveSpecs ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.AlignmentScanReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.AlignmentScanReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected boolean isExecutedAsChildCommand ( ) { return ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcActionType getParentCommandType ( ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = org.ovirt.engine.core.common.action.VdcActionType.Unknown ; if ( parentHasCallback ( ) ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { parentCommand = getParameters ( ) . getParentCommand ( ) ; } } else { parentCommand = getParameters ( ) . getParentCommand ( ) ; } return parentCommand ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setProviders ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterList ( dcQuery ) ; }

Target:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterList ( dcQuery ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( sender ) ) ; java.util.List items = ( ( java.util.List ) ( model.getItems ( ) ) ) ; java.lang.Object selectedItem = model.getSelectedItem ( ) ; updatePmPanelsVisibility ( ( ( items.indexOf ( selectedItem ) ) == 0 ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { createSpmControls ( object ) ; }
Source:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) ) ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) ) ) ; } return null ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . setnet_config_dirty ( false ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . update ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . getDynamicData ( ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetSafeNetworkConfig , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . setNetConfigDirty ( false ) ; org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . update ( org.ovirt.engine.core.bll.network.host.CommitNetworkChangesCommand.getVds ( ) . getDynamicData ( ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }

Target:
public void onCreated ( org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault instance ) { getIcon ( ) . setEntity ( instance ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }
Source:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v3_3 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; }

Target:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v3_3 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; mcr.mockConfigValue ( ConfigValues.MaxIoThreadsPerVm , 127 ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.propertyName ) ) { externalDiskPanel.clear ( ) ; if ( ( sanStorageModel.getProgress ( ) ) != null ) { externalDiskPanel.add ( progressContent ) ; } else { externalDiskPanel.add ( storageView ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( PropertyChangedEventArgs.Args.PROGRESS.toString ( ) . equals ( pcArgs.propertyName ) ) { externalDiskPanel.clear ( ) ; if ( ( sanStorageModel.getProgress ( ) ) != null ) { externalDiskPanel.add ( progressContent ) ; } else { externalDiskPanel.add ( storageView ) ; } } }
Source:
public static java.lang.String combine ( java.lang.String source , java.lang.String ... strings ) { java.lang.StringBuffer buffer = new java.lang.StringBuffer ( source ) ; if ( strings != null ) { for ( java.lang.String str : strings ) { buffer.append ( str ) ; } } return buffer.toString ( ) ; }

Target:
public static java.lang.String combine ( java.lang.String source , java.lang.String ... strings ) { java.lang.StringBuffer buffer = new java.lang.StringBuffer ( source ) ; if ( strings != null ) { for ( java.lang.String str : strings ) { buffer.append ( "\n" ) ; buffer.append ( str ) ; } } return buffer.toString ( ) ; }
Source:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) . value ( ) ) ; for ( org.ovirt.engine.api.model.IP ip : model.getIps ( ) . getIPs ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) . value ( ) ) ; for ( org.ovirt.engine.api.model.Ip ip : model.getIps ( ) . getIps ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( java.lang.String host ) { try { return org.ovirt.engine.core.compat.Guid.createGuidFromString ( host ) ; } catch ( java.lang.IllegalArgumentException exception ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host ) , host ) ; if ( entity != null ) { return entity.getId ( ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; } }
Source:
public org.ovirt.engine.core.compat.Guid findActiveISODomain ( org.ovirt.engine.core.compat.Guid storagePoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getStorageDomainDAO ( ) . getAllForStoragePool ( storagePoolId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( domain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return domain.getId ( ) ; } } return null ; }

Target:
public org.ovirt.engine.core.compat.Guid findActiveISODomain ( org.ovirt.engine.core.compat.Guid storagePoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( domain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return domain.getId ( ) ; } } return null ; }
Source:
protected void handleVdsErrors ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; }

Target:
protected void handleVdsErrors ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setError ( null ) ; }
Source:
private void removeVmStatlessImages ( ) { isFailedStatlessSnapshot = true ; org.ovirt.engine.core.bll.VmPoolHandler.removeVmStatelessImages ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { isFailedStatlessSnapshot = true ; org.ovirt.engine.core.bll.VmPoolHandler.removeVmStatelessImages ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
public void setUp ( ) throws java.io.IOException { ovfManager.setOsRepository ( osRepository ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
private boolean SelectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VmTemplate > Cast ( getSelectedItems ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( NGuid.Empty ) ) ) { return true ; } } } return false ; }

Target:
private boolean selectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VmTemplate > cast ( getSelectedItems ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( NGuid.Empty ) ) ) { return true ; } } } return false ; }