auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.bll.ValidationResult vmNotSavingRestoring ( ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.SavingState ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RestoringState ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmNotSavingRestoring ( ) { if ( ( vm.getStatus ( ) . isHibernating ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.RestoringState ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public boolean readBoolean ( ) { java.lang.String image = readString ( ) ; if ( ( image.equalsIgnoreCase ( "false" ) ) || ( image.equals ( "0" ) ) ) { return false ; } else if ( ( image.equalsIgnoreCase ( "true" ) ) || ( image.equals ( "1" ) ) ) { return true ; } else { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( ( ( "The text \"" + image ) + "\" isn\'t a valid boolean value" ) ) ; } }

Target:
public boolean parseBoolean ( java.lang.String image ) { if ( ( image.equalsIgnoreCase ( "false" ) ) || ( image.equals ( "0" ) ) ) { return false ; } else if ( ( image.equalsIgnoreCase ( "true" ) ) || ( image.equals ( "1" ) ) ) { return true ; } else { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( ( ( "The text \"" + image ) + "\" isn\'t a valid boolean value" ) ) ; } }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getParameters ( ) . getClusterId ( ) ; java.lang.String volumeName = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getParameters ( ) . getVolumeName ( ) ; infoReturn = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getBroker ( ) . glusterSnapshotInfo ( clusterId , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( infoReturn.getSnapshots ( ) ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getParameters ( ) . getClusterId ( ) ; java.lang.String volumeName = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getParameters ( ) . getVolumeName ( ) ; infoReturn = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getBroker ( ) . glusterVolumeSnapshotList ( clusterId , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotInfoVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( infoReturn.getSnapshots ( ) ) ; } }
Source:
public static void getAttachedTagsToUser ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByUserId , new org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static 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 ) ; }
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
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.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByHosts ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsWithNetwork = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVdsDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( hostsWithNetwork.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , hostsWithNetwork ) ; replacements.add ( VdcBllMessages.VAR__TYPE__HOSTS.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByHosts ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { return networkNotUsed ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVdsDAO ( ) . getAllForNetwork ( network.getId ( ) ) , VdcBllMessages.VAR__ENTITIES__HOSTS ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; param.setApplyChangesLater ( applyCpuChangesLater ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; param.setApplyChangesLater ( applyCpuChangesLater ) ; setRngDeviceToParams ( model , param ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( name ) ; }

Target:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( name ) ) ; }
Source:
public java.lang.String getVdcObjectName ( ) { org.ovirt.engine.core.common.businessentities.Permission perms = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; return org.ovirt.engine.core.bll.PermissionsCommandBase.getDbFacade ( ) . getEntityNameByIdAndType ( perms.getObjectId ( ) , perms.getObjectType ( ) ) ; }

Target:
public java.lang.String getVdcObjectName ( ) { org.ovirt.engine.core.common.businessentities.Permission perms = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; return org.apache.commons.lang.StringUtils.isNotEmpty ( perms.getObjectName ( ) ) ? perms.getObjectName ( ) : org.ovirt.engine.core.bll.PermissionsCommandBase.getDbFacade ( ) . getEntityNameByIdAndType ( perms.getObjectId ( ) , perms.getObjectType ( ) ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected < T > R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; entity = doUpdate ( incoming , entity , entityResolver , update , updateProvider ) ; R model = org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.deprecatedPopulate ( model , entity ) ; return addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.doPopulate ( model , entity ) ) ; }

Target:
protected < T > R performUpdate ( R incoming , org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , org.ovirt.engine.core.common.action.ActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { Q entity = getEntity ( entityResolver , true ) ; validateUpdate ( incoming , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ) ; entity = doUpdate ( incoming , entity , entityResolver , update , updateProvider ) ; R model = org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.map ( entity ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.deprecatedPopulate ( model , entity ) ; return addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.doPopulate ( model , entity ) ) ; }
Source:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VMStatus status ) { vm.setstatus ( status ) ; org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = vm.getstatus ( ) ; boolean isVmStatusDown = org.ovirt.engine.core.common.businessentities.VM.isStatusDown ( vmStatus ) ; if ( isVmStatusDown || ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmStatusDown ) { vm.setrun_on_vds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }

Target:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.VMStatus status ) { vm.setStatus ( status ) ; org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = vm.getStatus ( ) ; boolean isVmStatusDown = org.ovirt.engine.core.common.businessentities.VM.isStatusDown ( vmStatus ) ; if ( isVmStatusDown || ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmStatusDown ) { vm.setRunOnVds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }
Source:
public java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab > getTabs ( ) { java.util.List < org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab > tabs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( tabContainer.getWidgetCount ( ) ) ; i ++ ) { com.google.gwt.user.client.ui.Widget tab = tabContainer.getWidget ( i ) ; if ( tab instanceof org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab ) { tabs.add ( ( ( org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab ) ( tab ) ) ) ; } } return tabs ; }

Target:
public void switchTab ( org.ovirt.engine.ui.common.widget.dialog.tab.DialogTab tab ) { switchTab ( tab.getTabListItem ( ) ) ; }
Source:
public void testGetHostsForStorageOperationLocalFsOnly ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getHostsForStorageOperation ( null , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VDS_GROUP_RHEL6_LOCALFS , result.get ( 0 ) . getVdsGroupId ( ) ) ; }

Target:
public void testGetHostsForStorageOperationLocalFsOnly ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getHostsForStorageOperation ( null , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.CLUSTER_RHEL6_LOCALFS , result.get ( 0 ) . getClusterId ( ) ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void currentUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.users.VdcUser u = new org.ovirt.engine.core.common.users.VdcUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.common.users.VdcUser cu = b.getCurrentUser ( ) ; org.junit.Assert.assertEquals ( u , cu ) ; }

Target:
public void currentUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.common.businessentities.DbUser cu = b.getCurrentUser ( ) ; org.junit.Assert.assertEquals ( u , cu ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.RNG_NOT_FOUND ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( isRngSupportedByCluster ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }
Source:
private void doFetchPrincipalRecord ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserName , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserNameParameters ( configuration , null , getDirectoryName ( ) , input.< org.ovirt.engine.api.extensions.ExtMap > get ( Authn.InvokeKeys.AUTH_RECORD ) . < java.lang.String > get ( Authn.AuthRecord.PRINCIPAL ) ) ) ; output.mput ( Authz.InvokeKeys.PRINCIPAL_RECORD , mapLdapUser ( ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ) ) . mput ( Authz.InvokeKeys.STATUS , Authz.Status.SUCCESS ) ; }

Target:
private void doFetchPrincipalRecord ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserName , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByUserNameParameters ( configuration , null , getDirectoryName ( ) , input.< org.ovirt.engine.api.extensions.ExtMap > get ( Authn.InvokeKeys.AUTH_RECORD ) . < java.lang.String > get ( Authn.AuthRecord.PRINCIPAL ) ) ) ; output.mput ( Authz.InvokeKeys.PRINCIPAL_RECORD , mapLdapUser ( ( ( org.ovirt.engine.core.common.businessentities.aaa.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ) ) . mput ( Authz.InvokeKeys.STATUS , Authz.Status.SUCCESS ) ; }
Source:
public void volumeInfoIsEmpty ( ) { givenListOfImagesAndVolumes ( ) ; mockVdsCommand ( VDSCommandType.GetImageInfo , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetImageInfo , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.never ( ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void volumeInfoIsEmpty ( ) { givenListOfImagesAndVolumes ( ) ; mockVdsCommand ( VDSCommandType.GetImageInfo , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetImageInfo , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.never ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.VnicProfileParameters parameters = new org.ovirt.engine.core.common.action.VnicProfileParameters ( vnicProfile ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }

Target:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.VnicProfileParameters parameters = new org.ovirt.engine.core.common.action.VnicProfileParameters ( vnicProfile ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }
Source:
private void SaveNfsStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveNfs" } ) ) ) . Run ( ) ; }

Target:
private void saveNfsStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveNfs" } ) ) ) . Run ( ) ; }
Source:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.scheduling.PolicyUnit , java.lang.Integer > ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.scheduling.PolicyUnit , java.lang.Integer > ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setAvailableDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setUsedDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainDynamic > getAll ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromstorage_domain_dynamic" , org.ovirt.engine.core.dao.StorageDomainDynamicDAODbFacadeImpl.StorageDomainDynamicRowMapper.instance , parameterSource ) ; }
Source:
public int compare ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model1 , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model2 ) { if ( model1.isManagement ( ) ) { return - 1 ; } else if ( model2.isManagement ( ) ) { return 1 ; } return lexoNumeric.compare ( model1.getNetworkName ( ) , model2.getNetworkName ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model1 , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model2 ) { int retVal = java.lang.Boolean.compare ( model1.isManagement ( ) , model2.isManagement ( ) ) ; if ( retVal != 0 ) { return retVal ; } return lexoNumeric.compare ( model1.getNetworkName ( ) , model2.getNetworkName ( ) ) ; }
Source:
private void translateVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.Create ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class ) ; if ( translator.containsKey ( volumeEntity.getVolumeType ( ) ) ) { getDetailModel ( ) . setVolumeTypeSilently ( translator.get ( volumeEntity.getVolumeType ( ) ) ) ; } }

Target:
private void translateVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.create ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class ) ; if ( translator.containsKey ( volumeEntity.getVolumeType ( ) ) ) { getDetailModel ( ) . setVolumeTypeSilently ( translator.get ( volumeEntity.getVolumeType ( ) ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { getWindow ( ) . StopProgress ( ) ; Cancel ( ) ; }

Target:
public void OnSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; UpdateActionAvailability ( ) ; }
Source:
public void testSubResourceLocatorBadGuid ( ) { try { collection.getCdromResource ( "foo" ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Cdrom" , "add" , "file.id" ) ; }
Source:
public void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) ) ; }
Source:
private void checkIncompatibleIpAddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol networkBootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( networkBootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , networkBootProtocol.getDisplayName ( ) ) ) ) ; }

Target:
private void checkIncompatibleIpAddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( ipv4BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv4BootProtocol.getDisplayName ( ) ) ) ) ; }
Source:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockSpiceSupportMatrix ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockSpiceSupportMatrix ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
private void fastForwardDisksToActiveSnapshot ( ) { if ( ( getParameters ( ) . getDisks ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImagesToUpdate = org.ovirt.engine.core.bll.ImagesHandler.imagesSubtract ( getDiskImagesForVm ( ) , getParameters ( ) . getDisks ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImagesToUpdate ) { org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , newActiveSnapshotId ) ; } } }

Target:
private void fastForwardDisksToActiveSnapshot ( ) { if ( ( getParameters ( ) . getDisks ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImagesToUpdate = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.imagesSubtract ( getDiskImagesForVm ( ) , getParameters ( ) . getDisks ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImagesToUpdate ) { org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , newActiveSnapshotId ) ; } } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { setEnumTitle ( diskImage.getimageStatus ( ) ) ; switch ( diskImage.getimageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }
Source:
public void OnTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "AuditLogCleanupManager::deleteAgedOutAuditLogs - entered" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreashold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDAO ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "AuditLogCleanupManager::deleteAgedOutAuditLogs() - failed with exception" , e ) ; } }

Target:
public void OnTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "AuditLogCleanupManager::deleteAgedOutAuditLogs - entered" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreashold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "AuditLogCleanupManager::deleteAgedOutAuditLogs() - failed with exception" , e ) ; } }