auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testIsCrossReference ( ) { org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReference ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReference ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReference ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReference ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReference ( null , "TEMPLATES" ) ) ; }

Target:
public void testIsCrossReference ( ) { org.junit.jupiter.api.Assertions.assertTrue ( comp.isCrossReference ( "EVENTS" , "TEMPLATES" ) , "EVENTS" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.isCrossReference ( "fsfsdf" , "TEMPLATES" ) , "Garbage Cross" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.isCrossReference ( "EVENTS" , "fsfds" ) , "Garbage Object" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.isCrossReference ( "EVENTS" , null ) , "Null Object" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.isCrossReference ( null , "TEMPLATES" ) , "Null text" ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( dataCenterId , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResource.AddedNetworkResolver ( ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { return getBackendCollection ( VdcQueryType.GetNetworksByDataCenterId , getQueryParameters ( ) ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > findSelectedItems ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > items ) { if ( items == null ) { return java.util.Collections.EMPTY_LIST ; } return org.ovirt.engine.ui.uicommonweb.Linq.where ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > entityModel ) { return entityModel.getIsSelected ( ) ; } } ) ; }

Target:
public static java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > findSelectedItems ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > items ) { if ( items == null ) { return java.util.Collections.emptyList ( ) ; } return org.ovirt.engine.ui.uicommonweb.Linq.where ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < ? > entityModel ) { return entityModel.getIsSelected ( ) ; } } ) ; }
Source:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAlias ( ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAlias ( ) ; getIsPlugged ( ) . setIsAvailable ( true ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; getIsPlugged ( ) . setEntity ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }
Source:
private void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }

Target:
private void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LunDisk other = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( obj ) ) ; return org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( lun , other.lun ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LunDisk other = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( lun , other.lun ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( usingScsiReservation , other.usingScsiReservation ) ) ; }
Source:
public void testRemoveDetachOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "RemoveDisks" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendVmResource.DETACH_ONLY , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveDetachOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "RemoveDisks" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendVmResource.DETACH_ONLY , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void readMemoryItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setMemSizeMb ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:VirtualQuantity" , _xmlNS ) . innerText ) ) ; }

Target:
private void readCpuItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setNumOfSockets ( java.lang.Integer.parseInt ( selectSingleNode ( node , "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; vmBase.setCpuPerSocket ( java.lang.Integer.parseInt ( selectSingleNode ( node , "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetTemplateQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetTemplateQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; try { collection.deprecatedRemove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } else { return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }
Source:
public static org.ovirt.engine.api.model.Tag map ( org.ovirt.engine.core.common.businessentities.tags entity , org.ovirt.engine.api.model.Tag template ) { org.ovirt.engine.api.model.Tag model = ( template != null ) ? template : new org.ovirt.engine.api.model.Tag ( ) ; model.setId ( entity.gettag_id ( ) . toString ( ) ) ; model.setName ( entity.gettag_name ( ) ) ; model.setDescription ( entity.getdescription ( ) ) ; model.setParent ( org.ovirt.engine.api.restapi.types.TagMapper.parent ( entity ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Tag map ( org.ovirt.engine.core.common.businessentities.Tags entity , org.ovirt.engine.api.model.Tag template ) { org.ovirt.engine.api.model.Tag model = ( template != null ) ? template : new org.ovirt.engine.api.model.Tag ( ) ; model.setId ( entity.gettag_id ( ) . toString ( ) ) ; model.setName ( entity.gettag_name ( ) ) ; model.setDescription ( entity.getdescription ( ) ) ; model.setParent ( org.ovirt.engine.api.restapi.types.TagMapper.parent ( entity ) ) ; return model ; }
Source:
public javax.ws.rs.core.Response head ( ) { appMode = getCurrent ( ) . get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ; org.ovirt.engine.api.model.API api = null ; if ( ( appMode ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { api = getGlusterApi ( ) ; } else { api = getApi ( ) ; } return getResponseBuilder ( api ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response head ( ) { appMode = getCurrent ( ) . getApplicationMode ( ) ; org.ovirt.engine.api.model.API api = null ; if ( ( appMode ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { api = getGlusterApi ( ) ; } else { api = getApi ( ) ; } return getResponseBuilder ( api ) . build ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void setVirtioScsiController ( org.ovirt.engine.api.model.VM model ) { if ( ! ( model.isSetVirtioScsi ( ) ) ) { model.setVirtioScsi ( new org.ovirt.engine.api.model.VirtioScsi ( ) ) ; } model.getVirtioScsi ( ) . setEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getVirtioScsiControllersForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }

Target:
protected void setVirtioScsiController ( org.ovirt.engine.api.model.Vm model ) { if ( ! ( model.isSetVirtioScsi ( ) ) ) { model.setVirtioScsi ( new org.ovirt.engine.api.model.VirtioScsi ( ) ) ; } model.getVirtioScsi ( ) . setEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getVirtioScsiControllersForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }
Source:
private void doTest ( java.lang.String input , boolean expectedResult ) { javax.validation.Validator validator = javax.validation.Validation.buildDefaultValidatorFactory ( ) . getValidator ( ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.validation.Ipv6ConstraintTest.TestObject > > validationResult = validator.validate ( new org.ovirt.engine.core.common.validation.Ipv6ConstraintTest.TestObject ( input ) ) ; boolean valid = validationResult.isEmpty ( ) ; org.junit.Assert.assertThat ( valid , org.hamcrest.CoreMatchers.is ( expectedResult ) ) ; }

Target:
private void doTest ( java.lang.String input , boolean expectedResult ) { javax.validation.Validator validator = javax.validation.Validation.buildDefaultValidatorFactory ( ) . getValidator ( ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.validation.Ipv6ConstraintTest.TestObject > > validationResult = validator.validate ( new org.ovirt.engine.core.common.validation.Ipv6ConstraintTest.TestObject ( input ) ) ; boolean valid = validationResult.isEmpty ( ) ; org.hamcrest.MatcherAssert.assertThat ( valid , org.hamcrest.CoreMatchers.is ( expectedResult ) ) ; }
Source:
public static void getHostPublicKey ( 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > > aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForNewDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( disksList ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksList ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void queryFailed ( ) { getWindow ( ) . stopProgress ( ) ; cancel ( ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.users.VdcUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getUserId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getUserName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomainControler ( ) ) ; return obj ; }

Target:
protected org.codehaus.jackson.node.ObjectNode getUserInfoObject ( org.ovirt.engine.core.common.businessentities.DbUser loggedInUser ) { org.codehaus.jackson.node.ObjectNode obj = createObjectNode ( ) ; obj.put ( "id" , loggedInUser.getId ( ) . toString ( ) ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; return obj ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "AllowClusterWithVirtGlusterEnabled" . equals ( propName ) ) { getView ( ) . allowClusterWithVirtGlusterEnabled ( model.getAllowClusterWithVirtGlusterEnabled ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "AllowClusterWithVirtGlusterEnabled" . equals ( propName ) ) { getView ( ) . allowClusterWithVirtGlusterEnabled ( model.getAllowClusterWithVirtGlusterEnabled ( ) ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }

Target:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ) && ( cluster.getArchitecture ( ) . equals ( VmListModel.BALLOON_DEVICE_BLACKLISTED_ARCH ) ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }
Source:
public void unsupportedHostedEngineDeployWhenClusterLevelIsUnsupported ( ) { org.mockito.Mockito.when ( hostedEngineHelper.isVmManaged ( ) ) . thenReturn ( false ) ; mockCluster ( Version.v3_6 ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( Guid.Empty ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.DEPLOY ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_DEPLOYMENT_UNSUPPORTED ) ) ; }

Target:
public void supportsHostedEngineDeployInVersion36 ( ) { org.mockito.Mockito.when ( hostedEngineHelper.isVmManaged ( ) ) . thenReturn ( true ) ; mockCluster ( Version.v3_6 ) ; org.junit.Assert.assertThat ( validator.supportsDeployingHostedEngine ( new org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration ( HostedEngineDeployConfiguration.Action.DEPLOY ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.security.GeneralSecurityException { java.lang.String result = null ; byte [ ] cipherbytes = Encoding.UTF8.getBytes ( source.trim ( ) ) ; javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; byte [ ] cipher = rsa.doFinal ( cipherbytes ) ; result = Encoding.Base64.getString ( cipher ) ; return result ; }

Target:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.io.UnsupportedEncodingException , java.security.GeneralSecurityException { java.lang.String result = null ; byte [ ] cipherbytes = source.trim ( ) . getBytes ( "UTF-8" ) ; javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; byte [ ] cipher = rsa.doFinal ( cipherbytes ) ; result = org.apache.commons.codec.binary.Base64.encodeBase64String ( cipher ) ; return result ; }
Source:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsList ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.common.businessentities.Permissions permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.Permission permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
protected void executeVmCommand ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk : org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getCinderDisks ( ) ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase params = getRestoreFromSnapshotParams ( cinderDisk ) ; restoreCinderDisk ( cinderDisk , params ) ; if ( ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( Snapshot.SnapshotType.REGULAR ) ) { cinderDisk.setActive ( true ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getImageDao ( ) . update ( cinderDisk.getImage ( ) ) ; } } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }

Target:
private void updateCinderDiskSnapshot ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskFromSnapshot = org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getDiskImageDao ( ) . getDiskSnapshotForVmSnapshot ( cinderDiskId , snapshotId ) ; diskFromSnapshot.setActive ( true ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmSnapshotId ) ) ) { diskFromSnapshot.setVmSnapshotId ( vmSnapshotId ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getImageDao ( ) . update ( diskFromSnapshot.getImage ( ) ) ; }
Source:
private void mockPassDiscardSupportedForDestSd ( org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.businessentities.storage.ImageOperation imageOperation ) { command.getParameters ( ) . setOperation ( imageOperation ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( command ) . createMultipleDiskVmElementValidator ( ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( validationResult ) ; }

Target:
private void mockPassDiscardSupportedForDestSd ( org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.businessentities.storage.ImageOperation imageOperation ) { command.getParameters ( ) . setOperation ( imageOperation ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( command ) . createMultipleDiskVmElementValidator ( ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( validationResult ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; model.setAddress ( nic.getIpv4Address ( ) ) ; return model ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; model.setIpv4Address ( nic.getIpv4Address ( ) ) ; model.setIpv6Address ( nic.getIpv6Address ( ) ) ; return model ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardZeroesTheDataSupportBreaks ( ) { setSdDiscardSupport ( true , true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; junit.framework.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardZeroesTheDataSupportBreaks ( ) { setSdDiscardSupport ( true , true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }
Source:
public void diskImagesHasDerivedDisksNoStorageDomainSpecifiedFailure ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }

Target:
public void diskImagesHasDerivedDisksNoStorageDomainSpecifiedFailure ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }
Source:
private void updateCachedIsoFileListFromVdsm ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData repoFileMetaData ) { boolean isRefreshed = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > problematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; isRefreshed = refreshIsoDomain ( repoFileMetaData.getRepoDomainId ( ) , problematicRepoFileList , repoFileMetaData.getFileType ( ) ) ; addRepoFileToProblematicList ( problematicRepoFileList ) ; } finally { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.infoFormat ( "Finished automatic refresh process for {0} file type with {1}, for storage domain id {2}." , repoFileMetaData.getFileType ( ) , ( isRefreshed ? "success" : "failure" ) , repoFileMetaData.getRepoDomainId ( ) ) ; } }

Target:
private void updateCachedIsoFileListFromVdsm ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage ) { boolean isRefreshed = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > problematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ( ) ; isRefreshed = refreshIsoDomain ( repoImage.getRepoDomainId ( ) , problematicRepoFileList , repoImage.getFileType ( ) ) ; addRepoFileToProblematicList ( problematicRepoFileList ) ; } finally { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.infoFormat ( "Finished automatic refresh process for {0} file type with {1}, for storage domain id {2}." , repoImage.getFileType ( ) , ( isRefreshed ? "success" : "failure" ) , repoImage.getRepoDomainId ( ) ) ; } }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public static void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.aaa.AuthenticationProfile > profiles = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ; java.util.List < java.lang.String > names = new java.util.ArrayList ( profiles.size ( ) ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : profiles ) { names.add ( profile.getName ( ) ) ; } java.util.Collections.sort ( names ) ; org.ovirt.engine.core.bll.GetAAAProfileListQuery.getQueryReturnValue ( ) . setReturnValue ( names ) ; }

Target:
public int compare ( org.ovirt.engine.core.aaa.ProfileEntry lhs , org.ovirt.engine.core.aaa.ProfileEntry rhs ) { return ( lhs.getProfile ( ) . compareTo ( rhs.getProfile ( ) ) ) != 0 ? lhs.getProfile ( ) . compareTo ( rhs.getProfile ( ) ) : lhs.getAuthz ( ) . compareTo ( rhs.getAuthz ( ) ) ; }
Source:
public void updateStartedExecutionEntitiesToUnknown ( java.util.Date updateTime ) { updateQueryGetResult ( getEntityManager ( ) . createNativeQuery ( "select cast(UpdateStartedExecutionEntitiesToUnknown as text) from UpdateStartedExecutionEntitiesToUnknown(?)" ) . setParameter ( 1 , updateTime ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.job.Job > getJobsByOffsetAndPageSize ( int offset , int pageSize ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "position" , offset ) . addValue ( "page_size" , pageSize ) ; return getCallsHandler ( ) . executeReadList ( "GetJobsByOffsetAndPageSize" , createEntityRowMapper ( ) , parameterSource ) ; }
Source:
private void vnicProfileAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > vnicProfiles ) { this . vnicProfiles.addAll ( vnicProfiles ) ; org.mockito.Mockito.when ( vnicProfile.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_VNIC_PROFILE_NAME ) ; org.mockito.Mockito.when ( vnicProfile.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.vnicProfileNameNotUsed ( ) , matcher ) ; }

Target:
private void vnicProfileAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > vnicProfiles ) { this . vnicProfiles.addAll ( vnicProfiles ) ; org.mockito.Mockito.when ( vnicProfile.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_VNIC_PROFILE_NAME ) ; org.mockito.Mockito.when ( vnicProfile.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.hamcrest.MatcherAssert.assertThat ( validator.vnicProfileNameNotUsed ( ) , matcher ) ; }