auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isShowing ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , Util.C.closeCurrentDialog ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; } } ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }

Target:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isShowing ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , panel ) ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }
Source:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; return newGson ( ) . fromJson ( adminSession.get ( url ) . getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }

Target:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; return newGson ( ) . fromJson ( adminRestSession.get ( url ) . getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }
Source:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }
Source:
public void activate ( final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) { if ( ( indexOf ( patchSetId ) ) != ( - 1 ) ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } } else { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( patchSetId.getParentKey ( ) ) ) ; } }

Target:
public void activate ( final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) { if ( ( indexOf ( patchSetId ) ) != ( - 1 ) ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setActive ( true ) ; patchSetPanel.setOpen ( true ) ; activePatchSetId = patchSetId ; } } else { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( patchSetId.getParentKey ( ) ) ) ; } }
Source:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
public void generatePreparedStatementNull ( final com.google.gwtorm.jdbc.gen.CodeGenSupport cgs ) { cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.push ( getSqlTypeConstant ( ) ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEINTERFACE , org.objectweb.asm.Type.getInternalName ( java.sql.PreparedStatement.class ) , "setNull" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.INT_TYPE , org.objectweb.asm.Type.INT_TYPE } ) ) ; }

Target:
public void generatePreparedStatementNull ( final com.google.gwtorm.server.CodeGenSupport cgs ) { cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.push ( getSqlTypeConstant ( ) ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEINTERFACE , org.objectweb.asm.Type.getInternalName ( java.sql.PreparedStatement.class ) , "setNull" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.INT_TYPE , org.objectweb.asm.Type.INT_TYPE } ) ) ; }
Source:
void setSettings ( final com.google.gerrit.common.data.PatchScriptSettings s ) { settings = s ; context = settings.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } }

Target:
void setSettings ( final com.google.gerrit.common.data.PatchScriptSettings s ) { settings = s ; context = settings.getContext ( ) ; if ( ( context ) == ( com.google.gerrit.reviewdb.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } else if ( ( context ) > ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ) ) { context = com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.MAX_CONTEXT ; } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
private java.util.Set < java.lang.String > getAllowedUserIds ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; result.addAll ( user.getEmailAddresses ( ) ) ; for ( com.google.gerrit.server.account.ExternalId extId : user.state ( ) . getExternalIds ( ) ) { if ( extId.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_GPGKEY ) ) { continue ; } result.add ( extId.key ( ) . get ( ) ) ; } return result ; }

Target:
private java.util.Set < java.lang.String > getAllowedUserIds ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; result.addAll ( user.getEmailAddresses ( ) ) ; for ( com.google.gerrit.server.account.externalids.ExternalId extId : user.state ( ) . getExternalIds ( ) ) { if ( extId.isScheme ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GPGKEY ) ) { continue ; } result.add ( extId.key ( ) . get ( ) ) ; } return result ; }
Source:
private void setOnline ( boolean online ) { this . online = online ; setUp ( ) ; }

Target:
private void setOnline ( boolean online ) { this . online = online ; setUp ( ) ; if ( ! online ) { task = pool.scheduleWithFixedDelay ( new com.ericsson.gerrit.plugins.eventslog.SQLStore.CheckConnectionTask ( ) , 0 , connectTime , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } else { if ( ( task ) != null ) { task.cancel ( false ) ; } } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; com.google.gerrit.extensions.registration.DynamicSet.setOf ( binder ( ) , com.google.gerrit.server.plugins.ServerPluginProvider.class ) ; bind ( com.google.gerrit.server.plugins.UniversalServerPluginProvider.class ) ; }
Source:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; org.junit.Assert.assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; org.junit.Assert.assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
private Project.NameKey getParentName ( final com.google.gerrit.reviewdb.Project project ) { if ( ( project.getParent ( ) ) != null ) { return project.getParent ( ) ; } if ( project.getNameKey ( ) . equals ( allProjectsName ) ) { return null ; } return allProjectsName ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { final java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents = new java.util.HashSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey p = projectName ; while ( ( p != null ) && ( parents.add ( p ) ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( p ) ; if ( e == null ) { break ; } p = e.getProject ( ) . getParent ( allProjectsName ) ; } return parents ; }
Source:
private synchronized void runHook ( java.io.File hook , java.util.List < java.lang.String > args ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( null , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.common.base.Optional < java.nio.file.Path > hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.isPresent ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook.get ( ) , args ) ) ; } }
Source:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }
Source:
protected void configure ( ) { }

Target:
protected void configure ( ) { bind ( com.amd.gerrit.plugins.manifestsubscription.ManifestSubscription.class ) . in ( Scopes.SINGLETON ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.LifecycleListener.class ) . to ( com.amd.gerrit.plugins.manifestsubscription.ManifestSubscription.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.amd.gerrit.plugins.manifestsubscription.ManifestSubscription.class ) ; }
Source:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } com.google.gerrit.client.changes.CommentInfo info = getOriginal ( ) ; getDiffView ( ) . removeDraft ( info.side ( ) , ( ( info.line ( ) ) - 1 ) ) ; removeFromParent ( ) ; getSelfWidget ( ) . clear ( ) ; com.google.gerrit.client.diff.PaddingManager manager = getPaddingManager ( ) ; manager.remove ( this ) ; manager.resizePaddingWidget ( ) ; }

Target:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } com.google.gerrit.client.changes.CommentInfo info = getOriginal ( ) ; getDiffView ( ) . removeDraft ( info.side ( ) , ( ( info.line ( ) ) - 1 ) ) ; removeFromParent ( ) ; getSelfWidget ( ) . clear ( ) ; com.google.gerrit.client.diff.PaddingManager manager = getPaddingManager ( ) ; manager.remove ( this ) ; manager.resizePaddingWidget ( ) ; cm.focus ( ) ; }
Source:
public boolean isReadable ( ) { return ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ) || ( isOwner ( ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }
Source:
public void add ( final com.google.gwt.user.client.ui.Widget i ) { if ( ( body.getWidgetCount ( ) ) > 0 ) { final com.google.gwt.user.client.ui.Widget p = body.getWidget ( ( ( body.getWidgetCount ( ) ) - 1 ) ) ; p.addStyleName ( "gerrit-LinkMenuItem-NotLast" ) ; } i.addStyleName ( "gerrit-LinkMenuItem" ) ; body.add ( i ) ; }

Target:
public void add ( final com.google.gwt.user.client.ui.Widget i ) { if ( ( body.getWidgetCount ( ) ) > 0 ) { final com.google.gwt.user.client.ui.Widget p = body.getWidget ( ( ( body.getWidgetCount ( ) ) - 1 ) ) ; p.addStyleName ( Gerrit.RESOURCES.css ( ) . linkMenuItemNotLast ( ) ) ; } body.add ( i ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
public boolean rebuildProject ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > allChanges , com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.Repository allUsersRepo ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { boolean result = delegate.rebuildProject ( db , allChanges , project , allUsersRepo ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }

Target:
public boolean rebuildProject ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > allChanges , com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.Repository allUsersRepo ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } boolean result = delegate.rebuildProject ( db , allChanges , project , allUsersRepo ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }
Source:
, @ com.google.gerrit.acceptance.GerritConfig ( name = "suggest.from" , value = "1" ) , @ com.google.gerrit.acceptance.GerritConfig ( name = "accounts.visibility" , value = "NONE" ) } ) public void suggestReviewersNoResult2 ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 0 ) ; }

Target:
public void suggestReviewersNoResult3 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
public java.util.List < com.google.gerrit.common.data.GroupReference > run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) { return suggestAccountGroup ( query , limit ) ; }

Target:
public java.util.List < com.google.gerrit.common.data.GroupReference > run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) { com.google.gerrit.server.project.ProjectControl projectControl = null ; if ( project != null ) { try { projectControl = projectControlFactory.controlFor ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { return java.util.Collections.emptyList ( ) ; } } return suggestAccountGroup ( projectControl , query , limit ) ; }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( ctx.getProject ( ) , psId.getParentKey ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.MergedByPushOp.log.error ( ( "Cannot send email for submitted patch set " + ( psId ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.send.MergedSender cm = mergedSenderFactory.create ( ctx.getProject ( ) , psId.getParentKey ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.MergedByPushOp.log.error ( ( "Cannot send email for submitted patch set " + ( psId ) ) , e ) ; } }
Source:
public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; return rsrc.getControl ( ) . forUser ( who ) . isVisible ( ) ; }

Target:
public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; try { permissionBackend.user ( who ) . project ( rsrc.getNameKey ( ) ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } }
Source:
public void testListComments ( ) throws java.lang.Exception { com.google.gerrit.server.change.CommentsTest.assertListComments ( injector , revRes1 , com.google.common.collect.ImmutableMap.of ( "FileOne.txt" , com.google.common.collect.Lists.newArrayList ( plc3 , plc1 , plc2 ) ) ) ; com.google.gerrit.server.change.CommentsTest.assertListComments ( injector , revRes2 , java.util.Collections.< java.lang.String , java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchLineComment > > emptyMap ( ) ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , final com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return com.google.gerrit.testutil.TestChanges.newUpdate ( injector , repoManager , migration , c , allUsers , user ) ; }
Source:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( config.getStringList ( "gitiles" , null , "customTemplates" ) ) ) . transform ( new com.google.gitiles.Renderer.FileUrlMapper ( ) ) , com.google.common.base.Objects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }

Target:
private void setDefaultRenderer ( javax.servlet.FilterConfig filterConfig ) { if ( ( renderer ) == null ) { renderer = new com.google.gitiles.DefaultRenderer ( ( ( filterConfig.getServletContext ( ) . getContextPath ( ) ) + ( com.google.gitiles.GitilesServlet.STATIC_PREFIX ) ) , com.google.gitiles.Renderer.toFileURL ( config.getString ( "gitiles" , null , "customTemplates" ) ) , com.google.common.base.Objects.firstNonNull ( config.getString ( "gitiles" , null , "siteTitle" ) , "Gitiles" ) ) ; } }
Source:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - ( com.google.gerrit.client.diff.SideBySide2.HEADER_FOOTER ) ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { toggleReviewed ( ) . run ( ) ; }
Source:
public void createAnnotatedTagNotAllowed ( ) throws java.lang.Exception { block ( Permission.PUSH_TAG , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; input.message = "annotation" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( ( ( "Cannot create annotated tag \"" + ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) + "test\"" ) ) ; tag ( input.ref ) . create ( input ) ; }

Target:
public void createAnnotatedTagNotAllowed ( ) throws java.lang.Exception { block ( Permission.CREATE_TAG , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; input.message = "annotation" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( ( ( "Cannot create annotated tag \"" + ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) + "test\"" ) ) ; tag ( input.ref ) . create ( input ) ; }
Source:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.io.File srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getName ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin.toPath ( ) , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getName ( ) ) ) ; } }

Target:
private com.google.gerrit.server.plugins.Plugin loadPlugin ( java.lang.String name , java.nio.file.Path srcPlugin , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String pluginName = srcPlugin.getFileName ( ) . toString ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( pluginName ) ) { return loadJsPlugin ( name , srcPlugin , snapshot ) ; } else if ( serverPluginFactory.handles ( srcPlugin ) ) { return loadServerPlugin ( srcPlugin , snapshot ) ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Unsupported plugin type: %s" , srcPlugin.getFileName ( ) ) ) ; } }
Source:
private void setHeadRevision ( final int row , final int column , final java.lang.String rev ) { com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { if ( result.isOwner ( ) ) { table.setWidget ( row , column , getHeadRevisionWidget ( rev ) ) ; } else { table.setText ( row , 3 , rev ) ; } } } ) ; }

Target:
private void deleteTags ( final java.util.Set < java.lang.String > tags ) { com.google.gerrit.client.projects.ProjectApi.deleteTags ( getProjectKey ( ) , tags , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message with invalid Change-Id\n\nChange-Id: X\n" ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; HEAD ( 1.0 ) ; com.google.gerrit.acceptance.git.afa6 Merge ; into ( ( ( stable ) - 2.14 ) ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message with invalid Change-Id\n\nChange-Id: X\n" ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
private java.util.concurrent.atomic.AtomicInteger getAndIncrementAccountIdLock ( com.google.gerrit.reviewdb.client.Account.Id id ) { synchronized ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.accountIdLocks ) { java.util.concurrent.atomic.AtomicInteger accountIdLock = com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.accountIdLocks.get ( id ) ; if ( accountIdLock == null ) { accountIdLock = new java.util.concurrent.atomic.AtomicInteger ( 1 ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.accountIdLocks.put ( id , accountIdLock ) ; } else { accountIdLock.incrementAndGet ( ) ; } return accountIdLock ; } }

Target:
void index ( com.google.gerrit.reviewdb.client.Account.Id id , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.Operation operation ) throws java.io.IOException { indexer.index ( id ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.logger.debug ( "Account successfully indexed" , id ) ; }
Source:
private java.lang.String newChange2 ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; return push.rm ( git , "refs/for/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String newChange2 ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD , java.nio.charset.StandardCharsets.UTF_8 ) ) ; return push.rm ( git , "refs/for/master" ) . getChangeId ( ) ; }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
public void createNewProject ( java.lang.String projectName , java.lang.String parentName , boolean emptyCommit , boolean permissionsOnly , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { createProjectHandlerFactory.create ( projectName , parentName , emptyCommit , permissionsOnly ) . to ( callback ) ; }
Source:
public boolean isValid ( final com.google.gerrit.client.reviewdb.Account.Id accountId , final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { for ( final com.google.gerrit.client.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( state.isMember ( accountId , pr.getAccountGroupId ( ) ) ) && ( ( ( pr.getMinValue ( ) ) < 0 ) || ( ( pr.getMaxValue ( ) ) > 0 ) ) ) { return true ; } } return false ; }

Target:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.client.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { for ( final com.google.gerrit.client.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( ( pr.getMinValue ( ) ) < 0 ) || ( ( pr.getMaxValue ( ) ) > 0 ) ) ) { return true ; } } return false ; }
Source:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.acceptance.rest.change.ProjectConfigInput in = new com.google.gerrit.acceptance.rest.change.ProjectConfigInput ( ) ; in.use_content_merge = com.google.gerrit.reviewdb.client.Project.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = session.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.reviewdb.client.Project.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = session.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
public void display ( java.lang.Class < ? extends android.app.Fragment > fragmentClass , android.os.Bundle bundle , boolean addtoBackStack ) { try { android.app.Fragment f = fragmentClass.newInstance ( ) ; if ( bundle != null ) { f.setArguments ( bundle ) ; } display ( f , addtoBackStack ) ; } catch ( java.lang.IllegalAccessException e ) { throw new java.lang.IllegalStateException ( e ) ; } catch ( java.lang.InstantiationException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public void display ( java.lang.Class < ? extends android.support.v4.app.Fragment > fragmentClass , android.os.Bundle bundle , boolean addtoBackStack ) { try { android.support.v4.app.Fragment f = fragmentClass.newInstance ( ) ; if ( bundle != null ) { f.setArguments ( bundle ) ; } display ( f , addtoBackStack ) ; } catch ( java.lang.IllegalAccessException e ) { throw new java.lang.IllegalStateException ( e ) ; } catch ( java.lang.InstantiationException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
public void addReviewerToReviewableChangeByOtherInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accounts.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer , other ) ; } ) ; }

Target:
public void addReviewerToReviewableChangeByOtherInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accountCreator.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accountCreator.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; } ) ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "-" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }
Source:
void setMarker ( net.codemirror.lib.TextMarker marker , int length ) { this . marker = marker ; numSkipLines = length ; skipNum.setText ( java.lang.Integer.toString ( length ) ) ; if ( checkAndUpdateArrows ( ) ) { upArrow.setHTML ( PatchUtil.M.expandBefore ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ) ; downArrow.setHTML ( PatchUtil.M.expandAfter ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ) ; } }

Target:
void setMarker ( net.codemirror.lib.TextMarker marker , int length ) { this . marker = marker ; numSkipLines = length ; if ( checkAndUpdateArrows ( ) ) { upArrow.setHTML ( PatchUtil.M.expandBefore ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ) ; downArrow.setHTML ( PatchUtil.M.expandAfter ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ) ; } skipNum.setText ( PatchUtil.M.patchSkipRegion ( java.lang.Integer.toString ( length ) ) ) ; }
Source:
public void errorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( request.getPathInfo ( ) ) . andReturn ( "/someCache" ) ; java.lang.String errorMessage = "someError" ; org.easymock.EasyMock.expect ( request.getReader ( ) ) . andThrow ( new java.io.IOException ( errorMessage ) ) ; response.sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , errorMessage ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( "someOtherError" ) ) ; replayAll ( ) ; servlet.doPost ( request , response ) ; verifyAll ( ) ; }

Target:
public void errorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.when ( request.getPathInfo ( ) ) . thenReturn ( "/someCache" ) ; java.lang.String errorMessage = "someError" ; org.mockito.Mockito.doThrow ( new java.io.IOException ( errorMessage ) ) . when ( request ) . getReader ( ) ; servlet.doPost ( request , response ) ; org.mockito.Mockito.verify ( response ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , errorMessage ) ; }
Source:
private void assertUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = unwrapDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( repo ) ) . isEqualTo ( expected ) ; } }

Target:
private void assertChangeUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = unwrapDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( repo ) ) . isEqualTo ( expected ) ; } }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( Gerrit.RESOURCES.css ( ) . addSshKeyPanel ( ) ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }
Source:
public void testIsEnabledChangeMergedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeMergedEvent event = new com.google.gerrit.server.events.ChangeMergedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledChangeMergedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeMergedEvent event = new com.google.gerrit.server.events.ChangeMergedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void missingDestRef ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; java.lang.String ref = "refs/heads/master" ; testRepo.reset ( testRepo.getRepository ( ) . exactRef ( ref ) . getObjectId ( ) ) ; org.eclipse.jgit.lib.RefUpdate ru = testRepo.getRepository ( ) . updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination ref not found (may be new branch): " + ref ) ) ) ; }

Target:
public void missingDestRef ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; java.lang.String ref = "refs/heads/master" ; serverSideTestRepo.reset ( serverSideTestRepo.getRepository ( ) . exactRef ( ref ) . getObjectId ( ) ) ; org.eclipse.jgit.lib.RefUpdate ru = serverSideTestRepo.getRepository ( ) . updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination ref not found (may be new branch): " + ref ) ) ) ; }