auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public 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.VmGuestAgentInterface > ( ) ; } return source ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.Domain > list ( java.lang.Integer max ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) . add ( "max" , max , UrlParameterType.MATRIX ) . build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.Domains.class , org.ovirt.engine.sdk.decorators.Domain.class ) ; }

Target:
public java.util.List < org.ovirt.engine.sdk.decorators.Domain > list ( java.lang.Integer max ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; java.lang.String url = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) . add ( "max" , max , UrlParameterType.MATRIX ) . build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.Domains.class , org.ovirt.engine.sdk.decorators.Domain.class , headers ) ; }
Source:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setAllContentHeaderExpectation ( ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
private void updateSuggestedDiskAlias ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } , getHash ( ) ) , getVm ( ) . getId ( ) ) ; }

Target:
private void updateSuggestedDiskAlias ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } , getHash ( ) ) , getVm ( ) . getId ( ) ) ; }
Source:
public void init ( ) { org.ovirt.engine.core.bll.VmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmPropertiesUtils ) . separateCustomPropertiesToUserAndPredefined ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }

Target:
public void init ( ) { mockCpuFlagsManagerHandler ( ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmPropertiesUtils ) . separateCustomPropertiesToUserAndPredefined ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }
Source:
private void verifyModel ( org.ovirt.engine.api.model.Cdrom model ) { assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSetTemplate ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.TEMPLATE_ID.toString ( ) , model.getTemplate ( ) . getId ( ) ) ; assertTrue ( model.isSetFile ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.ISO_PATH , model.getFile ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
private void verifyModel ( org.ovirt.engine.api.model.Cdrom model ) { org.junit.Assert.assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetTemplate ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.TEMPLATE_ID.toString ( ) , model.getTemplate ( ) . getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSetFile ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendTemplateCdromsResourceTest.ISO_PATH , model.getFile ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setLoginName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.NAMESPACE ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setLoginName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.LinkedList < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.NAMESPACE ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; permissionList = org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . addQuotaPermissionSubject ( permissionList , org.ovirt.engine.core.bll.UpdateVmCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) ) ; return permissionList ; }

Target:
private boolean isVmExist ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) ) != null ) ; }
Source:
public void testGetPeersWithWrongPassword ( ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }

Target:
public void testGetPeersWithWrongPassword ( ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ) ; }

Target:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }
Source:
protected boolean CanAddDomain ( ) { boolean returnValue = true ; if ( ( ( ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) ) == null ) || ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getStorageDomain ( ) . getstorage ( ) ) ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_CREATE_STORAGE_DOMAIN_WITHOUT_VG_LV ) ; } return returnValue ; }

Target:
protected boolean CanAddDomain ( ) { boolean returnValue = true ; if ( ( ( ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) ) == null ) || ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getParameters ( ) . getLunIds ( ) . isEmpty ( ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.storage.AddSANStorageDomainCommand.getStorageDomain ( ) . getstorage ( ) ) ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_CREATE_STORAGE_DOMAIN_WITHOUT_VG_LV ) ; } return returnValue ; }
Source:
private void setExternalVms ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > externalVms ) { this . externalVms = externalVms ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { this . stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; hosts.add ( 0 , null ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ) { if ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { hosts.add ( host ) ; } } proxyHosts.setItems ( hosts ) ; }
Source:
private void writeCleanup ( ) { com.google.gwt.core.ext.typeinfo.JClassType editorType = model.getEditorType ( ) ; logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( editorType.getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( "getObject().cleanup();" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( java.lang.String.format ( "getObject()%s.cleanup();" , editorData.getBeanOwnerExpression ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; for ( com.google.gwt.core.ext.typeinfo.JField field : editorType.getFields ( ) ) { com.google.gwt.core.ext.typeinfo.JClassType fieldClassType = field.getType ( ) . isClassOrInterface ( ) ; if ( ( ( fieldClassType != null ) && ( fieldClassType.isAssignableTo ( hasCleanupType ) ) ) && ( ! ( field.getType ( ) . isClassOrInterface ( ) . isAssignableTo ( baseModelType ) ) ) ) { java.lang.String fieldName = field.getName ( ) ; sw.println ( java.lang.String.format ( "if (getEditor().%s != null) {" , fieldName ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "getEditor().%s.cleanup();" , fieldName ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private java.util.Set < java.lang.String > getModelCleanupExpressions ( ) { java.util.Set < java.lang.String > result = new java.util.LinkedHashSet < > ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { result.add ( "getObject()" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { result.add ( java.lang.String.format ( "getObject()%s" , editorData.getBeanOwnerExpression ( ) ) ) ; } } return result ; }
Source:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; org.ovirt.engine.core.common.businessentities.RepoFileMetaData repoFileMetaData = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; repoFileMetaData.setStoragePoolId ( storagePoolId ) ; repoFileMetaData.setRepoDomainId ( storageDomainId ) ; repoFileMetaData.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoFileMetaData ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }

Target:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; org.ovirt.engine.core.common.businessentities.RepoFileMetaData repoFileMetaData = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; repoFileMetaData.setStoragePoolId ( storagePoolId ) ; repoFileMetaData.setRepoDomainId ( storageDomainId ) ; repoFileMetaData.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoFileMetaData ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }
Source:
void bindInfrastructure ( ) { bindCommonInfrastructure ( ) ; bind ( com.gwtplatform.mvp.client.proxy.PlaceManager.class ) . to ( org.ovirt.engine.ui.webadmin.place.WebAdminPlaceManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.InternalConfiguration.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.PostMessageDispatcher.class ) . asEagerSingleton ( ) ; }

Target:
protected void configure ( ) { requestStaticInjection ( org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.class ) ; bindInfrastructure ( ) ; bindConfiguration ( ) ; }
Source:
public 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.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void initHosts ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getHostListByClusterId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getPinnedHost ( ) . setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; stopProgress ( ) ; selectCurrentPinnedHost ( ) ; } } ) , vm.getVdsGroupId ( ) ) ; }

Target:
protected void initHosts ( ) { startProgress ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getHostListByClusterId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getPinnedHost ( ) . setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; stopProgress ( ) ; selectCurrentPinnedHost ( ) ; } } ) , vm.getClusterId ( ) ) ; }
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 getRpmVersionViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void updateVmDevicesNull ( ) { updater.updateVmDevices ( java.util.Collections.singletonList ( "" ) ) ; junit.framework.Assert.assertEquals ( "wrong number of new devices" , 0 , updater.getNewVmDevices ( ) . size ( ) ) ; junit.framework.Assert.assertEquals ( "wrong number of removed devices" , 0 , updater.getRemovedVmDevices ( ) . size ( ) ) ; }

Target:
public void updateVmDevicesNull ( ) { updater.updateVmDevices ( java.util.Collections.singletonList ( "" ) ) ; org.junit.Assert.assertEquals ( "wrong number of new devices" , 0 , updater.getNewVmDevices ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( "wrong number of removed devices" , 0 , updater.getRemovedVmDevices ( ) . size ( ) ) ; }
Source:
void stubGetConfigurationValuePublicQuery ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( java.lang.Integer.valueOf ( 255 ) ) ; org.mockito.Mockito.when ( mockBackend.RunPublicQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetConfigurationValue ) , org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.isA ( org.ovirt.engine.core.common.queries.GetConfigurationValueParameters.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
void stubGetConfigurationValuePublicQuery ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( java.lang.Integer.valueOf ( 255 ) ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetConfigurationValue ) , org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.isA ( org.ovirt.engine.core.common.queries.GetConfigurationValueParameters.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) , failure ) ; } }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
private static void updateCdPath ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.bll.utils.VmDeviceUtils.getCdDevices ( oldVmBase.getId ( ) ) ; if ( ( cdList.size ( ) ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = cdList.get ( 0 ) ; cd.getSpecParams ( ) . putAll ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.getCdDeviceSpecParams ( "" , newVmBase.getIsoPath ( ) ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.update ( cd ) ; } }

Target:
private void updateCdPath ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = getCdDevices ( oldVmBase.getId ( ) ) ; if ( ( cdList.size ( ) ) > 0 ) { org.ovirt.engine.core.common.businessentities.VmDevice cd = cdList.get ( 0 ) ; cd.getSpecParams ( ) . putAll ( getCdDeviceSpecParams ( "" , newVmBase.getIsoPath ( ) ) ) ; vmDeviceDao.update ( cd ) ; } }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc getIsoList ( java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.getIsoList" ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "isolist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeDisk ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.Object > driveSpec ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeCD" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , driveSpec ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }
Source:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.OPENSTACK_NETWORK.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.Provider > getBackendCollection ( ) { if ( isFiltered ( ) ) { return getBackendCollection ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( org.ovirt.engine.core.common.businessentities.ProviderType.OPENSTACK_NETWORK , org.ovirt.engine.core.common.businessentities.ProviderType.EXTERNAL_NETWORK ) ) ; } else { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > openstackCollection = getBackendCollection ( SearchType.Provider , getConstraint ( ProviderType.OPENSTACK_NETWORK.name ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > externalCollection = getBackendCollection ( SearchType.Provider , getConstraint ( ProviderType.EXTERNAL_NETWORK.name ( ) ) ) ; openstackCollection.addAll ( externalCollection ) ; return openstackCollection ; } }
Source:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmById ( getVmInitQuery , vm.getId ( ) ) ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( 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.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean validateBondSlavesCount ( ) { boolean returnValue = true ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondEntry : bonds.entrySet ( ) ) { if ( ( bondEntry.getValue ( ) . size ( ) ) < 2 ) { returnValue = false ; addViolation ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }

Target:
private boolean validateBondSlavesCount ( ) { boolean returnValue = true ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondEntry : bonds.entrySet ( ) ) { if ( ( bondEntry.getValue ( ) . size ( ) ) < 2 ) { returnValue = false ; addViolation ( VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bondEntry.getKey ( ) ) ; } } return returnValue ; }
Source:
public boolean isBackedByHudepages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( ( ( vm.getCustomProperties ( ) ) == null ) || ( vm.getCustomProperties ( ) . isEmpty ( ) ) ) { return false ; } java.lang.String hugePage = getHugePageSize ( vm ) ; if ( hugePage == null ) { return false ; } try { return ( java.lang.Integer.parseInt ( hugePage ) ) > 0 ; } catch ( java.lang.NumberFormatException e ) { return false ; } }

Target:
public static boolean isBackedByHugepages ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { if ( ( ( vm.getCustomProperties ( ) ) == null ) || ( vm.getCustomProperties ( ) . isEmpty ( ) ) ) { return false ; } java.lang.String hugePage = org.ovirt.engine.core.common.utils.HugePageUtils.getHugePageSize ( vm ) ; if ( hugePage == null ) { return false ; } try { return ( java.lang.Integer.parseInt ( hugePage ) ) > 0 ; } catch ( java.lang.NumberFormatException e ) { return false ; } }
Source:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Event add ( org.ovirt.engine.sdk.decorators.Event event ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , event , org.ovirt.engine.sdk.entities.Event.class , org.ovirt.engine.sdk.decorators.Event.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Event add ( org.ovirt.engine.sdk.decorators.Event event ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , event , org.ovirt.engine.sdk.entities.Event.class , org.ovirt.engine.sdk.decorators.Event.class , headers ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . getVolumeOption ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateOptionInDb ( getParameters ( ) . getVolumeOption ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeOptionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . getVolumeOption ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateOptionInDb ( getParameters ( ) . getVolumeOption ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserProfile ( ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.UserProfile existingProfile = org.ovirt.engine.core.bll.AddUserProfileCommand.getUserProfile ( ) ; if ( ( existingProfile != null ) && ( ! ( isSSHPublicKeyUpdate ( existingProfile ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }
Source:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addNetworks ( java.util.Collections.singletonList ( unlabeledNetwork ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addNetworks ( java.util.Collections.singletonList ( unlabeledNetwork ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { java.lang.String currentHostNameToLog = getCustomValue ( GlusterConstants.VDS_NAME ) ; getCustomValues ( ) . remove ( currentHostNameToLog ) ; addCustomValue ( GlusterConstants.VDS_NAME , getVdsDAO ( ) . get ( currentRemoteHostId ) . getName ( ) ) ; return getBackend ( ) . runInternalAction ( VdcActionType.UpdateGlusterHostPubKeyToSlaveInternal , new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( currentRemoteHostId , pubKeys , userName ) ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { java.lang.String currentHostNameToLog = getCustomValue ( GlusterConstants.VDS_NAME ) ; getCustomValues ( ) . remove ( currentHostNameToLog ) ; addCustomValue ( GlusterConstants.VDS_NAME , getVdsDao ( ) . get ( currentRemoteHostId ) . getName ( ) ) ; return getBackend ( ) . runInternalAction ( VdcActionType.UpdateGlusterHostPubKeyToSlaveInternal , new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( currentRemoteHostId , pubKeys , userName ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter.QuotaAction quotaAction = ( ( memoryToConsume ) > 0 ) ? QuotaConsumptionParameter.QuotaAction.CONSUME : QuotaConsumptionParameter.QuotaAction.RELEASE ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand.getVm ( ) . getQuotaId ( ) , null , quotaAction , org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand.getVm ( ) . getVdsGroupId ( ) , 0 , java.lang.Math.abs ( memoryToConsume ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter.QuotaAction quotaAction = ( ( memoryToConsume ) > 0 ) ? QuotaConsumptionParameter.QuotaAction.CONSUME : QuotaConsumptionParameter.QuotaAction.RELEASE ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter ( org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand.getVm ( ) . getQuotaId ( ) , null , quotaAction , org.ovirt.engine.core.bll.HotSetAmountOfMemoryCommand.getVm ( ) . getClusterId ( ) , 0 , java.lang.Math.abs ( memoryToConsume ) ) ) ; return list ; }