auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setSize ( ( 1024 * 1024L ) ) ; model.setFormat ( DiskFormat.COW.value ( ) ) ; model.setInterface ( org.ovirt.engine.api.model.DiskInterface.IDE.value ( ) ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setAllowSnapshot ( false ) ; model.setPropagateErrors ( true ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setSize ( ( 1024 * 1024L ) ) ; model.setFormat ( DiskFormat.COW.value ( ) ) ; model.setInterface ( org.ovirt.engine.api.model.DiskInterface.IDE.value ( ) ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setPropagateErrors ( true ) ; return model ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateVmModelBehavior ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateVmModelBehavior ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }
Source:
private void moveMacsOfUpdatedDataCenter ( org.ovirt.engine.core.compat.Guid oldMacPoolId , org.ovirt.engine.core.compat.Guid newMacPoolId , java.util.List < java.lang.String > vmInterfaceMacs ) { java.util.Objects.requireNonNull ( vmInterfaceMacs ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc poolPerDc = org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy sourcePool = poolPerDc.getPoolById ( oldMacPoolId ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy targetPool = poolPerDc.getPoolById ( newMacPoolId ) ; for ( java.lang.String mac : vmInterfaceMacs ) { sourcePool.freeMac ( mac ) ; targetPool.forceAddMac ( mac ) ; } }

Target:
private void moveMacsOfUpdatedDataCenter ( org.ovirt.engine.core.compat.Guid oldMacPoolId , org.ovirt.engine.core.compat.Guid newMacPoolId , java.util.List < java.lang.String > vmInterfaceMacs ) { java.util.Objects.requireNonNull ( vmInterfaceMacs ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy sourcePool = poolPerDc.getPoolById ( oldMacPoolId ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy targetPool = poolPerDc.getPoolById ( newMacPoolId ) ; for ( java.lang.String mac : vmInterfaceMacs ) { sourcePool.freeMac ( mac ) ; targetPool.forceAddMac ( mac ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setCompatibilityVersion ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
public void setUp ( ) { org.mockito.Mockito.doReturn ( storageDomainStaticDao ) . when ( command ) . getStorageDomainStaticDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; }
Source:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getstatus ( ) ) != status ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }

Target:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }
Source:
public void onSuccess ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void testAddIncompleteParameters2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }
Source:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.ClusterDao clusterDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( geoRepUtil ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( getCluster ( MASTER_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getCluster ( SLAVE_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( SLAVE_CLUSTER_ID ) ; }

Target:
public void setupMock ( org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.ClusterDao clusterDao ) { org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( getCluster ( MASTER_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getCluster ( SLAVE_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( SLAVE_CLUSTER_ID ) ; }
Source:
public void storageDomainIdWithStorageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.Guid g = b.getStorageDomainId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void storageDomainIdWithStorageDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.Guid g = b.getStorageDomainId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.NetworkView networkView = ( ( org.ovirt.engine.core.common.businessentities.NetworkView ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ( networkView.getNetwork ( ) , this ) ; setWindow ( networkModel ) ; initDcList ( networkModel ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ( network , this ) ; setWindow ( networkModel ) ; initDcList ( networkModel ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Tag" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Tag" , "add" , "name" ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportStorageModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportStorageModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( array [ 1 ] ) ) ; behavior.postUpdateItemsAvailability ( behavior , storageModelItem , ( returnValue == null ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportStorageModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportStorageModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( array [ 1 ] ) ) ; behavior.postUpdateItemsAvailability ( storageModelItem , ( returnValue == null ) ) ; }
Source:
private static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < > ( ) ; if ( ( strings != null ) && ( ! ( strings.isEmpty ( ) ) ) ) { for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( guidString ) ) ; } } return guidList ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromStringArray ( java.util.List < java.lang.String > strings ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guidList = new java.util.ArrayList < > ( ) ; for ( java.lang.String guidString : strings ) { guidList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( guidString ) ) ; } return guidList ; }
Source:
public void setUp ( ) throws java.lang.Exception { storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storageDomain.setStorageType ( StorageType.NFS ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setCompatibilityVersion ( Version.ALL.get ( 0 ) ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; spyValidator ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storageDomain.setStorageType ( StorageType.NFS ) ; storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setCompatibilityVersion ( Version.ALL.get ( 0 ) ) ; spyValidator ( ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasNics = ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) > 0 ; if ( ! hasNics ) { org.ovirt.engine.ui.uicommonweb.models.vms.BootSequenceModel bootSequenceModel = getBootSequence ( ) ; bootSequenceModel.getNetworkOption ( ) . setIsChangable ( false ) ; bootSequenceModel.getNetworkOption ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . interfaceIsRequiredToBootFromNetwork ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasNics = ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) > 0 ; if ( ! hasNics ) { org.ovirt.engine.ui.uicommonweb.models.vms.BootSequenceModel bootSequenceModel = getBootSequence ( ) ; bootSequenceModel.getNetworkOption ( ) . setIsChangable ( false ) ; bootSequenceModel.getNetworkOption ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . interfaceIsRequiredToBootFromNetwork ( ) ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.ui.common.widget.editor.ListModelListBox < T > . ListItem item = ( ( org.ovirt.engine.ui.common.widget.editor.ListModelListBox < T > . ListItem ) ( event.getSource ( ) ) ) ; this . setValue ( item.getValue ( ) , true ) ; if ( this . isMultiSelect ) { event.stopPropagation ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.ui.common.widget.editor.ListModelListBox < T > . ListItem item = ( ( org.ovirt.engine.ui.common.widget.editor.ListModelListBox < T > . ListItem ) ( event.getSource ( ) ) ) ; this . setValue ( item.getValue ( ) , true , true ) ; if ( this . isMultiSelect ) { event.stopPropagation ( ) ; } }
Source:
protected void buildSysprepVmPayload ( java.lang.String strSysPrepContent ) { byte [ ] binarySysPrep ; try { binarySysPrep = strSysPrepContent.getBytes ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder.UTF8_CHARSET_ENCODING ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "Unsupported charset while building VM sysprep" , e ) ; } createInfo.add ( VdsProperties.sysprepInf , binarySysPrep ) ; }

Target:
protected void buildSysprepVmPayload ( java.lang.String strSysPrepContent ) { byte [ ] binarySysPrep ; try { binarySysPrep = strSysPrepContent.getBytes ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder.UTF8_CHARSET_ENCODING ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "Unsupported charset while building VM sysprep" , e ) ; } createInfo.put ( VdsProperties.sysprepInf , binarySysPrep ) ; }
Source:
public void testCredentialsWithConnectionExtensionSameHostDifferentTarget ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target2" ) ; org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionExtension ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( connExtDaoMock.getByHostIdAndTarget ( connExt.getHostId ( ) , connExt.getIqn ( ) ) ) . thenReturn ( connExt ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( connExt.getHostId ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getUserName ( ) , conn.getPassword ( ) ) ; }

Target:
public void testCredentialsWithConnectionExtensionSameHostDifferentTarget ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target2" ) ; org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionExtension ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( connExt.getHostId ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getUserName ( ) , conn.getPassword ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > tail ( ) { if ( ( size ( ) ) >= 2 ) { return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > ( subList ( 1 , size ( ) ) ) ; } return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > ( ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > tail ( ) { if ( ( size ( ) ) >= 2 ) { return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList ( subList ( 1 , size ( ) ) ) ; } return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList < > ( ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.events.EventModel eventModel ) { driver.edit ( eventModel ) ; org.ovirt.engine.core.common.businessentities.AuditLog event = eventModel.getEvent ( ) ; eventIdLabel.asValueBox ( ) . setValue ( event.getlog_typeValue ( ) ) ; eventTimeLabel.asValueBox ( ) . setValue ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) . render ( event.getlog_time ( ) ) ) ; eventMessageTextArea.asValueBox ( ) . setValue ( event.getmessage ( ) ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.events.EventModel eventModel ) { driver.edit ( eventModel ) ; org.ovirt.engine.core.common.businessentities.AuditLog event = eventModel.getEvent ( ) ; eventIdLabel.asValueBox ( ) . setValue ( java.lang.String.valueOf ( event.getlog_typeValue ( ) ) ) ; eventTimeLabel.asValueBox ( ) . setValue ( new org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer ( ) . render ( event.getlog_time ( ) ) ) ; eventMessageTextArea.asValueBox ( ) . setValue ( event.getmessage ( ) ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( runningVm.getstatus ( ) . isGuestUp ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; model = addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addInlineStatistics ( model ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addInlineStatistics ( model ) ; } return model ; }
Source:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , VdcActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Agent update ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > agentResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetFenceAgentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.pm.FenceAgent entity = getEntity ( agentResolver , true ) ; return performUpdate ( agent , entity , map ( entity ) , agentResolver , VdcActionType.UpdateFenceAgent , new org.ovirt.engine.api.restapi.resource.BackendFenceAgentResource.UpdateParametersProvider ( ) ) ; }
Source:
public void masterDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( storagePoolId , storageDomainId , false ) ; parameters.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ReconstructMasterDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void masterDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( storagePoolId , storageDomainId , true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ReconstructMasterDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIds , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageId : storageIds ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ; if ( storageDomain != null ) { list.add ( org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ) ; } } return list ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIds , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageId : storageIds ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ; if ( storageDomain != null ) { list.add ( storageDomain ) ; } } return list ; }
Source:
public static boolean interfaceHasVlan ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allIfaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : allIfaces ) { if ( ( ( i.getVlanId ( ) ) != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( i.getName ( ) , iface.getName ( ) ) ) ) { return true ; } } return false ; }

Target:
public static boolean interfaceHasVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allIfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : allIfaces ) { if ( ( ( i.getVlanId ( ) ) != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( i.getName ( ) , iface.getName ( ) ) ) ) { return true ; } } return false ; }
Source:
public void testGetAllStoragePoolIsoMapsForStoragePool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > result = dao.getAllForStoragePool ( existingPool.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapping : result ) { org.junit.Assert.assertEquals ( existingPool.getId ( ) , mapping.getstorage_pool_id ( ) ) ; } }

Target:
public void testGetAllStoragePoolIsoMapsForStoragePool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > result = dao.getAllForStoragePool ( existingPool.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapping : result ) { org.junit.Assert.assertEquals ( existingPool.getId ( ) , mapping.getStoragePoolId ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel bookmarkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel ) ( model ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > resultList = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; if ( resultList != null ) { java.util.Collections.sort ( resultList , org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel.COMPARATOR ) ; } setIsBookmarkInitiated ( true ) ; bookmarkListModel.setItems ( resultList ) ; setIsBookmarkInitiated ( false ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > resultList = returnValue.getReturnValue ( ) ; if ( resultList != null ) { java.util.Collections.sort ( resultList , org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel.COMPARATOR ) ; } setIsBookmarkInitiated ( true ) ; setItems ( resultList ) ; setIsBookmarkInitiated ( false ) ; }
Source:
private void setupHostNetworkQosDao ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getHostNetworkQosDao ( ) ) . thenReturn ( hostNetworkQosDaoMocked ) ; org.mockito.Mockito.when ( networkMocked.getQosId ( ) ) . thenReturn ( qosId ) ; org.mockito.Mockito.when ( hostNetworkQosDaoMocked.get ( networkMocked.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; }

Target:
private void setupHostNetworkQosDao ( ) { org.mockito.Mockito.when ( networkMocked.getQosId ( ) ) . thenReturn ( qosId ) ; org.mockito.Mockito.when ( hostNetworkQosDaoMocked.get ( networkMocked.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.GlusterVolumeRemoveBricksCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( null ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.GlusterVolumeRemoveBricksCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; if ( ! ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { unlockSnapshot ( org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getSnapshot ( ) . getId ( ) ) ; super . endSuccessfully ( ) ; } org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; org.ovirt.engine.core.bll.storage.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }
Source:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.Network a : networks ) { java.lang.String networkName = ( a == null ) ? null : a.getname ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( networkName , getNic ( ) . getNetworkName ( ) ) ) { getNetwork ( ) . setSelectedItem ( a ) ; return ; } } if ( ( getNic ( ) . getNetworkName ( ) ) == null ) { getNetwork ( ) . setSelectedItem ( null ) ; } }

Target:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network.Network a : networks ) { java.lang.String networkName = ( a == null ) ? null : a.getname ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( networkName , getNic ( ) . getNetworkName ( ) ) ) { getNetwork ( ) . setSelectedItem ( a ) ; return ; } } if ( ( getNic ( ) . getNetworkName ( ) ) == null ) { getNetwork ( ) . setSelectedItem ( null ) ; } }
Source:
public int getCountBySeverity ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataSeverity severity ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( e.getSeverity ( ) ) == severity ) { count ++ ; } } return count ; }

Target:
public int getCountBySeverity ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataSeverity severity ) { if ( ( ( errata ) == null ) || ( errata.isEmpty ( ) ) ) { return 0 ; } int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( e.getSeverity ( ) ) == severity ) { count ++ ; } } return count ; }
Source:
private boolean addOperationImpl ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation ) { final boolean operationCanBeAdded = ( ! ( operationQueue.contains ( operation ) ) ) || ( operation.allowDuplicates ( ) ) ; if ( operationCanBeAdded && ( operationQueue.add ( operation ) ) ) { processor.processOperation ( this ) ; if ( engineSessionRefreshed ( operation ) ) { org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.fire ( eventBus ) ; } } return true ; }

Target:
private void addOperationImpl ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation ) { final boolean operationCanBeAdded = ( ! ( operationQueue.contains ( operation ) ) ) || ( operation.allowDuplicates ( ) ) ; if ( operationCanBeAdded && ( operationQueue.add ( operation ) ) ) { processor.processOperation ( this ) ; if ( engineSessionRefreshed ( operation ) ) { org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.fire ( eventBus ) ; } } }
Source:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setAllContentHeaderExpectation ( ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setAllContentHeaderExpectation ( ) ; setUpGetEntityExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public static boolean shouldOverrideSoundDevice ( java.lang.Boolean soundDeviceEnabled , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion ) { return ( ( soundDeviceEnabled == null ) && ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }

Target:
public static boolean shouldOverrideSoundDevice ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean soundDeviceEnabled ) { return ( ( soundDeviceEnabled == null ) && ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }
Source:
public void addPosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addPosixNonEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public java.lang.String getValue ( ) { return this . value ; }
Source:
public static void addFileHandler ( java.lang.String fileName ) { try { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( fileName ) ; fh.setFormatter ( new java.util.logging.SimpleFormatter ( ) ) ; java.util.logging.Logger.getLogger ( "" ) . addHandler ( fh ) ; } catch ( java.lang.SecurityException | java.io.IOException ex ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Error accessing log file '%s': '%s'" , fileName , ex.getMessage ( ) ) , ex ) ; } }

Target:
public static void addFileHandler ( java.lang.String fileName ) { try { java.util.logging.FileHandler fh = new java.util.logging.FileHandler ( fileName , true ) ; fh.setFormatter ( new java.util.logging.SimpleFormatter ( ) ) ; java.util.logging.Logger.getLogger ( "" ) . addHandler ( fh ) ; } catch ( java.lang.SecurityException | java.io.IOException ex ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Error accessing log file '%s': '%s'" , fileName , ex.getMessage ( ) ) , ex ) ; } }
Source:
protected void RemoveVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }

Target:
protected void RemoveVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "Disks" . equals ( args.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( args.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "Disks" . equals ( args.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( args.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ; behavior.updateCommandsAccordingToPoolType ( isManualPool ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.VmPool pool ) { boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ; updateCommandsAccordingToPoolType ( isManualPool ) ; }