auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static < T extends org.ovirt.engine.core.common.businessentities.Nameable > java.util.Collection < java.lang.String > replaceWithNameable ( java.lang.String propertyName , java.util.List < T > items ) { java.util.List < java.lang.Object > printedItems = new java.util.ArrayList < > ( items.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Nameable itemName : items ) { printedItems.add ( itemName.getName ( ) ) ; } return org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( propertyName , printedItems ) ; }

Target:
public static < T extends org.ovirt.engine.core.common.businessentities.Nameable > java.util.Collection < java.lang.String > replaceWithNameable ( java.lang.String propertyName , java.util.Collection < T > items ) { java.util.List < java.lang.Object > printedItems = new java.util.ArrayList < > ( items.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Nameable itemName : items ) { printedItems.add ( itemName.getName ( ) ) ; } return org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( propertyName , printedItems ) ; }
Source:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService entity ) { if ( ( entity.getPort ( ) ) > 0 ) { return java.lang.String.valueOf ( entity.getPort ( ) ) ; } else { return constants.notAvailableLabel ( ) ; } }

Target:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService entity ) { if ( ( ( entity.getPort ( ) ) != null ) && ( ( entity.getPort ( ) ) > 0 ) ) { return java.lang.String.valueOf ( entity.getPort ( ) ) ; } else { return constants.notAvailableLabel ( ) ; } }
Source:
public void geoRepResumeSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ResumeGeoRepSessionCommand ( param ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void geoRepResumeSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ResumeGeoRepSessionCommand ( param ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void testLockedDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains tempStorageDomains = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; tempStorageDomains.setstatus ( StorageDomainStatus.Locked ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }

Target:
public void testLockedDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setstatus ( StorageDomainStatus.Locked ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }
Source:
private void updateGroupLabel ( ) { groupLabel.setText ( getGroupLabel ( selectableObjects.get ( getListBox ( ) . getSelectedIndex ( ) ) ) ) ; }

Target:
private void updateGroupLabel ( ) { if ( ( ( selectableObjects.size ( ) ) > ( getListBox ( ) . getSelectedIndex ( ) ) ) && ( ( getListBox ( ) . getSelectedIndex ( ) ) >= 0 ) ) { groupLabel.setText ( getGroupLabel ( selectableObjects.get ( getListBox ( ) . getSelectedIndex ( ) ) ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VmNetworkInterface setNetwork ( org.ovirt.engine.api.model.NIC device , org.ovirt.engine.core.common.businessentities.VmNetworkInterface ni ) { if ( device.isSetNetwork ( ) ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.network net = lookupClusterNetwork ( clusterId , ( device.getNetwork ( ) . isSetId ( ) ? asGuid ( device.getNetwork ( ) . getId ( ) ) : null ) , device.getNetwork ( ) . getName ( ) ) ; if ( net != null ) { ni.setNetworkName ( net.getname ( ) ) ; } } return ni ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmNetworkInterface setNetwork ( org.ovirt.engine.api.model.NIC device , org.ovirt.engine.core.common.businessentities.VmNetworkInterface ni ) { if ( device.isSetNetwork ( ) ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Network net = lookupClusterNetwork ( clusterId , ( device.getNetwork ( ) . isSetId ( ) ? asGuid ( device.getNetwork ( ) . getId ( ) ) : null ) , device.getNetwork ( ) . getName ( ) ) ; if ( net != null ) { ni.setNetworkName ( net.getname ( ) ) ; } } return ni ; }
Source:
public static void getAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }

Target:
public void getAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; boolean isReadOnly = checkForRemoveExternalNetworkAvailability ( providers , externalProviderIds ) ; makeRemoveExternalNetworkCheckboxAvailable ( isReadOnly ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = returnValue.getReturnValue ( ) ; boolean isReadOnly = checkForRemoveExternalNetworkAvailability ( providers , externalProviderIds ) ; makeRemoveExternalNetworkCheckboxAvailable ( isReadOnly ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; }
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 , 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 ) ; } } } }

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 ( ) ) { bootValidator.validateEnums ( os.getBoot ( ) ) ; } } }
Source:
private java.lang.String writeJsonAsString ( java.lang.Object payload , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.writeValueAsString ( payload ) ; } catch ( org.codehaus.jackson.JsonGenerationException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } catch ( org.codehaus.jackson.map.JsonMappingException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } catch ( java.io.IOException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } }

Target:
private java.lang.String writeJsonAsString ( java.lang.Object payload , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.writeValueAsString ( payload ) ; } catch ( java.io.IOException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( template.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = org.powermock.api.easymock.PowerMock.createMock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.easymock.EasyMock.expect ( backend.runQuery ( org.easymock.EasyMock.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . andReturn ( queryResult ) ; org.easymock.EasyMock.expect ( queryResult.getSucceeded ( ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queryResult.getReturnValue ( ) ) . andReturn ( setUpStats ( ) ) . anyTimes ( ) ; org.powermock.api.easymock.PowerMock.replayAll ( ) ; }

Target:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = createMock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.easymock.EasyMock.expect ( backend.runQuery ( org.easymock.EasyMock.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . andReturn ( queryResult ) ; org.easymock.EasyMock.expect ( queryResult.getSucceeded ( ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queryResult.getReturnValue ( ) ) . andReturn ( setUpStats ( ) ) . anyTimes ( ) ; replayAll ( ) ; }
Source:
protected void addVmToDb ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmInterfaces ( ) ; addVmStatistics ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }

Target:
protected void addVmToDb ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmStatistics ( ) ; addVmInterfaces ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }
Source:
private java.lang.String getSessionId ( ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( ( ( "IP [" + ( request.getRemoteAddr ( ) ) ) + "], Session ID [" ) + ( session.getId ( ) ) ) + "]" ) ) ; return session.getId ( ) ; }

Target:
private javax.servlet.http.HttpSession getSession ( ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( ( ( "IP [" + ( request.getRemoteAddr ( ) ) ) + "], Session ID [" ) + ( session.getId ( ) ) ) + "]" ) ) ; return session ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getDisksList ( ) { if ( ( selectedActiveDisks ) == null ) { selectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , false , true ) ; } return selectedActiveDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getDisksList ( ) { if ( ( selectedActiveDisks ) == null ) { selectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , true , true ) ; } return selectedActiveDisks ; }
Source:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedObject = selectionModel.getSelectedObject ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > selectedItems = ( selectedObject != null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Bookmark > ( java.util.Arrays.asList ( selectedObject ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Bookmark > ( ) ; this . setSelectedItems ( selectedItems ) ; }

Target:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedObject = selectionModel.getSelectedObject ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > selectedItems = ( selectedObject != null ) ? new java.util.ArrayList ( java.util.Arrays.asList ( selectedObject ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Bookmark > ( ) ; this . setSelectedItems ( selectedItems ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot addSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId , java.lang.String description , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus snapshotStatus , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , org.ovirt.engine.core.common.businessentities.VM vm , boolean saveVmConfiguration , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , snapshotStatus , vm.getId ( ) , ( saveVmConfiguration ? generateVmConfiguration ( vm ) : null ) , snapshotType , description , new java.util.Date ( ) , vm.getAppList ( ) ) ; getSnapshotDao ( ) . save ( snapshot ) ; compensationContext.snapshotNewEntity ( snapshot ) ; return snapshot ; }

Target:
public org.ovirt.engine.core.common.businessentities.Snapshot addSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId , java.lang.String description , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus snapshotStatus , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , org.ovirt.engine.core.common.businessentities.VM vm , boolean saveVmConfiguration , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , snapshotStatus , vm.getId ( ) , ( saveVmConfiguration ? generateVmConfiguration ( vm ) : null ) , snapshotType , description , new java.util.Date ( ) , vm.getAppList ( ) ) ; getSnapshotDao ( ) . save ( snapshot ) ; compensationContext.snapshotNewEntity ( snapshot ) ; return snapshot ; }
Source:
public boolean Validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
public boolean validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getvds_group_name ( ) . compareTo ( paramT2.getSecond ( ) . getvds_group_name ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getname ( ) . compareTo ( paramT2.getSecond ( ) . getname ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > paramT1 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > paramT2 ) { int compareValue = paramT1.getSecond ( ) . getvds_group_name ( ) . compareTo ( paramT2.getSecond ( ) . getvds_group_name ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return paramT1.getSecond ( ) . getName ( ) . compareTo ( paramT2.getSecond ( ) . getName ( ) ) ; }
Source:
private org.ovirt.engine.api.model.Network lookupAtachedNetwork ( java.lang.String networkName ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( networkName ) ) ) { for ( org.ovirt.engine.api.model.Network nwk : parent.getClusterNetworks ( ) ) { if ( nwk.getname ( ) . equals ( networkName ) ) return nwk ; } } return null ; }

Target:
private org.ovirt.engine.api.model.Network lookupAtachedNetwork ( java.lang.String networkName ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( networkName ) ) ) { for ( org.ovirt.engine.api.model.Network nwk : parent.getClusterNetworks ( ) ) { if ( nwk.getName ( ) . equals ( networkName ) ) return nwk ; } } return null ; }
Source:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void commandFailsNoPubKeys ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers , org.ovirt.engine.core.common.businessentities.VDS exceptServer ) { for ( org.ovirt.engine.core.common.businessentities.VDS server : servers ) { if ( ( ( server.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) && ( ! ( server.getId ( ) . equals ( exceptServer.getId ( ) ) ) ) ) { return server ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers , org.ovirt.engine.core.common.businessentities.VDS exceptServer ) { for ( org.ovirt.engine.core.common.businessentities.VDS server : servers ) { if ( ( ( server.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) && ( ! ( server.getId ( ) . equals ( exceptServer.getId ( ) ) ) ) ) { return server ; } } return null ; }
Source:
private void mockQueryParameters ( ) { org.mockito.Mockito.doReturn ( unregisteredDisksDaoMock ) . when ( getQuery ( ) ) . getUnregisteredDisksDao ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . isFilterResult ( ) ) . thenReturn ( true ) ; }

Target:
private void mockQueryParameters ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . isFilterResult ( ) ) . thenReturn ( true ) ; }
Source:
private boolean isSelectedDiskInterfaceIDE ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > selectedDisks ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > selectedDisk : selectedDisks ) { if ( ( selectedDisk.getEntity ( ) . getDisk ( ) . getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return true ; } } return false ; }

Target:
private boolean isSelectedDiskInterfaceIDE ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > selectedDisks ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > selectedDisk : selectedDisks ) { if ( ( selectedDisk.getEntity ( ) . getDiskInterface ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return true ; } } return false ; }
Source:
private org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand < org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters > mockedCommand ( org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters parameters ) { final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand < org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand ( parameters ) ) ; org.mockito.Mockito.when ( command.getDbFacade ( ) ) . thenReturn ( dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getVmNumaNodeDao ( ) ) . thenReturn ( vmNumaNodeDao ) ; org.mockito.Mockito.when ( dbFacade.getVdsNumaNodeDao ( ) ) . thenReturn ( vdsNumaNodeDao ) ; org.mockito.Mockito.when ( dbFacade.getVmDao ( ) ) . thenReturn ( vmDao ) ; command.init ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand < org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters > mockedCommand ( org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters parameters ) { final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand < org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( command.getDbFacade ( ) ) . thenReturn ( dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getVmNumaNodeDao ( ) ) . thenReturn ( vmNumaNodeDao ) ; org.mockito.Mockito.when ( dbFacade.getVdsNumaNodeDao ( ) ) . thenReturn ( vdsNumaNodeDao ) ; org.mockito.Mockito.when ( dbFacade.getVmDao ( ) ) . thenReturn ( vmDao ) ; command.init ( ) ; return command ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }
Source:
public java.util.Collection < org.ovirt.engine.api.model.DetailedLink > getLinks ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < org.ovirt.engine.api.model.DetailedLink > results = new java.util.ArrayList < org.ovirt.engine.api.model.DetailedLink > ( ) ; java.util.List < java.lang.Class < ? > > classes = org.ovirt.engine.api.utils.ReflectionHelper.getClasses ( org.ovirt.engine.api.rsdl.RsdlBuilder.RESOURCES_PACKAGE ) ; for ( java.lang.String path : rels ) { java.lang.Class < ? > resource = findResource ( path , classes ) ; results.addAll ( describe ( resource , path , new java.util.HashMap < java.lang.String , java.lang.reflect.Type > ( ) ) ) ; } return results ; }

Target:
public java.util.Collection < org.ovirt.engine.api.model.DetailedLink > getLinks ( ) throws java.io.IOException , java.lang.ClassNotFoundException { java.util.List < org.ovirt.engine.api.model.DetailedLink > results = new java.util.ArrayList < org.ovirt.engine.api.model.DetailedLink > ( ) ; for ( java.lang.String path : rels ) { java.lang.Class < ? > resource = findResource ( path ) ; results.addAll ( describe ( resource , path , new java.util.HashMap < java.lang.String , java.lang.reflect.Type > ( ) ) ) ; } return results ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . loadJobSteps ( job ) ; } org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }
Source:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { createParameters ( srcStorageId , dstStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setDisks ( value ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setDisks ( value ) ; }
Source:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ENABLE , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void setRxRate ( java.lang.Double value ) { if ( ( ( rxRate ) == null ) && ( value == null ) ) { return ; } if ( ( ( rxRate ) == null ) || ( ! ( rxRate.equals ( value ) ) ) ) { rxRate = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "RxRate" ) ) ; } }

Target:
public void setRxRate ( java.lang.Double value ) { rxRate = value ; }
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( getImagesToCheckDestinationStorageDomains ( ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE ) ; validDisksDomains = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( getImagesToCheckDestinationStorageDomains ( ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE ) ; validDisksDomains = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( diskImagesOnAnyApplicableDomains ( templateDiskImages , validDisksDomains , poolDomainsMap , validDomainStatuses ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } throw new java.lang.IllegalArgumentException ( ( "Unable to find network attachment for network id " + networkId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } throw new java.lang.IllegalArgumentException ( ( "Unable to find network attachment for network id " + networkId ) ) ; }
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 ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } org.ovirt.engine.ui.common.widget.tab.TabAccessibleChangeEvent.fire ( this , this ) ; }

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 ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } }
Source:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.< java.lang.Object > GetValue ( org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configValue.toString ( ) ) , version ) ; configValuesMap.put ( key , value ) ; }

Target:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.< java.lang.Object > getValue ( org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configValue.toString ( ) ) , version ) ; configValuesMap.put ( key , value ) ; }
Source:
private < T > T readJsonString ( java.lang.Object source , java.lang.Class < T > type , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.readValue ( source.toString ( ) , type ) ; } catch ( org.codehaus.jackson.JsonParseException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } catch ( org.codehaus.jackson.map.JsonMappingException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } catch ( java.io.IOException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } }

Target:
private < T > T readJsonString ( java.lang.Object source , java.lang.Class < T > type , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.readValue ( source.toString ( ) , type ) ; } catch ( java.io.IOException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } }
Source:
public void validate ( ) { numOfVfs.validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( 0 , getMaxNumOfVfs ( ) . getEntity ( ) ) } ) ; labelsModel.validate ( ) ; setIsValid ( ( ( labelsModel.getIsValid ( ) ) && ( numOfVfs.getIsValid ( ) ) ) ) ; }

Target:
public boolean validate ( ) { numOfVfs.validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( 0 , getMaxNumOfVfs ( ) . getEntity ( ) ) } ) ; labelsModel.validate ( ) ; return ( labelsModel.getIsValid ( ) ) && ( numOfVfs.getIsValid ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.SyncImageGroupDataVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) . getValue ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , org.ovirt.engine.core.common.vdscommands.SyncImageGroupDataVDSCommandParameters.SYNC_TYPE_INTERNAL ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.SyncImageGroupDataVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , org.ovirt.engine.core.common.vdscommands.SyncImageGroupDataVDSCommandParameters.SYNC_TYPE_INTERNAL ) ; }