auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( true ) ; group.setGlusterService ( false ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createClusterWithOlderVersion ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createNewCluster ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setVirtService ( true ) ; group.setGlusterService ( false ) ; group.setMaxVdsMemoryOverCommit ( 100 ) ; return group ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setName ( "testTemplate" ) ; final org.ovirt.engine.core.common.action.ImportVmTemplateParameters p = new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , t ) ; return p ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setName ( "testTemplate" ) ; final org.ovirt.engine.core.common.action.ImportVmTemplateParameters p = new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , t ) ; return p ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( result ) ; setIsFingerprintVerified ( true ) ; } else { getGlusterHostFingerprint ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; setIsFingerprintVerified ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public static void logEntry ( org.ovirt.engine.core.utils.log.Log log , java.lang.String id , java.lang.Object obj ) { org.ovirt.engine.core.utils.log.Logged logged = org.ovirt.engine.core.utils.log.LoggedUtils.getAnnotation ( obj ) ; if ( ( logged != null ) && ( org.ovirt.engine.core.utils.log.LoggedUtils.isLogLevelOn ( log , logged.executionLevel ( ) ) ) ) { org.ovirt.engine.core.utils.log.LoggedUtils.log ( log , logged.executionLevel ( ) , org.ovirt.engine.core.utils.log.LoggedUtils.ENTRY_LOG , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , logged , obj ) , id ) ; } }

Target:
public static void logEntry ( org.slf4j.Logger log , java.lang.String id , java.lang.Object obj ) { org.ovirt.engine.core.utils.log.Logged logged = org.ovirt.engine.core.utils.log.LoggedUtils.getAnnotation ( obj ) ; if ( logged != null ) { org.ovirt.engine.core.utils.log.LoggedUtils.log ( log , logged.executionLevel ( ) , org.ovirt.engine.core.utils.log.LoggedUtils.ENTRY_LOG , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , logged , obj ) , id ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.VmTemplate createVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setName ( "test-template" ) ; template.setOrigin ( OriginType.OVIRT ) ; template.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; template.setDescription ( "test-description" ) ; template.setDbGeneration ( 2L ) ; return template ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmTemplate createVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; template.setName ( "test-template" ) ; template.setOrigin ( OriginType.OVIRT ) ; template.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; template.setDescription ( "test-description" ) ; template.setDbGeneration ( 2L ) ; template.setClusterArch ( ArchitectureType.x86_64 ) ; return template ; }
Source:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; vmDeviceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDeviceDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDaoMock ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; }

Target:
private void setUpDaoMocks ( ) { org.mockito.Mockito.when ( getQuery ( ) . getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDaoMock ) ; org.mockito.Mockito.when ( getQuery ( ) . getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterList ( 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.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void test1 ( ) throws java.lang.Exception { java.security.KeyStore.PrivateKeyEntry entry = org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getPrivateKeyEntry ( org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getKeyStore ( "PKCS12" , "key.p12" , "NoSoup4U" ) , "1" , "NoSoup4U" ) ; byte [ ] test = "testing 1 2 3 4" . getBytes ( java.nio.charset.Charset.forName ( "UTF-8" ) ) ; org.junit.Assert.assertArrayEquals ( test , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.decrypt ( entry , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.encrypt ( "AES/OFB/PKCS5Padding" , 256 , entry.getCertificate ( ) , 100 , test ) ) ) ; }

Target:
public void test1 ( ) throws java.lang.Exception { java.security.KeyStore.PrivateKeyEntry entry = org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getPrivateKeyEntry ( org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getKeyStore ( "PKCS12" , "key.p12" , "NoSoup4U" ) , "1" , "NoSoup4U" ) ; byte [ ] test = "testing 1 2 3 4" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; org.junit.Assert.assertArrayEquals ( test , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.decrypt ( entry , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.encrypt ( "AES/OFB/PKCS5Padding" , 256 , entry.getCertificate ( ) , 100 , test ) ) ) ; }
Source:
public void init ( ) throws javax.servlet.ServletException { setVerifyHost ( getConfigBoolean ( org.ovirt.engine.core.services.ProxyServlet.VERIFY_HOST_PRM ) ) ; setVerifyChain ( getConfigBoolean ( org.ovirt.engine.core.services.ProxyServlet.VERIFY_CHAIN_PRM ) ) ; setHttpsProtocol ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.HTTPS_PROTOCOL_PRM ) ) ; setTrustManagerAlgorithm ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_MANAGER_ALGORITHM_PRM ) ) ; setTrustStore ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_PRM ) ) ; setTrustStoreType ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_TYPE_PRM ) ) ; setTrustStorePassword ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_PASSWORD_PRM ) ) ; setReadTimeout ( getConfigInteger ( org.ovirt.engine.core.services.ProxyServlet.READ_TIMEOUT_PRM ) ) ; setUrl ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.URL_PRM ) ) ; }

Target:
public void init ( ) throws javax.servlet.ServletException { setVerifyHost ( getConfigBoolean ( org.ovirt.engine.core.services.ProxyServlet.VERIFY_HOST_PRM ) ) ; setVerifyChain ( getConfigBoolean ( org.ovirt.engine.core.services.ProxyServlet.VERIFY_CHAIN_PRM ) ) ; setHttpsProtocol ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.HTTPS_PROTOCOL_PRM ) ) ; setTrustManagerAlgorithm ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_MANAGER_ALGORITHM_PRM ) ) ; setTrustStore ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_PRM ) ) ; setTrustStoreType ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_TYPE_PRM ) ) ; setTrustStorePassword ( getConfigString ( org.ovirt.engine.core.services.ProxyServlet.TRUST_STORE_PASSWORD_PRM ) ) ; setReadTimeout ( getConfigInteger ( org.ovirt.engine.core.services.ProxyServlet.READ_TIMEOUT_PRM ) ) ; setUrl ( getUrl ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.IPv4Address newPrimaryAddress ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface targetNic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setBootProtocol ( targetNic.getBootProtocol ( ) ) ; if ( ( primaryAddress.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { primaryAddress.setGateway ( targetNic.getGateway ( ) ) ; primaryAddress.setNetmask ( targetNic.getSubnet ( ) ) ; primaryAddress.setAddress ( targetNic.getAddress ( ) ) ; } return primaryAddress ; }

Target:
private static void removeLabel ( java.lang.String srcIfaceName , org.ovirt.engine.core.compat.Guid srcIfaceId , java.lang.String label , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { dataFromHostSetupNetworksModel.removeLabelFromParameters ( new org.ovirt.engine.core.common.businessentities.network.NicLabel ( srcIfaceId , srcIfaceName , label ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , entity ) ; } }
Source:
public java.util.List < org.ovirt.engine.api.model.ReportedDevice > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = new java.util.ArrayList < org.ovirt.engine.api.model.ReportedDevice > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } } return devices ; }

Target:
public java.util.List < org.ovirt.engine.api.model.ReportedDevice > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = new java.util.ArrayList < org.ovirt.engine.api.model.ReportedDevice > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } } return devices ; }
Source:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; }

Target:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s " , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }
Source:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }

Target:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addValidationMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult sriovFeatureSupported ( ) { org.ovirt.engine.core.common.businessentities.VDS host = getDbFacade ( ) . getVdsDao ( ) . get ( getNic ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version clusterCompVer = host.getVdsGroupCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED ) . unless ( org.ovirt.engine.core.common.FeatureSupported.sriov ( clusterCompVer ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult sriovFeatureSupported ( ) { org.ovirt.engine.core.common.businessentities.VDS host = getDbFacade ( ) . getVdsDao ( ) . get ( getNic ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version clusterCompVer = host.getVdsGroupCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED ) . unless ( org.ovirt.engine.core.common.FeatureSupported.sriov ( clusterCompVer ) ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getguest_last_login_time ( ) ) != null ) && ( ( ( getguest_last_logout_time ( ) ) == null ) || ( ( getguest_last_login_time ( ) . compareTo ( getguest_last_logout_time ( ) ) ) > 0 ) ) ) { setguest_last_logout_time ( new java.util.Date ( ) ) ; } }

Target:
public void setInterfaces ( java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > value ) { vmStatic.setInterfaces ( value ) ; }
Source:
public void testAddIdSuppliedButNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( "11111111-1111-1111-1111-111111111111" ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }

Target:
public void testAddIdSuppliedButNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( "11111111-1111-1111-1111-111111111111" ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( ActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { New ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { Edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { New ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { Edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }
Source:
private void createCluster ( ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( CLUSTER_NAME ) ; cluster.setDescription ( CLUSTER_DESCRIPTION ) ; cluster.setStoragePoolId ( DATA_CENTER_ID ) ; cluster.setCpuName ( CPU_NAME ) ; cluster.setMaxVdsMemoryOverCommit ( MAX_VDS_MEMORY_OVER_COMMIT ) ; cluster.setCountThreadsAsCores ( COUNT_THREADS_AS_CORES ) ; cluster.setTransparentHugepages ( SET_TRANSPARENT_HUGE_PAGES ) ; cluster.setCompatibilityVersion ( SET_COMPATIBILITY_VERSION ) ; cluster.setMigrateOnError ( MIGRATE_ON_ERROR ) ; cluster.setArchitecture ( ARCHITECTURE_TYPE ) ; }

Target:
private void createCluster ( ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( org.ovirt.engine.core.bll.AddClusterCommandTest.CLUSTER_NAME ) ; cluster.setDescription ( org.ovirt.engine.core.bll.AddClusterCommandTest.CLUSTER_DESCRIPTION ) ; cluster.setStoragePoolId ( org.ovirt.engine.core.bll.AddClusterCommandTest.DATA_CENTER_ID ) ; cluster.setCpuName ( org.ovirt.engine.core.bll.AddClusterCommandTest.CPU_NAME ) ; cluster.setMaxVdsMemoryOverCommit ( org.ovirt.engine.core.bll.AddClusterCommandTest.MAX_VDS_MEMORY_OVER_COMMIT ) ; cluster.setCountThreadsAsCores ( org.ovirt.engine.core.bll.AddClusterCommandTest.COUNT_THREADS_AS_CORES ) ; cluster.setTransparentHugepages ( org.ovirt.engine.core.bll.AddClusterCommandTest.SET_TRANSPARENT_HUGE_PAGES ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.AddClusterCommandTest.SET_COMPATIBILITY_VERSION ) ; cluster.setMigrateOnError ( org.ovirt.engine.core.bll.AddClusterCommandTest.MIGRATE_ON_ERROR ) ; cluster.setArchitecture ( org.ovirt.engine.core.bll.AddClusterCommandTest.ARCHITECTURE_TYPE ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.V2VJobInfo ) { return vmId.equals ( ( ( org.ovirt.engine.core.common.businessentities.V2VJobInfo ) ( obj ) ) . vmId ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.V2VJobInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.V2VJobInfo other = ( ( org.ovirt.engine.core.common.businessentities.V2VJobInfo ) ( obj ) ) ; return java.util.Objects.equals ( vmId , other.vmId ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxy ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; removeIrsProxy ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( this . getCurrentIrsProxy ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; removeIrsProxy ( ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; }
Source:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }

Target:
protected final void decreasePendingVm ( org.ovirt.engine.core.common.businessentities.VmStatic vm ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "PendingVms for the guest '{}' running on host '{}' was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVm ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findDirectoryUserByIds ( 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 ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecordsToDirectoryUsers ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.findPrincipalsByIds ( extension , namespace , ids , groupsResolving , groupsResolvingRecursive ) ) ; }

Target:
public static java.util.Collection < org.ovirt.engine.core.aaa.DirectoryUser > findDirectoryUserByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.Collection < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecordsToDirectoryUsers ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.findPrincipalsByIds ( extension , namespace , ids , groupsResolving , groupsResolvingRecursive ) ) ; }
Source:
public void diskImagesOnAnyApplicableDomainsNoValidDomainsForOneDisk ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > validDomainsForDisk = createDiskValidDomainsMap ( disk1 ) ; validDomainsForDisk.put ( disk2.getId ( ) , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptySet ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainMap = createStorageDomainsMap ( disk1 , disk2 ) ; org.junit.Assert.assertThat ( validator.diskImagesOnAnyApplicableDomains ( validDomainsForDisk , storageDomainMap , VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , java.util.EnumSet.of ( StorageDomainStatus.Active ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS ) ) ; }

Target:
public void diskImagesOnAnyApplicableDomainsNoValidDomainsForOneDisk ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > validDomainsForDisk = createDiskValidDomainsMap ( disk1 ) ; validDomainsForDisk.put ( disk2.getId ( ) , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptySet ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainMap = createStorageDomainsMap ( disk1 , disk2 ) ; org.junit.Assert.assertThat ( validator.diskImagesOnAnyApplicableDomains ( validDomainsForDisk , storageDomainMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , java.util.EnumSet.of ( StorageDomainStatus.Active ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS ) ) ; }
Source:
private void adjustDisplayIp ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo : graphicsInfos.values ( ) ) { if ( graphicsInfo == null ) { continue ; } if ( ( host.getConsoleAddress ( ) ) != null ) { graphicsInfo.setIp ( host.getConsoleAddress ( ) ) ; } else if ( graphicsInfo.getIp ( ) . startsWith ( "0" ) ) { graphicsInfo.setIp ( host.getHostName ( ) ) ; } } }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }
Source:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
private void doTestBadAddMacPool ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddMacPool , org.ovirt.engine.core.common.action.MacPoolParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddMacPool ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddMacPool , org.ovirt.engine.core.common.action.MacPoolParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 ) { try { return doGetEntity ( clz , query , queryParams , identifier ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
private < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }
Source:
public static void GetStorageDomainMaxNameLength ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( 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.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private void setIsoImages ( org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel > value ) { if ( ( ( ( isoImages ) == null ) && ( value != null ) ) || ( ( ( isoImages ) != null ) && ( ! ( isoImages.equals ( value ) ) ) ) ) { isoImages = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsoImages" ) ) ; } }

Target:
private void setIsoImages ( org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel > value ) { if ( ( ( ( isoImages ) == null ) && ( value != null ) ) || ( ( ( isoImages ) != null ) && ( ! ( isoImages.equals ( value ) ) ) ) ) { isoImages = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsoImages" ) ) ; } }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getMigrationPolicies ( 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 returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.migration.MigrationPolicy > ( ) ; } return returnValue ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllMigrationPolicies , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private void _nextCustomizationEntry ( ) throws java.lang.Exception { try { if ( _customizationShouldAbort ) { _parser.cliAbort ( ) ; } else { _customizationDialog [ ( ( _customizationIndex ) ++ ) ] . call ( ) ; } } catch ( java.lang.ArrayIndexOutOfBoundsException e ) { throw new java.lang.RuntimeException ( "Protocol violation" , e ) ; } catch ( org.ovirt.otopi.dialog.SoftError e ) { org.ovirt.engine.core.bll.VdsDeploy.log.errorFormat ( "Soft error during host {0} customization dialog" , _vds.gethost_name ( ) , e ) ; _failException = e ; _customizationShouldAbort = true ; } }

Target:
private void _nextCustomizationEntry ( ) throws java.lang.Exception { try { if ( _customizationShouldAbort ) { _parser.cliAbort ( ) ; } else { _customizationDialog [ ( ( _customizationIndex ) ++ ) ] . call ( ) ; } } catch ( java.lang.ArrayIndexOutOfBoundsException e ) { throw new java.lang.RuntimeException ( "Protocol violation" , e ) ; } catch ( org.ovirt.otopi.dialog.SoftError e ) { org.ovirt.engine.core.bll.VdsDeploy.log.errorFormat ( "Soft error during host {0} customization dialog" , _vds.getHostName ( ) , e ) ; _failException = e ; _customizationShouldAbort = true ; } }
Source:
public void CheckIsENGINEUser ( java.lang.Object targetObject ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( targetObject ) ) ; loginModel.getIsENGINEUser ( ) . setEntity ( null ) ; boolean isENGINEUser = true ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup : loginModel.getLoggedUserActionGroupList ( ) ) { if ( ! ( loginModel.getENGINEUserActionGroupList ( ) . contains ( actionGroup ) ) ) { isENGINEUser = false ; break ; } } loginModel.getIsENGINEUser ( ) . setEntity ( isENGINEUser ) ; }

Target:
public void checkIsENGINEUser ( java.lang.Object targetObject ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( targetObject ) ) ; loginModel.getIsENGINEUser ( ) . setEntity ( null ) ; boolean isENGINEUser = true ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup : loginModel.getLoggedUserActionGroupList ( ) ) { if ( ! ( loginModel.getENGINEUserActionGroupList ( ) . contains ( actionGroup ) ) ) { isENGINEUser = false ; break ; } } loginModel.getIsENGINEUser ( ) . setEntity ( isENGINEUser ) ; }
Source:
private void buildSmartcardDevice ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceType.SMARTCARD.getName ( ) , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map struct = new java.util.HashMap ( ) ; struct.put ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getType ( ) ) ; addDevice ( struct , vmDevice , null ) ; } }

Target:
private void buildSmartcardDevice ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map struct = new java.util.HashMap ( ) ; struct.put ( VdsProperties.Type , vmDevice.getType ( ) . getValue ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getType ( ) ) ; addDevice ( struct , vmDevice , null ) ; } }
Source:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( getCommand ( ) . getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( getCommand ( ) ) ; }

Target:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.storage.connection.StorageServerConnectionTestCommon.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( command ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }