auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean networkWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getNetworkName ( ) , existingIface.getNetworkName ( ) ) ) ) || ( ( iface.getBootProtocol ( ) ) != ( existingIface.getBootProtocol ( ) ) ) ) || ( staticBootProtoPropertiesChanged ( iface , existingIface ) ) ; }

Target:
private boolean networkWasModified ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getNetworkName ( ) , existingIface.getNetworkName ( ) ) ) ) || ( ( iface.getBootProtocol ( ) ) != ( existingIface.getBootProtocol ( ) ) ) ) || ( staticBootProtoPropertiesChanged ( iface , existingIface ) ) ; }
Source:
private void doProcessRequest ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String sessionID = request.getParameter ( SESSION_ID_PARAMETER ) ; if ( runQuery ( request , response , sessionID ) ) { response.setStatus ( SUCCESS_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' succeeded" , sessionID ) ; } else { response.setStatus ( FAILED_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' failed" , sessionID ) ; } }

Target:
private void doProcessRequest ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String sessionID = request.getParameter ( SESSION_ID_PARAMETER ) ; if ( runQuery ( response , sessionID ) ) { response.setStatus ( SUCCESS_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' succeeded" , sessionID ) ; } else { response.setStatus ( FAILED_CODE ) ; org.ovirt.engine.core.services.GetSessionUser.log.debug ( "Validate Session '{}' failed" , sessionID ) ; } }
Source:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }

Target:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . rdpSelected ( event.getValue ( ) ) ; getView ( ) . spiceSelected ( ( ! ( event.getValue ( ) ) ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( ! ( event.getValue ( ) ) ) ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . spiceSelected ( event.getValue ( ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( event.getValue ( ) ) ) ) ; getView ( ) . rdpSelected ( ( ! ( event.getValue ( ) ) ) ) ; }
Source:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; consoleOptionsPersister.storeToLocalStorage ( model.getModel ( ) , model.getConsoleContext ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }

Target:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; consoleOptionsPersister.storeToLocalStorage ( model.getModel ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }
Source:
private void cluster_SelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getHostList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost moveHost = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; moveHost.postGetHostList ( hosts ) ; } } ) ) ; } }

Target:
private void cluster_SelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getHostList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost moveHost = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MoveHost ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; moveHost.postGetHostList ( hosts ) ; } } ) ) ; } }
Source:
private boolean isRemoveCommandAvailable ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.Disk > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( isDiskLocked ( disk ) ) || ( ( ! ( isVmDown ( ) ) ) && ( disk.getPlugged ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean isRemoveCommandAvailable ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( isDiskLocked ( disk ) ) || ( ( ! ( isVmDown ( ) ) ) && ( disk.getPlugged ( ) ) ) ) { return false ; } } return true ; }
Source:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot addSnapshotToDB ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.bll.memory.MemoryImageBuilder memoryImageBuilder ) { boolean taskExists = ( ! ( getDisksList ( ) . isEmpty ( ) ) ) || ( memoryImageBuilder.isCreateTasks ( ) ) ; return new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . addSnapshot ( snapshotId , getParameters ( ) . getDescription ( ) , ( taskExists ? org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.LOCKED : org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK ) , getParameters ( ) . getSnapshotType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) , true , memoryImageBuilder.getVolumeStringRepresentation ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCompensationContext ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Snapshot addSnapshotToDB ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.bll.memory.MemoryImageBuilder memoryImageBuilder ) { boolean taskExists = ( ! ( getDisksList ( ) . isEmpty ( ) ) ) || ( memoryImageBuilder.isCreateTasks ( ) ) ; return new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . addSnapshot ( snapshotId , getParameters ( ) . getDescription ( ) , ( taskExists ? org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.LOCKED : org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK ) , getParameters ( ) . getSnapshotType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) , true , memoryImageBuilder.getVolumeStringRepresentation ( ) , getDisksList ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCompensationContext ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > domains = getAllForStoragePool ( pool ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : domains ) { if ( ( domain.getstorage_domain_type ( ) ) == type ) { returnValue = domain.getId ( ) ; break ; } } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getAllForStoragePool ( pool ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( domain.getstorage_domain_type ( ) ) == type ) { returnValue = domain.getId ( ) ; break ; } } return returnValue ; }
Source:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getstatus ( ) ) ) || ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }

Target:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getStatus ( ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }
Source:
public void testUpdateNotExistingConnection ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetNotExistingEntityExpectations ( ) ; control.replay ( ) ; try { resource.update ( getModel ( 3 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotExistingConnection ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetNotExistingEntityExpectations ( ) ; try { resource.update ( getModel ( 3 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.util.List < java.lang.String > getSelectedConnections ( ) { java.util.List < java.lang.String > selectedConnections = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : getStorageTargets ( ) . getSelectedItems ( ) ) { selectedConnections.add ( conn.getid ( ) ) ; } return selectedConnections ; }

Target:
private java.util.List < java.lang.String > getSelectedConnections ( ) { java.util.List < java.lang.String > selectedConnections = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : getStorageTargets ( ) . getSelectedItems ( ) ) { selectedConnections.add ( conn.getId ( ) ) ; } return selectedConnections ; }
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( ( ( org.ovirt.engine.api.resource.NicResource ) ( resource ) ) . getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Nic , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; org.ovirt.engine.core.compat.Guid Guid = ( ( org.ovirt.engine.core.compat.Guid ) ( returnValueBase.getActionReturnValue ( ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } }
Source:
private boolean isUserElement ( org.ovirt.engine.ui.uicommonweb.models.users.UserGeneralModel userGeneralModel ) { if ( ( getDetailModel ( ) . getEntity ( ) ) == null ) { return false ; } return ! ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( getDetailModel ( ) . getEntity ( ) ) ) . isGroup ( ) ) ; }

Target:
private boolean isUserElement ( ) { if ( ( getDetailModel ( ) . getEntity ( ) ) == null ) { return false ; } return ! ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( getDetailModel ( ) . getEntity ( ) ) ) . isGroup ( ) ) ; }
Source:
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.VmTemplate > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateByNameComparer ( ) ) ; } return list ; }

Target:
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.VmTemplate > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateByNameComparer ( ) ) ; } return list ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( javax.servlet.http.HttpServletRequest request ) { java.lang.String ssoUrl = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.sso.servlets.OpenIdConfigurationServlet.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , request.getContextPath ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( "authorization_endpoint" , java.lang.String.format ( "%s/openid/authorize" , ssoUrl ) ) ; payload.put ( "end_session_endpoint" , java.lang.String.format ( "%s/oauth/revoke" , ssoUrl ) ) ; payload.put ( "issuer" , ssoUrl ) ; payload.put ( "jwks_uri" , java.lang.String.format ( "%s/openid/jwks" , ssoUrl ) ) ; payload.put ( "token_endpoint" , java.lang.String.format ( "%s/oauth/token" , ssoUrl ) ) ; payload.put ( "userinfo_endpoint" , java.lang.String.format ( "%s/openid/userinfo" , ssoUrl ) ) ; payload.putAll ( org.ovirt.engine.core.sso.servlets.OpenIdConfigurationServlet.staticConfig ) ; return payload ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildResponse ( javax.servlet.http.HttpServletRequest request ) { java.lang.String ssoUrl = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.sso.servlets.OpenIdConfigurationServlet.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , request.getContextPath ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > payload = new java.util.HashMap < > ( ) ; payload.put ( "authorization_endpoint" , java.lang.String.format ( "%s/openid/authorize" , ssoUrl ) ) ; payload.put ( "end_session_endpoint" , java.lang.String.format ( "%s/oauth/revoke" , ssoUrl ) ) ; payload.put ( "issuer" , java.lang.String.format ( "%s/openid" , ssoUrl ) ) ; payload.put ( "jwks_uri" , java.lang.String.format ( "%s/openid/jwks" , ssoUrl ) ) ; payload.put ( "token_endpoint" , java.lang.String.format ( "%s/openid/token" , ssoUrl ) ) ; payload.put ( "userinfo_endpoint" , java.lang.String.format ( "%s/openid/userinfo" , ssoUrl ) ) ; payload.putAll ( org.ovirt.engine.core.sso.servlets.OpenIdConfigurationServlet.staticConfig ) ; return payload ; }
Source:
public static java.lang.String getTimezoneIndexByKey ( java.lang.String key ) { for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > timeZoneEntry : org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.timeZoneIndex.entrySet ( ) ) { if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneKey ( timeZoneEntry.getKey ( ) ) . equals ( key ) ) { return timeZoneEntry.getValue ( ) . toString ( ) ; } } org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( "getTimezoneIndexByKey: cannot find timezone key '{}'" , key ) ; return key ; }

Target:
public java.lang.String getTimezoneIndexByKey ( java.lang.String key ) { for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > timeZoneEntry : org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.timeZoneIndex.entrySet ( ) ) { if ( getTimezoneKey ( timeZoneEntry.getKey ( ) ) . equals ( key ) ) { return timeZoneEntry.getValue ( ) . toString ( ) ; } } org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( "getTimezoneIndexByKey: cannot find timezone key '{}'" , key ) ; return key ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testCreatingImageIfNotSupplied ( ) { transferImageCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . createImage ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.never ( ) ) . handleImageIsReadyForTransfer ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void testCreatingImageIfNotSupplied ( ) { transferImageCommand.executeCommand ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . createImage ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.never ( ) ) . handleImageIsReadyForTransfer ( ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getVdsId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { if ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) . equals ( Guid.Empty ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo > ( ) ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.infoFormat ( "-- SPMGetAllTasksInfoVDSCommand::ExecuteIrsBrokerCommand: Attempting on storage pool '{0}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.infoFormat ( "-- SPMGetAllTasksInfoVDSCommand::ExecuteIrsBrokerCommand: Attempting on storage pool '{0}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getCinderLeafImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > leafCinderDisks = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterCinderDisks ( disks ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { leafCinderDisks.add ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return leafCinderDisks ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getCinderLeafImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > leafCinderDisks = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterCinderDisks ( disks ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { leafCinderDisks.add ( getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return leafCinderDisks ; }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( clusterDao.getAllClustersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaStorageParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource storageQuotaParameterMap = createQuotaIdParameterMapper ( quotaStorage.getQuotaStorageId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "storage_id" , quotaStorage.getStorageId ( ) ) . addValue ( "cluster_id" , null ) . addValue ( "storage_size_gb" , quotaStorage.getStorageSizeGB ( ) ) . addValue ( "virtual_cpu" , null ) . addValue ( "mem_size_mb" , null ) ; return storageQuotaParameterMap ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaStorageParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage ) { return createQuotaIdParameterMapper ( quotaStorage.getQuotaStorageId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "storage_id" , quotaStorage.getStorageId ( ) ) . addValue ( "cluster_id" , null ) . addValue ( "storage_size_gb" , quotaStorage.getStorageSizeGB ( ) ) . addValue ( "virtual_cpu" , null ) . addValue ( "mem_size_mb" , null ) ; }
Source:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , restApiSessionTimeout ) ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . getImageId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }
Source:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; java.lang.System.out.println ( span ) ; assertEquals ( "days1" , 0 , span.Days ) ; assertEquals ( "hours1" , 3 , span.Hours ) ; assertEquals ( "minutes1" , 50 , span.Minutes ) ; assertEquals ( "seconds1" , 10 , span.Seconds ) ; assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }

Target:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; assertEquals ( "days1" , 0 , span.Days ) ; assertEquals ( "hours1" , 3 , span.Hours ) ; assertEquals ( "minutes1" , 50 , span.Minutes ) ; assertEquals ( "seconds1" , 10 , span.Seconds ) ; assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }
Source:
public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; if ( hasActionButtons ( ) ) { int eventX = event.getNativeEvent ( ) . getClientX ( ) ; int eventY = event.getNativeEvent ( ) . getClientY ( ) ; updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } }

Target:
public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { this . onContextMenu ( event ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getconnection ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getconnection ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getId ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int eventFloodRate = ( ( auditLogable.isExternal ( ) ) && ( ( auditLogable.getEventFloodInSec ( ) ) == 0 ) ) ? 30 : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }

Target:
private void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int eventFloodRate = ( ( auditLogable.isExternal ( ) ) && ( ( auditLogable.getEventFloodInSec ( ) ) == 0 ) ) ? 30 : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; auditLogable.setTimeoutObjectId ( composeObjectId ( auditLogable , logType ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( cluster != null ) { clusters.add ( cluster ) ; } java.util.Collections.sort ( clusters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , vm.getClusterId ( ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster != null ) { clusters.add ( cluster ) ; } java.util.Collections.sort ( clusters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; getModel ( ) . setDataCentersAndClusters ( getModel ( ) , dataCenters , clusters , vm.getClusterId ( ) ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getStorageModels ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filterredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } return filterredItems ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getStorageModels ( ) ) ; return getSelectableModels ( items ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId } , getEntityList ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId } , getEntityList ( ) , failure ) ; control.replay ( ) ; }
Source:
private void endCommand ( ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { removeImageFromDB ( true ) ; } } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
private void setCommandExecutionAllowedForProvider ( org.ovirt.engine.core.common.businessentities.Provider provider ) { if ( ( provider.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.ProviderType.EXTERNAL_NETWORK ) ) { org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ( provider.getAdditionalProperties ( ) ) ) ; if ( ( properties != null ) && ( properties.getReadOnly ( ) ) ) { setCommandExecutionAllowed ( false ) ; return ; } } setCommandExecutionAllowed ( true ) ; }

Target:
private void setCommandExecutionAllowedForProvider ( org.ovirt.engine.core.common.businessentities.Provider provider ) { org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ( provider.getAdditionalProperties ( ) ) ) ; if ( ( properties != null ) && ( properties.getReadOnly ( ) ) ) { setCommandExecutionAllowed ( false ) ; return ; } setCommandExecutionAllowed ( true ) ; }
Source:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageTransfer id {}" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.endSuccessfully ( ) ; log.info ( "Successfully transferred disk '{}' (command id '{}')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; }

Target:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageTransfer id {}" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; endSuccessfully ( ) ; log.info ( "Successfully transferred disk '{}' (command id '{}')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Map < java.lang.String , java.lang.String > customPropertiesList = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getCustomPropertySheet ( ) . setKeyValueMap ( customPropertiesList ) ; getCustomPropertySheet ( ) . setIsChangeable ( ( ! ( customPropertiesList.isEmpty ( ) ) ) ) ; initCustomProperties ( ) ; } stopProgress ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue != null ) { java.util.Map < java.lang.String , java.lang.String > customPropertiesList = returnValue.getReturnValue ( ) ; getCustomPropertySheet ( ) . setKeyValueMap ( customPropertiesList ) ; getCustomPropertySheet ( ) . setIsChangeable ( ( ! ( customPropertiesList.isEmpty ( ) ) ) ) ; initCustomProperties ( ) ; } stopProgress ( ) ; }