auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void initWindow ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession selectedSession ) { getForce ( ) . setEntity ( false ) ; getMasterVolume ( ) . setEntity ( selectedSession.getMasterVolumeName ( ) ) ; getSlaveVolume ( ) . setEntity ( selectedSession.getSlaveVolumeName ( ) ) ; getSlaveHost ( ) . setEntity ( selectedSession.getSlaveHostName ( ) ) ; }

Target:
protected void initWindow ( java.lang.String masterVolume , java.lang.String slaveVolume , java.lang.String slaveHost ) { getForce ( ) . setEntity ( false ) ; getMasterVolume ( ) . setEntity ( masterVolume ) ; getSlaveVolume ( ) . setEntity ( slaveVolume ) ; getSlaveHost ( ) . setEntity ( slaveHost ) ; }
Source:
public void virtIoRngSupported ( ) { org.mockito.Mockito.when ( cluster.getRequiredRngSources ( ) ) . thenReturn ( java.util.Collections.singleton ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.class ) ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . virtIoRngSupportedInCluster ( ) ; org.junit.Assert.assertThat ( validator.virtIoRngSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void virtIoRngSupported ( ) { org.mockito.Mockito.when ( cluster.getRequiredRngSources ( ) ) . thenReturn ( java.util.Collections.singleton ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.class ) ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . virtIoRngSupportedInCluster ( ) ; org.junit.Assert.assertThat ( validator.virtIoRngSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; resource.setUriInfo ( setUpActionExpectations ( ActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }

Target:
public void testUpdateCantDo ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; resource.setUriInfo ( setUpActionExpectations ( ActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ROOT_PASSWORD } , false , true , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , "ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST" , 409 ) ; } }
Source:
private void handleSequentialQueries ( final java.lang.String key ) { org.ovirt.engine.ui.frontend.Frontend.currentRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.QueryWrapper wrapper = org.ovirt.engine.ui.frontend.Frontend.pendingRequests.get ( key ) ; if ( wrapper != null ) { org.ovirt.engine.ui.frontend.Frontend.pendingRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( wrapper.getQueryType ( ) , wrapper.getParameters ( ) , wrapper.getCallback ( ) ) ; } }

Target:
private void handleSequentialQueries ( final java.lang.String key ) { org.ovirt.engine.ui.frontend.Frontend.currentRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.QueryWrapper wrapper = org.ovirt.engine.ui.frontend.Frontend.pendingRequests.get ( key ) ; if ( wrapper != null ) { org.ovirt.engine.ui.frontend.Frontend.pendingRequests.remove ( queryWrapper.getKey ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( wrapper.getQueryType ( ) , wrapper.getParameters ( ) , service , wrapper.getCallback ( ) ) ; } }
Source:
public void testRetry ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 3 , 10 ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; retryable.call ( ) ; org.mockito.Mockito.verify ( callable , org.mockito.Mockito.times ( 1 ) ) . call ( ) ; }

Target:
public void testRetry ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( 5 , 3 , 10 ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; retryable.call ( ) ; org.mockito.Mockito.verify ( callable , org.mockito.Mockito.times ( 1 ) ) . call ( ) ; }
Source:
protected org.ovirt.engine.api.model.Device postPopulate ( org.ovirt.engine.api.model.Device model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) . value ( ) ) ; for ( org.ovirt.engine.api.model.IP ip : model.getIps ( ) . getIPs ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) . value ( ) ) ; for ( org.ovirt.engine.api.model.IP ip : model.getIps ( ) . getIPs ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }
Source:
protected void validateResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult expected , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult actual ) { org.junit.Assert.assertNotNull ( actual ) ; org.junit.Assert.assertEquals ( expected.getStatus ( ) , actual.getStatus ( ) ) ; org.junit.Assert.assertEquals ( expected.getPowerStatus ( ) , actual.getPowerStatus ( ) ) ; }

Target:
protected void validateResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult expected , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult actual ) { org.junit.jupiter.api.Assertions.assertNotNull ( actual ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected.getStatus ( ) , actual.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected.getPowerStatus ( ) , actual.getPowerStatus ( ) ) ; }
Source:
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.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static boolean Is64bitOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.Get64bitOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
public static void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.VmPoolHandler.log.infoFormat ( "VdcBll.VmPoolHandler.ProcessVmPoolOnStopVm - Deleting snapshot for stateless vm {0}" , vmId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; } }

Target:
public static void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.VmPoolHandler.log.infoFormat ( "VdcBll.VmPoolHandler.processVmPoolOnStopVm - Deleting snapshot for stateless vm {0}" , vmId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( 50 ) ; builder.append ( "commandId: " ) ; builder.append ( getCommandId ( ) ) ; builder.append ( ", user: " ) ; if ( ( getParametersCurrentUser ( ) ) != null ) { builder.append ( getParametersCurrentUser ( ) . getUserName ( ) ) ; } builder.append ( ", commandType: " ) ; builder.append ( getCommandType ( ) ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( 50 ) ; builder.append ( "commandId: " ) ; builder.append ( getCommandId ( ) ) ; builder.append ( ", user: " ) ; if ( ( getParametersCurrentUser ( ) ) != null ) { builder.append ( getParametersCurrentUser ( ) . getLoginName ( ) ) ; } builder.append ( ", commandType: " ) ; builder.append ( getCommandType ( ) ) ; return builder.toString ( ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }

Target:
protected void addDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshots ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData ( ) ; data.setCollapseSnapshot ( collapseSnapshots ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; diskImportDataMap.put ( diskId , data ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void getZeroSnapshotsByMemory ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setMemoryDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; snapshot.setMetadataDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getNumOfSnapshotsByDisks ( snapshot ) ) ; }

Target:
public void getZeroSnapshotsByMemory ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setMemoryDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; snapshot.setMetadataDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , dao.getNumOfSnapshotsByDisks ( snapshot ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setSoundcard ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }
Source:
private void StyleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxOnlyEditor editor , org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { if ( ! ( model.getIsChangable ( ) ) ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.Object > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }

Target:
private void StyleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxOnlyEditor editor , org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { if ( ! ( model.getIsChangable ( ) ) ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.Object > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } editor.asValueBox ( ) . setTitle ( model.getTitle ( ) ) ; }
Source:
public java.lang.String GetTagNamesAndChildrenNamesByRegExp ( java.lang.String tagNameRegExp ) { tagNameRegExp = java.lang.String.format ( "^%1$s$" , tagNameRegExp ) ; tagNameRegExp = tagNameRegExp.replace ( "*" , ".*" ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; RecursiveGetTagsAndChildrenByRegExp ( tagNameRegExp , sb , GetRootTag ( ) , org.ovirt.engine.core.bll.TagsDirector.TagReturnValueIndicator.NAME ) ; return sb.toString ( ) ; }

Target:
public java.lang.String GetTagNamesAndChildrenNamesByRegExp ( java.lang.String tagNameRegExp ) { tagNameRegExp = java.lang.String.format ( "^%1$s$" , tagNameRegExp ) ; tagNameRegExp = tagNameRegExp.replace ( "*" , ".*" ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; org.ovirt.engine.core.bll.TagsDirector.RecursiveGetTagsAndChildrenByRegExp ( tagNameRegExp , sb , GetRootTag ( ) , org.ovirt.engine.core.bll.TagsDirector.TagReturnValueIndicator.NAME ) ; return sb.toString ( ) ; }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public org.ovirt.engine.api.model.RSDL build ( ) { try { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; rsdl.setApi ( getEntryPoint ( ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; org.ovirt.engine.api.restapi.rsdl.RsdlBuilder.LOG.error ( "RSDL generation failure." , e ) ; } return rsdl ; }

Target:
public org.ovirt.engine.api.model.RSDL build ( ) { try { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; rsdl.setGeneral ( getGeneralMetadata ( ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; org.ovirt.engine.api.restapi.rsdl.RsdlBuilder.LOG.error ( "RSDL generation failure." , e ) ; } return rsdl ; }
Source:
private void stylePanel ( com.google.gwt.user.client.ui.VerticalPanel panel , java.lang.String title ) { com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label ( title ) ; com.google.gwt.user.client.ui.SimplePanel titlePanel = new com.google.gwt.user.client.ui.SimplePanel ( new com.google.gwt.user.client.ui.Label ( title ) ) ; titlePanel.setStyleName ( style.requiredTitlePanel ( ) ) ; label.getElement ( ) . addClassName ( style.requiredLabel ( ) ) ; panel.add ( titlePanel ) ; super . stylePanel ( panel ) ; }

Target:
private com.google.gwt.user.client.ui.SimplePanel initTitlePanel ( java.lang.String title ) { com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label ( title ) ; com.google.gwt.user.client.ui.SimplePanel titlePanel = new com.google.gwt.user.client.ui.SimplePanel ( label ) ; titlePanel.setStyleName ( style.requiredTitlePanel ( ) ) ; label.getElement ( ) . addClassName ( style.requiredLabel ( ) ) ; return titlePanel ; }
Source:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) ) ; }

Target:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { return java.util.Arrays.stream ( org.apache.commons.lang.StringUtils.split ( java.util.Objects.toString ( str , StringUtils.EMPTY ) , org.ovirt.engine.core.utils.GuidUtils.SEPARATOR ) ) . map ( Guid :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { return java.util.Arrays.stream ( java.util.Objects.toString ( str , "" ) . split ( org.ovirt.engine.core.utils.GuidUtils.SEPARATOR ) ) . filter ( ( s ) -> ! ( s.isEmpty ( ) ) ) . map ( Guid :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public int compare ( org.ovirt.engine.api.model.DetailedLink dl1 , org.ovirt.engine.api.model.DetailedLink dl2 ) { int res = dl1.getHref ( ) . compareTo ( dl2.getHref ( ) ) ; return res != 0 ? res : dl1.getRel ( ) . compareTo ( dl2.getRel ( ) ) ; }

Target:
private org.ovirt.engine.api.model.Rsdl construct ( ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.Rsdl rsdl = new org.ovirt.engine.api.model.Rsdl ( ) ; rsdl.setLinks ( new org.ovirt.engine.api.model.DetailedLinks ( ) ) ; for ( org.ovirt.engine.api.model.DetailedLink link : getLinks ( ) ) { rsdl.getLinks ( ) . getLinks ( ) . add ( link ) ; } uniteDuplicateLinks ( rsdl ) ; java.util.Collections.sort ( rsdl.getLinks ( ) . getLinks ( ) , java.util.Comparator.comparing ( DetailedLink :: getHref ) . thenComparing ( DetailedLink :: getRel ) ) ; return rsdl ; }
Source:
static org.ovirt.engine.core.common.businessentities.DbUser setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.DbUser entity , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getuser_id ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.DbUser setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.DbUser entity , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getFirstName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
public void validRunningVmsOrVmLeasesForBackupDomain ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue ret = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; ret.setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmBase > ( ) ) ; ret.setSucceeded ( true ) ; org.mockito.Mockito.doReturn ( ret ) . when ( validator ) . getEntitiesWithLeaseIdForStorageDomain ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.isRunningVmsOrVmLeasesForBackupDomain ( vmHandler ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validRunningVmsOrVmLeasesForBackupDomain ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue ret = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; ret.setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmBase > ( ) ) ; ret.setSucceeded ( true ) ; org.mockito.Mockito.doReturn ( ret ) . when ( validator ) . getEntitiesWithLeaseIdForStorageDomain ( org.mockito.ArgumentMatchers.any ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isRunningVmsOrVmLeasesForBackupDomain ( vmHandler ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
public void versionHasMatchingFormat ( org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.StorageFormatType sft = org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getForVersion ( v ) ; org.junit.Assert.assertNotNull ( java.lang.String.format ( "Missing format for version %s" , v ) , sft ) ; org.ovirt.engine.core.compat.Version earliestSupported = org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getEarliestVersionSupported ( sft ) ; org.junit.Assert.assertNotNull ( java.lang.String.format ( "Missing earliest version for format %s" , sft ) , earliestSupported ) ; org.junit.Assert.assertTrue ( java.lang.String.format ( "Earliest supported version (%s) should no be later than the version requiring this type (%s)" , earliestSupported , v ) , ( ( v.compareTo ( earliestSupported ) ) >= 0 ) ) ; }

Target:
public void versionHasMatchingFormat ( org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.StorageFormatType sft = org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getForVersion ( v ) ; org.junit.jupiter.api.Assertions.assertNotNull ( sft , java.lang.String.format ( "Missing format for version %s" , v ) ) ; org.ovirt.engine.core.compat.Version earliestSupported = org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getEarliestVersionSupported ( sft ) ; org.junit.jupiter.api.Assertions.assertNotNull ( earliestSupported , java.lang.String.format ( "Missing earliest version for format %s" , sft ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( v.compareTo ( earliestSupported ) ) >= 0 ) , java.lang.String.format ( "Earliest supported version (%s) should no be later than the version requiring this type (%s)" , earliestSupported , v ) ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.VmTemplate template , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.VmTemplate template , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , template.getName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.templateGeneralSubTabPlace , parameters ) ; }
Source:
private void optimizationForDesktopFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationForDesktop ( ) ) != null ) && ( ( object.getOptimizationForDesktop ( ) . getEntity ( ) ) != null ) ) { optimizationForDesktopEditor.setLabel ( messages.clusterPopupMemoryOptimizationForDesktopLabel ( object.getOptimizationForDesktop ( ) . getEntity ( ) . toString ( ) ) ) ; } }

Target:
private void optimizationForDesktopFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationForDesktop ( ) ) != null ) && ( ( object.getOptimizationForDesktop ( ) . getEntity ( ) ) != null ) ) { optimizationForDesktopEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.ClusterPopupView.messages.clusterPopupMemoryOptimizationForDesktopLabel ( object.getOptimizationForDesktop ( ) . getEntity ( ) . toString ( ) ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }
Source:
public java.lang.String render ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.TransportType > transportTypes ) { org.ovirt.engine.ui.uicompat.Translator transportTypeTranslator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; java.lang.StringBuilder transportTypesBuilder = new java.lang.StringBuilder ( ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.gluster.TransportType > iterator = transportTypes.iterator ( ) ; while ( iterator.hasNext ( ) ) { org.ovirt.engine.core.common.businessentities.gluster.TransportType transportType = iterator.next ( ) ; transportTypesBuilder.append ( transportTypeTranslator.get ( transportType ) ) ; if ( iterator.hasNext ( ) ) { transportTypesBuilder.append ( ", " ) ; } } return new java.lang.String ( transportTypesBuilder.toString ( ) ) ; }

Target:
public java.lang.String render ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.TransportType > transportTypes ) { org.ovirt.engine.ui.uicompat.Translator transportTypeTranslator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; java.lang.StringBuilder transportTypesBuilder = new java.lang.StringBuilder ( ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.gluster.TransportType > iterator = transportTypes.iterator ( ) ; while ( iterator.hasNext ( ) ) { org.ovirt.engine.core.common.businessentities.gluster.TransportType transportType = iterator.next ( ) ; transportTypesBuilder.append ( transportTypeTranslator.translate ( transportType ) ) ; if ( iterator.hasNext ( ) ) { transportTypesBuilder.append ( ", " ) ; } } return transportTypesBuilder.toString ( ) ; }
Source:
public static java.util.Map.Entry < java.lang.Integer , java.lang.String > [ ] data ( ) { java.util.Map.Entry [ ] arr = org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.entrySet ( ) . toArray ( new java.util.Map.Entry [ ] { } ) ; return ( ( java.util.Map.Entry < java.lang.Integer , java.lang.String > [ ] ) ( arr ) ) ; }

Target:
public static java.util.Set < java.util.Map.Entry < java.lang.Integer , java.lang.String > > data ( ) { return org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.entrySet ( ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDisksList ( ) { if ( ( cachedSelectedActiveDisks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAndCinderForVm = getFilteredDisksForSnapshot ( ) ; if ( ( getParameters ( ) . getDisks ( ) ) == null ) { cachedSelectedActiveDisks = imagesAndCinderForVm ; } else { cachedSelectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.imagesIntersection ( imagesAndCinderForVm , getParameters ( ) . getDisks ( ) ) ; } } return cachedSelectedActiveDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( ( cachedImagesDisks ) == null ) { cachedImagesDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( disks , true , true , true ) ; } return cachedImagesDisks ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }
Source:
protected com.google.gwt.resources.client.ImageResource getStatusImage ( ) { org.ovirt.engine.core.common.businessentities.NetworkStatus netStatus = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) . getStatus ( ) ; if ( netStatus == ( org.ovirt.engine.core.common.businessentities.NetworkStatus.Operational ) ) { return resources.upImage ( ) ; } else if ( netStatus == ( org.ovirt.engine.core.common.businessentities.NetworkStatus.NonOperational ) ) { return resources.downImage ( ) ; } else { return resources.questionMarkImage ( ) ; } }

Target:
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.NonOperational ) ) { return resources.downImage ( ) ; } else { return resources.questionMarkImage ( ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getLVMVolumeGroups" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vglist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterStopProcesses ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterHost.processesStop" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . swapButton ( createButton ( item , false ) ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }
Source:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetTagsByTemplateId , new org.ovirt.engine.core.common.queries.GetTagsByTemplateIdParameters ( templateId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.getTagId ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Tag get ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , QueryType.GetTagsByTemplateId , new org.ovirt.engine.core.common.queries.GetTagsByTemplateIdParameters ( templateId.toString ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : tags ) { if ( tag.getTagId ( ) . equals ( guid ) ) { return addLinks ( populate ( map ( tag , null ) , tag ) ) ; } } return notFound ( ) ; }
Source:
private java.lang.String startPasswordDialog ( java.lang.String user ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting password dialog." ) ; java.lang.System.out.printf ( "Please enter a password for %s: " , user ) ; return new java.lang.String ( java.lang.System.console ( ) . readPassword ( ) ) ; }

Target:
public static java.lang.String startPasswordDialog ( java.lang.String user ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting password dialog." ) ; if ( user == null ) { java.lang.System.out.printf ( "Please enter a password" ) ; } else { java.lang.System.out.printf ( "Please enter a password for %s: " , user ) ; } return new java.lang.String ( java.lang.System.console ( ) . readPassword ( ) ) ; }
Source:
public void canDoActionFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void validateFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void onRevealOverlayContent ( org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent event ) { java.util.Set < com.gwtplatform.mvp.client.PresenterWidget < ? > > children = getChildren ( com.gwtplatform.mvp.client.presenter.slots.LegacySlotConvertor.convert ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) ; if ( ( ( event.getContent ( ) ) != null ) && ( ! ( children.isEmpty ( ) ) ) ) { event.getContent ( ) . setCurrentPlaceWidget ( children.iterator ( ) . next ( ) ) ; } setInSlot ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetOverlay , event.getContent ( ) ) ; }

Target:
public void onRevealOverlayContent ( org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent event ) { if ( ( event.getContent ( ) ) != null ) { event.getContent ( ) . setCurrentPlaceWidget ( getChild ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) ; } setInSlot ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetOverlay , event.getContent ( ) ) ; }
Source:
protected void executeCommand ( ) { updateOvfStoreContent ( ) ; int missingDiskCount = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainOvfStoreCount ) ) - ( ovfDiskCount ) ; if ( missingDiskCount > 0 ) { org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.CreateOvfStoresForStorageDomain , new org.ovirt.engine.core.common.action.CreateOvfStoresForStorageDomainCommandParameters ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) , missingDiskCount ) ) ; } org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { updateOvfStoreContent ( ) ; int missingDiskCount = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainOvfStoreCount ) ) - ( ovfDiskCount ) ; if ( missingDiskCount > 0 ) { runInternalAction ( VdcActionType.CreateOvfStoresForStorageDomain , new org.ovirt.engine.core.common.action.CreateOvfStoresForStorageDomainCommandParameters ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) , missingDiskCount ) , org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.cloneContextAndDetachFromParent ( ) ) ; } org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; }
Source:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }

Target:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }
Source:
private void addOsTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.OsType [ ] types ) { version.setOsTypes ( new org.ovirt.engine.api.model.OsTypes ( ) ) ; for ( org.ovirt.engine.api.model.OsType type : types ) { version.getOsTypes ( ) . getOsTypes ( ) . add ( type.value ( ) ) ; } }

Target:
private void addOsTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setOsTypes ( new org.ovirt.engine.api.model.OsTypes ( ) ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.getOsTypes ( ) . getOsTypes ( ) . addAll ( org.ovirt.engine.api.model.OsTypeUtils.getAllValues ( ) ) ; } else { for ( org.ovirt.engine.api.model.OsType type : org.ovirt.engine.api.model.OsType.values ( ) ) { version.getOsTypes ( ) . getOsTypes ( ) . add ( type.name ( ) ) ; } } }