auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.io.IOException { storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( unregisteredOVFDataDao ) . when ( cmd ) . getUnregisteredOVFDataDao ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
private boolean isAllVmsDown ( java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap ) { if ( ( vmsMap.get ( java.lang.Boolean.TRUE ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsMap.get ( java.lang.Boolean.TRUE ) ) { if ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { return false ; } } } return true ; }

Target:
protected boolean isAllVmsDown ( java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap ) { if ( ( vmsMap.get ( java.lang.Boolean.TRUE ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsMap.get ( java.lang.Boolean.TRUE ) ) { if ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { return false ; } } } return true ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getSnapshot ( ) , getSnapshot ( ) . getStatus ( ) ) ; getSnapshotDao ( ) . updateStatus ( sourceSnapshotId , SnapshotStatus.LOCKED ) ; lockVmWithCompensationIfNeeded ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getSnapshot ( ) ) ; getSnapshotDao ( ) . updateStatus ( sourceSnapshotId , SnapshotStatus.LOCKED ) ; lockVmWithCompensationIfNeeded ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }
Source:
public void labelBeingAttachedToValidBondExistingBondValid ( ) { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slave1" , "slave2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( java.util.Arrays.asList ( bond ) ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( bond.getId ( ) , bond.getName ( ) , "lbl1" ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void labelBeingAttachedToValidBondExistingBondValid ( ) { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slave1" , "slave2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = new java.util.ArrayList ( java.util.Arrays.asList ( bond ) ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( bond.getId ( ) , bond.getName ( ) , "lbl1" ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . keySet ( ) , false ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getInstanceTypeId ( ) ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }

Target:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . keySet ( ) , false ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getInstanceTypeId ( ) ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }
Source:
private static void addBondDeviceToHost ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.Object [ ] interfaces ) { vds.getInterfaces ( ) . add ( iface ) ; if ( interfaces != null ) { for ( java.lang.Object name : interfaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface tempInterface : vds.getInterfaces ( ) ) { if ( tempInterface.getName ( ) . equals ( name.toString ( ) ) ) { tempInterface.setBondName ( iface.getName ( ) ) ; break ; } } } } }

Target:
private static void addBondDeviceToHost ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.lang.Object [ ] interfaces ) { vds.getInterfaces ( ) . add ( iface ) ; if ( interfaces != null ) { for ( java.lang.Object name : interfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface tempInterface : vds.getInterfaces ( ) ) { if ( tempInterface.getName ( ) . equals ( name.toString ( ) ) ) { tempInterface.setBondName ( iface.getName ( ) ) ; break ; } } } } }
Source:
public void testInitCanBeCalledTwice ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc pool = new org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc ( ) ; pool.initialize ( ) ; org.mockito.Mockito.verify ( macPoolDao ) . getAll ( ) ; pool.initialize ( ) ; org.mockito.Mockito.verifyNoMoreInteractions ( storagePoolDao , vmNicDao , macPoolDao ) ; }

Target:
public void testInitCanBeCalledTwice ( ) throws java.lang.Exception { pool.initialize ( ) ; org.mockito.Mockito.verify ( macPoolDao ) . getAll ( ) ; pool.initialize ( ) ; org.mockito.Mockito.verifyNoMoreInteractions ( storagePoolDao , vmNicDao , macPoolDao ) ; }
Source:
public void testCredentialsWithConnectionExtensionDifferentHostSameTarget ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" ) ; 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 ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , 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 testCredentialsWithConnectionExtensionDifferentHostSameTarget ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" ) ; 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 boolean eval ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ! ( vds.getId ( ) . equals ( _vds.getId ( ) ) ) ) && ( vds.getstorage_pool_id ( ) . equals ( _vds.getstorage_pool_id ( ) ) ) ) && ( ( vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( ! ( vds.getId ( ) . equals ( _vds.getId ( ) ) ) ) && ( vds.getStoragePoolId ( ) . equals ( _vds.getStoragePoolId ( ) ) ) ) && ( ( vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ; }
Source:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; java.lang.System.out.println ( query ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }

Target:
private void testValidSql ( java.lang.String dynamicQuery , java.lang.String exepctedSQLResult ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( dynamicQuery , true ) ; org.junit.Assert.assertTrue ( ( "Invalid syntax: " + dynamicQuery ) , res.getvalid ( ) ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; java.lang.System.out.println ( exepctedSQLResult ) ; java.lang.System.out.println ( query ) ; org.junit.Assert.assertEquals ( exepctedSQLResult , query ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . isFiltered ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = allDcNetworks.stream ( ) . filter ( getManagementNetworkCandidatePredicate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = allDcNetworks.stream ( ) . filter ( getManagementNetworkCandidatePredicate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel providersListModel = getProviders ( ) ; providers.add ( 0 , null ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserIdListParameters ( getProfileName ( ) , ids , false ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }

Target:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserIdList , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserIdListParameters ( getName ( ) , ids , false ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }
Source:
private void updateDisksAfterVmRemoved ( ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) ; java.util.List < org.ovirt.engine.core.bll.DiskImage > diskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; if ( ! ( diskImages.isEmpty ( ) ) ) { for ( org.ovirt.engine.core.bll.DiskImage diskImage : diskImages ) { disksLeftInVm.add ( diskImage.getDiskAlias ( ) ) ; } AddCustomValue ( "DisksNames" , org.apache.commons.lang.StringUtils.join ( disksLeftInVm , "," ) ) ; } }

Target:
private void updateDisksAfterVmRemoved ( ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) , true , false ) ; if ( ! ( diskImages.isEmpty ( ) ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { disksLeftInVm.add ( diskImage.getDiskAlias ( ) ) ; } AddCustomValue ( "DisksNames" , org.apache.commons.lang.StringUtils.join ( disksLeftInVm , "," ) ) ; } }
Source:
public void onSuccess ( java.lang.Object parenModel , java.lang.Object returnValue ) { deactivate ( ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; activate ( ) ; if ( continueWithNext ) { updateRngDevice ( vmBase ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { deactivate ( ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue.getReturnValue ( ) ) ) ) ; activate ( ) ; if ( continueWithNext ) { updateRngDevice ( vmBase ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.compat.Guid > getVdsBlackList ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > blackList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.bll.MigrateVmCommand.getRunVdssList ( ) ) ; if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) ) != null ) { blackList.add ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) ) ; } return blackList ; }

Target:
private java.util.List < org.ovirt.engine.core.compat.Guid > getVdsBlackList ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > blackList = new java.util.ArrayList ( org.ovirt.engine.core.bll.MigrateVmCommand.getRunVdssList ( ) ) ; if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) ) != null ) { blackList.add ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) ) ; } return blackList ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > convert ( java.lang.Object source ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; } return list ; }
Source:
private static java.util.Collection < org.apache.commons.lang.math.LongRange > clipMultiCastsFromRanges ( java.util.Collection < org.apache.commons.lang.math.LongRange > ranges ) { final java.util.Collection < org.apache.commons.lang.math.LongRange > result = new java.util.ArrayList < > ( ) ; for ( org.apache.commons.lang.math.LongRange range : ranges ) { final org.apache.commons.lang.math.LongRange clippedRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( range ) ; if ( clippedRange != null ) { result.add ( clippedRange ) ; } } return result ; }

Target:
public static java.util.Collection < org.apache.commons.lang.math.LongRange > clipMultiCastsFromRanges ( java.util.Collection < org.apache.commons.lang.math.LongRange > ranges ) { final java.util.Collection < org.apache.commons.lang.math.LongRange > result = new java.util.ArrayList < > ( ) ; for ( org.apache.commons.lang.math.LongRange range : ranges ) { final org.apache.commons.lang.math.LongRange clippedRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( range ) ; if ( clippedRange != null ) { result.add ( clippedRange ) ; } } return result ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createNics ( java.lang.String bondName , int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( ( "eth" + i ) , null ) ; if ( bondName != null ) { nic = enslaveOrReleaseNIC ( nic , bondName ) ; } ifaces.add ( nic ) ; } return ifaces ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > createNics ( java.lang.String bondName , int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ( "eth" + i ) , null ) ; if ( bondName != null ) { nic = enslaveOrReleaseNIC ( nic , bondName ) ; } ifaces.add ( nic ) ; } return ifaces ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public static synchronized java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { validateSource ( ) ; clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; validateSource ( ) ; }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { validateSource ( ) ; clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; }
Source:
protected void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private void buildEntryStrings ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > locks , java.lang.StringBuilder message ) { if ( locks != null ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.lang.String > entry : locks.entrySet ( ) ) { message.append ( "key: " ) . append ( entry.getKey ( ) ) . append ( " value: " ) . append ( entry.getValue ( ) ) . append ( '\n' ) ; } } }

Target:
private void buildEntryStrings ( java.util.Map < java.lang.String , java.lang.String > locks , java.lang.StringBuilder message ) { if ( locks != null ) { for ( java.util.Map.Entry < java.lang.String , java.lang.String > entry : locks.entrySet ( ) ) { message.append ( "key: " ) . append ( entry.getKey ( ) ) . append ( " value: " ) . append ( entry.getValue ( ) ) . append ( '\n' ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStatisticsDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }
Source:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterList ( dcQuery ) ; }

Target:
private void doDataCenterSearch ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery dcQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; dcQuery.setModel ( this ) ; dcQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel systemTreeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeModel ) ( model ) ) ; systemTreeModel.setDataCenters ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( result ) ) ) ; doNetworksSearch ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterList ( dcQuery ) ; }
Source:
public java.lang.String buildMetadataDictionaryForVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages ) { java.lang.String vmMeta = generateVmMetadata ( vm , allVmImages ) ; metaDictionary.put ( vm.getId ( ) , new org.ovirt.engine.core.compat.KeyValuePairCompat ( vmMeta , vm.getDiskMap ( ) . values ( ) . stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; return vmMeta ; }

Target:
public java.lang.String buildMetadataDictionaryForVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages ) { java.lang.String vmMeta = generateVmMetadata ( vm , allVmImages ) ; metaDictionary.put ( vm.getId ( ) , new org.ovirt.engine.core.compat.KeyValuePairCompat ( vmMeta , vm.getDiskMap ( ) . values ( ) . stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; return vmMeta ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getQuotaId ( ) ) ; getQuotaDAO ( ) . remove ( getParameters ( ) . getQuotaId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getQuotaDAO ( ) . remove ( getParameters ( ) . getQuotaId ( ) ) ; org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getQuotaId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { try { org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . parseReport ( response.getText ( ) ) ; resourceMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getResourceMap ( ) ; dashboardMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getDashboardMap ( ) ; isCommunityEdition = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . isCommunityEdition ( ) ; } catch ( com.google.gwt.xml.client.impl.DOMParseException e ) { } finally { setXmlInitialized ( ) ; } }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { try { if ( org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . parseReport ( response.getText ( ) ) ) { resourceMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getResourceMap ( ) ; dashboardMap = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . getDashboardMap ( ) ; isCommunityEdition = org.ovirt.engine.ui.uicompat.ReportParser.getInstance ( ) . isCommunityEdition ( ) ; } } catch ( com.google.gwt.xml.client.impl.DOMParseException e ) { } finally { setXmlInitialized ( ) ; } }
Source:
private void mockGetImageDomainsListVdsCommand ( ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( 1 ) ; guids.add ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( guids ) ; org.powermock.api.mockito.PowerMockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockGetImageDomainsListVdsCommand ( ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( 1 ) ; guids.add ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( guids ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions getMigrateOnErrorOption ( ) { if ( ( getMigrateOnErrorOption_NO ( ) . getEntity ( ) ) == true ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.NO ; } else if ( ( getMigrateOnErrorOption_YES ( ) . getEntity ( ) ) == true ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES ; } else if ( ( getMigrateOnErrorOption_HA_ONLY ( ) . getEntity ( ) ) == true ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.HA_ONLY ; } return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES ; }

Target:
public org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions getMigrateOnErrorOption ( ) { if ( getMigrateOnErrorOption_NO ( ) . getEntity ( ) ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.NO ; } else if ( getMigrateOnErrorOption_YES ( ) . getEntity ( ) ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES ; } else if ( getMigrateOnErrorOption_HA_ONLY ( ) . getEntity ( ) ) { return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.HA_ONLY ; } return org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions.YES ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setPlugged ( false ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; disk.setId ( diskImageGuid ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setPlugged ( false ) ; disk.setactive ( true ) ; disk.setId ( diskImageGuid ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }
Source:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain stDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; stDomain.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( stDomain ) ; }

Target:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain stDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; stDomain.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.any ( ) ) ) . thenReturn ( stDomain ) ; }
Source:
public void setHtml ( com.google.gwt.safehtml.shared.SafeHtml html ) { assert html != null : "Tooltip HTML content cannot be null" ; if ( ( ( tooltip ) == null ) || ( ! ( tooltip.asString ( ) . equals ( html.asString ( ) ) ) ) ) { tooltip = html ; scheduleTooltipUpdate ( ) ; } }

Target:
public void setHtml ( com.google.gwt.safehtml.shared.SafeHtml html ) { if ( html == null ) { return ; } if ( ( ( tooltip ) == null ) || ( ! ( tooltip.asString ( ) . equals ( html.asString ( ) ) ) ) ) { tooltip = html ; scheduleTooltipUpdate ( ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VmNumaNode mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmNumaNode entity = org.ovirt.engine.core.dao.VmNumaNodeDaoImpl.vmNumaNodeRowMapper.mapRow ( rs , rowNum ) ; entity.setCpuIds ( java.util.Arrays.asList ( ( ( java.lang.Integer [ ] ) ( rs.getArray ( "cpu_core_ids" ) . getArray ( ) ) ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmNumaNode mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmNumaNode entity = org.ovirt.engine.core.dao.VmNumaNodeDaoImpl.vmNumaNodeRowMapper.mapRow ( rs , rowNum ) ; entity.setCpuIds ( new java.util.ArrayList < java.lang.Integer > ( java.util.Arrays.asList ( ( ( java.lang.Integer [ ] ) ( rs.getArray ( "cpu_core_ids" ) . getArray ( ) ) ) ) ) ) ; return entity ; }
Source:
protected void initializeCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmDiskCommand < org.ovirt.engine.core.common.action.UpdateVmDiskParameters > ( createParameters ( ) ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override protected org.ovirt.engine.core.dao.DiskDao getDiskDao ( ) { return diskDao ; } } ) ; org.mockito.Mockito.doReturn ( vmNetworkInterfaceDAO ) . when ( command ) . getVmNetworkInterfaceDAO ( ) ; mockVds ( ) ; }

Target:
private void initializeCommand ( ) { initializeCommand ( createParameters ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , index ) ; org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = control.createMock ( org.ovirt.engine.core.common.businessentities.VdsStatic.class ) ; org.easymock.EasyMock.expect ( vdsStatic.getId ( ) ) . andReturn ( GUIDS [ 2 ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( vds.getStaticData ( ) ) . andReturn ( vdsStatic ) . anyTimes ( ) ; return vds ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , null , index ) ; return vds ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.Disk x , org.ovirt.engine.core.common.businessentities.storage.Disk y ) { java.lang.String xAlias = x.getDiskAlias ( ) ; java.lang.String yAlias = y.getDiskAlias ( ) ; if ( xAlias == null ) { return 1 ; } if ( yAlias == null ) { return - 1 ; } return xAlias.compareTo ( yAlias ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.Disk x , org.ovirt.engine.core.common.businessentities.storage.Disk y ) { java.lang.String xAlias = x.getDiskAlias ( ) ; java.lang.String yAlias = y.getDiskAlias ( ) ; return xAlias.compareTo ( yAlias ) ; }
Source:
public java.lang.String getSessionIdBySeqId ( long sessionSequenceId ) { java.lang.String sessionId = null ; for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID ) ) == sessionSequenceId ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } return sessionId ; }

Target:
public java.lang.String getSessionIdBySeqId ( long sessionSequenceId ) { java.lang.String sessionId = null ; for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID ) . equals ( sessionSequenceId ) ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } return sessionId ; }
Source:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = new java.util.ArrayList ( volume.getOptions ( ) ) ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } return ! ( filteredOptions.isEmpty ( ) ) ; }

Target:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = new java.util.ArrayList ( volume.getOptions ( ) ) ; filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; return ! ( filteredOptions.isEmpty ( ) ) ; }