auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isEditAvailable ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( storageDomain == null ) { return false ; } boolean isActive = ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) || ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Mixed ) ) ; boolean isBlockStorage = storageDomain.getstorage_type ( ) . isBlockDomain ( ) ; return isBlockStorage ? true : isActive ; }

Target:
private boolean isNfsPathEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { return ( ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storage.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; }
Source:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.ActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.ActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.ActionReturnValue createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > applyUserConfiguredNics ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics = new java.util.ArrayList < > ( ) ; userConfiguredNics.addAll ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingBondToRemove : getRemovedBonds ( ) ) { existingBondToRemove.setLabels ( null ) ; userConfiguredNics.add ( existingBondToRemove ) ; } return userConfiguredNics ; }
Source:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }

Target:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( VdcActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VdcActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }

Target:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }
Source:
protected void mockGetImageDomainsListVdsCommand ( int availableDiskSizeFirstDomain , int availableDiskSizeSecondDomain ) { mockGetStorageDomainList ( availableDiskSizeFirstDomain , availableDiskSizeSecondDomain ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.mockStorageGuidList ( storageDomainsList ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockGetImagesList ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImagesList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }
Source:
private void run ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.RunVmParams ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RunVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void run ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.RunVmParams ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RunVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network_cluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network_cluster entity = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( rs.getInt ( "status" ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network_cluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network_cluster entity = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }
Source:
protected void initializeCommand ( org.ovirt.engine.core.common.businessentities.ImageOperation operation ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.MoveOrCopyDiskCommandDummy ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( diskImageGuid , srcStorageId , destStorageId , operation ) ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . acquireLock ( ) ; }

Target:
protected void initializeCommand ( org.ovirt.engine.core.common.businessentities.ImageOperation operation ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.MoveOrCopyDiskCommandDummy ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( diskImageGuid , srcStorageId , destStorageId , operation ) ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . acquireLock ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; queryInterfaces ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > configureNetworks ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { configureNetwork ( nic , vlans , network ) ; } return vlans ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > configureNetworks ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > networks , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfaces ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { configureNetwork ( nic , vlans , network , existingInterfaces ) ; } return vlans ; }
Source:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }

Target:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshStoragePool ( java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.refreshStoragePool ( spUUID , msdUUID , masterVersion ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.remove_image_ticket ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( "repoimagename" , getRepoImageName ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( "repoimagename" , getRepoImageName ( ) ) ; jobProperties.put ( "storage" , org.ovirt.engine.core.bll.ImportRepoImageCommand.getStorageDomainName ( ) ) ; } return jobProperties ; }
Source:
protected void expectGetLunsForVg ( java.lang.String vgId ) { org.ovirt.engine.core.dao.LunDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDAO ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( ) ) ; }

Target:
protected void expectGetLunsForVg ( java.lang.String vgId ) { org.ovirt.engine.core.dao.LunDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( ) ) ; }
Source:
protected < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.interfaces.SearchType searchType , java.lang.String constraint ) { try { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.Search , createSearchParameters ( searchType , constraint ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return castQueryResultToEntity ( clz , result , constraint ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , false ) ; } }

Target:
protected < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.interfaces.SearchType searchType , java.lang.String constraint ) { try { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.Search , createSearchParameters ( searchType , constraint ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return castQueryResultToEntity ( clz , result , constraint ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , false ) ; } }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void stats ( ) { long now = new java.util.Date ( ) . getTime ( ) ; if ( now > ( nextStats ) ) { nextStats = now + ( statsTTL ) ; for ( org.ovirt.engineextensions.aaa.ldap.Framework.ConnectionPoolEntry entry : connectionPools.values ( ) ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Stats: {}" , entry.connectionPool.getConnectionPoolStatistics ( ) ) ; } } }

Target:
public void stats ( ) { long now = new java.util.Date ( ) . getTime ( ) ; if ( now > ( nextStats ) ) { nextStats = now + ( statsTTL ) ; for ( org.ovirt.engineextensions.aaa.ldap.Framework.ConnectionPoolEntry entry : connectionPools.values ( ) ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Stats: {}" , entry.name , entry.connectionPool.getConnectionPoolStatistics ( ) ) ; } } }
Source:
public void testAddStorageDomainWithHostName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setName ( NAMES [ 0 ] ) ; setUpGetEntityExpectations ( ( "Hosts: name=" + ( NAMES [ 0 ] ) ) , SearchType.VDS , setUpVDS ( 0 ) ) ; doTestAddStorageDomain ( 0 , host , false ) ; }

Target:
public void testAddStorageDomainWithHostName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setName ( NAMES [ 0 ] ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsStaticByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 0 ] } , setUpVDStatic ( 0 ) ) ; doTestAddStorageDomain ( 0 , host , false ) ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesEmpty ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String domain ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( userName , password , domain , null , null , null ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( VdcActionType.LoginAdminUser ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . Login ( params ) ; return returnValue ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String domain , org.ovirt.engine.core.common.action.VdcActionType loginType ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( userName , password , domain , null , null , null ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( loginType ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . Login ( params ) ; return returnValue ; }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setImageTemplateId ( itGuid ) ; return expectedDisk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setImageTemplateId ( itGuid ) ; return expectedDisk ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( int index ) { org.ovirt.engine.api.restapi.resource.Cluster entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }
Source:
public void getClusterFeaturesByClusterId ( 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 ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.scheduling.PolicyUnit object ) { if ( object.isInternal ( ) ) { setTitle ( constants.internalPolicyUnit ( ) ) ; return resources.lockImage ( ) ; } setTitle ( constants.externalPolicyUnit ( ) ) ; return resources.exteranlPolicyUnitImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.scheduling.PolicyUnit object ) { if ( object.isInternal ( ) ) { setTitle ( org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.constants.internalPolicyUnit ( ) ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.resources.lockImage ( ) ; } setTitle ( org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.constants.externalPolicyUnit ( ) ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.resources.exteranlPolicyUnitImage ( ) ; }
Source:
private void auditLogForNoMetadataDescriptionUpdate ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.addCustomValue ( "DataCenterName" , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getName ( ) ) ; auditLogableBase.addCustomValue ( "StorageDomainName" , storageDomain.getName ( ) ) ; auditLogableBase.addCustomValue ( "DiskName" , diskImage.getDiskAlias ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( auditLogableBase , auditLogType ) ; }

Target:
private void auditLogForNoMetadataDescriptionUpdate ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.addCustomValue ( "DataCenterName" , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getName ( ) ) ; auditLogableBase.addCustomValue ( "StorageDomainName" , storageDomain.getName ( ) ) ; auditLogableBase.addCustomValue ( "DiskName" , diskImage.getDiskAlias ( ) ) ; auditLogDirector.log ( auditLogableBase , auditLogType ) ; }
Source:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId ) { org.ovirt.engine.ui.common.widget.AbstractUiCommandButton button = createCommandButton ( label , uniqueId ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; return button ; }

Target:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId ) { org.ovirt.engine.ui.common.widget.AbstractUiCommandButton button = createCommandButton ( label , uniqueId ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; focusableButtons.add ( 0 , button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; return button ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_pool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintanance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case Problematic : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_pool dc ) { setEnumTitle ( dc.getstatus ( ) ) ; switch ( dc.getstatus ( ) ) { case Contend : return getApplicationResources ( ) . waitImage ( ) ; case Maintenance : return getApplicationResources ( ) . maintenanceImage ( ) ; case NotOperational : case Problematic : case Uninitialized : return getApplicationResources ( ) . downImage ( ) ; case Up : return getApplicationResources ( ) . upImage ( ) ; default : break ; } return null ; }
Source:
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( 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.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected void writeAdditionalJsData ( javax.servlet.http.HttpServletRequest request , java.io.PrintWriter writer ) { super . writeAdditionalJsData ( request , writer ) ; java.lang.Integer applicationMode = getApplicationMode ( request ) ; if ( applicationMode != null ) { java.util.Map < java.lang.String , java.lang.String > appModeData = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; appModeData.put ( "value" , java.lang.String.valueOf ( applicationMode ) ) ; writeJsObject ( writer , "applicationMode" , appModeData ) ; } }

Target:
private void writeApplicationMode ( javax.servlet.http.HttpServletRequest request , java.io.PrintWriter writer ) { java.lang.Integer applicationMode = getApplicationMode ( request ) ; if ( applicationMode != null ) { java.util.Map < java.lang.String , java.lang.String > appModeData = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; appModeData.put ( "value" , java.lang.String.valueOf ( applicationMode ) ) ; writeJsObject ( writer , "applicationMode" , appModeData ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Permissions o1 , org.ovirt.engine.core.common.businessentities.Permissions o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return getCommonResources ( ) . userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.Permission o1 , org.ovirt.engine.core.common.businessentities.Permission o2 ) { if ( getValue ( o1 ) . equals ( getValue ( o2 ) ) ) { return 0 ; } else { return org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn.resources.userImage ( ) . equals ( getValue ( o1 ) ) ? - 1 : 1 ; } }
Source:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Cluster: name=" + ( NAMES [ 1 ] ) ) , SearchType.Cluster , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }

Target:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 1 ] } , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > serviceList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > ) ( source ) ) ; if ( ! ( serviceList.isEmpty ( ) ) ) { return serviceList.get ( 0 ) ; } return null ; } else { return source ; } }

Target:
public void getClusterGlusterSwiftService ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetFirstConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterClusterServiceByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
private static void addIpsByVersion ( org.ovirt.engine.api.model.Ips ips , java.util.List < java.lang.String > entityIps , org.ovirt.engine.api.restapi.types.IpVersion ipVersion ) { if ( entityIps != null ) { for ( java.lang.String entityIp : entityIps ) { org.ovirt.engine.api.model.Ip ip = new org.ovirt.engine.api.model.Ip ( ) ; ip.setAddress ( entityIp ) ; ip.setVersion ( ipVersion.value ( ) ) ; ips.getIps ( ) . add ( ip ) ; } } }

Target:
private static void addIpsByVersion ( org.ovirt.engine.api.model.Ips ips , java.util.List < java.lang.String > entityIps , org.ovirt.engine.api.model.IpVersion ipVersion ) { if ( entityIps != null ) { for ( java.lang.String entityIp : entityIps ) { org.ovirt.engine.api.model.Ip ip = new org.ovirt.engine.api.model.Ip ( ) ; ip.setAddress ( entityIp ) ; ip.setVersion ( ipVersion ) ; ips.getIps ( ) . add ( ip ) ; } } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.api.model.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateCluster , org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.core.common.businessentities.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }
Source:
public void testDoFilterFromRequest ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getLocale ( ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; testFilter.doFilter ( mockRequest , mockResponse , mockChain ) ; org.mockito.Mockito.verify ( mockChain ) . doFilter ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( LocaleFilter.LOCALE , java.util.Locale.JAPANESE ) ; org.mockito.Mockito.verify ( mockResponse , org.mockito.Mockito.times ( 1 ) ) . addCookie ( ( ( javax.servlet.http.Cookie ) ( org.mockito.Mockito.any ( ) ) ) ) ; }

Target:
public void testDoFilterFromRequest ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getLocale ( ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; testFilter.doFilter ( mockRequest , mockResponse , mockChain ) ; org.mockito.Mockito.verify ( mockChain ) . doFilter ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse , org.mockito.Mockito.times ( 1 ) ) . addCookie ( ( ( javax.servlet.http.Cookie ) ( org.mockito.Mockito.any ( ) ) ) ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( LocaleFilter.LOCALE , java.util.Locale.JAPAN ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( name ) == null ? 0 : name.hashCode ( ) ) ; result = ( prime * result ) + ( ( value ) == null ? 0 : value.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , name , value ) ; }