auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void initHasSpiceSupport ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.spiceSupportMatrix = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetSpiceSupportMatrix ) , callback ) ; }

Target:
private static void initDisplayTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDisplayTypes ) , callback ) ; }
Source:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( ! ( macPools.containsKey ( macPool.getId ( ) ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } removeWithoutLocking ( macPool.getId ( ) ) ; initializeMacPool ( macPool ) ; } }

Target:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( ! ( macPools.containsKey ( macPool.getId ( ) ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } removeWithoutLocking ( macPool.getId ( ) ) ; initializeMacPool ( macPool ) ; } }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { java.lang.String storageDomainName = value.substring ( 0 , value.lastIndexOf ( " (" ) ) ; importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedStorageDomainString ( storageDomainName ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk , java.lang.String value ) { java.lang.String storageDomainName = value.substring ( 0 , value.lastIndexOf ( " (" ) ) ; importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedStorageDomainString ( storageDomainName ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }
Source:
private boolean shouldResizeDiskImage ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

Target:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getImages ( ) { return java.util.Collections.emptyList ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; org.mockito.Mockito.when ( externalVnicProfileMappingValidator.validateExternalVnicProfileMapping ( new java.util.ArrayList < > ( ) , clusterId ) ) . thenReturn ( ValidationResult.VALID ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
public static void GetDiskMaxSize ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( PropertyChangedEventArgs.PROGRESS.equals ( pcArgs.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( PropertyChangedEventArgs.PROGRESS.equals ( args.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } ) ; } } }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationMessages messages ) { selectHostAutomaticallyEditor.setLabel ( constants.vmMigratePopupSelectHostAutomaticallyLabel ( ) ) ; selectDestinationHostEditor.setLabel ( constants.vmMigratePopupSelectDestinationHostLabel ( ) ) ; hostsListEditor.setLabel ( constants.vmMigratePopupHostsListLabel ( ) ) ; message1.setText ( messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( messages.migrateNoAvailableHost ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationMessages messages ) { selectHostAutomaticallyEditor.setLabel ( constants.vmMigratePopupSelectHostAutomaticallyLabel ( ) ) ; selectDestinationHostEditor.setLabel ( constants.vmMigratePopupSelectDestinationHostLabel ( ) ) ; hostsListEditor.setLabel ( constants.vmMigratePopupHostsListLabel ( ) ) ; clustersEditor.setLabel ( constants.hostClusterVmPopup ( ) ) ; message1.setText ( messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( messages.migrateNoAvailableHost ( ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { if ( fp == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.compat.Version ver = org.ovirt.engine.core.compat.Version.v3_0 ; if ( fp.isSkipFencingIfSDActive ( ) ) { for ( org.ovirt.engine.core.compat.Version v : org.ovirt.engine.core.compat.Version.ALL ) { if ( ( ( v.compareTo ( Version.v3_0 ) ) >= 0 ) && ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) ) { ver = v ; break ; } } } return ver ; }

Target:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { if ( fp == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.compat.Version ver = Version.ALL.get ( 0 ) ; if ( fp.isSkipFencingIfSDActive ( ) ) { for ( org.ovirt.engine.core.compat.Version v : org.ovirt.engine.core.compat.Version.ALL ) { if ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) { ver = v ; break ; } } } return ver ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { mVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.getBroker ( ) . getVmStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , mVmListReturn.mInfoList [ 0 ] ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.setReturnValue ( new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.businessentities.VmDynamic , org.ovirt.engine.core.common.businessentities.VmStatistics > ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( mVmListReturn.mInfoList [ 0 ] ) ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { mVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.getBroker ( ) . getVmStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmStatsVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( createVmInternalData ( mVmListReturn.mInfoList [ 0 ] ) ) ; }
Source:
private void writeModel ( ) { writer.writeStartObject ( ) ; writer.writeStartArray ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writer.writeEnd ( ) ; writer.writeStartArray ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writer.writeEnd ( ) ; writer.writeEnd ( ) ; }

Target:
private void writeModel ( ) { writer.writeStartObject ( ) ; writer.writeStartArray ( "types" ) ; model.types ( ) . forEach ( this :: writeType ) ; writer.writeEnd ( ) ; writer.writeStartArray ( "services" ) ; model.services ( ) . forEach ( this :: writeService ) ; writer.writeEnd ( ) ; writer.writeStartArray ( "documents" ) ; model.documents ( ) . forEach ( this :: writeDocument ) ; writer.writeEnd ( ) ; writer.writeEnd ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { Network_SelectedItemChanged ( null ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return storageDomain.getHost ( ) . isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( storageDomain.getHost ( ) . getId ( ) ) : storageDomain.getHost ( ) . isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , SearchType.VDS , ( "Hosts: name=" + ( storageDomain.getHost ( ) . getName ( ) ) ) ) . getId ( ) : null ; }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return storageDomain.getHost ( ) . isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( storageDomain.getHost ( ) . getId ( ) ) : storageDomain.getHost ( ) . isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomain.getHost ( ) . getName ( ) ) , ( "Hosts: name=" + ( storageDomain.getHost ( ) . getName ( ) ) ) ) . getId ( ) : null ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > soundDevList = getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetSoundDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.SOUND ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( soundDevList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : soundDevList ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetSoundDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; } }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.users.VdcUser loggedUser = loginModel.getLoggedUser ( ) ; org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( loggedUser ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser.getUserName ( ) ) ; clearPassword ( loginModel ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.users.VdcUser loggedUser = loginModel.getLoggedUser ( ) ; org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( loggedUser ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ) ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
protected org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor createWidget ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > value ) { org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor widget = new org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor ( ) ; if ( usePatternFly ) { widget.setUsePatternFly ( true ) ; widget.hideLabel ( ) ; widget.getElement ( ) . getStyle ( ) . setWidth ( width , Unit.PX ) ; } widget.edit ( value ) ; return widget ; }

Target:
protected org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor createWidget ( org.ovirt.engine.ui.uicommonweb.models.dnsconfiguration.NameServerModel value ) { org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor widget = new org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor ( ) ; if ( usePatternFly ) { widget.setUsePatternFly ( true ) ; widget.hideLabel ( ) ; widget.getElement ( ) . getStyle ( ) . setWidth ( width , Unit.PX ) ; } widget.edit ( value ) ; return widget ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( type ) == null ? 0 : type.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , type ) ; }
Source:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( getImportImagesCommand ( ) . equals ( command ) ) { importImages ( ) ; } else if ( command.getName ( ) . equals ( "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( getImportImagesCommand ( ) . equals ( command ) ) { importImages ( ) ; } else if ( command.getName ( ) . equals ( "Cancel" ) ) { cancel ( ) ; } else if ( command.getName ( ) . equals ( "CancelConfirm" ) ) { setConfirmWindow ( null ) ; } }
Source:
static java.lang.String cpuTuneToString ( final org.ovirt.engine.api.model.CpuTune tune ) { final java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( final org.ovirt.engine.api.model.VCpuPin pin : tune.getVCpuPin ( ) ) { if ( first ) { first = false ; } else { builder.append ( "_" ) ; } builder.append ( pin.getVcpu ( ) ) . append ( '#' ) . append ( pin.getCpuSet ( ) ) ; } return builder.toString ( ) ; }

Target:
static java.lang.String cpuTuneToString ( final org.ovirt.engine.api.model.CpuTune tune ) { final java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( final org.ovirt.engine.api.model.VcpuPin pin : tune.getVcpuPin ( ) ) { if ( first ) { first = false ; } else { builder.append ( "_" ) ; } builder.append ( pin.getVcpu ( ) ) . append ( '#' ) . append ( pin.getCpuSet ( ) ) ; } return builder.toString ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomainStaticDao ( ) . update ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) ) ; if ( ( storageDomainNameChanged ) && ( ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStoragePool ( ) ) != null ) ) { runVdsCommand ( VDSCommandType.SetStorageDomainDescription , new org.ovirt.engine.core.common.vdscommands.SetStorageDomainDescriptionVDSCommandParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getStorageName ( ) ) ) ; } org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { storageDomainStaticDao.update ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) ) ; if ( ( storageDomainNameChanged ) && ( ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStoragePool ( ) ) != null ) ) { runVdsCommand ( VDSCommandType.SetStorageDomainDescription , new org.ovirt.engine.core.common.vdscommands.SetStorageDomainDescriptionVDSCommandParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getStorageName ( ) ) ) ; } org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.setSucceeded ( true ) ; }
Source:
public < T extends org.ovirt.engine.core.common.vdscommands.StorageDomainIdParametersBase & org.ovirt.engine.core.common.vdscommands.PostDeleteAction > T fixParameters ( T parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = storageDomainStaticDao.get ( parameters.getStorageDomainId ( ) ) ; return fixParameters ( parameters , storageDomainStatic.getStorageType ( ) . isFileDomain ( ) ) ; }

Target:
public < T extends org.ovirt.engine.core.common.vdscommands.StorageDomainIdParametersBase & org.ovirt.engine.core.common.vdscommands.PostDeleteAction > T fixParameters ( T parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = storageDomainStaticDao.get ( parameters.getStorageDomainId ( ) ) ; T parametersWithFixedPostZero = fixPostZeroField ( parameters , storageDomain.getStorageType ( ) . isFileDomain ( ) ) ; return fixDiscardField ( parametersWithFixedPostZero , storageDomain ) ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public void testNotRemovingLabeledNetworks_referencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Arrays.asList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment , null ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment , null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void verifyBuiltVmBase ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { verifyBuiltCommonVm ( vm ) ; verifyBuiltKernelOptions ( vm ) ; verifyBuiltMigrationOptions ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.HOST_ID , vm.getDedicatedVmForVds ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.VM_NAME , vm.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.USB_POLICY , vm.getUsbPolicy ( ) ) ; }

Target:
protected void verifyBuiltVmBase ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { verifyBuiltCommonVm ( vm ) ; verifyBuiltKernelOptions ( vm ) ; verifyBuiltMigrationOptions ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.HOST_ID , vm.getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.VM_NAME , vm.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.vms.USB_POLICY , vm.getUsbPolicy ( ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Guid generateGuidUsingMd5 ( java.lang.String ... args ) { java.lang.String id = "" ; for ( java.lang.String arg : args ) { id = id + arg ; } byte [ ] hash ; try { hash = java.security.MessageDigest.getInstance ( org.ovirt.engine.api.restapi.utils.GuidUtils.MD5_SECURITY_ALGORITHM ) . digest ( id.getBytes ( ) ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.lang.IllegalStateException ( e ) ; } return new org.ovirt.engine.core.compat.Guid ( hash , true ) ; }

Target:
public static org.ovirt.engine.core.compat.Guid generateGuidUsingMd5 ( java.lang.String ... args ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( java.lang.String arg : args ) { builder.append ( arg ) ; } byte [ ] hash ; try { hash = java.security.MessageDigest.getInstance ( org.ovirt.engine.api.restapi.utils.GuidUtils.MD5_SECURITY_ALGORITHM ) . digest ( builder.toString ( ) . getBytes ( ) ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.lang.IllegalStateException ( e ) ; } return new org.ovirt.engine.core.compat.Guid ( hash , true ) ; }
Source:
public void canDoActionFails ( ) { cmd = createTestCommand ( startedVolumeId ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.DeleteGlusterVolumeCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( null ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase logoff ( org.ovirt.engine.core.common.action.LogoutUserParameters parameters ) { return runAction ( VdcActionType.LogoutUser , parameters ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.aaa.DbGroup getGroup ( ) { if ( ( ( group ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { group = org.ovirt.engine.core.bll.aaa.AdGroupsHandlingCommandBase.getAdGroupDao ( ) . get ( org.ovirt.engine.core.bll.aaa.AdGroupsHandlingCommandBase.getParameters ( ) . getId ( ) ) ; } return group ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbGroup getGroup ( ) { if ( ( ( group ) == null ) && ( ! ( getGroupId ( ) . equals ( Guid.Empty ) ) ) ) { group = dbGroupDao.get ( org.ovirt.engine.core.bll.aaa.AdGroupsHandlingCommandBase.getParameters ( ) . getId ( ) ) ; } return group ; }
Source:
private org.ovirt.engine.core.vdsbroker.VmStatsRefresher getRefresherForVds ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { org.ovirt.engine.core.compat.Version version = vdsManager.getCompatibilityVersion ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsManager.getCopyVds ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( vds.getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVmStatsRefresher ( vdsManager ) ; } return new org.ovirt.engine.core.vdsbroker.PollListAndAllVmStatsRefresher ( vdsManager ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.VmStatsRefresher getRefresherForVds ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { org.ovirt.engine.core.compat.Version version = vdsManager.getCompatibilityVersion ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsManager.getCopyVds ( ) ; if ( ( ( ( org.ovirt.engine.core.common.FeatureSupported.jsonProtocol ( version ) ) && ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( vds.getProtocol ( ) ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.events ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.EventVmStatsRefresher ( vdsManager ) ; } return new org.ovirt.engine.core.vdsbroker.PollListAndAllVmStatsRefresher ( vdsManager ) ; }
Source:
public boolean validate ( ) { int nameLength = ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isWindowsOsType ( vm.getOs ( ) ) ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthWin ( ) : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthNonWin ( ) ; getCloneName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( nameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getCloneName ( ) . getIsValid ( ) ; }

Target:
public boolean validate ( ) { getCloneName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLength ( ) ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getCloneName ( ) . getIsValid ( ) ; }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private java.lang.String readInteractively ( java.lang.String prompt , boolean isPassword ) { java.lang.String value = null ; while ( org.apache.commons.lang.StringUtils.isBlank ( value ) ) { if ( isPassword ) { value = new java.lang.String ( java.lang.System.console ( ) . readPassword ( prompt ) ) ; } else { value = java.lang.System.console ( ) . readLine ( prompt ) ; } } return value ; }

Target:
private java.lang.String readInteractively ( java.lang.String prompt , boolean isPassword ) { java.lang.String value = null ; try { if ( isPassword ) { char [ ] pass = java.lang.System.console ( ) . readPassword ( prompt ) ; if ( ( pass != null ) && ( ( pass.length ) > 0 ) ) { value = new java.lang.String ( pass ) ; } } else { value = java.lang.System.console ( ) . readLine ( prompt ) ; } } catch ( java.lang.Exception ex ) { value = null ; } return value ; }
Source:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( org.ovirt.engine.core.dao.ClusterDaoImpl ) ( dao ) ) . getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetClustersHavingHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = dao.getClustersHavingHosts ( ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertThat ( clusters , org.hamcrest.Matchers.hasSize ( 4 ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.AdUser setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.AdUser entity , int index ) { org.easymock.EasyMock.expect ( entity.getUserId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDomainControler ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapUser setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.LdapUser entity , int index ) { org.easymock.EasyMock.expect ( entity.getUserId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDomainControler ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
public void testAddValueVersion ( ) { org.ovirt.engine.core.compat.Version verision = new org.ovirt.engine.core.compat.Version ( new java.util.Random ( ) . nextInt ( ) , new java.util.Random ( ) . nextInt ( ) ) ; paramSource.addValue ( paramName , verision ) ; org.junit.Assert.assertEquals ( "wrong value returned from parameter source" , verision.toString ( ) , paramSource.getValue ( paramName ) ) ; }

Target:
public void testAddValueVersion ( ) { org.ovirt.engine.core.compat.Version verision = new org.ovirt.engine.core.compat.Version ( this . random.nextInt ( ) , this . random.nextInt ( ) ) ; paramSource.addValue ( paramName , verision ) ; org.junit.Assert.assertEquals ( "wrong value returned from parameter source" , verision.toString ( ) , paramSource.getValue ( paramName ) ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < java.lang.Void , org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel > getDashboardReportsListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.MainTabModelProvider < java.lang.Void , org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel > ( eventBus , defaultConfirmPopupProvider , org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel.class ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel getReportsListModel ( com.google.gwt.event.shared.EventBus eventBus , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.CommonModel > commonModelProvider ) { org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel result = new org.ovirt.engine.ui.uicommonweb.models.reports.ReportsListModel ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportBaseUrl ( ) , org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getSsoToken ( ) , commonModelProvider ) ; result.setEventBus ( eventBus ) ; return result ; }
Source:
private boolean isVncSelected ( ) { boolean isVnc = false ; if ( ( getDisplayProtocol ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = getDisplayProtocol ( ) . getSelectedItem ( ) . getEntity ( ) ; isVnc = displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ; } return isVnc ; }

Target:
private org.ovirt.engine.core.compat.Guid getSmallIconId ( java.lang.String newIcon , java.lang.String oldIcon , java.lang.String newOsDefaultIcon , org.ovirt.engine.core.compat.Guid newOsDefaultIconId ) { if ( newIcon.equals ( oldIcon ) ) { return getIcon ( ) . getEntity ( ) . getSmallIconId ( ) ; } if ( newIcon.equals ( newOsDefaultIcon ) ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSmallByLargeOsDefaultIconId ( newOsDefaultIconId ) ; } return null ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.Snapshot.SnapshotStatus snapshotStatus , java.lang.String template ) { switch ( snapshotStatus ) { case IN_PREVIEW : return SnapshotStatus.IN_PREVIEW.value ( ) ; case LOCKED : return SnapshotStatus.LOCKED.value ( ) ; case OK : return SnapshotStatus.OK.value ( ) ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.SnapshotStatus map ( org.ovirt.engine.api.model.Snapshot.SnapshotStatus snapshotStatus , org.ovirt.engine.api.model.SnapshotStatus template ) { switch ( snapshotStatus ) { case IN_PREVIEW : return org.ovirt.engine.api.model.SnapshotStatus.IN_PREVIEW ; case LOCKED : return org.ovirt.engine.api.model.SnapshotStatus.LOCKED ; case OK : return org.ovirt.engine.api.model.SnapshotStatus.OK ; default : return null ; } }
Source:
private org.ovirt.engine.core.aaa.DirectoryUser getUserById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String userId ) { org.ovirt.engine.core.aaa.DirectoryUser result ; userId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( userId ) ; result = getEntity ( org.ovirt.engine.core.aaa.DirectoryUser.class , VdcQueryType.GetDirectoryUserById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , userId ) , userId , true ) ; return result ; }

Target:
private org.ovirt.engine.core.aaa.DirectoryUser getUserById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String userId ) { org.ovirt.engine.core.aaa.DirectoryUser result ; try { userId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( userId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } result = getEntity ( org.ovirt.engine.core.aaa.DirectoryUser.class , VdcQueryType.GetDirectoryUserById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , userId ) , userId , true ) ; return result ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.InstanceType model ) { assertNotNull ( model.getCpu ( ) ) ; assertNotNull ( model.getCpu ( ) . getTopology ( ) ) ; assertEquals ( 4 , model.getCpu ( ) . getTopology ( ) . getCores ( ) . intValue ( ) ) ; assertEquals ( 2 , model.getCpu ( ) . getTopology ( ) . getSockets ( ) . intValue ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.InstanceType model ) { assertNotNull ( model.getCpu ( ) ) ; assertNotNull ( model.getCpu ( ) . getTopology ( ) ) ; assertEquals ( 4 , model.getCpu ( ) . getTopology ( ) . getCores ( ) . intValue ( ) ) ; assertEquals ( 2 , model.getCpu ( ) . getTopology ( ) . getSockets ( ) . intValue ( ) ) ; assertEquals ( 1 , model.getCpu ( ) . getTopology ( ) . getThreads ( ) . intValue ( ) ) ; }