auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ) && ( cluster.getArchitecture ( ) . equals ( VmListModel.BALLOON_DEVICE_BLACKLISTED_ARCH ) ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }

Target:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ) && ( ! ( cluster.getArchitecture ( ) . equals ( VmListModel.BALLOON_DEVICE_BLACKLISTED_ARCH ) ) ) ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getEntity ( ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate entity : parent.getEntitiesFromExportDomain ( ) ) { if ( guid.equals ( entity.getId ( ) ) ) { return entity ; } } return entityNotFound ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getEntity ( ) { if ( ( template ) != null ) { return template ; } for ( org.ovirt.engine.core.common.businessentities.VmTemplate entity : parent.getEntitiesFromExportDomain ( ) ) { if ( guid.equals ( entity.getId ( ) ) ) { template = entity ; return entity ; } } return entityNotFound ( ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; return cmd ; }
Source:
private void mockExecutor ( boolean success ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result ; if ( success ) { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ; } else { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ; } org.mockito.Mockito.doReturn ( result ) . when ( executor ) . fence ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.class ) ) ; }

Target:
private void mockExecutor ( boolean success ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result ; if ( success ) { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ; } else { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ; } org.mockito.Mockito.doReturn ( result ) . when ( executor ) . fence ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void updateBootMenu ( ) { if ( ( getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; final boolean supported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBootMenuSupported ( version.toString ( ) ) ; if ( ! supported ) { getBootMenuEnabled ( ) . setEntity ( false ) ; getBootMenuEnabled ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bootMenuNotSupported ( version.toString ( 2 ) ) ) ; } getBootMenuEnabled ( ) . setIsChangeable ( supported ) ; } }

Target:
private void updateBootMenu ( ) { if ( ( getSelectedCluster ( ) ) != null ) { getBootMenuEnabled ( ) . setIsChangeable ( true ) ; } }
Source:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( vdsDaoMock ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( asyncTaskDaoMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }

Target:
private void mockCommand ( ) { org.mockito.Mockito.doReturn ( asyncTaskDaoMock ) . when ( command ) . getAsyncTaskDao ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( storagePoolDaoMock ) . getForVds ( vdsId ) ; org.mockito.Mockito.doReturn ( vds ) . when ( vdsDaoMock ) . get ( vdsId ) ; }
Source:
private boolean networkAttachedToVds ( java.lang.String networkName , org.ovirt.engine.core.compat.Guid vdsId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > listOfInterfaces = getInterfaceDao ( ) . getAllInterfacesForVds ( vdsId ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsNetworkInterface : listOfInterfaces ) { if ( networkName.equals ( vdsNetworkInterface.getNetworkName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean networkAttachedToVds ( java.lang.String networkName , org.ovirt.engine.core.compat.Guid vdsId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = getInterfaceDao ( ) . getAllInterfacesForVds ( vdsId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : listOfInterfaces ) { if ( networkName.equals ( vdsNetworkInterface.getNetworkName ( ) ) ) { return true ; } } return false ; }
Source:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void addListeners ( ) { getTargets ( ) . getSelectedItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getLoginCommand ( ) . setIsExecutionAllowed ( ( ( ( getTargets ( ) . getSelectedItems ( ) ) != null ) && ( ! ( getTargets ( ) . getSelectedItems ( ) . isEmpty ( ) ) ) ) ) ; } } ) ; }

Target:
private void addListeners ( ) { getTargets ( ) . getSelectedItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getLoginCommand ( ) . setIsExecutionAllowed ( ( ( ( getTargets ( ) . getSelectedItems ( ) ) != null ) && ( ! ( getTargets ( ) . getSelectedItems ( ) . isEmpty ( ) ) ) ) ) ; } } ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.CLOSE.equals ( command.getName ( ) ) ) { cancel ( ) ; } else if ( ( ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_SECURITY_COMMAND.equals ( command.getName ( ) ) ) || ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_BUGS_COMMAND.equals ( command.getName ( ) ) ) ) || ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_ENHANCEMENTS_COMMAND.equals ( command.getName ( ) ) ) ) { showErrataListWithDetailsPopup ( ) ; } else { super . executeCommand ( command ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.CLOSE.equals ( command.getName ( ) ) ) { cancel ( ) ; } else if ( ( ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_SECURITY_COMMAND.equals ( command.getName ( ) ) ) || ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_BUGS_COMMAND.equals ( command.getName ( ) ) ) ) || ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel.SHOW_ENHANCEMENTS_COMMAND.equals ( command.getName ( ) ) ) ) { showErrataListWithDetailsPopup ( command.getName ( ) ) ; } else { super . executeCommand ( command ) ; } }
Source:
public void hostNNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostNNotUsed ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testDiskAttachedToVMFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM ) ) ; }

Target:
public void testDiskAttachedToVMFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM ) ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; assertTrue ( disk.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; assertTrue ( disk.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; } finally { accepts.clear ( ) ; } }
Source:
protected void init ( ) { setVmName ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getVmName ( ) ) ; setVdsId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getProxyHostId ( ) ) ; setVdsGroupId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getVdsGroupId ( ) ) ; setStoragePoolId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }

Target:
protected void init ( ) { super . init ( ) ; setVmName ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getVmName ( ) ) ; setVdsId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getProxyHostId ( ) ) ; setVdsGroupId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getVdsGroupId ( ) ) ; setStoragePoolId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }
Source:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsToClone ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( ! ( validateName ( ( ( template.getName ( ) ) + suffix ) , entityModel , getClonedAppendedNameValidators ( null ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsToClone ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( ! ( validateName ( ( ( template.getName ( ) ) + suffix ) , entityModel , getClonedAppendedNameValidators ( ) ) ) ) { return false ; } } return true ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public boolean isApplicable ( org.ovirt.engine.core.common.businessentities.VDSGroup oldCluster , org.ovirt.engine.core.common.businessentities.VDSGroup newCluster ) { newCpuName = newCluster.getCpuName ( ) ; final java.lang.String oldCpuName = oldCluster.getCpuName ( ) ; return ! ( newCpuName.equals ( oldCpuName ) ) ; }

Target:
public boolean isApplicable ( org.ovirt.engine.core.common.businessentities.VDSGroup oldCluster , org.ovirt.engine.core.common.businessentities.VDSGroup newCluster ) { newCpuName = newCluster.getCpuName ( ) ; final java.lang.String oldCpuName = oldCluster.getCpuName ( ) ; return ( ( newCpuName ) != null ) && ( ! ( newCpuName.equals ( oldCpuName ) ) ) ; }
Source:
private void updateConsoleAddressPartiallyOverridden ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { boolean isConsistent = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; setConsoleAddressPartiallyOverridden ( ( ! isConsistent ) ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsDisplayAddressConsistentInCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( cluster.getId ( ) ) , query ) ; }

Target:
private void updateConsoleAddressPartiallyOverridden ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { boolean isConsistent = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; setConsoleAddressPartiallyOverridden ( ( ! isConsistent ) ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsDisplayAddressConsistentInCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( cluster.getId ( ) ) , query ) ; }
Source:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { java.util.Iterator < java.lang.String > iterator = replacements.iterator ( ) ; while ( iterator.hasNext ( ) ) { java.lang.String replacement = iterator.next ( ) ; for ( int i = ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.Assert.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }

Target:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { for ( java.lang.String replacement : replacements ) { for ( int i = ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.Assert.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getDbFacade ( ) . getAuditLogDao ( ) . getAllByVMTemplateName ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . getVmTemplateName ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getDbFacade ( ) . getAuditLogDao ( ) . getAllByVMTemplateName ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . getName ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.column.StyledImageResourceCell.template.imageContainer ( title , style , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.column.StyledImageResourceCell.template.imageContainer ( style , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( hostsWithNonMigratableVms.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }

Target:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }
Source:
public void setDefaultNames4 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterListByName ( new org.ovirt.engine.ui.frontend.AsyncQuery ( null , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.dataCenterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; setDefaultNames5 ( ) ; } } , frontendHash ) , ( ( getCommonName ( ) ) + "*" ) ) ; }

Target:
public void setDefaultNames4 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterListByName ( new org.ovirt.engine.ui.frontend.AsyncQuery ( null , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.dataCenterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; setDefaultNames5 ( ) ; } } , frontendHash ) , ( ( getCommonName ( ) ) + "*" ) ) ; }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; java.lang.System.out.println ( comps ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }

Target:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel createNetworkClusterModel ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ( cluster ) ; networkClusterModel.setAttached ( true ) ; networkClusterModel.setRequired ( ( ! ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) ) ; networkClusterModel.setIsChangeable ( false ) ; return networkClusterModel ; } else { return super . createNetworkClusterModel ( cluster ) ; } }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel createNetworkClusterModel ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ( cluster ) ; networkClusterModel.setAttached ( true ) ; networkClusterModel.setRequired ( ( ! ( getExport ( ) . getEntity ( ) ) ) ) ; networkClusterModel.setIsChangeable ( false ) ; return networkClusterModel ; } else { return super . createNetworkClusterModel ( cluster ) ; } }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Vm , org.ovirt.engine.api.restapi.resource.VM > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , guid , query ) ) ; }
Source:
private static org.ovirt.engine.api.model.ErrorHandling map ( org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions migrateOnError , org.ovirt.engine.api.model.ErrorHandling template ) { org.ovirt.engine.api.model.MigrateOnError value = org.ovirt.engine.api.restapi.types.ClusterMapper.map ( migrateOnError , ( ( org.ovirt.engine.api.model.MigrateOnError ) ( null ) ) ) ; if ( value == null ) { return null ; } else { template = ( template == null ) ? new org.ovirt.engine.api.model.ErrorHandling ( ) : template ; template.setOnError ( value.value ( ) ) ; return template ; } }

Target:
private static org.ovirt.engine.api.model.ErrorHandling map ( org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions migrateOnError , org.ovirt.engine.api.model.ErrorHandling template ) { org.ovirt.engine.api.model.MigrateOnError value = org.ovirt.engine.api.restapi.types.ClusterMapper.map ( migrateOnError , ( ( org.ovirt.engine.api.model.MigrateOnError ) ( null ) ) ) ; if ( value == null ) { return null ; } else { template = ( template == null ) ? new org.ovirt.engine.api.model.ErrorHandling ( ) : template ; template.setOnError ( value ) ; return template ; } }
Source:
public void getVdsWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , v.getId ( ) ) ; }

Target:
public void getVdsWithVm ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , v.getId ( ) ) ; }
Source:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( vdsStatisticsDao ) . when ( command ) . getVdsStatisticsDao ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
private void bindConsoles ( ) { bind ( org.ovirt.engine.ui.uicommonweb.models.vms.INoVnc.class ) . to ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IVncNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.VncNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceHtml5.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpPlugin.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpPluginImpl.class ) ; }

Target:
private void bindConsoles ( ) { bind ( org.ovirt.engine.ui.uicommonweb.models.vms.INoVnc.class ) . to ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IVncNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.VncNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.SpiceNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpNative.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpNativeImpl.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdpPlugin.class ) . to ( org.ovirt.engine.ui.common.uicommon.RdpPluginImpl.class ) ; }
Source:
public static < E extends org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > java.util.Map < java.lang.String , E > hostInterfacesByNetworkName ( java.util.Collection < E > entityList ) { if ( entityList != null ) { java.util.Map < java.lang.String , E > map = new java.util.HashMap < java.lang.String , E > ( ) ; for ( E e : entityList ) { map.put ( e.getNetworkName ( ) , e ) ; } return map ; } else { return java.util.Collections.emptyMap ( ) ; } }

Target:
public static < E extends org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > java.util.Map < java.lang.String , E > hostInterfacesByNetworkName ( java.util.Collection < E > entityList ) { if ( entityList != null ) { java.util.Map < java.lang.String , E > map = new java.util.HashMap < java.lang.String , E > ( ) ; for ( E e : entityList ) { if ( ( e.getNetworkName ( ) ) != null ) { map.put ( e.getNetworkName ( ) , e ) ; } } return map ; } else { return java.util.Collections.emptyMap ( ) ; } }
Source:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getstatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }

Target:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getStatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }
Source:
public java.util.HashMap < java.lang.Integer , java.lang.String > getOsNames ( ) { java.util.HashMap < java.lang.Integer , java.lang.String > osNames = new java.util.HashMap < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String name = getValueByVersion ( idToUnameLookup.get ( osId ) , "name" , null ) ; if ( name != null ) { osNames.put ( osId , name ) ; } } return osNames ; }

Target:
public java.util.Map < java.lang.Integer , java.lang.String > getOsNames ( ) { java.util.Map < java.lang.Integer , java.lang.String > osNames = new java.util.HashMap < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String name = getValueByVersion ( idToUnameLookup.get ( osId ) , "name" , null ) ; if ( name != null ) { osNames.put ( osId , name ) ; } } return osNames ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < Q > qosList = ( ( java.util.ArrayList < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; qosMap = new java.util.HashMap < > ( ) ; if ( qosList != null ) { for ( Q qos : qosList ) { qosMap.put ( qos.getId ( ) , qos ) ; } } fetchProfiles ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < Q > qosList = ( ( java.util.ArrayList < Q > ) ( returnValue.getReturnValue ( ) ) ) ; qosMap = new java.util.HashMap < > ( ) ; if ( qosList != null ) { for ( Q qos : qosList ) { qosMap.put ( qos.getId ( ) , qos ) ; } } fetchProfiles ( ) ; }
Source:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; }

Target:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertEquals ( result , dummyPolicy ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getName ( ) ) ; } return iface ; }
Source:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { onDataLoad ( ) ; } } ) ; getCollapseSnapshots ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel.ON_DISK_LOAD ) ) ; } } ) ; }

Target:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { onDataLoad ( ) ; } } ) ; }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ; } }
Source:
public java.util.Date parse ( java.lang.CharSequence text ) throws java.text.ParseException { return new java.util.Date ( java.util.Date.parse ( text.toString ( ) ) ) ; }

Target:
public java.util.Date parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( text.toString ( ) . isEmpty ( ) ) ) { return null ; } else { return new java.util.Date ( java.util.Date.parse ( text.toString ( ) ) ) ; } }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroup ( ) ; jobProperties.put ( GlusterConstants.CLUSTER , ( vdsGroup == null ? null : vdsGroup.getname ( ) ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroup ( ) ; jobProperties.put ( GlusterConstants.CLUSTER , ( vdsGroup == null ? null : vdsGroup.getName ( ) ) ) ; } return jobProperties ; }
Source:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress" , "address" ) ; } }

Target:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDisk_IncompleteParameters_ConnectionAddress" , "address" ) ; } }