auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkStatus netStatus = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) . getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.OPERATIONAL ) ) { return resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) { return resources.downImage ( ) ; } else { return resources.questionMarkImage ( ) ; } }

Target:
protected abstract com.google.gwt.resources.client.ImageResource getStatusImage ( ) ;
Source:
private boolean isValueValid ( org.ovirt.engine.core.compat.Version version , java.lang.String key , java.lang.String value ) { java.util.regex.Pattern userDefinedPattern = userdefinedProperties.get ( version ) . get ( key ) ; java.util.regex.Pattern predefinedPattern = predefinedProperties.get ( version ) . get ( key ) ; return ( ( userDefinedPattern != null ) && ( userDefinedPattern.matcher ( value ) . matches ( ) ) ) || ( ( predefinedPattern != null ) && ( predefinedPattern.matcher ( value ) . matches ( ) ) ) ; }

Target:
private boolean isValueValid ( org.ovirt.engine.core.compat.Version version , java.lang.String key , java.lang.String value ) { java.lang.String userDefinedPattern = userdefinedProperties.get ( version ) . get ( key ) ; java.lang.String predefinedPattern = predefinedProperties.get ( version ) . get ( key ) ; return ( ( userDefinedPattern != null ) && ( value.matches ( userDefinedPattern ) ) ) || ( ( predefinedPattern != null ) && ( value.matches ( predefinedPattern ) ) ) ; }
Source:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } }

Target:
private void clearAsyncTasksWithOutVdsmId ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.CommandBase.getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } }
Source:
public void validateSpaceAndThreshold ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIsoImage ( ) . setItems ( images ) ; if ( ( getIsoImage ( ) . getIsChangable ( ) ) && ( ( getIsoImage ( ) . getSelectedItem ( ) ) == null ) ) { getIsoImage ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( images ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIsoImage ( ) . setItems ( images ) ; if ( ( getIsoImage ( ) . getIsChangable ( ) ) && ( ( getIsoImage ( ) . getSelectedItem ( ) ) == null ) ) { getIsoImage ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( images ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ImportVmCommand setupDiskSpaceTest ( final int diskSpaceRequired , final int diskSpacePct ) { org.ovirt.engine.core.bll.ImportVmCommandTest.mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , diskSpaceRequired ) ; org.ovirt.engine.core.bll.ImportVmCommandTest.mcr.mockConfigValue ( ConfigValues.FreeSpaceLow , diskSpacePct ) ; org.ovirt.engine.core.bll.ImportVmCommandTest.mcr.mockConfigValue ( org.mockito.Matchers.eq ( ConfigValues.LimitNumberOfNetworkInterfaces ) , org.mockito.Matchers.anyString ( ) , java.lang.Boolean.TRUE ) ; return new org.ovirt.engine.core.bll.TestHelperImportVmCommand ( createParameters ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.ImportVmCommand setupDiskSpaceTest ( final int diskSpaceRequired , final int diskSpacePct ) { org.ovirt.engine.core.bll.ImportVmCommandTest.mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , diskSpaceRequired ) ; org.ovirt.engine.core.bll.ImportVmCommandTest.mcr.mockConfigValue ( ConfigValues.FreeSpaceLow , diskSpacePct ) ; return new org.ovirt.engine.core.bll.TestHelperImportVmCommand ( createParameters ( ) ) ; }
Source:
public void checkIsENGINEUser ( java.lang.Object targetObject ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( targetObject ) ) ; loginModel.getIsENGINEUser ( ) . setEntity ( null ) ; boolean isENGINEUser = true ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup : loginModel.getLoggedUserActionGroupList ( ) ) { if ( ! ( loginModel.getENGINEUserActionGroupList ( ) . contains ( actionGroup ) ) ) { isENGINEUser = false ; break ; } } loginModel.getIsENGINEUser ( ) . setEntity ( isENGINEUser ) ; }

Target:
public void checkIsENGINEUser ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel ) { loginModel.getIsENGINEUser ( ) . setEntity ( null ) ; boolean isENGINEUser = true ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup : loginModel.getLoggedUserActionGroupList ( ) ) { if ( ! ( loginModel.getENGINEUserActionGroupList ( ) . contains ( actionGroup ) ) ) { isENGINEUser = false ; break ; } } loginModel.getIsENGINEUser ( ) . setEntity ( isENGINEUser ) ; }
Source:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVds ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; if ( ( org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVds ( ) . getpm_enabled ( ) ) && ( executor.FindVdsToFence ( ) ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = executor.Fence ( ) ; _fenceSucceeded = returnValue.getSucceeded ( ) ; _fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; _vdsProxyFound = true ; } }

Target:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( executor.FindVdsToFence ( ) ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = executor.Fence ( ) ; _fenceSucceeded = returnValue.getSucceeded ( ) ; _fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; _vdsProxyFound = true ; } }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; control.replay ( ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( domainsInPool , vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeSharedComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeFileComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }

Target:
protected java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > getStorageDomainComparators ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > vmDisks ) { return java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainNumberOfVmDisksComparator ( vmDisks ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeSharedComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageTypeFileComparator ( ) , new org.ovirt.engine.core.bll.memory.sdcomparators.StorageDomainAvailableDiskSizeComparator ( ) ) ; }
Source:
private java.lang.Boolean isTunnelMigrationUsed ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.tunnelMigration ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . isTunnelMigration ( ) ; } return null ; }

Target:
private boolean isTunnelMigrationUsed ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.tunnelMigration ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . isTunnelMigration ( ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getVmName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }

Target:
protected boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getVmName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
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 > ( ) ; }
Source:
public void testGetEntityNameByIdAndTypeForVNICProfile ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = vnicProfileDao.get ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.Assert.assertNotNull ( vnicProfile ) ; java.lang.String name = vnicProfile.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE , VdcObjectType.VnicProfile ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVNICProfile ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = vnicProfileDao.get ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.Assert.assertNotNull ( vnicProfile ) ; java.lang.String name = vnicProfile.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE , VdcObjectType.VnicProfile ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel backupModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel ) ( model1 ) ) ; backupModel1.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel backupModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel ) ( model1 ) ) ; backupModel1.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ) ; }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getVDSGroup ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { validateEnums ( org.ovirt.engine.api.model.Network.class , incoming ) ; org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dbUserDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getLoginName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.USER_ID , VdcObjectType.User ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dbUserDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getLoginName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.USER_ID , VdcObjectType.User ) ) ; }
Source:
private void doTestRemoveNotFound ( java.lang.String id ) throws java.lang.Exception { initResource ( resource.parent ) ; resource.id = id ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }

Target:
private void doTestRemoveNotFound ( java.lang.String id ) throws java.lang.Exception { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }
Source:
public void snapshotExistsByGuidReturnsValidResultWhenSnapshotExists ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( true ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateValidResult ( validator.snapshotExists ( vmId , snapshotId ) ) ; }

Target:
public void snapshotExistsByGuidReturnsValidResultWhenSnapshotExists ( ) throws java.lang.Exception { org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( true ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateValidResult ( validator.snapshotExists ( vmId , snapshotId ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { boolean isNameUnique = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! isNameUnique ) { model.getInvalidityReasons ( ) . clear ( ) ; model.getName ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) ) ; model.getName ( ) . setIsValid ( false ) ; model.setIsValid ( false ) ; model.fireValidationCompleteEvent ( ) ; } else { postNameUniqueCheck ( vm ) ; } }

Target:
public void onSuccess ( java.lang.Boolean isNameUnique ) { if ( ! isNameUnique ) { model.getInvalidityReasons ( ) . clear ( ) ; model.getName ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) ) ; model.getName ( ) . setIsValid ( false ) ; model.setIsValid ( false ) ; model.fireValidationCompleteEvent ( ) ; } else { postNameUniqueCheck ( vm ) ; } }
Source:
public void calculateNetworkImplementationDetailsEmptyNetworkName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setNetworkName ( "" ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.Network > emptyMap ( ) , iface ) ) ; }

Target:
public void calculateNetworkImplementationDetailsEmptyNetworkName ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setNetworkName ( "" ) ; org.junit.Assert.assertNull ( "Network implementation details should not be filled." , org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > emptyMap ( ) , iface ) ) ; }
Source:
public void testGet ( ) { initResource ( resource.parent ) ; control.replay ( ) ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup action : org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) { resource.id = java.lang.Integer.toString ( action.getId ( ) ) ; verifyPermit ( resource.get ( ) , action ) ; } resource.id = "1" ; }

Target:
public void testGet ( ) { initResource ( resource.parent ) ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup action : org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) { resource.id = java.lang.Integer.toString ( action.getId ( ) ) ; verifyPermit ( resource.get ( ) , action ) ; } resource.id = "1" ; }
Source:
protected void revertToActiveSnapshot ( org.ovirt.engine.core.compat.Guid createdSnapshotId ) { if ( createdSnapshotId != null ) { getSnapshotDao ( ) . remove ( createdSnapshotId ) ; getSnapshotDao ( ) . updateId ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) , createdSnapshotId ) ; } org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.setSucceeded ( false ) ; }

Target:
protected void revertToActiveSnapshot ( org.ovirt.engine.core.compat.Guid createdSnapshotId ) { if ( createdSnapshotId != null ) { org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotDao ( ) . remove ( createdSnapshotId ) ; org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotDao ( ) . updateId ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) , createdSnapshotId ) ; } org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.setSucceeded ( false ) ; }
Source:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.setWidget ( contentWidget ) ; label.addStyleName ( OvirtCss.LABEL_ENABLED ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { setElementId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } }

Target:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.add ( contentWidget ) ; label.addStyleName ( OvirtCss.LABEL_ENABLED ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { setElementId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } }
Source:
private boolean bondWasModified ( 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.getBondOptions ( ) , existingIface.getBondOptions ( ) ) ) ; }

Target:
private boolean bondWasModified ( 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.getBondOptions ( ) , existingIface.getBondOptions ( ) ) ) ; }
Source:
public void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDSGroup > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Cluster" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.VDSGroup > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabClusterView.constants.showReportCluster ( ) , resourceSubActions ) ) ; } } }

Target:
public void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDSGroup > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Cluster" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabClusterView.constants.showReportCluster ( ) , resourceSubActions ) ) ; } } }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalComputeResource.class ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup.class ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( ) ) ; }
Source:
public void oSType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; int osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( template != null ) { updateVirtioScsiEnabled ( template.getId ( ) , osType ) ; } }

Target:
public void oSType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( template != null ) && ( osType != null ) ) { updateVirtioScsiEnabled ( template.getId ( ) , osType ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VnicProfile createVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network net , org.ovirt.engine.core.dao.network.NetworkFilterDao networkFilterDao ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile profile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; profile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; profile.setName ( net.getName ( ) ) ; profile.setNetworkId ( net.getId ( ) ) ; profile.setPortMirroring ( false ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter defaultNetworkFilter = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.resolveVnicProfileDefaultNetworkFilter ( networkFilterDao ) ; profile.setNetworkFilterId ( ( defaultNetworkFilter == null ? null : defaultNetworkFilter.getId ( ) ) ) ; return profile ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VnicProfile createVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile profile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; profile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; profile.setName ( net.getName ( ) ) ; profile.setNetworkId ( net.getId ( ) ) ; profile.setPortMirroring ( false ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter defaultNetworkFilter = resolveVnicProfileDefaultNetworkFilter ( ) ; profile.setNetworkFilterId ( ( defaultNetworkFilter == null ? null : defaultNetworkFilter.getId ( ) ) ) ; return profile ; }
Source:
protected java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > getSharedLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) && ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) , LockingGroup.VM.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getSharedLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) && ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; } return null ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) , SearchType.Network ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryUsers ( java.lang.String query ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryData queryData = new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryDataImpl ( ) ; queryData.setLdapQueryType ( LdapQueryType.searchUsers ) ; queryData.setDomain ( getProfileName ( ) ) ; queryData.setFilterParameters ( new java.lang.Object [ ] { query } ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.SearchUserByQuery , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByQueryParameters ( null , getProfileName ( ) , queryData ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }

Target:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryUsers ( java.lang.String query ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryData queryData = new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapQueryDataImpl ( ) ; queryData.setLdapQueryType ( LdapQueryType.searchUsers ) ; queryData.setDomain ( getName ( ) ) ; queryData.setFilterParameters ( new java.lang.Object [ ] { query } ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.SearchUserByQuery , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByQueryParameters ( null , getName ( ) , queryData ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ldapUsers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUsers ( ldapUsers ) ; }
Source:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getName ( ) , target_vds.getHostName ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( java.util.Arrays.asList ( target_vds ) ) ) ; } return returnValue ; }

Target:
private boolean canRunOnDestinationVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { boolean returnValue = false ; if ( ( getDestinationVdsId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS target_vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getDestinationVdsId ( ) ) ; org.ovirt.engine.core.bll.VdsSelector.log.infoFormat ( "Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}" , getDestinationVdsId ( ) , target_vds.getName ( ) , target_vds.getHostName ( ) ) ; returnValue = canFindVdsToRun ( messages , isMigrate , java.util.Arrays.asList ( target_vds ) ) ; } return returnValue ; }
Source:
public boolean equals ( java.lang.Object obj ) { boolean returnValue = super . equals ( obj ) ; if ( ( ( ! returnValue ) && ( obj != null ) ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ) { returnValue = ( ! ( "" . equals ( getid ( ) ) ) ) && ( org.ovirt.engine.core.compat.StringHelper.EqOp ( getid ( ) , ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( obj ) ) . getid ( ) ) ) ; } return returnValue ; }

Target:
public boolean equals ( java.lang.Object obj ) { boolean returnValue = super . equals ( obj ) ; if ( ( ( ! returnValue ) && ( obj != null ) ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ) { returnValue = ( ( ( getid ( ) ) != null ) && ( ! ( getid ( ) . isEmpty ( ) ) ) ) && ( getid ( ) . equals ( ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( obj ) ) . getid ( ) ) ) ; } return returnValue ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { AddErrorMessages ( VdcBllMessages.VAR__ACTION__ACTIVATE , VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; returnValue = false ; } if ( returnValue && ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { AddErrorMessages ( VdcBllMessages.VAR__ACTION__ACTIVATE , VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; returnValue = false ; } if ( returnValue && ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; returnValue = false ; } return returnValue ; }
Source:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; prepareDao ( ) . removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = prepareDao ( ) . get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }

Target:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; dao.removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = dao.get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = dao.get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }
Source:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }

Target:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; response.addCookie ( cookie ) ; }
Source:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , false ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }

Target:
protected boolean validateCreateAllSnapshotsFromVmCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , true ) ; if ( ! ( returnValue.isValid ( ) ) ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return false ; } return true ; }
Source:
public org.ovirt.engine.api.v3.types.V3Usb adapt ( org.ovirt.engine.api.model.Usb from ) { org.ovirt.engine.api.v3.types.V3Usb to = new org.ovirt.engine.api.v3.types.V3Usb ( ) ; if ( from.isSetEnabled ( ) ) { to.setEnabled ( from.isEnabled ( ) ) ; } if ( from.isSetType ( ) ) { to.setType ( from.getType ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3Usb adapt ( org.ovirt.engine.api.model.Usb from ) { org.ovirt.engine.api.v3.types.V3Usb to = new org.ovirt.engine.api.v3.types.V3Usb ( ) ; if ( from.isSetEnabled ( ) ) { to.setEnabled ( from.isEnabled ( ) ) ; } if ( from.isSetType ( ) ) { to.setType ( from.getType ( ) . value ( ) ) ; } return to ; }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }

Target:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.alert ( alert , logType , auditLogDirector ) ; }
Source:
protected void connect ( org.ovirt.engine.core.utils.ssh.SSHClient client , java.lang.String serverName ) { java.lang.Integer timeout = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ConnectToServerTimeoutInSeconds ) ) * 1000 ; client.setHardTimeout ( timeout ) ; client.setSoftTimeout ( timeout ) ; client.setHost ( serverName , org.ovirt.engine.core.bll.utils.GlusterUtil.SSH_PORT ) ; try { client.connect ( ) ; } catch ( java.lang.Exception e ) { log.debug ( java.lang.String.format ( "Could not connect to server %1$s: %2$s" , serverName , e.getMessage ( ) ) ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
protected void connect ( org.ovirt.engine.core.utils.ssh.SSHClient client , java.lang.String serverName ) { java.lang.Integer timeout = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ConnectToServerTimeoutInSeconds ) ) * 1000 ; client.setHardTimeout ( timeout ) ; client.setSoftTimeout ( timeout ) ; client.setHost ( serverName , org.ovirt.engine.core.bll.utils.GlusterUtil.SSH_PORT ) ; try { client.connect ( ) ; } catch ( java.lang.Exception e ) { log.debug ( java.lang.String.format ( "Could not connect to server %1$s: %2$s" , serverName , e.getMessage ( ) ) ) ; throw new java.lang.RuntimeException ( e ) ; } }