auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { switch ( org.ovirt.engine.core.bll.GetTimeZonesQuery.getParameters ( ) . getTimeZoneType ( ) ) { case GENERAL_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.javaTimezones ) ; break ; case WINDOWS_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.windowsTimezones ) ; break ; } }

Target:
protected void executeQueryCommand ( ) { switch ( org.ovirt.engine.core.bll.GetTimeZonesQuery.getParameters ( ) . getTimeZoneType ( ) ) { case GENERAL_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.linuxTimezones ) ; break ; case WINDOWS_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.windowsTimezones ) ; break ; } }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageId ) { double actualSize = 0 ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = storageToDisksMap.get ( storageId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { actualSize += disk.getActualSize ( ) ; } return ( ( int ) ( actualSize ) ) ; }

Target:
private org.ovirt.engine.core.compat.Guid retrieveDestinationDomainForDisk ( org.ovirt.engine.core.compat.Guid id ) { return diskInfoDestinationMap.get ( id ) . getStorageIds ( ) . get ( 0 ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkBelongsToClusterDataCenter ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . unless ( cluster.getStoragePoolId ( ) . equals ( network.getDataCenterId ( ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkBelongsToClusterDataCenter ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . unless ( cluster.getStoragePoolId ( ) . equals ( network.getDataCenterId ( ) ) ) ; }
Source:
org.ovirt.engine.api.model.User lookupUser ( org.ovirt.engine.core.compat.Guid guid ) { java.lang.String id = guid.toString ( ) ; for ( org.ovirt.engine.core.common.businessentities.AdUser user : getUsersFromDomain ( ) ) { if ( user.getUserId ( ) . toString ( ) . equals ( id ) ) return mapAdUser ( user ) ; } return notFound ( ) ; }

Target:
org.ovirt.engine.api.model.User lookupUser ( org.ovirt.engine.core.compat.Guid guid ) { java.lang.String id = guid.toString ( ) ; for ( org.ovirt.engine.core.common.businessentities.LdapUser user : getUsersFromDomain ( ) ) { if ( user.getUserId ( ) . toString ( ) . equals ( id ) ) return mapAdUser ( user ) ; } return notFound ( ) ; }
Source:
public void validateFailsForVdsNonUp ( ) { prepareMocks ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForVdsNonUp ( ) { prepareMocks ( VDSStatus.Down ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void canDoActionSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void validateSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; getInstanceImages ( ) . updateActionsAvailability ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMigrationOptions ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; updateBootMenu ( ) ; getInstanceImages ( ) . updateActionsAvailability ( ) ; initGraphicsConsoles ( ) ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , ipv4Address , ipv6Address , bondName , bondOptions , bondType , bonded , ipv4BootProtocol , ipv6BootProtocol , reportedSwitchType , networkName , bridged , ipv4Gateway , ipv6Gateway , mtu , ipv4Subnet , ipv6Prefix , vdsId , baseInterface , vlanId , qos , labels , adPartnerMac ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , ipv4Address , ipv6Address , bondName , bondOptions , bondType , bonded , ipv4BootProtocol , ipv6BootProtocol , reportedSwitchType , networkName , bridged , ipv4Gateway , ipv6Gateway , mtu , ipv4Subnet , ipv6Prefix , vdsId , baseInterface , vlanId , qos , labels , adPartnerMac , adAggregatorId ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetStatusUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { userPortalItemModel.getDefaultConsole ( ) . getConnectCommand ( ) . Execute ( ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { userPortalItemModel.getDefaultConsole ( ) . getConnectCommand ( ) . Execute ( ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }
Source:
public void lunsMatch ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUNId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; lun.setPhysicalVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Arrays.asList ( lun , lun ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Arrays.asList ( lun , lun ) ; boolean isMatch = command.getLunsToUpdateInDb ( lunsFromVgInfo , lunsFromDb ) . isEmpty ( ) ; org.junit.Assert.assertTrue ( isMatch ) ; }

Target:
public void testGetLunsToUpdateInDbForSameLun ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; lun.setLUNId ( lunId.toString ( ) ) ; lun.setPhysicalVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > upToDateLuns = getLunsToUpdateInDb ( lun , lun ) . get ( command.noOp ) ; assertLunIdInList ( upToDateLuns , lunId ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getUpServerId ( ) { if ( ( brick ) == null ) { return getRandomUpServerId ( clusterId ) ; } org.ovirt.engine.core.common.businessentities.VDS brickServer = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQuery.getDbFacade ( ) . getVdsDao ( ) . get ( brick.getServerId ( ) ) ; if ( ( brickServer.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return brickServer.getId ( ) ; } return super . getRandomUpServerId ( clusterId ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getUpServerId ( ) { if ( ( brick ) == null ) { return getRandomUpServerId ( clusterId ) ; } org.ovirt.engine.core.common.businessentities.VDS brickServer = vdsDao.get ( brick.getServerId ( ) ) ; if ( ( brickServer.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return brickServer.getId ( ) ; } return super . getRandomUpServerId ( clusterId ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
protected org.ovirt.engine.api.model.Label addParents ( org.ovirt.engine.api.model.Label model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNIC ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( hostId ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Label addParents ( org.ovirt.engine.api.model.Label model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNic ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( hostId ) ; return model ; }
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 e = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( e.propertyName.equals ( "STATUS_UPDATED" ) ) { status.setVisible ( object.isStatusAvailable ( ) ) ; } else if ( e.propertyName.equals ( "STOP_TIME_UPDATED" ) ) { stopTimePanel.setVisible ( object.isStopTimeVisible ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equals ( "STATUS_UPDATED" ) ) { status.setVisible ( object.isStatusAvailable ( ) ) ; } else if ( args.propertyName.equals ( "STOP_TIME_UPDATED" ) ) { stopTimePanel.setVisible ( object.isStopTimeVisible ( ) ) ; } }
Source:
protected void propagateFailure ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; }

Target:
protected void propagateFailure ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , java.lang.System.lineSeparator ( ) ) ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
private static void putHost ( java.util.Map < java.lang.String , java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > > osToHostIdMap , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.bll.scheduling.OS hostOs ) { if ( ! ( osToHostIdMap.containsKey ( hostOs.getOsFamily ( ) ) ) ) { osToHostIdMap.put ( hostOs.getOsFamily ( ) , new java.util.HashSet < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } osToHostIdMap.get ( hostOs.getOsFamily ( ) ) . add ( host ) ; }

Target:
private static void putHost ( java.util.Map < java.lang.String , java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > > osToHostIdMap , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.utils.OS hostOs ) { if ( ! ( osToHostIdMap.containsKey ( hostOs.getOsFamily ( ) ) ) ) { osToHostIdMap.put ( hostOs.getOsFamily ( ) , new java.util.HashSet < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } osToHostIdMap.get ( hostOs.getOsFamily ( ) ) . add ( host ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }
Source:
private static boolean isTaskSuccess ( org.ovirt.engine.core.common.job.Step step ) { switch ( step.getStatus ( ) ) { case ABORTED : case FAILED : return false ; case FINISHED : return true ; default : return false ; } }

Target:
public void run ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { try { createJobToMonitor ( cluster , task ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.log.error ( "Error creating job for task from CLI" , e ) ; } return null ; } } ) ; }
Source:
protected void initTableColumns ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.EntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , constants.serverBricks ( ) ) ; bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.EntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , constants.brickDirectoryBricks ( ) ) ; }

Target:
protected void initTableColumns ( ) { bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.serverBricks ( ) ) ; bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.brickDirectoryBricks ( ) ) ; }
Source:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "@SCHEMA_NAME@.user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , new java.util.Date ( ) . getTime ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }

Target:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , new java.util.Date ( ) . getTime ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) : null ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) : null ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }
Source:
public void testRetryWithInfiniteNumberOfRetries ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 5 , 0 , 10 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }

Target:
public void testRetryWithInfiniteNumberOfRetries ( ) throws java.lang.Exception { java.util.concurrent.Callable < java.lang.Object > callable = org.mockito.Mockito.mock ( java.util.concurrent.Callable.class ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( 5 , 0 , 10 , java.io.IOException.class ) ; org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable < java.lang.Object > retryable = new org.ovirt.vdsm.jsonrpc.client.utils.retry.Retryable ( callable , policy ) ; org.mockito.Mockito.stub ( callable.call ( ) ) . toThrow ( new java.io.IOException ( ) ) ; retryable.call ( ) ; }
Source:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , macPool ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , getMacPool ( ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void GetoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public static void getAAAProfilesListViaPublic ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.convertAAAProfilesResult ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getCompatibilityVersion ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return ( vmBase.getClusterId ( ) ) != null ? org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) . getClusterDao ( ) . get ( vmBase.getClusterId ( ) ) . getCompatibilityVersion ( ) : Version.ALL.get ( 0 ) ; }

Target:
public org.ovirt.engine.core.compat.Version getCompatibilityVersion ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return ( vmBase.getClusterId ( ) ) != null ? clusterDao.get ( vmBase.getClusterId ( ) ) . getCompatibilityVersion ( ) : Version.ALL.get ( 0 ) ; }
Source:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Collections.singletonList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addExistingInterfaces ( slave ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( getStorageDevice ( "sda" , null ) ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( getStorageDevice ( "sda" , null ) ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void testIt ( ) { org.ovirt.engine.core.compat.backendcompat.PropertyInfo pc = org.ovirt.engine.core.compat.backendcompat.TypeCompat.GetProperty ( this . getClass ( ) , "someValue" ) ; java.lang.String result = ( ( java.lang.String ) ( pc.GetValue ( this , "JarJar" ) ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , result ) ; this . someValue = null ; result = ( ( java.lang.String ) ( pc.GetValue ( this , "JarJar" ) ) ) ; org.junit.Assert.assertEquals ( "Null Value" , "JarJar" , result ) ; }

Target:
public void testIt ( ) { org.ovirt.engine.core.compat.backendcompat.PropertyInfo propInfo = org.ovirt.engine.core.compat.backendcompat.TypeCompat.GetProperty ( this . getClass ( ) , "someValue" ) ; java.lang.String result = ( ( java.lang.String ) ( propInfo.getValue ( this , "JarJar" ) ) ) ; org.junit.Assert.assertEquals ( "Standard" , "Anakin" , result ) ; this . someValue = null ; result = ( ( java.lang.String ) ( propInfo.getValue ( this , "JarJar" ) ) ) ; org.junit.Assert.assertEquals ( "Null Value" , "JarJar" , result ) ; }
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
private void initIpv4ConfigurationBootProtocolGateway ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol networkBootProtocol , boolean syncGateway ) { initIpv4ConfigurationStaticBootProtocol ( networkBootProtocol ) ; ipv4Address.setGateway ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_GATEWAY ) ; iface.setIpv4Gateway ( ( syncGateway ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_GATEWAY : null ) ) ; }
Source:
public boolean validate ( ) { if ( backingFile ) { getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.storage.ImageInfoModel.constants.uploadImageBackingFileUnsupported ( ) ) ; return false ; } return true ; }

Target:
public boolean validate ( ) { if ( ! ( fileLoaded ) ) { getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.storage.ImageInfoModel.constants.uploadImageCannotBeOpened ( ) ) ; return false ; } if ( backingFile ) { getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.storage.ImageInfoModel.constants.uploadImageBackingFileUnsupported ( ) ) ; return false ; } return true ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryType , callback.getContext ( ) ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryType , callback.getContext ( ) ) ; }
Source:
public void testAllEmpty ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testComplexCommand ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . privateKey ( java.nio.file.Paths.get ( "/mykey" ) ) . inventoryFile ( java.nio.file.Paths.get ( "/myinventory" ) ) . limit ( "mylimit" ) . verboseLevel ( AnsibleVerbosity.LEVEL3 ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , "-vvv" , "--private-key=/mykey" , "--inventory=/myinventory" , "--limit=mylimit" , "--extra-vars=a=1" , "--extra-vars=b=2" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
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 ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangeable ( ( ! entity ) ) ; }

Target:
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 ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangeable ( ( ! entity ) ) ; }
Source:
public static void GetMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private com.google.gwt.user.client.ui.PushButton createPlusButton ( final org.ovirt.engine.core.common.utils.Pair < T , V > item ) { final com.google.gwt.user.client.ui.PushButton button = createPushButton ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget.resources.increaseIcon ( ) ) ; button.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { V widget = item.getSecond ( ) ; getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; } } ) ; return button ; }

Target:
private org.gwtbootstrap3.client.ui.Button createPlusButton ( final org.ovirt.engine.core.common.utils.Pair < T , V > item ) { final org.gwtbootstrap3.client.ui.Button button = createButton ( IconType.PLUS , new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { V widget = item.getSecond ( ) ; getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; } } ) ; return button ; }