auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) { disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; }

Target:
public void setUp ( ) { disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( diskImageDao ) . when ( validator ) . getDiskImageDao ( ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void diskImagesSnapshotsNotAttachedToOtherVmsNoDiskSnapshotsAttached ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > createdDevices = prepareForCheckingIfDisksSnapshotsAttachedToOtherVms ( ) ; org.junit.Assert.assertThat ( validator.diskImagesSnapshotsNotAttachedToOtherVms ( false ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; org.mockito.Mockito.verify ( snapshotDao , org.mockito.Mockito.never ( ) ) . get ( createdDevices.get ( 1 ) . getSnapshotId ( ) ) ; org.mockito.Mockito.verify ( snapshotDao , org.mockito.Mockito.never ( ) ) . get ( createdDevices.get ( 0 ) . getSnapshotId ( ) ) ; }

Target:
public void diskImagesSnapshotsNotAttachedToOtherVmsNoDiskSnapshotsAttached ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > createdDevices = prepareForCheckingIfDisksSnapshotsAttachedToOtherVms ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesSnapshotsNotAttachedToOtherVms ( false ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; org.mockito.Mockito.verify ( snapshotDao , org.mockito.Mockito.never ( ) ) . get ( createdDevices.get ( 1 ) . getSnapshotId ( ) ) ; org.mockito.Mockito.verify ( snapshotDao , org.mockito.Mockito.never ( ) ) . get ( createdDevices.get ( 0 ) . getSnapshotId ( ) ) ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeInt ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { dos.writeInt ( this . history_id ) ; writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; dos.writeShort ( this . storage_domain_status ) ; dos.writeDouble ( this . minutes_in_status ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
private void addBootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { switch ( attachment.getBootProtocol ( ) ) { case DHCP : opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.BOOT_PROTOCOL , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCP_BOOT_PROTOCOL ) ; break ; case STATIC_IP : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipaddr" , attachment.getAddress ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "netmask" , attachment.getNetmask ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "gateway" , attachment.getGateway ( ) ) ; break ; default : break ; } }

Target:
private void addBootProtocol ( java.util.Map < java.lang.String , java.lang.Object > opts , org.ovirt.engine.core.common.vdscommands.HostNetwork attachment ) { switch ( attachment.getBootProtocol ( ) ) { case DHCP : opts.put ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.BOOT_PROTOCOL , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.DHCP_BOOT_PROTOCOL ) ; break ; case STATIC_IP : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "ipaddr" , attachment.getAddress ( ) ) ; putPrefixOrNetmaskIfNotEmpty ( opts , attachment.getNetmask ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.putIfNotEmpty ( opts , "gateway" , attachment.getGateway ( ) ) ; break ; default : break ; } }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public java.util.List < java.lang.String > getClusterNames ( ) { java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; if ( ( getCluster ( ) . getItems ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup : getCluster ( ) . getItems ( ) ) { names.add ( vdsGroup.getName ( ) ) ; } } return names ; }

Target:
public java.util.List < java.lang.String > getClusterNames ( ) { java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; if ( ( getCluster ( ) . getItems ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : getCluster ( ) . getItems ( ) ) { names.add ( cluster.getName ( ) ) ; } } return names ; }
Source:
public static java.lang.String rangeParsser ( java.util.List < java.lang.String > values ) { return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( ( java.lang.Integer.parseInt ( values.get ( 1 ) ) ) - ( java.lang.Integer.parseInt ( values.get ( 0 ) ) ) ) ) ) + ( java.lang.Integer.parseInt ( values.get ( 0 ) ) ) ) ) ; }

Target:
public static java.lang.String rangeParser ( java.util.List < java.lang.String > values ) { return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( ( java.lang.Integer.parseInt ( values.get ( 1 ) ) ) - ( java.lang.Integer.parseInt ( values.get ( 0 ) ) ) ) ) ) + ( java.lang.Integer.parseInt ( values.get ( 0 ) ) ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.bookmarks mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.bookmarks entity = new org.ovirt.engine.core.common.businessentities.bookmarks ( ) ; entity.setbookmark_id ( new org.ovirt.engine.core.compat.Guid ( rs.getString ( "bookmark_id" ) ) ) ; entity.setbookmark_name ( rs.getString ( "bookmark_name" ) ) ; entity.setbookmark_value ( rs.getString ( "bookmark_value" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.Bookmark mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Bookmark entity = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; entity.setbookmark_id ( new org.ovirt.engine.core.compat.Guid ( rs.getString ( "bookmark_id" ) ) ) ; entity.setbookmark_name ( rs.getString ( "bookmark_name" ) ) ; entity.setbookmark_value ( rs.getString ( "bookmark_value" ) ) ; return entity ; }
Source:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDao.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }

Target:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDao.getDiskIdByLunId ( disk.getLun ( ) . getLUNId ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getClustersHavingHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Disk incoming , org.ovirt.engine.api.model.Disk entity ) { return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( entity.getId ( ) , vmId ) , map ( incoming , entity ) ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Disk incoming , org.ovirt.engine.api.model.Disk entity ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dveFromDb = runQuery ( VdcQueryType.GetDiskVmElementById , new org.ovirt.engine.core.common.queries.VmDeviceIdQueryParameters ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( entity.getId ( ) , vmId ) ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updatedDve = updateDiskVmElementFromDisk ( incoming , dveFromDb ) ; return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( updatedDve , map ( incoming , entity ) ) ; }
Source:
public boolean evaluate ( java.lang.String obj ) { return ( obj != null ) && ( ! ( obj.isEmpty ( ) ) ) ; }

Target:
protected static java.util.Collection < java.lang.String > getPackagesForCheckUpdate ( ) { java.util.List < java.lang.String > systemPackages = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.PackageNamesForCheckUpdate ) ; java.util.List < java.lang.String > userPackages = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.UserPackageNamesForCheckUpdate ) ; return java.util.stream.Stream.concat ( systemPackages.stream ( ) , userPackages.stream ( ) . filter ( StringUtils :: isNotEmpty ) ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
private org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }

Target:
public int compare ( org.ovirt.engine.api.model.Network n1 , org.ovirt.engine.api.model.Network n2 ) { if ( n1.getId ( ) . equals ( n2.getId ( ) ) ) { return 0 ; } else { return n1.getId ( ) . compareTo ( n2.getId ( ) ) ; } }
Source:
private com.google.gwt.safehtml.shared.SafeHtml toUnorderedList ( java.util.List < java.lang.String > stringItems ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder builder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String stringItem : stringItems ) { builder.append ( templates.listItem ( stringItem ) ) ; } return templates.unorderedList ( builder.toSafeHtml ( ) ) ; }

Target:
private void updateErrorIconLabel ( java.util.List < java.lang.String > reasons ) { if ( reasons.isEmpty ( ) ) { errorMessage.setText ( SafeHtmlUtils.EMPTY_SAFE_HTML.asString ( ) ) ; } else { final com.google.gwt.safehtml.shared.SafeHtml htmlReasons = toList ( reasons ) ; errorMessage.setText ( htmlReasons.asString ( ) ) ; errorMessage.setVisible ( true ) ; } }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.GetDiskByDiskIdParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__RUN ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__VM ) ; }

Target:
protected void updateGraphicsInfos ( ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.GRAPHICS ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getGraphicsInfos ( ) . put ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( vmDevice.getDevice ( ) ) , new org.ovirt.engine.core.common.businessentities.GraphicsInfo ( ) ) ; } }
Source:
private void optimizationCustomFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationCustom ( ) ) != null ) && ( ( object.getOptimizationCustom ( ) . getEntity ( ) ) != null ) ) { optimizationCustomEditor.asRadioButton ( ) . setHTML ( templates.radioButtonLabel ( messages.clusterPopupMemoryOptimizationCustomLabel ( java.lang.String.valueOf ( object.getMemoryOverCommit ( ) ) ) ) ) ; } }

Target:
private void optimizationCustomFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationCustom ( ) ) != null ) && ( ( object.getOptimizationCustom ( ) . getEntity ( ) ) != null ) ) { optimizationCustomEditor.setLabel ( messages.clusterPopupMemoryOptimizationCustomLabel ( java.lang.String.valueOf ( object.getMemoryOverCommit ( ) ) ) ) ; } }
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.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.isVmReadyForUpgrade ( invalidVM ) ) . contains ( UPGRADE_ERROR.VM_NUMA_PINNED ) ; }

Target:
public void shouldDetectCpuPinning ( ) { invalidVM.setCpuPinning ( "i am pinned" ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_CPUS_PINNED ) ; }
Source:
void onWindowFocusChange ( boolean inFocus ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; if ( ( modelTimer.isActive ( ) ) && ( ! ( modelTimer.isPaused ( ) ) ) ) { if ( inFocus ) { modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; } else { modelTimer.setRefreshRate ( org.ovirt.engine.ui.common.widget.refresh.AbstractRefreshManager.OUT_OF_FOCUS_REFRESH_RATE ) ; } } }

Target:
void onWindowFocusChange ( boolean inFocus ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; if ( ( modelTimer.isActive ( ) ) && ( ! ( modelTimer.isPaused ( ) ) ) ) { modelTimer.stop ( ) ; if ( inFocus ) { modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; } else { modelTimer.setRefreshRate ( org.ovirt.engine.ui.common.widget.refresh.AbstractRefreshManager.OUT_OF_FOCUS_REFRESH_RATE ) ; } modelTimer.start ( ) ; } }
Source:
public static org.ovirt.engine.core.utils.crypt.TicketUtils getInstanceForEngineStoreSigning ( ) throws java.io.IOException , java.security.KeyStoreException , java.security.NoSuchAlgorithmException , java.security.UnrecoverableKeyException , java.security.cert.CertificateException { java.io.File store = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKIEngineStore ( ) ; java.lang.String password = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKIEngineStorePassword ( ) ; java.lang.String alias = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKIEngineStoreAlias ( ) ; java.lang.Integer lifetime = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.WebSocketProxyTicketValiditySeconds ) ; return new org.ovirt.engine.core.utils.crypt.TicketUtils ( store , password , alias , lifetime ) ; }

Target:
public static org.ovirt.engine.core.utils.crypt.TicketUtils getInstanceForEngineStoreSigning ( ) throws java.io.IOException , java.security.KeyStoreException , java.security.NoSuchAlgorithmException , java.security.UnrecoverableKeyException , java.security.cert.CertificateException { return new org.ovirt.engine.core.utils.crypt.TicketUtils ( org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.WebSocketProxyTicketValiditySeconds ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.Cancel ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }
Source:
private void createProfiles ( ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . dump ( ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy authnExtension : org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getProvidedExtensions ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_SERVICE ) ) { registerProfile ( new org.ovirt.engine.core.aaa.AuthenticationProfile ( authnExtension , org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getExtensionByName ( authnExtension.getContext ( ) . < java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) . getProperty ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_AUTHZ_PLUGIN ) ) ) ) ; } }

Target:
private void createProfiles ( ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy authnExtension : org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getProvidedExtensions ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_SERVICE ) ) { registerProfile ( new org.ovirt.engine.core.aaa.AuthenticationProfile ( authnExtension , org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getExtensionByName ( authnExtension.getContext ( ) . < java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) . getProperty ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_AUTHZ_PLUGIN ) ) , org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getExtensionByName ( authnExtension.getContext ( ) . < java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) . getProperty ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_MAPPING_PLUGIN ) ) ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; if ( cluster != null ) { clusters.add ( cluster ) ; } java.util.Collections.sort ( clusters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , vm.getVdsGroupId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { clusters.add ( cluster ) ; } java.util.Collections.sort ( clusters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , vm.getClusterId ( ) ) ; }
Source:
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 ) { if ( java.lang.Boolean.TRUE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { discoverHostName_SelectedItemChanged ( ) ; } else if ( java.lang.Boolean.FALSE.equals ( getIsDiscoveredHosts ( ) . getEntity ( ) ) ) { cleanHostParametersFields ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }
Source:
public void getVdsNullRun ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( null ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsNullRun ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( null ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.jupiter.api.Assertions.assertNull ( v ) ; }
Source:
protected void initTableColumns ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , constants.serverBricks ( ) ) ; bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , constants.brickDirectoryBricks ( ) ) ; }

Target:
protected void initTableColumns ( ) { bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.serverBricks ( ) ) ; bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.brickDirectoryBricks ( ) ) ; }
Source:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } updateIteration ( ) ; }

Target:
public void poll ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetcher , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , manager.getVdsName ( ) ) ; } } updateIteration ( ) ; }
Source:
public void testIsNetworkInSyncWhenIpv6GatewayBothBlank ( ) { java.util.List < java.lang.String > blankValues = java.util.Arrays.asList ( null , "" ) ; initIpv6ConfigurationStaticBootProtocol ( Ipv6BootProtocol.STATIC_IP ) ; int blankIndex = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 ) ; ipv6Address.setGateway ( blankValues.get ( blankIndex ) ) ; iface.setIpv6Gateway ( blankValues.get ( ( blankIndex ^ 1 ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv6GatewayBothNull ( ) { initIpv6ConfigurationStaticBootProtocol ( Ipv6BootProtocol.STATIC_IP ) ; ipv6Address.setGateway ( null ) ; iface.setIpv6Gateway ( null ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( shouldEndSnapshotCreation ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( ActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
private void expandTree ( com.google.gwt.user.cellview.client.TreeNode node , boolean collapse ) { if ( node == null ) { return ; } if ( ( node.getChildCount ( ) ) > 0 ) { for ( int i = 0 ; i < ( node.getChildCount ( ) ) ; i ++ ) { expandTree ( node.setChildOpen ( i , collapse ) , collapse ) ; } } }

Target:
private void expandTree ( com.google.gwt.user.cellview.client.TreeNode node , boolean expand ) { expandTree ( node , expand , 0 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configGet" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , response ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.get ( ) ) ) ; }
Source:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }

Target:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , ActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }
Source:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedCustomMacs.contains ( mac ) ) { allocatedCustomMacs.remove ( mac ) ; } else if ( allocatedMacs.contains ( mac ) ) { allocatedMacs.remove ( mac ) ; availableMacs.add ( mac ) ; } }

Target:
public boolean isMacInUse ( java.lang.String mac ) { lockObj.readLock ( ) . lock ( ) ; try { return ( allocatedMacs.containsKey ( mac ) ) || ( allocatedCustomMacs.containsKey ( mac ) ) ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
private void generateEnumValue ( org.ovirt.api.metamodel.concepts.EnumValue value ) { java.lang.String constantName = pythonNames.getConstantStyleName ( value.getName ( ) ) ; java.lang.String constantValue = pythonNames.getMemberStyleName ( value.getName ( ) ) ; buffer.addLine ( "%1$s = '%2$s'" , constantName , constantValue ) ; }

Target:
private void generateEnumValue ( org.ovirt.api.metamodel.concepts.EnumValue value ) { org.ovirt.api.metamodel.concepts.Name name = value.getName ( ) ; java.lang.String constantName = pythonNames.getConstantStyleName ( name ) ; java.lang.String constantValue = names.getLowerJoined ( name , "_" ) ; buffer.addLine ( "%1$s = '%2$s'" , constantName , constantValue ) ; }